From ae51e021440e8f47e952edce56cf4bace3ba1302 Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Mon, 11 Dec 2023 11:41:13 +0200 Subject: [PATCH 1/7] feat: more info on staleness in health report Signed-off-by: andreas-unleash --- .../ReportTable/ReportCard/ReportCard.tsx | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx index 671851fe01bc..990b83f9d8cd 100644 --- a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx +++ b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx @@ -1,9 +1,12 @@ -import { Box, Paper, styled } from '@mui/material'; +import { Box, Link, Paper, styled } from "@mui/material"; import CheckIcon from '@mui/icons-material/Check'; +import { Link as RouterLink } from 'react-router-dom'; import ReportProblemOutlinedIcon from '@mui/icons-material/ReportProblemOutlined'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import ReactTimeAgo from 'react-timeago'; import { IProjectHealthReport } from 'interfaces/project'; +import { HtmlTooltip } from "../../../../../common/HtmlTooltip/HtmlTooltip"; +import { Info, InfoOutlined } from "@mui/icons-material"; const StyledBoxActive = styled(Box)(({ theme }) => ({ display: 'flex', @@ -39,6 +42,8 @@ const StyledPaper = styled(Paper)(({ theme }) => ({ const StyledHeader = styled('h2')(({ theme }) => ({ fontSize: theme.fontSizes.mainHeader, marginBottom: theme.spacing(1), + justifyItems: 'center', + display: 'flex' })); const StyledHealthRating = styled('p')(({ theme }) => ({ @@ -95,9 +100,29 @@ export const ReportCard = ({ healthReport }: IReportCardProps) => { {healthReport.potentiallyStaleCount} potentially stale toggles + ); + const renderStalenessInfoIcon = () => ( + + If your toggle exceeds the expected lifetime of it's toggle type it will be marked as potentially stale. +
+
+ + Read more in the documentation + + + }> + theme.palette.text.secondary, ml: 1}}/> +
+ ) + return ( @@ -149,7 +174,9 @@ export const ReportCard = ({ healthReport }: IReportCardProps) => { - Potential actions + + Potential actions {renderStalenessInfoIcon()} +
  • { Review your feature toggles and delete unused toggles. +
    +
    + + Configure feature types lifetime +
    } elseShow={No action is required} From 6594b83785600293a51668ae089ccf3d28609cb2 Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Mon, 11 Dec 2023 11:43:00 +0200 Subject: [PATCH 2/7] feat: more info on staleness in health report Signed-off-by: andreas-unleash --- .../ReportTable/ReportCard/ReportCard.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx index 990b83f9d8cd..f3c3cbb9c4f9 100644 --- a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx +++ b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx @@ -190,15 +190,16 @@ export const ReportCard = ({ healthReport }: IReportCardProps) => { Review your feature toggles and delete unused toggles. -
    -
    - - Configure feature types lifetime -
    +
    + + Configure feature types lifetime + + } elseShow={No action is required} /> From 14942e6027cee85e8be4afcf63aa7de019fba5fe Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Mon, 11 Dec 2023 12:21:59 +0200 Subject: [PATCH 3/7] fix: PR comments Signed-off-by: andreas-unleash --- .../ReportTable/ReportCard/ReportCard.tsx | 136 +++++++++--------- 1 file changed, 69 insertions(+), 67 deletions(-) diff --git a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx index f3c3cbb9c4f9..c9ace57e97b0 100644 --- a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx +++ b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx @@ -1,71 +1,71 @@ import { Box, Link, Paper, styled } from "@mui/material"; -import CheckIcon from '@mui/icons-material/Check'; -import { Link as RouterLink } from 'react-router-dom'; -import ReportProblemOutlinedIcon from '@mui/icons-material/ReportProblemOutlined'; -import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import ReactTimeAgo from 'react-timeago'; -import { IProjectHealthReport } from 'interfaces/project'; +import CheckIcon from "@mui/icons-material/Check"; +import { Link as RouterLink } from "react-router-dom"; +import ReportProblemOutlinedIcon from "@mui/icons-material/ReportProblemOutlined"; +import { ConditionallyRender } from "component/common/ConditionallyRender/ConditionallyRender"; +import ReactTimeAgo from "react-timeago"; +import { IProjectHealthReport } from "interfaces/project"; import { HtmlTooltip } from "../../../../../common/HtmlTooltip/HtmlTooltip"; import { Info, InfoOutlined } from "@mui/icons-material"; const StyledBoxActive = styled(Box)(({ theme }) => ({ - display: 'flex', - alignItems: 'center', + display: "flex", + alignItems: "center", color: theme.palette.success.dark, - '& svg': { - color: theme.palette.success.main, - }, + "& svg": { + color: theme.palette.success.main + } })); const StyledBoxStale = styled(Box)(({ theme }) => ({ - display: 'flex', - alignItems: 'center', + display: "flex", + alignItems: "center", color: theme.palette.warning.dark, - '& svg': { - color: theme.palette.warning.main, - }, + "& svg": { + color: theme.palette.warning.main + } })); const StyledPaper = styled(Paper)(({ theme }) => ({ padding: theme.spacing(4), marginBottom: theme.spacing(2), borderRadius: theme.shape.borderRadiusLarge, - boxShadow: 'none', - display: 'flex', - justifyContent: 'space-between', - [theme.breakpoints.down('md')]: { - flexDirection: 'column', - gap: theme.spacing(2), - }, + boxShadow: "none", + display: "flex", + justifyContent: "space-between", + [theme.breakpoints.down("md")]: { + flexDirection: "column", + gap: theme.spacing(2) + } })); -const StyledHeader = styled('h2')(({ theme }) => ({ +const StyledHeader = styled("h2")(({ theme }) => ({ fontSize: theme.fontSizes.mainHeader, marginBottom: theme.spacing(1), - justifyItems: 'center', - display: 'flex' + justifyItems: "center", + display: "flex" })); -const StyledHealthRating = styled('p')(({ theme }) => ({ - fontSize: '2rem', - fontWeight: theme.fontWeight.bold, +const StyledHealthRating = styled("p")(({ theme }) => ({ + fontSize: "2rem", + fontWeight: theme.fontWeight.bold })); -const StyledLastUpdated = styled('p')(({ theme }) => ({ - color: theme.palette.text.secondary, +const StyledLastUpdated = styled("p")(({ theme }) => ({ + color: theme.palette.text.secondary })); -const StyledList = styled('ul')(({ theme }) => ({ - listStyleType: 'none', +const StyledList = styled("ul")(({ theme }) => ({ + listStyleType: "none", margin: 0, padding: 0, - '& svg': { - marginRight: theme.spacing(1), - }, + "& svg": { + marginRight: theme.spacing(1) + } })); -const StyledAlignedItem = styled('p')(({ theme }) => ({ - marginLeft: theme.spacing(4), +const StyledAlignedItem = styled("p")(({ theme }) => ({ + marginLeft: theme.spacing(4) })); interface IReportCardProps { @@ -75,10 +75,10 @@ interface IReportCardProps { export const ReportCard = ({ healthReport }: IReportCardProps) => { const healthRatingColor = healthReport.health < 50 - ? 'error.main' + ? "error.main" : healthReport.health < 75 - ? 'warning.main' - : 'success.main'; + ? "warning.main" + : "success.main"; const renderActiveToggles = () => ( @@ -104,24 +104,25 @@ export const ReportCard = ({ healthReport }: IReportCardProps) => { ); - const renderStalenessInfoIcon = () => ( + const StalenessInfoIcon = () => ( If your toggle exceeds the expected lifetime of it's toggle type it will be marked as potentially stale. -
    -
    - - Read more in the documentation - +
    + + + Read more in the documentation + + }> - theme.palette.text.secondary, ml: 1}}/> + theme.palette.text.secondary, ml: 1 }} />
    - ) + ); return ( @@ -137,7 +138,7 @@ export const ReportCard = ({ healthReport }: IReportCardProps) => { {healthReport.health}% - Last updated:{' '} + Last updated:{" "} {
  • - + - Potential actions {renderStalenessInfoIcon()} + Potential actions
  • @@ -190,16 +191,17 @@ export const ReportCard = ({ healthReport }: IReportCardProps) => { - - Review your feature toggles and delete unused - toggles. - -
    - - Configure feature types lifetime - - + <> + + Review your feature toggles and delete unused + toggles. + + + + Configure feature types lifetime + + + } elseShow={No action is required} /> From 884a7276d971a3dbddf42cb89463a6466cfb6a5d Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Mon, 11 Dec 2023 12:22:46 +0200 Subject: [PATCH 4/7] fix: PR comments Signed-off-by: andreas-unleash --- .../ReportTable/ReportCard/ReportCard.tsx | 2 +- .../scheduled-change-conflict.html | 527 ++++++++++++++++++ .../scheduled-execution-failed.html | 522 +++++++++++++++++ 3 files changed, 1050 insertions(+), 1 deletion(-) create mode 100644 src/mailtemplates/schedule-change-conflict/scheduled-change-conflict.html create mode 100644 src/mailtemplates/scheduled-execution-failed/scheduled-execution-failed.html diff --git a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx index c9ace57e97b0..417b1dd58502 100644 --- a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx +++ b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx @@ -5,7 +5,7 @@ import ReportProblemOutlinedIcon from "@mui/icons-material/ReportProblemOutlined import { ConditionallyRender } from "component/common/ConditionallyRender/ConditionallyRender"; import ReactTimeAgo from "react-timeago"; import { IProjectHealthReport } from "interfaces/project"; -import { HtmlTooltip } from "../../../../../common/HtmlTooltip/HtmlTooltip"; +import { HtmlTooltip } from "component/common/HtmlTooltip/HtmlTooltip"; import { Info, InfoOutlined } from "@mui/icons-material"; const StyledBoxActive = styled(Box)(({ theme }) => ({ diff --git a/src/mailtemplates/schedule-change-conflict/scheduled-change-conflict.html b/src/mailtemplates/schedule-change-conflict/scheduled-change-conflict.html new file mode 100644 index 000000000000..dbc58b2807c2 --- /dev/null +++ b/src/mailtemplates/schedule-change-conflict/scheduled-change-conflict.html @@ -0,0 +1,527 @@ + + + + + *|MC:SUBJECT|* + + + +
    + + + + +
    + + + + + + + + + + + + + + +
    + + + + + + + + +
    + Scheduled changes can no longer be applied + + Email not displaying correctly?
    View it in your browser. +
    + +
    + + + + + +
    + +
    + +
    + + + + + +
    +

    Conflict detected in a scheduled change

    + +
    + {{ conflict }}. Scheduled change requests that use this {{ conflictScope }} can no longer be applied and their scheduled applications will fail{{#conflictResolution}}{{.}}{{/conflictResolution}}{{^conflictResolution}}.{{/conflictResolution}} +
    + For you, this concerns change requests: +
    + {{#changeRequests}} + + {{/changeRequests}} +
    + +
    + + + + + + + + + +
    + Follow us on Github +
    + Copyright © {{ year }} | Bricks Software | All rights reserved. +
    + +
    + Our mailing address is: team@getunleash.io +
    + +
    + +
    + +
    +
    + + diff --git a/src/mailtemplates/scheduled-execution-failed/scheduled-execution-failed.html b/src/mailtemplates/scheduled-execution-failed/scheduled-execution-failed.html new file mode 100644 index 000000000000..acab22bd2223 --- /dev/null +++ b/src/mailtemplates/scheduled-execution-failed/scheduled-execution-failed.html @@ -0,0 +1,522 @@ + + + + + *|MC:SUBJECT|* + + + +
    + + + + +
    + + + + + + + + + + + + + + +
    + + + + + + + + +
    + Scheduled change request failed to apply + + Email not displaying correctly?
    View it in your browser. +
    + +
    + + + + + +
    + +
    + +
    + + + + + +
    +

    Scheduled change request failed to apply

    + +
    + Scheduled change request {{{ changeRequestTitle }}} failed to apply at {{{ scheduledAt }}} due to {{{ errorMessage }}}. +
    + You can reschedule the change request to try again later or reject the changes to close it. +
    +
    + +
    + + + + + + + + + +
    + Follow us on Github +
    + Copyright © {{ year }} | Bricks Software | All rights reserved. +
    + +
    + Our mailing address is: team@getunleash.io +
    + +
    + +
    + +
    +
    + + From cb627f37133752c9daa32ecd23728bc35d45ebd8 Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Mon, 11 Dec 2023 12:23:08 +0200 Subject: [PATCH 5/7] fix: PR comments Signed-off-by: andreas-unleash --- .../Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx index 417b1dd58502..67aa6b57c064 100644 --- a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx +++ b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx @@ -6,7 +6,7 @@ import { ConditionallyRender } from "component/common/ConditionallyRender/Condit import ReactTimeAgo from "react-timeago"; import { IProjectHealthReport } from "interfaces/project"; import { HtmlTooltip } from "component/common/HtmlTooltip/HtmlTooltip"; -import { Info, InfoOutlined } from "@mui/icons-material"; +import { InfoOutlined } from "@mui/icons-material"; const StyledBoxActive = styled(Box)(({ theme }) => ({ display: "flex", From cad22895188e38bfb859cd61384705acf71cf6e8 Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Mon, 11 Dec 2023 12:24:23 +0200 Subject: [PATCH 6/7] fix: fmt Signed-off-by: andreas-unleash --- .../ReportTable/ReportCard/ReportCard.tsx | 142 ++++++++++-------- 1 file changed, 76 insertions(+), 66 deletions(-) diff --git a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx index 67aa6b57c064..d0190b20130d 100644 --- a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx +++ b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx @@ -1,71 +1,71 @@ -import { Box, Link, Paper, styled } from "@mui/material"; -import CheckIcon from "@mui/icons-material/Check"; -import { Link as RouterLink } from "react-router-dom"; -import ReportProblemOutlinedIcon from "@mui/icons-material/ReportProblemOutlined"; -import { ConditionallyRender } from "component/common/ConditionallyRender/ConditionallyRender"; -import ReactTimeAgo from "react-timeago"; -import { IProjectHealthReport } from "interfaces/project"; -import { HtmlTooltip } from "component/common/HtmlTooltip/HtmlTooltip"; -import { InfoOutlined } from "@mui/icons-material"; +import { Box, Link, Paper, styled } from '@mui/material'; +import CheckIcon from '@mui/icons-material/Check'; +import { Link as RouterLink } from 'react-router-dom'; +import ReportProblemOutlinedIcon from '@mui/icons-material/ReportProblemOutlined'; +import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; +import ReactTimeAgo from 'react-timeago'; +import { IProjectHealthReport } from 'interfaces/project'; +import { HtmlTooltip } from 'component/common/HtmlTooltip/HtmlTooltip'; +import { InfoOutlined } from '@mui/icons-material'; const StyledBoxActive = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", + display: 'flex', + alignItems: 'center', color: theme.palette.success.dark, - "& svg": { - color: theme.palette.success.main - } + '& svg': { + color: theme.palette.success.main, + }, })); const StyledBoxStale = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", + display: 'flex', + alignItems: 'center', color: theme.palette.warning.dark, - "& svg": { - color: theme.palette.warning.main - } + '& svg': { + color: theme.palette.warning.main, + }, })); const StyledPaper = styled(Paper)(({ theme }) => ({ padding: theme.spacing(4), marginBottom: theme.spacing(2), borderRadius: theme.shape.borderRadiusLarge, - boxShadow: "none", - display: "flex", - justifyContent: "space-between", - [theme.breakpoints.down("md")]: { - flexDirection: "column", - gap: theme.spacing(2) - } + boxShadow: 'none', + display: 'flex', + justifyContent: 'space-between', + [theme.breakpoints.down('md')]: { + flexDirection: 'column', + gap: theme.spacing(2), + }, })); -const StyledHeader = styled("h2")(({ theme }) => ({ +const StyledHeader = styled('h2')(({ theme }) => ({ fontSize: theme.fontSizes.mainHeader, marginBottom: theme.spacing(1), - justifyItems: "center", - display: "flex" + justifyItems: 'center', + display: 'flex', })); -const StyledHealthRating = styled("p")(({ theme }) => ({ - fontSize: "2rem", - fontWeight: theme.fontWeight.bold +const StyledHealthRating = styled('p')(({ theme }) => ({ + fontSize: '2rem', + fontWeight: theme.fontWeight.bold, })); -const StyledLastUpdated = styled("p")(({ theme }) => ({ - color: theme.palette.text.secondary +const StyledLastUpdated = styled('p')(({ theme }) => ({ + color: theme.palette.text.secondary, })); -const StyledList = styled("ul")(({ theme }) => ({ - listStyleType: "none", +const StyledList = styled('ul')(({ theme }) => ({ + listStyleType: 'none', margin: 0, padding: 0, - "& svg": { - marginRight: theme.spacing(1) - } + '& svg': { + marginRight: theme.spacing(1), + }, })); -const StyledAlignedItem = styled("p")(({ theme }) => ({ - marginLeft: theme.spacing(4) +const StyledAlignedItem = styled('p')(({ theme }) => ({ + marginLeft: theme.spacing(4), })); interface IReportCardProps { @@ -75,10 +75,10 @@ interface IReportCardProps { export const ReportCard = ({ healthReport }: IReportCardProps) => { const healthRatingColor = healthReport.health < 50 - ? "error.main" + ? 'error.main' : healthReport.health < 75 - ? "warning.main" - : "success.main"; + ? 'warning.main' + : 'success.main'; const renderActiveToggles = () => ( @@ -100,27 +100,31 @@ export const ReportCard = ({ healthReport }: IReportCardProps) => { {healthReport.potentiallyStaleCount} potentially stale toggles - ); const StalenessInfoIcon = () => ( - - If your toggle exceeds the expected lifetime of it's toggle type it will be marked as potentially stale. -
    - - - Read more in the documentation - - - - }> - theme.palette.text.secondary, ml: 1 }} /> + + If your toggle exceeds the expected lifetime of it's toggle + type it will be marked as potentially stale. +
    + + + Read more in the documentation + + + + } + > + theme.palette.text.secondary, ml: 1 }} + />
    ); @@ -138,7 +142,7 @@ export const ReportCard = ({ healthReport }: IReportCardProps) => { {healthReport.health}% - Last updated:{" "} + Last updated:{' '} {
  • - + - Potential actions + Potential actions{' '} + + +
  • @@ -197,7 +204,10 @@ export const ReportCard = ({ healthReport }: IReportCardProps) => { toggles. - + Configure feature types lifetime From e4f800846ca5babc0d701c5219373642e643ef5b Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Mon, 11 Dec 2023 12:33:21 +0200 Subject: [PATCH 7/7] fix: fmt Signed-off-by: andreas-unleash --- .../Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx index d0190b20130d..b51e0cb10c72 100644 --- a/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx +++ b/frontend/src/component/project/Project/ProjectHealth/ReportTable/ReportCard/ReportCard.tsx @@ -109,7 +109,6 @@ export const ReportCard = ({ healthReport }: IReportCardProps) => { <> If your toggle exceeds the expected lifetime of it's toggle type it will be marked as potentially stale. -