Skip to content

Commit

Permalink
feat(company certificate): list company certificates (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
manojava-gk authored Jan 26, 2024
1 parent daffdc7 commit 1786e89
Show file tree
Hide file tree
Showing 11 changed files with 550 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
## unreleased 1.8.0-RC3

- Portal login with registration in validation
- Company Certificate
- Provide new link from user menu for the company certificate page
- UI components created to display filter, sort and company certificates
- Company Roles
- Fetch the standard library data from standards.json and implement Table component to display it in the company roles section.
-

## 1.8.0-RC2

Expand Down
18 changes: 18 additions & 0 deletions src/assets/locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"about": "About",
"dataspace": "Data Space",
"admin-credential": "Certification Mgmt",
"companyCertificate": "Company Certificates",
"companyWallet": "Company Wallet"
},
"overlays": {
Expand Down Expand Up @@ -1701,6 +1702,23 @@
},
"noData": "Derzeit bestehen keine Zertifikate für das Unternehmen. Sie können mit dem Hochladen eines Zertifikats beginnen, indem Sie oben auf die Schaltfläche „Zertifikat hochladen“ klicken."
},
"companyCertificate": {
"heading": "Company Certificates",
"description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard .Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard .",
"tabs": {
"inactive": "Pending",
"active": " Active",
"all": "All"
},
"sort": {
"name": "Name",
"date": "Date"
},
"uploadCertificate": "Upload Certificate",
"noData": "Currently there are no certificates for the company. You can start uploading a certificate by clicking the 'Upload Certificate' button above.",
"validtill": "Valid Till",
"morelink": ">> More"
},
"companyWallet": {
"heading": "Mein Firmen-Wallet",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
Expand Down
18 changes: 18 additions & 0 deletions src/assets/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"about": "About",
"dataspace": "Data Space",
"admin-credential": "Certification Mgmt",
"companyCertificate": "Company Certificates",
"companyWallet": "Company Wallet"
},
"overlays": {
Expand Down Expand Up @@ -1642,6 +1643,23 @@
},
"noData": "Currently there are no certificates for the company. You can start uploading a certificate by clicking the 'Upload Certificate' button above."
},
"companyCertificate": {
"heading": "Company Certificates",
"description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard .Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard .",
"tabs": {
"inactive": "Pending",
"active": " Active",
"all": "All"
},
"sort": {
"name": "Name",
"date": "Date"
},
"uploadCertificate": "Upload Certificate",
"noData": "Currently there are no certificates for the company. You can start uploading a certificate by clicking the 'Upload Certificate' button above.",
"validtill": "Valid Till",
"morelink": ">> More"
},
"adminCertificate": {
"headline": "Credential Request Overview",
"search": "...search for Company Name",
Expand Down
151 changes: 151 additions & 0 deletions src/components/pages/CompanyCertificates/CompanyCertificate.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
/********************************************************************************
* Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

.company-certificate-main {
.company-certificate-section {
margin-top: 72px;
}

.container {
max-width: 1140px;
margin: 0 auto;
padding: 0 15px;

.heading {
text-align: center;
}

.description {
text-align: center;
margin: 34px auto 64px;
width: 70%;
}

.mainContainer {
width: 100%;
max-width: 1100px;
padding: 0 15px 0 15px !important;
margin-right: auto;
margin-left: auto;
}

.filterSection {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-top: 30px;
margin-bottom: 20px;
}

.filterSection .chipContainer {
padding-left: 20px;
}

.sortSection {
position: absolute;
background: #f9f9f9;
box-shadow: 0px 10px 20px rgb(80 80 80 / 30%);
border-radius: 16px;
z-index: 9;
}

.uploadBtn {
width: 20%;
margin: 0 auto;
margin-bottom: 80px;
}

.company-certificate-section {
margin: 0 -15px !important;
width: calc(100% + 30px) !important;

.company-certificate-card {
padding: 0 15px;
margin-bottom: 30px;
}
}
}

.noData {
text-align: center;
}

.card-container {
background-color: #fff;
box-shadow: 0px 10px 20px rgb(80 80 80 / 30%);
max-width: 400px;
height: 160px;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: flex-start;
padding: 20px 0px;
border-radius: 8px;

.first-container {
width: 30%;

img {
width: auto;
height: auto;
}
}

.second-container {
display: flex;
flex-direction: column;
width: 70%;
justify-content: space-between;

.top-container {
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0px 10px;

.dots {
cursor: pointer;
}
}

.bottom-container {
padding: 0px 10px;
margin-top: 30px;
display: flex;
flex-direction: column;

.link {
color: #0f71cb;
cursor: pointer;
}
}
}
}
}

@media (max-width: 480px) {
.company-certificate-main .container .mainContainer {
padding: 0px !important;
}

.company-certificate-main .container .uploadBtn {
width: 50%;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/********************************************************************************
* Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { useTranslation } from 'react-i18next'
import { Logo, Typography } from '@catena-x/portal-shared-components'
import './CompanyCertificate.scss'
import { type ComapnyCertificateData } from 'features/companyCertification/companyCertificateApiSlice'
import { Box } from '@mui/material'
import { useState } from 'react'
import MoreVertIcon from '@mui/icons-material/MoreVert'

export default function CompanyCertificateCard({
item,
}: Readonly<{
item: ComapnyCertificateData
}>): JSX.Element {
const { t } = useTranslation()
const [dotsMenu, setDotsMenu] = useState(false)
return (
<Box className="card-container">
<Box className="first-container">
<Logo />
</Box>
<Box className="second-container">
<Box className="top-container">
<Typography variant="h4">{item.companyCertificateType}</Typography>
<Box
className="dots"
onClick={() => {
setDotsMenu(!dotsMenu)
}}
>
<MoreVertIcon />
</Box>
</Box>
<Box className="bottom-container">
<Typography variant="label3">
{t('content.companyCertificate.validtill')} : {item.validTill}
</Typography>
<Box
className="link"
onClick={() => {
// show overlay
}}
>
<Typography variant="label3">
{t('content.companyCertificate.morelink')}
</Typography>
</Box>
</Box>
</Box>
</Box>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/********************************************************************************
* Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { useTranslation } from 'react-i18next'
import { Grid } from '@mui/material'
import { Typography } from '@catena-x/portal-shared-components'
import './CompanyCertificate.scss'
import { type ComapnyCertificateData } from 'features/companyCertification/companyCertificateApiSlice'
import CompanyCertificateCard from './CompanyCertificateCard'

export default function CompanyCertificateElements({
data,
}: Readonly<{
data: ComapnyCertificateData[]
}>): JSX.Element {
const { t } = useTranslation()

if (data?.length === 0) {
return (
<Typography variant="body1" className="noData">
{t('content.companyCertificate.noData')}
</Typography>
)
}

return (
<Grid container spacing={2} className="company-certificate-section">
{data?.map((item: ComapnyCertificateData) => (
<Grid
item
xs={12}
sm={6}
md={6}
className="company-certificate-card"
key={item.companyCertificateType}
>
<CompanyCertificateCard item={item} />
</Grid>
))}
</Grid>
)
}
Loading

0 comments on commit 1786e89

Please sign in to comment.