From 2cd97687b9975d7b510cc10327219c8d995157a7 Mon Sep 17 00:00:00 2001 From: Edwin Christie Date: Tue, 14 Oct 2025 16:42:02 -0400 Subject: [PATCH 1/4] chore(ui): update header to show read-only status for address manager (ENG-64727) --- package-lock.json | 12 ++++---- package.json | 2 +- src/header/HeaderAuthentication.js | 21 +++++++++++-- src/header/HeaderAuthentication.less | 39 ++++++++++++------------- stories/HeaderAuthentication.stories.js | 2 ++ 5 files changed, 47 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd2249e..a5863cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2270,9 +2270,9 @@ "peer": true }, "node_modules/@bluecateng/pelagos": { - "version": "12.17.2", - "resolved": "https://registry.npmjs.org/@bluecateng/pelagos/-/pelagos-12.17.2.tgz", - "integrity": "sha512-dR0LhZUxxR+sWxyaCrk+iDfpXOTkZ+82Dk1dwCzol/MldOodVo8Khvmi/YMzamF9Oxw2eWpRaD0kJLAXNtCOhg==", + "version": "12.23.0", + "resolved": "https://registry.npmjs.org/@bluecateng/pelagos/-/pelagos-12.23.0.tgz", + "integrity": "sha512-fGGD6YJMrEgDZ0a+ZwAlPtIHOISm6me7eHi1kXYWMk3qJZVtawyoLXV7thunwag6iDRgLs++9+CRAL1W/Vekew==", "license": "ISC", "peer": true, "dependencies": { @@ -26349,9 +26349,9 @@ "peer": true }, "@bluecateng/pelagos": { - "version": "12.17.2", - "resolved": "https://registry.npmjs.org/@bluecateng/pelagos/-/pelagos-12.17.2.tgz", - "integrity": "sha512-dR0LhZUxxR+sWxyaCrk+iDfpXOTkZ+82Dk1dwCzol/MldOodVo8Khvmi/YMzamF9Oxw2eWpRaD0kJLAXNtCOhg==", + "version": "12.23.0", + "resolved": "https://registry.npmjs.org/@bluecateng/pelagos/-/pelagos-12.23.0.tgz", + "integrity": "sha512-fGGD6YJMrEgDZ0a+ZwAlPtIHOISm6me7eHi1kXYWMk3qJZVtawyoLXV7thunwag6iDRgLs++9+CRAL1W/Vekew==", "peer": true, "requires": { "@bluecateng/l10n-core": "^0.2.0", diff --git a/package.json b/package.json index b82dad3..824f958 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "prop-types": "^15.8.1" }, "peerDependencies": { - "@bluecateng/pelagos": "^12.17.2", + "@bluecateng/pelagos": "^12.23.0", "@bluecateng/pelagos-forms": "^5.0.1" }, "devDependencies": { diff --git a/src/header/HeaderAuthentication.js b/src/header/HeaderAuthentication.js index 72f8ef7..82fc9f4 100644 --- a/src/header/HeaderAuthentication.js +++ b/src/header/HeaderAuthentication.js @@ -23,6 +23,7 @@ import PropTypes from 'prop-types'; import usePlatformData from '../hooks/usePlatformData'; import './HeaderAuthentication.less'; +import { Tag, useTooltip } from '@bluecateng/pelagos'; /** * HeaderAuthentication component displays the connected Authentication @@ -35,15 +36,22 @@ const HeaderAuthentication = ({ className }) => { const authenticationAlias = data?.user?.authentication_info?.alias; const authenticationLink = data?.user?.authentication_info?.url; const authenticationService = data?.user?.authentication_info?.service; + const isReadOnly = data?.user?.authentication_info?.is_read_only; + const readOnlyTooltipRef = useTooltip( + `Connected to Address Manager in read- + only mode. Gateway settings aren’t + affected.`, + 'bottom', + ); return ( <> {authenticationService && (
- + {authenticationAlias ? ( { authenticationService )} + {isReadOnly && ( + + )}
)} diff --git a/src/header/HeaderAuthentication.less b/src/header/HeaderAuthentication.less index 2108228..61516ed 100644 --- a/src/header/HeaderAuthentication.less +++ b/src/header/HeaderAuthentication.less @@ -23,31 +23,26 @@ .HeaderAuthentication { height: @sp-48; width: @sp-48; + display: flex; + flex-direction: row; + align-items: center; &__authentication { - & span { - color: var(--tag-color-teal); - display: flex; - flex-direction: row; - align-items: center; - font-size: 14px; - text-align: left; + color: var(--tag-color-teal); + align-items: center; + font-size: 14px; + text-align: left; - a { - text-decoration: none; - padding-left: @sp-02; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - color: var(--link-primary); - } + a { + text-decoration: none; + padding-left: @sp-02; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + color: var(--link-primary); } - &__linkIcon { - color: var(--icon-interactive); - } - - & > span::before { + & > ::before { content: ''; margin-left: @sp-08; margin-right: @sp-08; @@ -55,4 +50,8 @@ border: 1px solid var(--border-subtle); } } + + &__readOnlyLabel { + margin-left: @sp-08; + } } diff --git a/stories/HeaderAuthentication.stories.js b/stories/HeaderAuthentication.stories.js index 71c19bf..8d0a45b 100644 --- a/stories/HeaderAuthentication.stories.js +++ b/stories/HeaderAuthentication.stories.js @@ -30,6 +30,8 @@ const mockBAM = { alias: 'BAM-9.5.0', url: '#', service: 'Address Manager', + // eslint-disable-next-line camelcase + is_read_only: true, }, }, }, From 3ef47658045fdb9a0bb91d94001ea3371042595d Mon Sep 17 00:00:00 2001 From: Edwin Christie Date: Tue, 14 Oct 2025 21:25:45 -0400 Subject: [PATCH 2/4] chore(ui): fix test case (ENG-64727) --- .../components/HeaderAuthentication.test.js | 3 ++ .../HeaderAuthentication.test.js.snap | 36 ++++++++++++++----- src/header/HeaderAuthentication.less | 4 +-- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/__tests__/components/HeaderAuthentication.test.js b/__tests__/components/HeaderAuthentication.test.js index 4b33505..b668e1a 100644 --- a/__tests__/components/HeaderAuthentication.test.js +++ b/__tests__/components/HeaderAuthentication.test.js @@ -41,6 +41,7 @@ const mockBAM = { alias: 'BAM-9.5.0', url: '#', service: 'BAM', + is_read_only: true, }, }, }, @@ -73,6 +74,8 @@ jest.mock('../../src/hooks/usePlatformData', () => { mockUsePlatformData.mockImplementation(() => mockValue); return mockUsePlatformData; }); + +jest.mock('@bluecateng/pelagos'); const mockUsePlatformData = require('../../src/hooks/usePlatformData'); mockUsePlatformData.mockReturnValueOnce({ ...mockDisable }); mockUsePlatformData.mockReturnValueOnce({ ...mockMicetro }); diff --git a/__tests__/components/__snapshots__/HeaderAuthentication.test.js.snap b/__tests__/components/__snapshots__/HeaderAuthentication.test.js.snap index 3f3dee9..8b5f825 100644 --- a/__tests__/components/__snapshots__/HeaderAuthentication.test.js.snap +++ b/__tests__/components/__snapshots__/HeaderAuthentication.test.js.snap @@ -3,9 +3,11 @@ exports[`HeaderAuthentication Rendering Render HeaderAuthentication component with BAM authentication and default props 1`] = `
- + +
`; @@ -27,9 +35,11 @@ exports[`HeaderAuthentication Rendering Render HeaderAuthentication component wi exports[`HeaderAuthentication Rendering Render HeaderAuthentication component with BAM authentication and props 1`] = `
- + +
`; @@ -51,9 +67,11 @@ exports[`HeaderAuthentication Rendering Render HeaderAuthentication component wi exports[`HeaderAuthentication Rendering Render HeaderAuthentication component with Micetro authentication 1`] = `
- +
- + Standalone
diff --git a/src/header/HeaderAuthentication.less b/src/header/HeaderAuthentication.less index 61516ed..c20c0e6 100644 --- a/src/header/HeaderAuthentication.less +++ b/src/header/HeaderAuthentication.less @@ -21,14 +21,14 @@ @import '~@bluecateng/pelagos/less/colors'; .HeaderAuthentication { - height: @sp-48; - width: @sp-48; display: flex; flex-direction: row; align-items: center; &__authentication { color: var(--tag-color-teal); + display: flex; + flex-direction: row; align-items: center; font-size: 14px; text-align: left; From 086d3f89fceafe2e8a4e1e1de848515b28e58b20 Mon Sep 17 00:00:00 2001 From: Edwin Christie Date: Wed, 15 Oct 2025 17:01:13 -0400 Subject: [PATCH 3/4] chore(ui): revert back some changes (ENG-64727) --- .../HeaderAuthentication.test.js.snap | 14 ++++++++++---- package-lock.json | 12 ++++++------ package.json | 2 +- src/header/HeaderAuthentication.js | 11 ++++++----- src/l10n/en.po | 7 +++++++ src/l10n/zz.po | 7 +++++++ 6 files changed, 37 insertions(+), 16 deletions(-) diff --git a/__tests__/components/__snapshots__/HeaderAuthentication.test.js.snap b/__tests__/components/__snapshots__/HeaderAuthentication.test.js.snap index 8b5f825..4e640e2 100644 --- a/__tests__/components/__snapshots__/HeaderAuthentication.test.js.snap +++ b/__tests__/components/__snapshots__/HeaderAuthentication.test.js.snap @@ -25,9 +25,12 @@ exports[`HeaderAuthentication Rendering Render HeaderAuthentication component wi + > + + Read-only + +
`; @@ -57,9 +60,12 @@ exports[`HeaderAuthentication Rendering Render HeaderAuthentication component wi + > + + Read-only + + `; diff --git a/package-lock.json b/package-lock.json index a5863cf..bd2249e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2270,9 +2270,9 @@ "peer": true }, "node_modules/@bluecateng/pelagos": { - "version": "12.23.0", - "resolved": "https://registry.npmjs.org/@bluecateng/pelagos/-/pelagos-12.23.0.tgz", - "integrity": "sha512-fGGD6YJMrEgDZ0a+ZwAlPtIHOISm6me7eHi1kXYWMk3qJZVtawyoLXV7thunwag6iDRgLs++9+CRAL1W/Vekew==", + "version": "12.17.2", + "resolved": "https://registry.npmjs.org/@bluecateng/pelagos/-/pelagos-12.17.2.tgz", + "integrity": "sha512-dR0LhZUxxR+sWxyaCrk+iDfpXOTkZ+82Dk1dwCzol/MldOodVo8Khvmi/YMzamF9Oxw2eWpRaD0kJLAXNtCOhg==", "license": "ISC", "peer": true, "dependencies": { @@ -26349,9 +26349,9 @@ "peer": true }, "@bluecateng/pelagos": { - "version": "12.23.0", - "resolved": "https://registry.npmjs.org/@bluecateng/pelagos/-/pelagos-12.23.0.tgz", - "integrity": "sha512-fGGD6YJMrEgDZ0a+ZwAlPtIHOISm6me7eHi1kXYWMk3qJZVtawyoLXV7thunwag6iDRgLs++9+CRAL1W/Vekew==", + "version": "12.17.2", + "resolved": "https://registry.npmjs.org/@bluecateng/pelagos/-/pelagos-12.17.2.tgz", + "integrity": "sha512-dR0LhZUxxR+sWxyaCrk+iDfpXOTkZ+82Dk1dwCzol/MldOodVo8Khvmi/YMzamF9Oxw2eWpRaD0kJLAXNtCOhg==", "peer": true, "requires": { "@bluecateng/l10n-core": "^0.2.0", diff --git a/package.json b/package.json index 824f958..b82dad3 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "prop-types": "^15.8.1" }, "peerDependencies": { - "@bluecateng/pelagos": "^12.23.0", + "@bluecateng/pelagos": "^12.17.2", "@bluecateng/pelagos-forms": "^5.0.1" }, "devDependencies": { diff --git a/src/header/HeaderAuthentication.js b/src/header/HeaderAuthentication.js index 82fc9f4..daf405a 100644 --- a/src/header/HeaderAuthentication.js +++ b/src/header/HeaderAuthentication.js @@ -1,5 +1,5 @@ /* -Copyright 2023-2024 BlueCat Networks Inc. +Copyright 2023-2025 BlueCat Networks Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -24,6 +24,7 @@ import usePlatformData from '../hooks/usePlatformData'; import './HeaderAuthentication.less'; import { Tag, useTooltip } from '@bluecateng/pelagos'; +import { t } from '@bluecateng/l10n.macro'; /** * HeaderAuthentication component displays the connected Authentication @@ -38,7 +39,7 @@ const HeaderAuthentication = ({ className }) => { const authenticationService = data?.user?.authentication_info?.service; const isReadOnly = data?.user?.authentication_info?.is_read_only; const readOnlyTooltipRef = useTooltip( - `Connected to Address Manager in read- + t`Connected to Address Manager in read- only mode. Gateway settings aren’t affected.`, 'bottom', @@ -70,9 +71,9 @@ const HeaderAuthentication = ({ className }) => { className='HeaderAuthentication__readOnlyLabel' size='sm' type='gray' - text='Read-only' - ref={readOnlyTooltipRef} - /> + ref={readOnlyTooltipRef}> + Read-only + )} )} diff --git a/src/l10n/en.po b/src/l10n/en.po index cebfe56..8468809 100644 --- a/src/l10n/en.po +++ b/src/l10n/en.po @@ -52,6 +52,13 @@ msgstr "" msgid "Close side menu" msgstr "" +#: e22d +msgid "" +"Connected to Address Manager in read-\n" +" only mode. Gateway settings aren’t \n" +" affected." +msgstr "" + #: b38e msgid "Custom workflows" msgstr "" diff --git a/src/l10n/zz.po b/src/l10n/zz.po index 09b3fb6..3f12a06 100644 --- a/src/l10n/zz.po +++ b/src/l10n/zz.po @@ -52,6 +52,13 @@ msgstr "ÇÇlôôséé" msgid "Close side menu" msgstr "ÇÇlôôséé sîîdéé ménûû" +#: e22d +msgid "" +"Connected to Address Manager in read-\n" +" only mode. Gateway settings aren’t \n" +" affected." +msgstr "" + #: b38e msgid "Custom workflows" msgstr "ÇÇûûstôôm wôôrkflôôws" From e3e3b82bf44ce2f1afd537cc475ad324a80247a0 Mon Sep 17 00:00:00 2001 From: Edwin Christie Date: Thu, 16 Oct 2025 13:52:00 -0400 Subject: [PATCH 4/4] chore(ui): make translation for new strings (ENG-64727) --- src/header/HeaderAuthentication.js | 2 +- src/l10n/en.po | 4 ++++ src/l10n/zz.po | 9 ++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/header/HeaderAuthentication.js b/src/header/HeaderAuthentication.js index daf405a..585037f 100644 --- a/src/header/HeaderAuthentication.js +++ b/src/header/HeaderAuthentication.js @@ -72,7 +72,7 @@ const HeaderAuthentication = ({ className }) => { size='sm' type='gray' ref={readOnlyTooltipRef}> - Read-only + {t`Read-only`} )} diff --git a/src/l10n/en.po b/src/l10n/en.po index 8468809..cae3aa3 100644 --- a/src/l10n/en.po +++ b/src/l10n/en.po @@ -115,6 +115,10 @@ msgstr "" msgid "Quick access to default workflows" msgstr "" +#: 9b19 +msgid "Read-only" +msgstr "" + #: efc0 #~ msgid "Save" #~ msgstr "" diff --git a/src/l10n/zz.po b/src/l10n/zz.po index 3f12a06..a45a9c1 100644 --- a/src/l10n/zz.po +++ b/src/l10n/zz.po @@ -22,7 +22,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-13T14:44:45.416Z\n" -"PO-Revision-Date: 2024-10-22T19:28:49.031786+00:00\n" +"PO-Revision-Date: 2025-10-16T16:02:32.394339+00:00\n" "Last-Translator: \n" "Language-Team: \n" "Language: zz\n" @@ -58,6 +58,9 @@ msgid "" " only mode. Gateway settings aren’t \n" " affected." msgstr "" +"ÇÇôônnééççtééd tôô ÂÂddrééss Mâânââgéér îîn rééââd-\n" +" ôônly môôdéé. Gââtééwâây sééttîîngs ââréén’t \n" +" ââffééççtééd." #: b38e msgid "Custom workflows" @@ -115,6 +118,10 @@ msgstr "Lôôgôôùùt" msgid "Quick access to default workflows" msgstr "Rââpîîd açççéès àû dêéfââùùlt wôôrkflôôws" +#: 9b19 +msgid "Read-only" +msgstr "Rééââd-ôônly" + #: efc0 #~ msgid "Save" #~ msgstr "Sââvéé"