-
Notifications
You must be signed in to change notification settings - Fork 19
adding schema and data for admin console v0.4 #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughMultiple new JSON configuration and schema files have been introduced for the HCM Admin Console. These cover display field mappings, field properties, field type mappings, email templates, app configuration caching, module schemas, localization, form configuration, mobile app links, and help tutorials. Each file defines structured metadata or validation rules for the admin console's dynamic UI and data handling. Changes
Sequence Diagram(s)sequenceDiagram
participant AdminConsole
participant ConfigFile
participant SchemaFile
AdminConsole->>ConfigFile: Load configuration (fields, types, templates)
AdminConsole->>SchemaFile: Validate configuration against schema
SchemaFile-->>AdminConsole: Return validation result
AdminConsole->>AdminConsole: Render UI or process data as per config
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🧹 Nitpick comments (12)
mdms/HCM/AdminConsole v0.4/Schemas/commonUiConfig.HelpTutorial (3)
30-33: Add URI format validation forurl
Explicit"format": "uri"lets upstream validators catch malformed links early.- "url": { - "type": "string" - }, + "url": { + "type": "string", + "format": "uri" + },
36-38: Useinteger& minimum-0 fororder
Order is a whole number; narrowing the type avoids float inputs like1.5.- "order": { - "type": "number" - }, + "order": { + "type": "integer", + "minimum": 0 + },
20-23: Guarantee at least one help item
AddminItems: 1so a module cannot register an empty help array.- "helpContent": { - "type": "array", + "helpContent": { + "type": "array", + "minItems": 1,mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.MobileAppLink (1)
17-19: Consider URI validation forappLink
Helps catch bad deep-links before they propagate.- "appLink": { - "type": "string" + "appLink": { + "type": "string", + "format": "uri"mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.AppModuleSchema (1)
19-39: Strengthenfeaturesarray constraints
AddminItems, and useuniqueItemProperties(supported by Ajv & others) oncodeto stop duplicate feature codes.- "features": { - "type": "array", + "features": { + "type": "array", + "minItems": 1, + "uniqueItemProperties": ["code"],mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.AppConfigCache (1)
20-28: Optional: add patterns to prevent empty strings
Current schema accepts"". If that’s unintended, add regex patterns orminLength: 1.- "flow": { - "type": "string" + "flow": { + "type": "string", + "minLength": 1(Repeat for
projectTypeandcampaignNumber.)mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.emailTemplate (1)
2-4: UnifytenantIdplaceholder usage across new schemasOther newly-added schema files hard-code
"tenantId": "mz"whereas this file keeps the{{tenantId}}template. Mixing literal vs placeholder values will break the MDMS loader in non-template environments (the literal"{{tenantId}}"will be treated as the actual tenant id).Recommend standardising on one approach – either keep the template in all schema files or materialise the concrete tenant everywhere, e.g.
- "tenantId": "{{tenantId}}", + "tenantId": "mz",mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.AppScreenLocalisationConfig (1)
5-15: MissingadditionalProperties: falseallows silent config driftUnlike the nested objects, the root schema omits
additionalProperties. This silently accepts typos at top level (screeenName, etc.). Add the restriction for stronger validation.... "properties": { ... }, -"isActive": true +"additionalProperties": false, +"isActive": truemdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FieldPropertiesPanelConfig (1)
8-17: Add root-leveladditionalProperties: falsefor stricter validationTo prevent unnoticed config typos, consider disallowing undeclared root keys just as you do for nested objects.
... "x-unique": [ "label" ], +"additionalProperties": false, "properties": {mdms/HCM/AdminConsole v0.4/Data/HCM-ADMIN-CONSOLE.FieldTypeMappingConfig (1)
114-118: Redundant identity mappings clutter the fileMappings like
"helpText": "helpText"or"endDate": "endDate"add ~80 noisy lines but convey no transformation logic.
Unless the downstream engine uses the key’s presence (not the value) as a toggle, you can drop these without changing behaviour.Benefit: file shrinks ~15 %, visual diffs become clearer.
Also applies to: 127-129, 140-141, 178-183
mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfig (1)
44-50: Nestedpage.typeproperty shadows JSON-Schema’s reserved keywordInside
pages[].propertiesyou add:"type": { "type": "string" }While valid, naming a child property
typeinside a schema can confuse tools/readers becausetypealready has special meaning in JSON-Schema. Consider renaming (e.g.,pageType) to avoid ambiguity.Also applies to: 47-49
mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate (1)
44-50: The template schema duplicates ~95 % of FormConfig – extract a common$refMaintaining two nearly-identical schemas will quickly lead to drift.
Create a base definition (e.g.,FormConfigBase) and let both schemas$refit, overriding only the tenant-specific pieces (tenantId, defaults, etc.).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (15)
mdms/HCM/AdminConsole v0.4/Data/HCM-ADMIN-CONSOLE.DETAILS_RENDERER_CONFIG(1 hunks)mdms/HCM/AdminConsole v0.4/Data/HCM-ADMIN-CONSOLE.FieldPropertiesPanelConfig(1 hunks)mdms/HCM/AdminConsole v0.4/Data/HCM-ADMIN-CONSOLE.FieldTypeMappingConfig(1 hunks)mdms/HCM/AdminConsole v0.4/Data/HCM-ADMIN-CONSOLE.emailTemplate(1 hunks)mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.AppConfigCache(1 hunks)mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.AppModuleSchema(1 hunks)mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.AppScreenLocalisationConfig(1 hunks)mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.DETAILS_RENDERER_CONFIG(1 hunks)mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FieldPropertiesPanelConfig(1 hunks)mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FieldTypeMappingConfig(1 hunks)mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfig(1 hunks)mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate(1 hunks)mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.MobileAppLink(1 hunks)mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.emailTemplate(1 hunks)mdms/HCM/AdminConsole v0.4/Schemas/commonUiConfig.HelpTutorial(1 hunks)
🔇 Additional comments (7)
mdms/HCM/AdminConsole v0.4/Schemas/commonUiConfig.HelpTutorial (1)
17-20: JSON becomes invalid – missing comma after themoduleobject
Without a comma, the JSON cannot be parsed, breaking MDMS loading at runtime.- "module": { - "type": "string" - } - "helpContent": { + "module": { + "type": "string" + }, + "helpContent": {Likely an incorrect or invalid review comment.
mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.MobileAppLink (1)
17-20: JSON syntax error – comma missing between properties
This stops the MobileAppLink schema from loading.- "appLink": { - "type": "string" - } - "hierarchy": { + "appLink": { + "type": "string" + }, + "hierarchy": {Likely an incorrect or invalid review comment.
mdms/HCM/AdminConsole v0.4/Data/HCM-ADMIN-CONSOLE.emailTemplate (1)
1-12: Validate template codes against available i18n keys
Ensure everysubjectCodeand each entry inbodyCodesexists in your message bundle; missing keys will surface as blank texts to end-users.mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FieldTypeMappingConfig (1)
40-68: Let’s inspect the actualrequiredarrays in the schema to see ifattributeToRenameis included and in what context:#!/bin/bash file="mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FieldTypeMappingConfig" echo "=== Lines 1–30 (top-level required) ===" sed -n '1,30p' "$file" echo echo "=== Lines 20–60 (nested sections) ===" sed -n '20,60p' "$file"mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.AppScreenLocalisationConfig (1)
55-57: Typo or intentional?LocalisationModulevs.LocalizationModuleDouble-check the spelling – other artefacts/use-sites may expect American spelling. A mismatch will surface only at runtime when the lookup fails.
mdms/HCM/AdminConsole v0.4/Data/HCM-ADMIN-CONSOLE.FieldTypeMappingConfig (1)
13-20: Inconsistent casing fortypevs.fieldTypemay break look-upsSome items use a capitalized
type/fieldTypevalue ("Table","DetailsCard", …) whereas the majority are lowercase ("resourceCard","dropdown").
If the consumer code performs a direct, case-sensitive map (dict[type]), these entries will silently miss.Either:
- "type": "Table", + "type": "table",(or normalise on PascalCase everywhere) – but keep it consistent across all configs.
Also applies to: 22-29
mdms/HCM/AdminConsole v0.4/Data/HCM-ADMIN-CONSOLE.FieldPropertiesPanelConfig (1)
98-115:tooltiptoggle enabled only fortext&number– intentional?Other textual inputs (
mobileNumber,textArea, etc.) might also benefit from tooltips. Double-check the UX requirement; expanding the list now prevents future hot-fixes.
| @@ -0,0 +1,72 @@ | |||
| :{ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File cannot be parsed – stray leading colon breaks JSON
The very first character is :, producing invalid JSON and causing the entire MDMS upload to fail.
-:{
+{📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| :{ | |
| { |
🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.FieldTypeMappingConfig
at line 1, remove the leading colon character `:` at the start of the file to
ensure the JSON is valid and can be parsed correctly during the MDMS upload.
| "fieldKey": "locality", | ||
| "jsonPath": "Individual.address[0].locality.code", | ||
| "mandatory": "false" | ||
| }, | ||
| { | ||
| "fieldKey": "name", | ||
| "jsonPath": "Individual.name.givenName", | ||
| "mandatory": "true" | ||
| }, | ||
| { | ||
| "fieldKey": "gender", | ||
| "jsonPath": "Individual.gender", | ||
| "mandatory": "false" | ||
| }, | ||
| { | ||
| "fieldKey": "identifierId", | ||
| "jsonPath": "Individual.identifiers[0].identifierId", | ||
| "mandatory": "false" | ||
| }, | ||
| { | ||
| "isList": "true", | ||
| "fieldKey": "identifierType", | ||
| "jsonPath": "Individual.identifiers[0].identifierType", | ||
| "mandatory": "false" | ||
| }, | ||
| { | ||
| "fieldKey": "mobileNumber", | ||
| "jsonPath": "Individual.mobileNumber", | ||
| "mandatory": "false" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Booleans stored as strings – type mismatch with consumer code
"mandatory", "isList" and "additionalField" are expressed as "true"/"false" strings.
Unless the renderer explicitly coerces, this will evaluate to truthy strings and break boolean checks.
- "mandatory": "false"
+ "mandatory": false
...
- "isList": "true",
+ "isList": true,
...
- "additionalField": "true"
+ "additionalField": trueRun the same replacement for all occurrences.
Also applies to: 42-62, 68-89
🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Schemas/HCM-ADMIN-CONSOLE.DETAILS_RENDERER_CONFIG
from lines 6 to 35, the boolean fields "mandatory" and "isList" are incorrectly
stored as string values "true"/"false". This causes type mismatches with the
consumer code expecting actual booleans. To fix this, replace all occurrences of
these fields' values from strings to proper boolean literals true or false.
Apply the same fix to lines 42-62 and 68-89 as well.
| "type": "number", | ||
| "order": 2, | ||
| "metadata": { | ||
| "type": "integer", | ||
| "format": "text" | ||
| }, | ||
| "fieldType": "number", | ||
| "attributeToRename": { | ||
| "helpText": "helpText" | ||
| } | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
number block reports format: "text" – probably a copy-paste slip
"type": "integer" combined with "format": "text" is semantically confusing and may affect UI renderers that rely on the format to decide between <input type="number"> and <input type="text">.
- "metadata": {
- "type": "integer",
- "format": "text"
- },
+ "metadata": {
+ "type": "integer",
+ "format": "number"
+ },📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "type": "number", | |
| "order": 2, | |
| "metadata": { | |
| "type": "integer", | |
| "format": "text" | |
| }, | |
| "fieldType": "number", | |
| "attributeToRename": { | |
| "helpText": "helpText" | |
| } | |
| }, | |
| "type": "number", | |
| "order": 2, | |
| "metadata": { | |
| "type": "integer", | |
| "format": "number" | |
| }, | |
| "fieldType": "number", | |
| "attributeToRename": { | |
| "helpText": "helpText" | |
| } | |
| }, |
🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Data/HCM-ADMIN-CONSOLE.FieldTypeMappingConfig
between lines 120 and 130, the "number" block incorrectly sets "format" to
"text" while "type" is "integer". This mismatch can confuse UI renderers. Update
the "format" value to a more appropriate one for numbers, such as "number" or
remove the "format" field if not needed, to ensure consistency and correct UI
behavior.
| "fieldKey": "locality", | ||
| "jsonPath": "Individual.address[0].locality.code", | ||
| "mandatory": "false" | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boolean flags are stored as strings – this will break strict JSON consumers
Fields mandatory, isList, and additionalField are declared as "false" / "true" (strings) instead of false / true.
Example fix:
- "mandatory": "false"
+ "mandatory": falseSearch & replace throughout the file – otherwise schema validation and any boolean logic will fail.
Also applies to: 16-19, 21-30, 42-46, 58-62, 68-72, 80-89
🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Data/HCM-ADMIN-CONSOLE.DETAILS_RENDERER_CONFIG
around lines 6 to 9 and other specified ranges, boolean flags like "mandatory",
"isList", and "additionalField" are incorrectly set as strings "true"/"false".
Change these string values to proper boolean literals true/false without quotes
throughout the file to ensure correct JSON parsing and schema validation.
| "visibilityEnabledFor": [ | ||
| "checkbox", | ||
| "numeric", | ||
| "dob", | ||
| "date", | ||
| "select", | ||
| "dropdown", | ||
| "mobileNumber", | ||
| "number", | ||
| "textArea", | ||
| "text", | ||
| "latLng", | ||
| "administrativeArea", | ||
| "" | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spurious empty string in visibilityEnabledFor array
The final element "" has no meaning and can derail look-ups that iterate over the list.
- "administrativeArea",
- ""
+ "administrativeArea"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "visibilityEnabledFor": [ | |
| "checkbox", | |
| "numeric", | |
| "dob", | |
| "date", | |
| "select", | |
| "dropdown", | |
| "mobileNumber", | |
| "number", | |
| "textArea", | |
| "text", | |
| "latLng", | |
| "administrativeArea", | |
| "" | |
| ] | |
| "visibilityEnabledFor": [ | |
| "checkbox", | |
| "numeric", | |
| "dob", | |
| "date", | |
| "select", | |
| "dropdown", | |
| "mobileNumber", | |
| "number", | |
| "textArea", | |
| "text", | |
| "latLng", | |
| "administrativeArea" | |
| ] |
🤖 Prompt for AI Agents
In mdms/HCM/AdminConsole v0.4/Data/HCM-ADMIN-CONSOLE.FieldPropertiesPanelConfig
around lines 341 to 355, remove the spurious empty string element "" from the
visibilityEnabledFor array as it serves no purpose and may cause issues during
look-ups or iterations over this list.
Summary by CodeRabbit