diff --git a/packages/apps/esm-login-app/__mocks__/config.mock.ts b/packages/apps/esm-login-app/__mocks__/config.mock.ts index c125a1ca8..942d0fd03 100644 --- a/packages/apps/esm-login-app/__mocks__/config.mock.ts +++ b/packages/apps/esm-login-app/__mocks__/config.mock.ts @@ -21,6 +21,8 @@ export const mockConfig: ConfigSchema = { }, footer: { additionalLogos: [], + version: '3.0.0', + showVersion: false, }, showPasswordOnSeparateScreen: true, }; diff --git a/packages/apps/esm-login-app/src/config-schema.ts b/packages/apps/esm-login-app/src/config-schema.ts index 1b985c1c5..1cb20b8d4 100644 --- a/packages/apps/esm-login-app/src/config-schema.ts +++ b/packages/apps/esm-login-app/src/config-schema.ts @@ -77,21 +77,33 @@ export const configSchema = { _type: Type.Array, _elements: { _type: Type.Object, - src: { - _type: Type.String, - _required: true, - _description: 'The source URL of the logo image', - _validators: [validators.isUrl], - }, - alt: { - _type: Type.String, - _required: true, - _description: 'The alternative text for the logo image', + _properties: { + src: { + _type: Type.String, + _required: true, + _description: 'The source URL of the logo image', + _validators: [validators.isUrl], + }, + alt: { + _type: Type.String, + _required: true, + _description: 'The alternative text for the logo image', + }, }, }, _default: [], _description: 'An array of logos to be displayed in the footer next to the OpenMRS logo.', }, + version: { + _type: Type.String, + _default: null, + _description: 'Version number to display in the footer (e.g., "3.0.0")', + }, + showVersion: { + _type: Type.Boolean, + _default: false, + _description: 'Whether to display the version information in the footer.', + }, }, showPasswordOnSeparateScreen: { _type: Type.Boolean, @@ -113,6 +125,8 @@ export interface ConfigSchema { alt: string; src: string; }>; + version: string; + showVersion: boolean; }; links: { loginSuccess: string; diff --git a/packages/apps/esm-login-app/src/footer.component.tsx b/packages/apps/esm-login-app/src/footer.component.tsx index 667d3a415..a347c6dbf 100644 --- a/packages/apps/esm-login-app/src/footer.component.tsx +++ b/packages/apps/esm-login-app/src/footer.component.tsx @@ -28,8 +28,14 @@ const Footer: React.FC = () => { - {t('poweredBySubtext', 'An open-source medical record system and global community')} + {t('poweredBySubtext', 'An open-source medical record system and global community.')} + {/* Only show version section if enabled in config and version is provided */} + {config.footer.showVersion && config.footer.version && ( + + {t('version', 'Version')} {config.footer.version} + + )}