frontend
frontend copied to clipboard
Do not write "import" and "push" to routing.ts if there is already absolutely the same
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
- There are some entity and react-frontend component for it
- 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"
});
- Add a new attribute to the entity
-
And now there is a need to add this new attribute onto the frontend
Re-create the frontend-component*
- 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
- Start the application
AR:
npm install
- fails.
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.