Skip to content

Commit

Permalink
feat(application requests and connector management): update skipped s…
Browse files Browse the repository at this point in the history
…tatus (#1074)
  • Loading branch information
oyo authored Sep 5, 2024
1 parent 56740a3 commit 50f124a
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 40 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## unreleased (2.2.0-RC3)

### Change

- **Application Requests and Connector Management**
- update the status(skipped) in application requests and necessary changes with checkbox in connector management [#1019](https://github.com/eclipse-tractusx/portal-frontend/pull/1019)

## 2.2.0-RC2

### Feature
Expand Down
29 changes: 14 additions & 15 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ npm/npmjs/-/ci-info/3.9.0, MIT, approved, clearlydefined
npm/npmjs/-/cjs-module-lexer/1.2.3, MIT, approved, #9069
npm/npmjs/-/classnames/2.5.1, MIT, approved, clearlydefined
npm/npmjs/-/cliui/8.0.1, ISC AND Artistic-2.0, approved, #3753
npm/npmjs/-/clsx/2.1.1, MIT, approved, clearlydefined
npm/npmjs/-/clsx/2.1.0, MIT, approved, clearlydefined
npm/npmjs/-/co/4.6.0, MIT, approved, clearlydefined
npm/npmjs/-/collect-v8-coverage/1.0.2, MIT, approved, clearlydefined
npm/npmjs/-/color-convert/1.9.3, MIT, approved, clearlydefined
Expand All @@ -90,7 +90,7 @@ npm/npmjs/-/data-view-buffer/1.0.1, MIT, approved, clearlydefined
npm/npmjs/-/data-view-byte-length/1.0.1, MIT, approved, clearlydefined
npm/npmjs/-/data-view-byte-offset/1.0.0, MIT, approved, clearlydefined
npm/npmjs/-/date-fns/3.6.0, MIT, approved, #14000
npm/npmjs/-/dayjs/1.11.13, MIT, approved, #9149
npm/npmjs/-/dayjs/1.11.12, MIT, approved, #9149
npm/npmjs/-/debug/3.2.7, MIT, approved, clearlydefined
npm/npmjs/-/debug/4.3.4, MIT, approved, clearlydefined
npm/npmjs/-/decimal.js/10.4.3, MIT, approved, clearlydefined
Expand Down Expand Up @@ -389,7 +389,7 @@ npm/npmjs/-/path-is-absolute/1.0.1, MIT, approved, clearlydefined
npm/npmjs/-/path-key/3.1.1, MIT, approved, clearlydefined
npm/npmjs/-/path-parse/1.0.7, MIT, approved, clearlydefined
npm/npmjs/-/path-type/4.0.0, MIT, approved, clearlydefined
npm/npmjs/-/phone/3.1.50, MIT, approved, #10500
npm/npmjs/-/phone/3.1.49, MIT, approved, #10500
npm/npmjs/-/picocolors/1.0.0, ISC, approved, #14718
npm/npmjs/-/picomatch/2.3.1, MIT, approved, clearlydefined
npm/npmjs/-/pirates/4.0.6, MIT, approved, #680
Expand All @@ -416,7 +416,7 @@ npm/npmjs/-/react-hook-form/7.51.5, MIT, approved, #13909
npm/npmjs/-/react-i18next/14.1.3, MIT AND Apache-2.0, approved, #13870
npm/npmjs/-/react-is/16.13.1, MIT, approved, clearlydefined
npm/npmjs/-/react-is/17.0.2, MIT, approved, clearlydefined
npm/npmjs/-/react-is/18.3.1, MIT, approved, clearlydefined
npm/npmjs/-/react-is/18.2.0, MIT, approved, clearlydefined
npm/npmjs/-/react-player/2.15.1, MIT, approved, #13914
npm/npmjs/-/react-redux/9.1.2, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-3-Clause, approved, #13913
npm/npmjs/-/react-refresh/0.14.0, MIT, approved, clearlydefined
Expand Down Expand Up @@ -678,14 +678,14 @@ npm/npmjs/@jridgewell/sourcemap-codec/1.4.15, MIT, approved, clearlydefined
npm/npmjs/@jridgewell/trace-mapping/0.3.25, MIT, approved, #9904
npm/npmjs/@jridgewell/trace-mapping/0.3.9, MIT, approved, #9904
npm/npmjs/@mui/base/5.0.0-beta.40, MIT, approved, #2992
npm/npmjs/@mui/core-downloads-tracker/5.16.7, MIT, approved, clearlydefined
npm/npmjs/@mui/icons-material/5.15.21, MIT AND CC-BY-3.0, approved, #13171
npm/npmjs/@mui/material/5.15.21, MIT AND CC-BY-3.0, approved, #13175
npm/npmjs/@mui/private-theming/5.16.6, MIT, approved, #15717
npm/npmjs/@mui/styled-engine/5.16.6, MIT, approved, #15718
npm/npmjs/@mui/system/5.16.7, MIT, approved, #15715
npm/npmjs/@mui/types/7.2.15, MIT, approved, #16017
npm/npmjs/@mui/utils/5.16.6, MIT, approved, #15716
npm/npmjs/@mui/core-downloads-tracker/5.15.15, MIT, approved, clearlydefined
npm/npmjs/@mui/icons-material/5.15.15, MIT AND CC-BY-3.0, approved, #13171
npm/npmjs/@mui/material/5.15.15, MIT AND CC-BY-3.0, approved, #13175
npm/npmjs/@mui/private-theming/5.15.14, MIT AND CC-BY-3.0, approved, #13174
npm/npmjs/@mui/styled-engine/5.15.14, MIT AND CC-BY-3.0, approved, #13173
npm/npmjs/@mui/system/5.15.15, MIT, approved, #13170
npm/npmjs/@mui/types/7.2.14, MIT, approved, #16017
npm/npmjs/@mui/utils/5.15.14, MIT AND OFL-1.1 AND CC-BY-3.0, approved, #13927
npm/npmjs/@mui/x-data-grid/6.19.11, MIT, approved, #14027
npm/npmjs/@mui/x-date-pickers/6.19.9, MIT, approved, #14025
npm/npmjs/@nodelib/fs.scandir/2.1.5, MIT, approved, clearlydefined
Expand All @@ -694,7 +694,7 @@ npm/npmjs/@nodelib/fs.walk/1.2.8, MIT, approved, clearlydefined
npm/npmjs/@popperjs/core/2.11.8, MIT, approved, clearlydefined
npm/npmjs/@react-hook/cache/1.1.1, MIT, approved, clearlydefined
npm/npmjs/@react-hook/latest/1.0.3, MIT, approved, clearlydefined
npm/npmjs/@reduxjs/toolkit/2.2.7, MIT AND (BSD-2-Clause AND ISC AND MIT) AND Apache-2.0, approved, #14170
npm/npmjs/@reduxjs/toolkit/2.2.6, MIT AND (BSD-2-Clause AND ISC AND MIT) AND Apache-2.0, approved, #14170
npm/npmjs/@remix-run/router/1.15.3, MIT, approved, clearlydefined
npm/npmjs/@rollup/pluginutils/5.1.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-android-arm-eabi/4.17.2, MIT, approved, clearlydefined
Expand Down Expand Up @@ -729,7 +729,7 @@ npm/npmjs/@svgr/core/8.1.0, MIT, approved, clearlydefined
npm/npmjs/@svgr/hast-util-to-babel-ast/8.0.0, MIT, approved, clearlydefined
npm/npmjs/@svgr/plugin-jsx/8.1.0, MIT, approved, clearlydefined
npm/npmjs/@testing-library/dom/9.3.4, MIT AND (MIT AND WTFPL), approved, #9038
npm/npmjs/@testing-library/jest-dom/6.4.8, MIT, approved, clearlydefined
npm/npmjs/@testing-library/jest-dom/6.4.6, MIT, approved, clearlydefined
npm/npmjs/@testing-library/react/14.2.2, MIT, approved, #13316
npm/npmjs/@testing-library/user-event/14.5.2, MIT, approved, clearlydefined
npm/npmjs/@tootallnate/once/2.0.0, MIT, approved, clearlydefined
Expand Down Expand Up @@ -760,7 +760,6 @@ npm/npmjs/@types/node/20.11.30, MIT, approved, #13826
npm/npmjs/@types/papaparse/5.3.14, MIT, approved, #10964
npm/npmjs/@types/parse-json/4.0.2, MIT, approved, clearlydefined
npm/npmjs/@types/prop-types/15.7.11, MIT, approved, clearlydefined
npm/npmjs/@types/prop-types/15.7.12, MIT, approved, clearlydefined
npm/npmjs/@types/qs/6.9.15, MIT, approved, #14071
npm/npmjs/@types/react-dom/18.2.22, MIT, approved, #8256
npm/npmjs/@types/react-redux/7.1.33, MIT, approved, #10970
Expand Down
10 changes: 8 additions & 2 deletions src/assets/locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
"buttonprogress": "in progress",
"buttonrejected": "rejected",
"buttoncompleted": "completed",
"buttonPartiallyCompleted": "teilweise abgeschlossen",
"buttonerror": "error",
"cellconfirmed": "bestätigt",
"celldeclined": "abgelehnt",
Expand Down Expand Up @@ -569,7 +570,7 @@
"location": "Location",
"tooltipText": "Connector's status is pending",
"sdDescription": "SD Registration",
"sdRegistrationToolTip": "Die Selbstbeschreibung wurde ausgelöst. Der Vorgang kann bis zu ein paar Minuten dauern.",
"sdRegistrationToolTip": "Das SD-Dokument ist noch nicht geladen. Dies könnte auf die Deaktivierung der SD-Fabrik zurückzuführen sein. Dieser Prozess wird so bald wie möglich vom CX-Administrator neu ausgelöst.",
"hostCompanyName": "Host",
"providerCompanyName": "Customer",
"connectorUrl": "Connector-URL"
Expand Down Expand Up @@ -1616,7 +1617,8 @@
"DONE": "approved",
"IN_PROGRESS": "in progress",
"FAILED": "failed",
"TO_DO": "to do"
"TO_DO": "to do",
"SKIPPED": "skipped"
},
"buttonApprove": "Approve",
"buttonConfirm": "Confirm",
Expand Down Expand Up @@ -1774,6 +1776,10 @@
"FAILED": {
"title": "Ihre Aktion ist erforderlich, um fortzufahren.",
"description": "The self-description creation was unsuccessful. Details regarding the unsuccessful process can get found below. Additionally you can retrigger the endpoint (by resetting the status) or close/reject the company registration."
},
"SKIPPED": {
"title": "Von Ihrer Seite sind keine Maßnahmen erforderlich",
"description": "Die Erstellung der Selbstbeschreibung wurde absichtlich übersprungen. Dieser Prozess wird vom CX-Operator so bald wie möglich wieder ausgelöst."
}
}
},
Expand Down
10 changes: 8 additions & 2 deletions src/assets/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
"buttonprogress": "in progress",
"buttonrejected": "rejected",
"buttoncompleted": "completed",
"buttonPartiallyCompleted": "partially completed",
"buttonerror": "error",
"cellconfirmed": "confirmed",
"celldeclined": "declined",
Expand Down Expand Up @@ -568,7 +569,7 @@
"location": "Location",
"tooltipText": "Connector's status is pending",
"sdDescription": "SD Registration",
"sdRegistrationToolTip": "The Self-Description is triggered. Process might take up to a couple of minutes.",
"sdRegistrationToolTip": "The SD Document is not yet loaded. This could be due to the deactivation of the Sd Factory. This process will be retriggered as soon as possible by the CX Admin",
"hostCompanyName": "Host",
"providerCompanyName": "Customer",
"connectorUrl": "Connector URL"
Expand Down Expand Up @@ -1583,7 +1584,8 @@
"DONE": "approved",
"IN_PROGRESS": "in progress",
"FAILED": "failed",
"TO_DO": "to do"
"TO_DO": "to do",
"SKIPPED": "skipped"
},
"buttonApprove": "Approve",
"buttonConfirm": "Confirm",
Expand Down Expand Up @@ -1741,6 +1743,10 @@
"FAILED": {
"title": "Your action is needed.",
"description": "The self-description creation was unsuccessful. Details regarding the unsuccessful process can get found below. Additionally you can retrigger the endpoint (by resetting the status) or close/reject the company registration."
},
"SKIPPED": {
"title": "No action needed from your side",
"description": "The self-description creation was skipped on purpose. This process will be retriggered by the CX Operator as soon as possible."
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ export const getTitle = (
) => {
const getStatus = () => {
if (
selectedRequest?.applicationStatus ===
ApplicationRequestStatus.CONFIRMED &&
selectedRequest?.applicationChecklist?.filter(
(checklist) => checklist.statusId === ProgressStatus.SKIPPED
).length > 0
) {
return t('content.admin.registration-requests.buttonPartiallyCompleted')
} else if (
selectedRequest?.applicationStatus === ApplicationRequestStatus.SUBMITTED
) {
const failedItems = selectedRequest.applicationChecklist.filter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@
align-items: center;
border-radius: 30px;
padding: 5px;
width: 140px;

.statusText {
margin: 0 auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,19 @@ export default function CheckListFullButtons({
),
backgroundColor: '#FFF6FF',
}
case ProgressStatus.SKIPPED:
return {
icon: (
<PendingActionsIcon
style={{
color: '#0F71CB',
height: '30px',
width: '20px',
}}
/>
),
backgroundColor: '#ffffff',
}
}
}

Expand All @@ -111,6 +124,8 @@ export default function CheckListFullButtons({
return 'confirmed'
case ProgressStatus.FAILED:
return 'declined'
case ProgressStatus.SKIPPED:
return 'label'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ export const StatusProgress = ({
style={{
border: `2px solid ${style.border}`,
background: style.background,
width:
statusText ===
t('content.admin.registration-requests.buttonPartiallyCompleted')
? 'max-width'
: '140px',
}}
>
<Progress
Expand Down Expand Up @@ -133,6 +138,20 @@ export const StatusProgress = ({
application,
t('content.admin.registration-requests.buttonrejected')
)
} else if (
application.applicationStatus === ApplicationRequestStatus.CONFIRMED &&
items?.SKIPPED === 1
) {
const style = {
border: '#0f71cb',
color: '#0f71cb',
background: '#eaf1fe',
}
return getProgressStatus(
style,
application,
t('content.admin.registration-requests.buttonPartiallyCompleted')
)
} else if (
application.applicationStatus === ApplicationRequestStatus.CONFIRMED
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
} from '@catena-x/portal-shared-components'
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline'
import CheckBoxIcon from '@mui/icons-material/CheckBox'
import CheckBoxOutlineBlankIcon from '@mui/icons-material/CheckBoxOutlineBlank'
import Box from '@mui/material/Box'
import type { ConnectorContentAPIResponse } from 'features/connector/types'
import { useTranslation } from 'react-i18next'
Expand Down Expand Up @@ -92,7 +93,7 @@ export const ConnectorTableColumns = (
children={
<span>
<Box>
<CheckBoxIcon
<CheckBoxOutlineBlankIcon
sx={{
color: '#b6b6b6',
cursor: 'pointer',
Expand Down
44 changes: 25 additions & 19 deletions src/components/shared/basic/Progress/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,30 @@ export const Progress = ({
const red = (items.FAILED / totalItems) * 360 + yellow

const progressColor = () => {
switch (applicationStatus) {
case ApplicationRequestStatus.CONFIRMED:
return {
progressBg: '#e2f6c7',
progressColor: 'conic-gradient(#00aa55 360deg 360deg)',
}
case ApplicationRequestStatus.DECLINED:
case ApplicationRequestStatus.CANCELLED_BY_CUSTOMER:
return {
progressBg: '#fee7e2',
progressColor: 'conic-gradient(#d91e18 360deg 360deg)',
}
default:
return {
progressBg: '#ffffff',
progressColor: `conic-gradient(#00aa55 ${green}deg, #efb800 ${green}deg ${yellow}deg, #d91e18 ${yellow}deg ${red}deg, #ffffff ${red}deg 360deg)`,
}
}
if (ApplicationRequestStatus.CONFIRMED && items?.SKIPPED === 1) {
return {
progressBg: '#eaf1fe',
progressColor: '#0f71cb',
}
} else
switch (applicationStatus) {
case ApplicationRequestStatus.CONFIRMED:
return {
progressBg: '#e2f6c7',
progressColor: 'conic-gradient(#00aa55 360deg 360deg)',
}
case ApplicationRequestStatus.DECLINED:
case ApplicationRequestStatus.CANCELLED_BY_CUSTOMER:
return {
progressBg: '#fee7e2',
progressColor: 'conic-gradient(#d91e18 360deg 360deg)',
}
default:
return {
progressBg: '#ffffff',
progressColor: `conic-gradient(#00aa55 ${green}deg, #efb800 ${green}deg ${yellow}deg, #d91e18 ${yellow}deg ${red}deg, #ffffff ${red}deg 360deg)`,
}
}
}

return (
Expand Down Expand Up @@ -65,7 +71,7 @@ export const Progress = ({
}}
>
{applicationStatus !== ApplicationRequestStatus.DECLINED &&
`${items.DONE}/${totalItems}`}
`${items.DONE + items.SKIPPED}/${totalItems}`}
</div>
</div>
)
Expand Down
4 changes: 4 additions & 0 deletions src/features/admin/applicationRequestApiSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,23 @@ export enum ProgressStatus {
TO_DO = 'TO_DO',
DONE = 'DONE',
FAILED = 'FAILED',
SKIPPED = 'SKIPPED',
}

export type ProgressType = {
TO_DO: number
DONE: number
FAILED: number
IN_PROGRESS: number
SKIPPED: number
}

export const initialProgressValue: ProgressType = {
TO_DO: 0,
DONE: 0,
FAILED: 0,
IN_PROGRESS: 0,
SKIPPED: 0,
}

export enum StatusType {
Expand Down Expand Up @@ -128,6 +131,7 @@ export const progressMapper = {
IN_PROGRESS: 5,
TO_DO: 0,
FAILED: 0,
SKIPPED: 0,
}

export interface ApplicationRequest {
Expand Down

0 comments on commit 50f124a

Please sign in to comment.