From e9fc442eb850385be0ff0695d3419ca858f12b0d Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Wed, 22 Nov 2023 12:58:38 +0000 Subject: [PATCH] Swap alert + error colours for v5 ECL Watch Update warning messages Switch to Alert from Critical in v9 ECL Watch --- esp/src/eclwatch/HPCCPlatformWidget.js | 5 ++++- esp/src/eclwatch/InfoGridWidget.js | 6 +++--- esp/src/eclwatch/css/hpcc.css | 6 +++--- esp/src/src-react/components/Title.tsx | 8 ++++---- esp/src/src/nls/hpcc.ts | 3 ++- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/esp/src/eclwatch/HPCCPlatformWidget.js b/esp/src/eclwatch/HPCCPlatformWidget.js index 407927ed60b..635c25542cb 100644 --- a/esp/src/eclwatch/HPCCPlatformWidget.js +++ b/esp/src/eclwatch/HPCCPlatformWidget.js @@ -168,14 +168,17 @@ define([ platformModule.fetchCheckFeatures().then(function (features) { if (!features || !features.BuildTagTimestamp) return; const age = features.BuildTagTimestamp ? Math.floor((Date.now() - new Date(features.BuildTagTimestamp).getTime()) / DAY) : 0; - const message = nlsHPCC.PlatformIsNNNDaysOld.replace("NNN", `${age}`); + let message = nlsHPCC.PlatformBuildIsNNNDaysOld.replace("NNN", `${age}`); let severity = "Info"; if (age > 90) { severity = "Alert"; + message += ` ${nlsHPCC.PleaseUpgradeToLaterPointRelease}`; } else if (age > 60) { severity = "Error"; + message += ` ${nlsHPCC.PleaseUpgradeToLaterPointRelease}`; } else if (age > 30) { severity = "Warning"; + message += ` ${nlsHPCC.PleaseUpgradeToLaterPointRelease}`; } else { severity = "Info"; } diff --git a/esp/src/eclwatch/InfoGridWidget.js b/esp/src/eclwatch/InfoGridWidget.js index 8a525a4f6c5..3effa1b5c72 100755 --- a/esp/src/eclwatch/InfoGridWidget.js +++ b/esp/src/eclwatch/InfoGridWidget.js @@ -247,11 +247,11 @@ define([ if (item) { var severity = this.store.getValue(item, "Severity", null); if (severity === "Error") { - row.customStyles += "background-color: red;"; - } else if (severity === "Alert") { row.customStyles += "background-color: #fe8147;"; + } else if (severity === "Alert") { + row.customStyles += "background-color: #ff1e00;"; } else if (severity === "Warning") { - row.customStyles += "background-color: yellow;"; + row.customStyles += "background-color: #ffee00;"; } } this.infoGrid.focus.styleRow(row); diff --git a/esp/src/eclwatch/css/hpcc.css b/esp/src/eclwatch/css/hpcc.css index be5e6acf63b..27edac50158 100644 --- a/esp/src/eclwatch/css/hpcc.css +++ b/esp/src/eclwatch/css/hpcc.css @@ -1658,15 +1658,15 @@ margin-left:-20px; } .dijitToasterWarning .dijitToasterContent { - background: rgb(255, 238, 0); + background: #ffee00; } .dijitToasterError .dijitToasterContent { - background: rgb(255, 30, 0); + background: #fe8147; } .dijitToasterAlert .dijitToasterContent { - background: #fe8147; + background: #ff1e00; } /* imported from dijit.css */ diff --git a/esp/src/src-react/components/Title.tsx b/esp/src/src-react/components/Title.tsx index 7f2a57927b7..b04c940b178 100644 --- a/esp/src/src-react/components/Title.tsx +++ b/esp/src/src-react/components/Title.tsx @@ -193,13 +193,13 @@ export const DevTitle: React.FunctionComponent = ({ React.useEffect(() => { if (!features.timestamp) return; const age = Math.floor((Date.now() - features.timestamp.getTime()) / DAY); - const message = nlsHPCC.PlatformIsNNNDaysOld.replace("NNN", `${age}`); + const message = nlsHPCC.PlatformBuildIsNNNDaysOld.replace("NNN", `${age}`); if (age > 90) { - logger.critical(message); + logger.alert(message + ` ${nlsHPCC.PleaseUpgradeToLaterPointRelease}`); } else if (age > 60) { - logger.error(message); + logger.error(message + ` ${nlsHPCC.PleaseUpgradeToLaterPointRelease}`); } else if (age > 30) { - logger.warning(message); + logger.warning(message + ` ${nlsHPCC.PleaseUpgradeToLaterPointRelease}`); } else { logger.info(message); } diff --git a/esp/src/src/nls/hpcc.ts b/esp/src/src/nls/hpcc.ts index 2f55c6bc7d7..c8a567ce689 100644 --- a/esp/src/src/nls/hpcc.ts +++ b/esp/src/src/nls/hpcc.ts @@ -641,11 +641,12 @@ export = { PlaceholderFirstName: "John", PlaceholderLastName: "Smith", Platform: "Platform", - PlatformIsNNNDaysOld: "Platform is NNN days old", + PlatformBuildIsNNNDaysOld: "Platform build is NNN days old.", Playground: "Playground", PleaseEnableCookies: "This site uses cookies. To see how cookies are used, please review our cookie notice. If you agree to our use of cookies, please continue to use our site.", PleaseLogIntoECLWatch: "Please log into ECL Watch", PleasePickADefinition: "Please pick a definition", + PleaseUpgradeToLaterPointRelease: "Please upgrade to a later point release.", PleaseSelectAGroupToAddUser: "Please select a group to add the user to", PleaseSelectAUserOrGroup: "Please select a user or a group along with a file name", PleaseSelectAUserToAdd: "Please select a user to add",