Describe the bug
Support for having appMenuTriggerTextAudible: true was added a month ago, which has the following issues in our app (which uses enterprise-ng).
ERROR TypeError: Cannot read property 'modifyTriggers' of undefinedTo Reproduce
Steps to reproduce the behavior:
appMenuTrigger:false, appMenuTriggerTextAudible: false as default.appMenuTrigger:true, appMenuTriggerTextAudible: trueERROR TypeError: Cannot read property 'modifyTriggers' of undefined
at Tabs.renderHelperMarkup (sohoxi.js:78188)Expected behavior
No error in log, dismiss icon still available.
Version
Screenshots

Platform
@EdwardCoyle can you take a look at this when you have a moment and let us know what you think. I forget why we changed this type back and forth
@tmcconechy the appMenuTriggerTextAudible was actually something I put in a ticket to have (i.e. the ability to have a menu trigger without a text value. Currently we set appMenuTriggerText to ' ').
It is on line 576 it crashes now where $('#application-menu').data('applicationmenu')is undefined.
$('#application-menu').data('applicationmenu').modifyTriggers([appMenuTrigger.children('a')]);
Also, team label for this issue should be M3 something, not stratus if I'm not missing something. :)
@whernebrink had a chance to look at this example... In order to properly link the Application Menu to the Tabs' trigger button, this line is necessary:
$('#application-menu').data('applicationmenu').modifyTriggers([appMenuTrigger.children('a')]);
After debugging I can see in the sample that the Tabs component is invoking and setting up ahead of the Application Menu. I'm not sure why that would be the case in this sample (seems like app menu is defined in the template ahead of the Tabs... should be setup ahead of Tabs?). In standard IDS components (outside of angular) we control the initialization process and setup the Application Menu ahead of most other components.
I'm hesitant to remove that line that connects the components, since that would remove any automatic linking. Is it possible to change the order of initialization in your application/setup so the App Menu initializes first?
Hi @EdwardCoyle, thanks for looking into it!
After debugging I can see in the sample that the Tabs component is invoking and setting up ahead of the Application Menu. I'm not sure why that would be the case in this sample (seems like app menu is defined in the template ahead of the Tabs... should be setup ahead of Tabs?).
I think it's a good thing this issue was caught and brought up! In Angular, the children (e.g. soho-tabs inside my app-tabs component) are initialized first. It first need to initialize all child components/views before the root one. Kinda counterintuitive, one may think (although, makes sense when you think about it some more). But this is important to know, so that we do not make assumptions about what _will_ or _should_ be initialized first in ids-enterprise.
I have updated the repository I shared in this ticket and added a appSpy directive to the components which logs out the component, when onInit/afterViewInit etc are called, and as you can see, the soho-tabs's afterViewInit is called before soho-application-menu's afterVIewInit (which is the second from the bottom), which should explain why this issue of initialization order occurs?

We have, as many others, a big codebase. We need to have a good structure and to separated our code into smaller parts in order to be able to maintain it. We’re using angular libraries for feature-modules, shared ui components etc. which facilitate us breaking up the application in these smaller parts, which also has the benefit for us to be able to reuse functionality and/or components in other applications, e.g. our m3-tabs component, which wraps the soho-tabs[moduleTabs=true].
With that background to the architecture being said, I have set the following application architecture for us (M3):
++++++++++++++++++++++++++++++++
// resides inside feature-main-controller library
++++++++++++++++++++++++++++++++
// resides inside shared/ui/m3-components library
++++++++++++++++++++++++++++++++
This architecture of ours was working prior to (i.e. not getting any error logs in console):
https://github.com/infor-design/enterprise/issues/4590
In 4590, I just wanted to be able to not have a text value for for the menu trigger button, without impacting the actual trigger button width (which is the case when we provide appMenuTriggerText = ‘ ‘;).
I’d much rather go back to where we were, and be able to keep our application architecture as is, than having to work around this issue with soho components initialization order.
If we, the consumers of ids-enterprise-ng, have to worry about soho-components not being initialized in the right order due to where we decide to use the soho-components (e.g. wrapped in a application specific component or shared-ui component), it will not be the best of developer experiences, I'd say. However, If that is the case, then we need a clear documentation/guideline about which components are dependent on others, and which ones needs to be initialized in what order...
I hope we will just revert 4590 if that ticket is not possible to solve without having to re-architect our application (which, as I mentioned above) worked just fine prior to me logging that issue… :)
@EdwardCoyle might make sense to revert 4590 if that in fact caused this and not something else? EIther that or maybe we can find a simpler Css based way to solve it. Maybe with :empty css selector or min width or something?
Not sure of all the details because im not 100% up on this issue
We shouldn't have to revert #4590. This is something we can solve with a small check in Tabs I think. The difficulty is that the NG environment is setup to be more "manually" scaffolded (hence @whernebrink's issue with the ordering) , but anyone consuming the ES6-only components depends on the automatic initialization, so we need to ensure both work.
QA Passed. Working as expected. Thank you.