Skip to content

Commit

Permalink
fix(registration detail): add data and ui changes (#862)
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhigarg-bmw authored Jun 3, 2024
1 parent 992dd2e commit 2f4c2a8
Show file tree
Hide file tree
Showing 9 changed files with 311 additions and 139 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
- fetch details using api, added permissions and fixed error messages
- App Release Process
- Integrated role deletion with BE api reponse
- Company Application Registraion Detail Overlay
- UI improvements
- Add correct registration application checklist items

### Feature

Expand Down
48 changes: 46 additions & 2 deletions src/assets/locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@
"tab1": "Company Data",
"tab2": "Registration Process",
"tab1Title": "Company Data",
"tab1SubTitle": "Registration Status: {{status}}",
"tab2Title": "Confirmation {{status}}",
"statusComplete": "[complete]",
"tab2SubTitle": "Registration Status: {{status}}",
"lastDate": "Last process update: {{date}}",
"statusIncomplete": "[incomplete]",
"approvedButton": "approved",
"failedButton": "falied"
Expand Down Expand Up @@ -1596,6 +1596,8 @@
"REGISTRATION_VERIFICATION": "Data Validation",
"BUSINESS_PARTNER_NUMBER": "BPN Creation",
"IDENTITY_WALLET": "Identity Wallet Creation",
"BPNL_CREDENTIAL": "BPNL Credential",
"MEMBERSHIP_CREDENTIAL": "Membership Credential",
"CLEARING_HOUSE": "Clearing House",
"SELF_DESCRIPTION_LP": "Self Description"
},
Expand Down Expand Up @@ -1679,6 +1681,48 @@
"description": "Die Identity-Wallet-Erstellung ist fehlgeschlagen. Sie können den Job erneut auslösen oder die Firmenregistrierung schließen/ablehnen."
}
},
"BPNL_CREDENTIAL": {
"stepName": "BPNL Credential",
"stepDescription": "Manual validation of the company registration by the operator. Please check the company details as well as uploaded documents and 'accept' / 'decline' the application; depending on the validation results",
"additionalText": "",
"TO_DO": {
"title": "Your action is needed to resolve the issue",
"description": "The process gets auto triggered with the next automation run."
},
"IN_PROGRESS": {
"title": "No action needed from your side",
"description": "The process is ongoing."
},
"DONE": {
"title": "No action needed from your side",
"description": "The process is successfully completed."
},
"FAILED": {
"title": "No action needed from your side",
"description": "The BPNL Credential creation failed. You can retrigger the endpoint or close/reject the company registration."
}
},
"MEMBERSHIP_CREDENTIAL": {
"stepName": "Membership Credential",
"stepDescription": "Manual validation of the company registration by the operator. Please check the company details as well as uploaded documents and 'accept' / 'decline' the application; depending on the validation results",
"additionalText": "",
"TO_DO": {
"title": "Your action is needed to resolve the issue",
"description": "The process gets auto triggered with the next automation run."
},
"IN_PROGRESS": {
"title": "No action needed from your side",
"description": "The process is ongoing."
},
"DONE": {
"title": "No action needed from your side",
"description": "The process is successfully completed."
},
"FAILED": {
"title": "No action needed from your side",
"description": "The Membership Credential creation failed. You can retrigger the endpoint or close/reject the company registration."
}
},
"CLEARING_HOUSE": {
"stepName": "Clearing House",
"stepDescription": "Gaia-X Clearinghouse provider is validating the company registration form (company name; address and unique identifier) and after successful validation verified credentials are added to the managed wallet of the customer.",
Expand Down
48 changes: 46 additions & 2 deletions src/assets/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@
"tab1": "Company Data",
"tab2": "Registration Process",
"tab1Title": "Company Data",
"tab1SubTitle": "Registration Status: {{status}}",
"tab2Title": "Confirmation {{status}}",
"statusComplete": "[complete]",
"tab2SubTitle": "Registration Status: {{status}}",
"lastDate": "Last process update: {{date}}",
"statusIncomplete": "[incomplete]",
"approvedButton": "approved",
"failedButton": "falied"
Expand Down Expand Up @@ -1563,6 +1563,8 @@
"REGISTRATION_VERIFICATION": "Data Validation",
"BUSINESS_PARTNER_NUMBER": "BPN Creation",
"IDENTITY_WALLET": "Identity Wallet Creation",
"BPNL_CREDENTIAL": "BPNL Credential",
"MEMBERSHIP_CREDENTIAL": "Membership Credential",
"CLEARING_HOUSE": "Clearing House",
"SELF_DESCRIPTION_LP": "Self Description"
},
Expand Down Expand Up @@ -1646,6 +1648,48 @@
"description": "The Identity Wallet creation failed. You can retrigger the endpoint or close/reject the company registration."
}
},
"BPNL_CREDENTIAL": {
"stepName": "BPNL Credential",
"stepDescription": "Manual validation of the company registration by the operator. Please check the company details as well as uploaded documents and 'accept' / 'decline' the application; depending on the validation results",
"additionalText": "",
"TO_DO": {
"title": "Your action is needed to resolve the issue",
"description": "The process gets auto triggered with the next automation run."
},
"IN_PROGRESS": {
"title": "No action needed from your side",
"description": "The process is ongoing."
},
"DONE": {
"title": "No action needed from your side",
"description": "The process is successfully completed."
},
"FAILED": {
"title": "No action needed from your side",
"description": "The BPNL Credential creation failed. You can retrigger the endpoint or close/reject the company registration."
}
},
"MEMBERSHIP_CREDENTIAL": {
"stepName": "Membership Credential",
"stepDescription": "Manual validation of the company registration by the operator. Please check the company details as well as uploaded documents and 'accept' / 'decline' the application; depending on the validation results",
"additionalText": "",
"TO_DO": {
"title": "Your action is needed to resolve the issue",
"description": "The process gets auto triggered with the next automation run."
},
"IN_PROGRESS": {
"title": "No action needed from your side",
"description": "The process is ongoing."
},
"DONE": {
"title": "No action needed from your side",
"description": "The process is successfully completed."
},
"FAILED": {
"title": "No action needed from your side",
"description": "The Membership Credential creation failed. You can retrigger the endpoint or close/reject the company registration."
}
},
"CLEARING_HOUSE": {
"stepName": "Clearing House",
"stepDescription": "Gaia-X Clearinghouse provider is validating the company registration form (company name; address and unique identifier) and after successful validation verified credentials are added to the managed wallet of the customer.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,46 +19,83 @@
********************************************************************************/

import {
type ProgressButtonsType,
ProgressStatus,
ApplicationRequestStatus,
type ApplicationRequest,
} from 'features/admin/applicationRequestApiSlice'
import { Trans } from 'react-i18next'
import type i18next from 'i18next'

export const isComplete = (applicationChecklist: ProgressButtonsType[]) =>
applicationChecklist.reduce(
(a, b) => a && b.statusId === ProgressStatus.DONE,
true
)
import dayjs from 'dayjs'
import { Typography } from '@catena-x/portal-shared-components'
import { type CompanyDetail } from 'features/admin/registration/types'

export const getTitle = (
activeTab: number,
applicationChecklist: ProgressButtonsType[],
t: typeof i18next.t
t: typeof i18next.t,
selectedRequest?: ApplicationRequest
) => {
const getStatus = () => {
if (
selectedRequest?.applicationStatus === ApplicationRequestStatus.SUBMITTED
) {
const failedItems = selectedRequest.applicationChecklist.filter(
(checklist) => checklist.statusId === ProgressStatus.FAILED
)
return t(
`content.admin.registration-requests.${failedItems.length ? 'buttonerror' : 'buttonprogress'}`
)
} else if (
selectedRequest?.applicationStatus ===
ApplicationRequestStatus.DECLINED ||
selectedRequest?.applicationStatus ===
ApplicationRequestStatus.CANCELLED_BY_CUSTOMER
) {
return t('content.admin.registration-requests.buttonrejected')
} else if (
selectedRequest?.applicationStatus === ApplicationRequestStatus.CONFIRMED
) {
return t('content.admin.registration-requests.buttoncompleted')
}
}

if (activeTab === 0) {
return t('content.admin.registration-requests.overlay.tab1Title')
} else {
return (
<>
<Typography variant="h3">
{t('content.admin.registration-requests.overlay.tab1Title')}
</Typography>
<Trans
values={{
status: getStatus(),
}}
>
<Typography variant="h3">
{t('content.admin.registration-requests.overlay.tab2SubTitle')}
</Typography>
</Trans>
</>
)
}
if (isComplete(applicationChecklist)) {
}

export const getIntro = (
activeTab: number,
selectedCompany: CompanyDetail,
t: typeof i18next.t
) => {
if (activeTab === 1) {
return (
<Trans
i18nKey={'content.admin.registration-requests.overlay.tab2Title'}
values={{
status: t(
'content.admin.registration-requests.overlay.statusComplete'
),
date: dayjs(selectedCompany.lastChanged).format('DD-MM-YYYY'),
}}
></Trans>
>
<Typography variant="caption3">
{t('content.admin.registration-requests.overlay.lastDate')}
</Typography>
</Trans>
)
}
return (
<Trans
i18nKey={'content.admin.registration-requests.overlay.tab2Title'}
values={{
status: t(
'content.admin.registration-requests.overlay.statusIncomplete'
),
}}
></Trans>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ import {
} from 'features/admin/applicationRequestApiSlice'
import { download } from 'utils/downloadUtils'
import CheckListFullButtons from '../components/CheckList/CheckListFullButtons'
import { getTitle } from './CompanyDetailsHelper'
import { getIntro, getTitle } from './CompanyDetailsHelper'
import { useFetchNewDocumentByIdMutation } from 'features/appManagement/apiSlice'
import { KeyValueView } from 'components/shared/basic/KeyValueView'
import { type UniqueIdType } from 'features/admin/registration/types'
import { StatusProgress } from '../registrationTableColumns'

interface CompanyDetailOverlayProps {
openDialog?: boolean
Expand Down Expand Up @@ -269,24 +270,28 @@ const CompanyDetailOverlay = ({
>
<DialogHeader
{...{
title: getTitle(activeTab, checklistData ?? [], t),
title: getTitle(activeTab, t, selectedRequest),
intro: getIntro(activeTab, selectedCompany, t),
closeWithIcon: true,
onCloseWithIcon: handleOverlayClose,
}}
>
<>
<Box
sx={{
marginLeft: '60px',
width: '80%',
margin: '0 auto',
}}
>
<Tabs value={activeTab} onChange={handleChange}>
<Tab
icon={getStepIcon('1')}
iconPosition="start"
sx={{
fontSize: '18px',
fontSize: '14px',
width: '50%',
textTransform: 'capitalize',
color: '#111 !important',
'&.Mui-selected': {
borderBottom: '3px solid #0f71cb',
},
Expand All @@ -299,7 +304,10 @@ const CompanyDetailOverlay = ({
icon={getStepIcon('2')}
iconPosition="start"
sx={{
fontSize: '18px',
fontSize: '14px',
width: '50%',
textTransform: 'capitalize',
color: '#111 !important',
'&.Mui-selected': {
borderBottom: '3px solid #0f71cb',
},
Expand Down Expand Up @@ -340,7 +348,7 @@ const CompanyDetailOverlay = ({
}}
>
<TabPanel value={activeTab} index={0}>
<Box sx={{ width: '100%', marginBottom: '50px' }}>
<Box sx={{ width: '100%', margin: '50px 0' }}>
<KeyValueView
cols={2.3}
title={t(
Expand All @@ -364,6 +372,21 @@ const CompanyDetailOverlay = ({
</TabPanel>
<TabPanel value={activeTab} index={1}>
<Box sx={{ width: '100%', height }}>
{selectedRequest && (
<div
style={{
display: 'flex',
justifyContent: 'center',
margin: '30px',
}}
>
<StatusProgress
application={selectedRequest}
trans={t}
type={false}
/>
</div>
)}
<CheckListFullButtons
progressButtons={checklistData}
selectedRequestId={selectedRequestId}
Expand Down
Loading

0 comments on commit 2f4c2a8

Please sign in to comment.