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
  • Loading branch information
lavanya-bmw authored Aug 28, 2024
1 parent 59fa5aa commit 7fbb5f5
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 27 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

### 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)

### Bugfixes

- **IDP management**
Expand Down
2 changes: 1 addition & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ 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, clearlydefined
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
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 @@ -187,6 +187,7 @@
"buttonprogress": "in progress",
"buttonrejected": "rejected",
"buttoncompleted": "completed",
"buttonPartiallyCompleted": "teilweise abgeschlossen",
"buttonerror": "error",
"cellconfirmed": "bestätigt",
"celldeclined": "abgelehnt",
Expand Down Expand Up @@ -568,7 +569,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 @@ -1615,7 +1616,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 @@ -1773,6 +1775,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 @@ -186,6 +186,7 @@
"buttonprogress": "in progress",
"buttonrejected": "rejected",
"buttoncompleted": "completed",
"buttonPartiallyCompleted": "partially completed",
"buttonerror": "error",
"cellconfirmed": "confirmed",
"celldeclined": "declined",
Expand Down Expand Up @@ -567,7 +568,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 @@ -1582,7 +1583,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 @@ -1740,6 +1742,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 @@ -79,6 +79,13 @@ 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 @@ -145,6 +152,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 @@ -83,7 +84,6 @@ export const ConnectorTableColumns = (
<Tooltips
additionalStyles={{
cursor: 'pointer',
marginTop: '30px !important',
}}
tooltipPlacement="bottom"
tooltipText={t(
Expand All @@ -92,7 +92,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 @@ -56,20 +56,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 @@ -131,6 +134,7 @@ export const progressMapper = {
IN_PROGRESS: 5,
TO_DO: 0,
FAILED: 0,
SKIPPED: 0,
}

export interface ApplicationRequest {
Expand Down

0 comments on commit 7fbb5f5

Please sign in to comment.