Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
IskandarovRost opened this issue Dec 18, 2020 · 0 comments
Assignees

Comments

@IskandarovRost
Copy link

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 IskandarovRost changed the title Do not write "import" and "push" to routing.ts if there is already absolutely the same value Do not write "import" and "push" to routing.ts if there is already absolutely the same Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants