From 52975b97411455b3cc464fd40b4746418dcedc75 Mon Sep 17 00:00:00 2001 From: Mansoor Sajjad Date: Fri, 13 Dec 2024 11:21:10 +0100 Subject: [PATCH] Remove OTP1 graph status. --- src/actions/SuppliersActions.js | 12 +- src/sass/main.scss | 4 +- .../providers/components/GraphStatus.js | 66 ++++----- .../components/ShowOTPGraphStatus.js | 8 +- .../components/SupplierTabWrapper.js | 6 +- .../components/SuppliersContainer.js | 125 ++++++++---------- src/screens/providers/providers.js | 9 +- 7 files changed, 96 insertions(+), 134 deletions(-) diff --git a/src/actions/SuppliersActions.js b/src/actions/SuppliersActions.js index 8b83e7af..4170e411 100644 --- a/src/actions/SuppliersActions.js +++ b/src/actions/SuppliersActions.js @@ -764,21 +764,11 @@ SuppliersActions.getGraphStatus = () => async (dispatch, getState) => { otherStatus: [] }; response.data.forEach(type => { - if (type.jobType === 'BUILD_GRAPH') { - status.graphStatus.otp1 = { - status: type.currentState, - started: type.currentStateDate - }; - } else if (type.jobType === 'OTP2_BUILD_GRAPH') { + if (type.jobType === 'OTP2_BUILD_GRAPH') { status.graphStatus.otp2 = { status: type.currentState, started: type.currentStateDate }; - } else if (type.jobType === 'BUILD_BASE') { - status.baseGraphStatus.otp1 = { - status: type.currentState, - started: type.currentStateDate - }; } else if (type.jobType === 'OTP2_BUILD_BASE') { status.baseGraphStatus.otp2 = { status: type.currentState, diff --git a/src/sass/main.scss b/src/sass/main.scss index cbabf8ea..2443f794 100644 --- a/src/sass/main.scss +++ b/src/sass/main.scss @@ -40,7 +40,8 @@ body { .supplier-info { background: #fff; - margin: 10px 20px 20px; + margin: 0 20px 20px; + padding: 0 10px 10px; border: 1px solid #ccc; flex-grow: 1; @@ -61,7 +62,6 @@ body { } .suppliers-container { - flex-grow: 1; > h1 { margin-bottom: 40px; font-weight: 500; diff --git a/src/screens/providers/components/GraphStatus.js b/src/screens/providers/components/GraphStatus.js index 447810c2..8d65e4f6 100644 --- a/src/screens/providers/components/GraphStatus.js +++ b/src/screens/providers/components/GraphStatus.js @@ -36,12 +36,15 @@ const getColorByStatus = status => { const containerStyle = { display: 'flex', flexDirection: 'row', - justifyContent: 'space-between', - width: '360px', - margin: '0 30px' + margin: '0 20px', + lineHeight: '24px' }; -const wrapperStyle = {}; +const wrapperStyle = { + display: 'flex', + flexDirection: 'column', + margin: '0 10px' +}; const statusStyle = { display: 'flex', @@ -49,21 +52,18 @@ const statusStyle = { flexDirection: 'row' }; -const GraphStatusDetails = ({ title, status, started }) => ( +const GraphStatusDetails = ({ status, started }) => (
{status && started && ( <> - - {title} - - {status} - + + {status}
- <> -

Graph status

- {graphStatus.otp1 && ( - - )} - {graphStatus.otp2 && ( - - )} - +

Graph status

+

Base graph status

-

Base graph status

- {baseGraphStatus.otp1 && ( - - )} {baseGraphStatus.otp2 && ( )} + {graphStatus.otp2 && ( + + )}
); diff --git a/src/screens/providers/components/ShowOTPGraphStatus.js b/src/screens/providers/components/ShowOTPGraphStatus.js index 51cb9251..c9d0388d 100644 --- a/src/screens/providers/components/ShowOTPGraphStatus.js +++ b/src/screens/providers/components/ShowOTPGraphStatus.js @@ -4,15 +4,11 @@ import LatestOTPGraphVersions from './LatestOTPGraphVersions'; export const ShowOTPGraphStatus = () => { return ( -
+
diff --git a/src/screens/providers/components/SupplierTabWrapper.js b/src/screens/providers/components/SupplierTabWrapper.js index 20398ede..be72db87 100644 --- a/src/screens/providers/components/SupplierTabWrapper.js +++ b/src/screens/providers/components/SupplierTabWrapper.js @@ -378,11 +378,7 @@ class SupplierTabWrapper extends React.Component { ); } - return ( -
-
{tabsToRender}
-
- ); + return
{tabsToRender}
; } else { return null; } diff --git a/src/screens/providers/components/SuppliersContainer.js b/src/screens/providers/components/SuppliersContainer.js index b00ee90c..2586a017 100644 --- a/src/screens/providers/components/SuppliersContainer.js +++ b/src/screens/providers/components/SuppliersContainer.js @@ -107,85 +107,76 @@ class SuppliersContainer extends React.Component { return (
-
-
- this.selectSupplier(v)} - selectedSupplierId={activeProviderId} - /> - {canEditOrganisation && ( +
+ this.selectSupplier(v)} + selectedSupplierId={activeProviderId} + /> + {canEditOrganisation && ( +
this.handleEditProvider()} > -
this.handleEditProvider()} - > - {!this.props.displayAllSuppliers && ( -
- - Edit -
- )} -
-
this.handleNewProvider()} - > + {!this.props.displayAllSuppliers && (
- - New + + Edit
+ )} +
+
this.handleNewProvider()} + > +
+ + New
+
-
this.handleOpenConfirmDeleteProviderDialog()} - > -
- - Delete -
+
this.handleOpenConfirmDeleteProviderDialog()} + > +
+ + Delete
- )} -
- { - this.setState({ - confirmDialogOpen: false, - confirmAction: null - }); - }} - /> +
+ )}
+ { + this.setState({ + confirmDialogOpen: false, + confirmAction: null + }); + }} + />
); } diff --git a/src/screens/providers/providers.js b/src/screens/providers/providers.js index f1411585..66322690 100644 --- a/src/screens/providers/providers.js +++ b/src/screens/providers/providers.js @@ -16,7 +16,14 @@ const Providers = ({ auth, isAdmin }) => {
-
+