New portal affected user page - customizing the template dropdownlist

I have installed the latest portal version and I'm testing the new affected user page.
One thing is blocking me before making that page visible to my analysts. By default the dropdown is showing all my incident templates.  I want to filter the list to exclude my workflow en ARO templates.
I think there might be a possibility to build some custom code in custom.js to achieve that, but I don't know how.

Inside this script source I found some code building up the list of IR templates: \Scripts\viewPanels\affectedUser\app\ircontroller.js

    // IR TEMPLATE LIST
    $scope.irTemplateList = valueService.irTemplateList;
    if(valueService.irTemplateList == ""){
        templateListService.getTemplates("a604b942-4c7b-2fb2-28dc-61dc6f465c68").then(function (tList) {
            $scope.irTemplateList = tList;
            valueService.irTemplateList = tList;
        });
    }

I want to filter the tList object, by making a customization inside custom.js.
Thanks for any help.

Kind regards,
Frederik

Answers

  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    You should be able to get started with this post
    And just add a new target to the drop down control.

  • Frederik_VandendriesFrederik_Vandendries Customer IT Monkey ✭
    Thank you for the link. The drawer template list was also one of my todo's. I used the most recent code post from Tom in post https://community.cireson.com/discussion/2443/hiding-templates-from-showing 

    If I want to filter the template combobox on the new affectedUser page, I experience some difficulties.
    1) The combobox <select> and its <option> elements are not having an ID or good classname to use in document.querySelector().
    2) If I use the code from the post and want to change the target to the combobox with templates, then I use this code in custom.js inside document ready:
    $(document).ready(function() {
        var dropdownTarget = document.querySelector('select');
        dropdownObserver.observe(dropdownTarget, { childList: true });
    });
    But my problem is that the viewpanel with the affectedUser form is not yet loaded, so my var dropdownTarget is null.  The affected user app is working different to the drawer. The drawer is already loaded, but a viewpanel not.
    How can I solve this?

Sign In or Register to comment.