Base solution for your next web application
Open Closed

Power Tools "Parent Menu Position" #12299


User avatar
0
ips-ad created

Hi,

I'm struggling with setting up two new entities correctly, e.g.:

  1. Entity A "Coworker", menu position "Root" (which is actually "main" in the json file) Main menu -> Coworkers
  2. Entity B "CoworkerOrganizationUnit" should be placed under "Coworker" Main menu -> Coworkers -> CoworkerOrganizationUnit

Entity A is fine, B is not. Both entities share the same namespace "Persons". Entity B is fullaudited and has only 2 navigation properties (lookup tables for CoworkerId and OrganizationUnitId), no other properties.

What do I have to set as custom parent menu position, tried different things like "main>coworkers", "coworkers", "main>persons>coworkers" - but all that ends in weird folder structures and/or faulty code... Using Power Tools 4.5.3.

Thanks upfront!

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

3 Answer(s)
  • User Avatar
    0
    ips-ad created

    ..some additional findings/bugs in the tool:

    • When adding more than 3 display properties, it generates like
                                               PersonDisplayProperty = string.Format("{0} {1} {2} {3}", s1 == null || s1.Vorname == null ? "" : s1.Vorname.ToString()
                               , s1 == null || s1.Nachname == null ? "" : s1.Nachname.ToString()
                               , s1 == null || s1.ABnr == null ? "" : s1.ABnr.ToString()
                               , s1 == null || s1.VNr== null ? "" : s1.VNr.ToString()
                               ),
    

    This fails, because string.Format takes max. 3 arguments, need to adjust it to string.Format("...", new object[]{ ...}) instead.

    • using IPSweb.Exporting; is missing in the appService
    • _personOrganizationUnitTestId = ; id is missing in generated test

    No big deals, but I thought I'd share these so that you can fix it in a next version :-)

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi @ips-ad,

    I created an issue for this problem. We will fix it as soon as possible.

    https://github.com/aspnetzero/aspnet-zero-core/issues/5522

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @ips-ad,

    Here, you do not need to use the main menu name when using custom menu position. Here, all entities created with custom menu position are created under the main folder in Angular projects. If you want to create an entity under the Coworkers menu, it will be enough to write Coworkers in the Parent Menu Position section. Here, the Relative Name Space also comes into play in the folder structure. However, in the sidebar, only the parent menu items of the entity will be what you entered in the Parent Menu Position section. Let's say you want to create a CoworkerOrganizationUnit entity and you want to host this entity under the Coworkers menu item. Then just writing Coworkers to the Parent Menu Position section will be enough. Power Tools will create this entity under the "main>{{RelativeNameSpace}}>CoworkerOrganizationUnit" folder in Angular. However, this is different in the sidebar. Here it will look like this: "Coworkers>CoworkerOrganizationUnit". If you are going to create entities with different Person characters such as Coworkers, it would be more logical to create Coworkers under Persons.

    Example:

    Parent Menu Position: Persons>Coworkers Entity Name: CoworkerOrganizationUnit

    It will be formed as follows Angular File Structure: main>CoworkerOrganizationUnit Sidebar Menu Structure: Persons>Coworkers>CoworkerOrganizationUnit

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)