Change default text for Certification comment box

We have a requirement to change the default text of the comment box that shows up on certifications. Currently the text box says “Type your comments here”. We would like to change that wording to give additional instructions.

We can’t figure out which item needs to be modified in the configuration files. Does anyone have any guidance on this?

Thanks,
Vic

This text is part of the iiqMessages.properties file from IdentityIQ and can be overwritten.

There are 4 labels in the iiqMessages file with a similar text:

ui_comment_textarea_placeholder=Type your comment here
ui_access_request_comments_placeholder_text=Type your comment here...
ui_violation_comment_placeholder_text=Type your comment here...
ui_certification_schedule_timeline_closing_comments_descr=Type your comment here

I think the one you are searching for is the first one: ui_comment_textarea_placeholder
You can add that label to the iiqCustom.properties properties files located in the \WEB-INF\classes\sailpoint\web\messages\ folder. It will override the default value.

If I am correct there is no need to restart the application server (Tomcat), but the browser cache must be cleared to see the change.

– Remold

1 Like

This is the one I want: ui_comment_textarea_placeholder

I updated that item to have my custom text. I then launched a cert and looked at the comment box and it DID have my custom text. So, I have a fix for my issue.

However, that same text is now showing up on access request approval comments.

Seems like a bug to me…

Thanks,
Vic

It is common to have the same placeholder in multiple places when it is assumed to hold the same text.

If you just want to change one single text on a specific page, you should look outside of the options provided by OOTB IdentityIQ. This might be using a simple jQuery or recompilling/overwritting IIQ classes or something else.

— Remold

OK, thanks for the help!

Vic

1 Like

I’m just getting back to this. We have never done any JS mods on our end, so I’m looking for a little help in getting started.

Is there a doc that I can reference that would show how to find where the content lives that I want to modify? Has anyone else written JS to customize a comment box?

Thanks,
Vic

There is no single documentation on how to get the references from the pages other than the OOTB localization white paper which contains the basics already answered in this thread.

For the more advanced stuff you need to user other tooling.
I normally use Chrome with the Developer Tools and jQuery to do the selection.
A quick search on something nice for the developer tools (ctrl-shift-i): The Web Platform Course
And for jQuery: jQuery Tutorial

– Remold

Thanks for the pointers. I have found the element in the Chrome Developer Tools and I am able to dynamically update the comment text using JQuery:

$('label[for="commentTextArea"]').text('New text for comment');

Now I need to find out where to add this JQuery code to the HTML file. The path of the page I’m looking at is this:

/identityiq/certification/certification.jsf#/certification/0a1169e28c111336818c118548370042

Do I need to update certification.jsf with my short script embedded? If so, where does that file live at? I have looked all over and can’t find it.

Thanks!
Vic

Hi @vic_rinkenberger,

There is a nice place to put your custom JavaScripts :slight_smile: and that file is: scripts/custom.js

An example of scripts/custom.js:

/*
* Custom Javascript functions may be placed here.
* */

$(document).ready(function(){
  if(window.location.href.indexOf("roleEditor") > -1) {
    $("#roleOptionsTable tbody tr:last td:last input").on("change", function(){
      alert("Diable changed");
    });
  }
});

As this file is included in all IIQ pages, I am using the location.href to see on which page to ‘include’ the jQuery-statement. For you this should be:

if(window.location.href.indexOf("certification.jsf") > -1) {

I hope this answers your question :slight_smile:

– Remold

Remold,

Thanks for the reply. Your code works great I the developer console, but when I add it to custom.js and restart tomcat, it doesn’t seem to execute when I navigate to the certification.jsf page and click on the Revoke button (like it does in the dev console).

Do I need to activate something to start using custom.js?

$(document).ready(function(){

if(window.location.href.indexOf("certification.jsf") > -1) {

$('label[for="commentTextArea"]').text('New text for comment');

}

});

Thanks,

Vic

The Comment Box is only created when the menu option ‘Comment’ is used, so the label[for="commentTextArea"]' is not available when the page is loaded, therefor the jQuery doesn’t do anything.

The simplest solution is to check on a regular interval if the element exists and when it appears directly change the text.

Untested code:

$(document).ready(function(){
  if(window.location.href.indexOf("certification.jsf") > -1) {

    var CONTROL_INTERVAL = setInterval(function(){
      // Check if element exist
      if($('label[for="commentTextArea"]').length > 0){
        // Since element is created, no need to check anymore
        clearInterval(CONTROL_INTERVAL);

       //change text
       $('label[for="commentTextArea"]').text('New text for comment');
      }
    }, 100); // check for every 100ms
  }
});

I hope this works :slight_smile:


There is another way to adjust it, but not advisable! :no_entry:
It is tricky and gets overwritten during patches and upgrades.

The code to create the comment-box is In the file ui/js/bundles/SailPointBundleLibrary.js :

<label for="commentTextArea">{{ \'ui_comment_textarea_placeholder\' | spTranslate }}<span class="text-danger" ng-if="dialogCtrl.required" aria-label="({{ \'ui_required\' | spTranslate }})">*</span></label>

here you can replace {{ \'ui_comment_textarea_placeholder\' | spTranslate }} with your hard-coded text.

Again, this is not a good practice! :no_entry:


– Remold

Remold,

Thanks a bunch for all of your help on this. I actually went down a different path since I was a little concerned about running the JS every 100ms (which is what was needed, since running it only once would only work for the first button click).

Here is what I ended up with (assisted by Claude and ChatGPT :slight_smile: ):

  // only run on the Certifications page
  if(window.location.href.indexOf("certification.jsf") > -1) {
    // check to see if the Revoke button is loaded before trying to change the Comment text value on it
    function checkButtonLoaded() {
      let $button = $('button.btn.btn-white.btn-sm.icon-btn.m-r-xs.cert-action-Remediated');
      if ($button.length > 0) {
        $("button.btn.btn-white.btn-sm.icon-btn.m-r-xs.cert-action-Remediated").click(function() {
          let $label = $('label[for="commentTextArea"]');
          // instruct the revoker what is required for revocations
          $label.text('Enter a reason for this revocation');
        });
      } else {
        // button not yet loaded, check again after 1 second
        setTimeout(checkButtonLoaded, 1000);
      }
    }

    checkButtonLoaded();
  }
});

This is working as expected. Thanks again for your guidance getting to this point!

Vic

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.