Skip to content

Commit d6dccb9

Browse files
committed
chore: release schedule on subscription update
1 parent 54b2e8c commit d6dccb9

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

webapp/src/ee/billing/administration/subscriptionPlans/migration/cloud/AdministrationCloudPlanMigrationEdit.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,10 @@ export const AdministrationCloudPlanMigrationEdit = () => {
165165
})}
166166
</TableCell>
167167
<TableCell>
168-
<PlanMigrationStatus status={item.status} />
168+
<PlanMigrationStatus
169+
status={item.status}
170+
date={item.finalizedAt}
171+
/>
169172
</TableCell>
170173
</TableRow>
171174
)}

webapp/src/ee/billing/administration/subscriptionPlans/migration/general/PlanMigrationStatus.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { components } from 'tg.service/billingApiSchema.generated';
2-
import { Chip } from '@mui/material';
2+
import { Chip, Tooltip } from '@mui/material';
33
import { useTranslate } from '@tolgee/react';
4+
import { useDateFormatter } from 'tg.hooks/useLocale';
45

56
type Status = components['schemas']['PlanMigrationHistoryModel']['status'];
67

78
type Props = {
89
status: Status;
10+
date?: number;
911
};
1012

1113
const colors = {
@@ -17,9 +19,24 @@ const translates = {
1719
SCHEDULED: 'administration_plan_migration_status_scheduled',
1820
};
1921

20-
export const PlanMigrationStatus = ({ status }: Props) => {
22+
export const PlanMigrationStatus = ({ status, date }: Props) => {
2123
const { t } = useTranslate();
22-
return (
24+
const formatDate = useDateFormatter();
25+
26+
const chip = (
2327
<Chip label={t(translates[status])} color={colors[status] || 'default'} />
2428
);
29+
return date ? (
30+
<Tooltip
31+
title={formatDate(date, {
32+
timeZone: 'UTC',
33+
dateStyle: 'short',
34+
timeStyle: 'short',
35+
})}
36+
>
37+
{chip}
38+
</Tooltip>
39+
) : (
40+
chip
41+
);
2542
};

webapp/src/ee/billing/administration/subscriptionPlans/migration/selfhosted/AdministrationSelfHostedEePlanMigrationEdit.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ export const AdministrationSelfHostedEePlanMigrationEdit = () => {
166166
})}
167167
</TableCell>
168168
<TableCell>
169-
<PlanMigrationStatus status={item.status} />
169+
<PlanMigrationStatus
170+
status={item.status}
171+
date={item.finalizedAt}
172+
/>
170173
</TableCell>
171174
</TableRow>
172175
)}

0 commit comments

Comments
 (0)