Skip to content

Commit

Permalink
fix: Resolve blank page issue after activating service subscription r…
Browse files Browse the repository at this point in the history
…equest. (#1005)
  • Loading branch information
ss-nikunj authored Aug 26, 2024
1 parent da427fc commit 304dc6f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 40 deletions.
86 changes: 47 additions & 39 deletions src/components/overlays/ActivateServiceSubscription/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,44 +93,49 @@ export default function ActivateserviceSubscription({

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,
},
],
],
body:
techUserInfo?.technicalUserInfo
?.map((userData) => [
[
t('serviceSubscription.activation.userId'),
userData.technicalClientId ?? '',
],
[
t('serviceSubscription.activation.sercret'),
userData.technicalUserSecret ?? '',
],
[
t('serviceSubscription.activation.url'),
techUserInfo?.clientInfo?.clientUrl ?? 'N/A',
],
[
t('serviceSubscription.activation.technicaluserType'),
userData.technicalUserPermissions.join(', ') ?? '',
],
])
.flat(1) ?? [],
edit:
techUserInfo?.technicalUserInfo
?.map((userData) => [
[
{
icon: false,
},
{
icon: false,
},
],
[
{
icon: false,
},
{
icon: false,
copyValue: userData.technicalUserSecret,
},
],
])
.flat(1) ?? [],
}

return (
Expand Down Expand Up @@ -177,7 +182,10 @@ export default function ActivateserviceSubscription({
</Typography>
</Trans>
</Box>
<StaticTable data={tableData} horizontal={false} />
{techUserInfo?.technicalUserInfo &&
techUserInfo?.technicalUserInfo?.length > 0 ? (
<StaticTable data={tableData} horizontal={false} />
) : null}
</DialogContent>
<DialogActions>
<Button
Expand Down
2 changes: 1 addition & 1 deletion src/features/serviceManagement/apiSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export type ActivateSubscriptionRequest = {
}

export type ActivateSubscriptionResponse = {
technicalUserInfo: TechnicalUserInfoType
technicalUserInfo: Array<TechnicalUserInfoType>
clientInfo: ClientInfoType
}

Expand Down

0 comments on commit 304dc6f

Please sign in to comment.