Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-14054

XUI Custom templates and Partials not applied consistently


    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.0,,,,,, 6.5.0,,, 7.0.0
    • Fix Version/s: 6.5.2, 7.0.0
    • Component/s: XUI
    • Sprint:
      2019.4 - Coins, 2019.5 - Scissors
    • Support Ticket IDs:


      Bug description

      There are still a large number of templates that may not be customizable like the KBA and others. Similar in nature to OPENAM-13456

      Usecase:, some of the Templates like Navigation, DefaultBaseTemplate and also some partials like basicSave*.html and basicInput.html cannot be consistently customized as it still uses the default ones. So this make isolating realm customization difficult

      An example :


      How to reproduce the issue

      1. Create a test realm
      2. Assign a dark to this realm

      +        "test-theme": {
      +            // An ordered list of URLs to stylesheets that will be applied to e
      +            stylesheets: [
      +                "themes/test-theme/css/bootstrap.min.css",
      +                StructureStyle,
      +                "themes/test-theme/css/theme-dark.css"
      +            ],
      +            path: "test-theme-path/",
      +            settings: {
      +                loginLogo: {
      +                    src: "themes/test-theme/images/login-logo-white.png",
      +                    title: "Test-ForgeRock",
      +                    alt: "Test-ForgeRock",
      +                    height: "128px",
      +                    width: "120px"
      +                }
      +            }
      +        },
               "fr-dark-theme": {
                   // An ordered list of URLs to stylesheets that will be applied to e
                   stylesheets: [
      @@ -80,6 +98,7 @@ export default {
           mappings: [
               // Use the theme with the key "my-theme" if the realm is either /my-rea
               //{ theme: "my-theme", realms: ["/my-realm", "/my/sub-realm"] }
      +        { theme: "test-theme", realms: ["/test"] }

      ie: the test-theme folder is same as the dark theme CSS
      and the theme/test-theme-path/ holds the customized template/partials

      3. You can copy the template, partials to test-theme-path
      4. Now edit say the DefaultBaseTemplate and others to tag the context so can see
      which one is used (ie the one in the default or the custom one in test-theme-path)

      Many other templates includes KBA, SelfService, Navigation.

      Expected behaviour
      All customized templates/partials should be used
      Current behaviour
      Some of the template, partials uses the default. So inconsistent application. This is seen on and 6.5.0

      Work around

      Similar to OPENAM-13456 for some of these.

      Just for the templates case (not the partial), just need to go over all the templates to move the define to like this
      For example, the changes is to make the change from

      --- a/openam-ui/openam-ui-ria/src/main/js/org/forgerock/commons/ui/common/main/AbstractView.js
      +++ b/openam-ui/openam-ui-ria/src/main/js/org/forgerock/commons/ui/common/main/AbstractView
      @@ -25,11 +25,10 @@ define([
      -    "templates/common/DefaultBaseTemplate",
       ], ($, _, Backbone, Configuration, Constants, EventManager, Router, ThemeManage
      -    ValidatorsManager, DefaultBaseTemplate, Handlebars, unwrapDefaultExport) =>
      +    ValidatorsManager, Handlebars, unwrapDefaultExport) => {
            * @exports org/forgerock/commons/ui/common/main/AbstractView
      @@ -68,7 +67,7 @@ define([
               element: "#content",
      -        baseTemplate: DefaultBaseTemplate,
      +        baseTemplate: "common/DefaultBaseTemplate",
                * View mode: replace or append

      There are many of these KBA, SelfService, Navigation, etc etc. So correcting are required for all these so that it uses only the correct template instead of the default one

      The ones that pertains to partials like basicInput basicSave and kbaItems (especially in The KBA with security question in UsersProfileKBATab.js is a bit problematic)

      One workaround is
      a) Put all the needed partials to the preload list in UIUtils.js (org/forgerock/commons/ui/common/util/UIUtils)
      b) For those code that access these partials using JS import, change them to remove them
      c) For code like UserProfileKBATab.js that access the partials directly the following works

      -    KBAItemPartial) => {
      +    Handlebars) {
      +           // Assuming partials are registered
      +           let KBAItemPartial = Handlebars.partials['profile/_kbaItem'];
                           questions: this.data.predefinedQuestions,


          Issue Links



              • Assignee:
                phil.ostler Phil Ostler [X] (Inactive)
                chee-weng.chea C-Weng C
              • Votes:
                0 Vote for this issue
                8 Start watching this issue


                • Created: