From eaffffe0d0313eaadbf25980ea42afeb1e753ffd Mon Sep 17 00:00:00 2001 From: Artem Zaiko <102226752+azaiko-akveo@users.noreply.github.com> Date: Thu, 19 Oct 2023 19:13:57 +0300 Subject: [PATCH] feat: update change request layout (#2848) --- frontend/web/components/Tooltip.tsx | 17 +- .../web/components/pages/ChangeRequestPage.js | 357 +++++++++++------- frontend/web/styles/components/_panel.scss | 21 ++ 3 files changed, 252 insertions(+), 143 deletions(-) diff --git a/frontend/web/components/Tooltip.tsx b/frontend/web/components/Tooltip.tsx index f4a848cb5d0c..6897a600204c 100644 --- a/frontend/web/components/Tooltip.tsx +++ b/frontend/web/components/Tooltip.tsx @@ -15,6 +15,7 @@ type TooltipProps = { plainText: boolean place?: string | undefined title: JSX.Element // This is actually the Tooltip parent component + noIcon?: boolean } const StyledTooltip = ({ children }: StyledTooltipProps) => ( @@ -24,10 +25,17 @@ const StyledTooltip = ({ children }: StyledTooltipProps) => ( ) -const tooltipStyler = (plainText: boolean, children: string): string => { - const html = renderToStaticMarkup( - {plainText ? children : '{{html}}'}, +const tooltipStyler = ( + plainText: boolean, + children: string, + noIcon?: boolean, +): string => { + const tooltip = noIcon ? ( + {plainText ? children : '{{html}}'} + ) : ( + {plainText ? children : '{{html}}'} ) + const html = renderToStaticMarkup(tooltip) if (plainText) { return html } @@ -36,6 +44,7 @@ const tooltipStyler = (plainText: boolean, children: string): string => { const Tooltip = ({ children, + noIcon, place, plainText, title, @@ -58,7 +67,7 @@ const Tooltip = ({ type='dark' effect='solid' > - {tooltipStyler(plainText, children)} + {tooltipStyler(plainText, children, noIcon)} ) diff --git a/frontend/web/components/pages/ChangeRequestPage.js b/frontend/web/components/pages/ChangeRequestPage.js index 2b89a6d8107a..893a539ca2f6 100644 --- a/frontend/web/components/pages/ChangeRequestPage.js +++ b/frontend/web/components/pages/ChangeRequestPage.js @@ -18,8 +18,9 @@ import { getMyGroups } from 'common/services/useMyGroup' import { getStore } from 'common/store' import PageTitle from 'components/PageTitle' import Icon from 'components/Icon' +import classnames from 'classnames' -const labelWidth = 100 +const labelWidth = 120 const ChangeRequestsPage = class extends Component { static displayName = 'ChangeRequestsPage' @@ -513,159 +514,237 @@ const ChangeRequestsPage = class extends Component { } /> - -
- -
- Feature: -
- - {projectFlag && projectFlag.name} - -
- -
- Enabled: -
- {!changeRequest.committed_at && ( - - -
Live Version
-
- )} - - -
- {isScheduled - ? 'Scheduled Change' - : 'Change Request'} -
-
-
- -
- Value: -
- {!changeRequest.committed_at && ( - - - - - )} - - - - -
- {isMv && ( - +
+ +
+
- Variations: + Feature:
- - {mvData.map((v, i) => ( + + {projectFlag && projectFlag.name} + +
+
+
+ + + + +
+ + Live Version + + +
+ Enabled: +
+ +
+
+ Value: +
+ - - + + + +
+ + {isMv && + mvData.map((v, i) => ( + +
+
+ + Variation {i + 1} + + } + className='ml-1' + noIcon + > + {Utils.getTypedValue(v.value)} + +
+
+ + + + +
+ ))} +
+
+
+ + {!changeRequest.committed_at && ( + + +
+ + {isScheduled + ? 'Scheduled Change' + : 'Change Request'} + + +
+ Enabled: +
+ +
+ +
+ Value: +
+ + - - - - Environment weight: {v.oldValue}% - - + - - - Environment weight: {v.newValue}% - - -
-
- ))} -
- + {isMv && + mvData.map((v, i) => ( + +
+
+ + Variation {i + 1} + + + } + className='ml-1' + noIcon + > + {Utils.getTypedValue(v.value)} + +
+
+ + + + +
+ ))} +
+ + )} -
-
+ + +
Committed at{' '} {moment(changeRequest.committed_at).format( 'Do MMM YYYY HH:mma', diff --git a/frontend/web/styles/components/_panel.scss b/frontend/web/styles/components/_panel.scss index b1631dddb51a..2f069e9d7b69 100644 --- a/frontend/web/styles/components/_panel.scss +++ b/frontend/web/styles/components/_panel.scss @@ -197,6 +197,27 @@ a.text-white { } } } + &.panel-change-request { + .search-list { + border-color: rgba(149, 108, 255, 0.48); + + .table-header { + color: #6837fc; + background-color: rgba(102, 51, 255, 0.08); + } + + .change-request-item { + border-color: rgba(149, 108, 255, 0.48); + } + } + + .change-request-updated-value { + input, + code.txt { + color: #6837fc; + } + } + } } @include media-breakpoint-down(xxl) {