Skip to content

Commit

Permalink
fix(service subscription): add copy icon to static table (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhigarg-bmw authored Jan 11, 2024
1 parent eeea689 commit 6c276f7
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 48 deletions.
2 changes: 1 addition & 1 deletion src/assets/locales/de/servicerelease.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
"activation": {
"title": "Service Subscription Activated",
"subtitle": "for ",
"successDescription": "The service is now activated and is now located in your active contract management",
"successDescription": "The service is now activated and technical user was successfully created. <br />Please find the necessary user details below.",
"successDescriptionWithTechUser": "The service is now activated and technical user was successfully created.<br /> Please find the necessary user details below.",
"tableheader": "Technical User Details:",
"userId": "Client ID Tech User:",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/locales/en/servicerelease.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
"activation": {
"title": "Service Subscription Activated",
"subtitle": "for ",
"successDescription": "The service is now activated and is now located in your active contract management",
"successDescription": "The service is now activated and technical user was successfully created. <br />Please find the necessary user details below.",
"successDescriptionWithTechUser": "The service is now activated and technical user was successfully created.<br /> Please find the necessary user details below.",
"tableheader": "Technical User Details:",
"userId": "Client ID Tech User:",
Expand Down
71 changes: 43 additions & 28 deletions src/components/overlays/ActivateServiceSubscription/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import {
DialogContent,
DialogHeader,
LoadingButton,
StaticTable,
type TableType,
Typography,
} from '@catena-x/portal-shared-components'
import { Trans, useTranslation } from 'react-i18next'
Expand All @@ -38,7 +40,6 @@ import {
useFetchServiceTechnicalUserProfilesQuery,
} from 'features/serviceManagement/apiSlice'
import { Link } from 'react-router-dom'
import { KeyValueView } from 'components/shared/basic/KeyValueView'

const ProfileHelpURL =
'/documentation/?path=docs%2F05.+Service%28s%29%2F03.+Service+Subscription%2F01.+Service+Subscription.md'
Expand Down Expand Up @@ -90,27 +91,47 @@ export default function ActivateserviceSubscription({
}
}

const activationData = [
{
key: t('serviceSubscription.activation.userId'),
value: techUserInfo?.technicalUserInfo.technicalClientId ?? '',
},
{
key: t('serviceSubscription.activation.sercret'),
value: techUserInfo?.technicalUserInfo.technicalUserSecret ?? '',
copy: true,
},
{
key: t('serviceSubscription.activation.url'),
value: techUserInfo?.clientInfo?.clientUrl ?? 'n/a',
},
{
key: t('serviceSubscription.activation.technicaluserType'),
value:
const tableData: TableType = {
head: [t('serviceSubscription.activation.tableheader'), ''],
body: [
[
t('serviceSubscription.activation.userId'),
techUserInfo?.technicalUserInfo.technicalClientId ?? '',
],
[
t('serviceSubscription.activation.sercret'),
techUserInfo?.technicalUserInfo.technicalUserSecret ?? '',
],
[
t('serviceSubscription.activation.url'),
techUserInfo?.clientInfo?.clientUrl ?? 'n/a',
],
[
t('serviceSubscription.activation.technicaluserType'),
techUserInfo?.technicalUserInfo.technicalUserPermissions.join(', ') ??
'',
},
]
'',
],
],
edit: [
[
{
icon: false,
},
{
icon: false,
},
],
[
{
icon: false,
},
{
icon: false,
copyValue: techUserInfo?.technicalUserInfo.technicalUserSecret,
},
],
],
}

return (
<Dialog
Expand Down Expand Up @@ -156,13 +177,7 @@ export default function ActivateserviceSubscription({
</Typography>
</Trans>
</Box>
{isTechUser && techUserInfo && (
<KeyValueView
cols={2}
title={t('serviceSubscription.activation.tableheader')}
items={activationData}
/>
)}
<StaticTable data={tableData} horizontal={false} />
</DialogContent>
<DialogActions>
<Button
Expand Down
18 changes: 0 additions & 18 deletions src/components/overlays/ActivateServiceSubscription/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,6 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

.activation {
table {
width: 90%;
margin: 20px 40px;
border-collapse: collapse;

tr td {
border-top: 1px solid rgb(220, 220, 220);
padding: 10px;
text-align: left;
}

tr:first-child td {
border: none;
}
}
}

.helpText {
display: flex;
color: #0d55af !important;
Expand Down

0 comments on commit 6c276f7

Please sign in to comment.