frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Do not write "import" and "push" to routing.ts if there is already absolutely the same

Open IskandarovRost opened this issue 4 years ago • 0 comments

CUBA Platform version: 7.2.10 CUBA Studio plugin version: 15.0.SNAPSHOT2687-202 IntelliJ version: IntelliJ IDEA 2020.2.4 (Community Edition) Generator version (probably) 3.1.3

See also this feature in Studio https://youtrack.haulmont.com/issue/STUDIO-8553

  1. There are some entity and react-frontend component for it
  2. The management-component is registered in routing.ts
import { CustomerManagement } from "./app/customer/CustomerManagement";

import { getMenuItems } from "@cuba-platform/react-core";

export const menuItems = getMenuItems();

menuItems.push({
  pathPattern: "/customerManagement/:entityId?",
  menuLink: "/customerManagement",
  component: CustomerManagement,
  caption: "CustomerManagement"
});

  1. Add a new attribute to the entity image.png
  2. And now there is a need to add this new attribute onto the frontend Re-create the frontend-component* image.png
  3. In the frontend component wizard leave everything by default and chose to "Update frontend app model" Here the "add to menu" checkbox is enabled - if to disable it, there will be no problems, but it is not obvious image.png
  4. Start the application AR: npm install - fails. image.png

The routing.ts is as follows

import { CustomerManagement } from "./app/customer/CustomerManagement";
import { CustomerManagement } from "./app/customer/CustomerManagement";

import { getMenuItems } from "@cuba-platform/react-core";

export const menuItems = getMenuItems();

menuItems.push({
  pathPattern: "/customerManagement/:entityId?",
  menuLink: "/customerManagement",
  component: CustomerManagement,
  caption: "CustomerManagement"
});

menuItems.push({
  pathPattern: "/customerManagement/:entityId?",
  menuLink: "/customerManagement",
  component: CustomerManagement,
  caption: "CustomerManagement"
});

ER: it seems there will absolutely no problem with the component re-creation if just not to write "the same" import to routing.xml No need for two menu items - too, as the folder contents were rewritten.

IskandarovRost avatar Dec 18 '20 09:12 IskandarovRost