Type navigation 3rd button - Goto ItemType [Definition]

I'd like there to be a third button here, for Admin(s).

While going through Configuring Solutions, for v12, I can't help but think of a very convenient 3rd button right here to eliminate navigating to an Item Type's definition:

[Currently] Administration > ItemTypes > Enter search text for IT, find and finally open to edit... could also be:
[3rd button] Click (Edit | View | Goto) ItemType

I think this would be especially useful for admins as they need to check on TOC settings, or set sort rules, and on and on... Just click the [proposed] button!

Parents
  • Notes on issue:
    The button would be added in Innovator/Client/Modules/aras/NavigationPanel.js, after ~line 123. Here is the search button per ItemType secondary left-nav menu.

    Here we have access to the *itemTypeId*. But, it is passed to searchItemType here. We need whatever is called when viewing item types table and double clicking a row.

    this._searchItemType(secondaryMenuData.itemTypeId)

    Using the itemTypeId we should be able to get to the item type edit form for a certain item type. I'm not sure, but I believe this could be a call to whatever creates the url including virtualGetForm, maybe!?

    Any input on that would be like totally awesome!

    Going to investigate what this call to aras.getResource does. I think it is just getting label text as the text appears dynamic and not set using a psuedo selector content property...

    Here, I just copy/pasted the search button, added static text (notice the search text is appended after) and made the onclick alert with the item type id.

  • Further discoveries include: Edit ui_resources.xml to then be able to use the function aras.getResource and use dynamic text...

    ...resulting in:

    Here, the icon is an svg, using the "use" tag to pull in shared resources. I just found the pointer to ItemType icon and replaced the use xlink:href to end with: #svg-itemtype

    The click currently still just does an alert with:
    onclick="${() => alert(secondaryMenuData.itemTypeId)}"

    The code change in NavigationPanel.js was to tack this on ~ln123 for a third button. The inline styling is just me figuring stuff out w/o touching the CSS (because I'd add a ...__secondary-menu-goto-button style, but I don't know yet how to make the JS get re-minified, trigger a build or whatever). And... I cannot just paste this and don't have the time so a pictue of code:


    So... my ask is:

    How to utilize the onclick in conjunction with the item type id we already have available?


  • Hi Neil,

    Since you already have the ID of the ItemType, you can use a handy function on the aras object to open up the associated ItemType. 

    aras.uiShowItem("ItemType", secondaryMenuData.itemTypeId);

    You can also uiShowItem to open any item in the database, not just ItemTypes. The first argument is a string of the name of the ItemType you want to open and the second argument is the ID of the item you want to open. For completeness, I'll also mention that there are more arguments that you can pass in to uiShowItem, but in almost all use cases, you'll only need to use the ItemType name and item ID.

    Chris

Reply
  • Hi Neil,

    Since you already have the ID of the ItemType, you can use a handy function on the aras object to open up the associated ItemType. 

    aras.uiShowItem("ItemType", secondaryMenuData.itemTypeId);

    You can also uiShowItem to open any item in the database, not just ItemTypes. The first argument is a string of the name of the ItemType you want to open and the second argument is the ID of the item you want to open. For completeness, I'll also mention that there are more arguments that you can pass in to uiShowItem, but in almost all use cases, you'll only need to use the ItemType name and item ID.

    Chris

Children