Not all routes set page title in Navigation [RMI24H]

Issue #1285 resolved
Brian Lewis repo owner created an issue

cf initial issue #1009. Not all routes added since then support a custom page title.

Note the helper functions in routeHelper

+    /**
+     * Contruct a resolve value for page title for the base route of a feature
+     * ie this is a route with name site.<featureName>
+     * This is set up to create a page Title like
+     * FedEMIS * Schools
+     * @param featureName
+     */
+    public static featureTitle(featureName) {
+      return ["rootPageTitle", (title) => `${title} * ${featureName}`]
+    }
+
+    /**
+     *  construct a resolve balue for page title for a page within a fweature
+     *  e.g. site.schools.list will return 
+     *  FedEMIS * Schools: List
+     * @param pageName
+     */
+    public static simpleTitle(pageName) {
+      return ["pageTitle", (title) => `${title} ${pageName}`]
+       }
    }

We have from these two common forms:

For e.g. <feature> Lists, <feature> Charts etc

pageTitle: Sw.Utils.RouteHelper.simpleTitle("Dashboard"),

for items:

pageTitle: ['model', 'rootPageTitle', (model, title) => `${title} * Teacher: ${model.tFullName}`] 

rootPageTitle holds the system context name.

rootPageTitle: ["lookupsResolver", "Lookups", (lookupsResolver, lookups: Sw.Lookups.LookupService) => {
+                   return lookups.byCode("sysParams", "APP_NAME", "N") || "Pacific EMIS";
+               }],

Comments (5)

  1. Brian Lewis reporter

    @Ghislain Hachey Not a high priority but useful to get back into client side development

  2. Log in to comment