From 48b8f8e27b23e7984054dff43a24fe35b7c30b01 Mon Sep 17 00:00:00 2001 From: Joel Abshier Date: Tue, 20 Jun 2023 14:42:07 -0500 Subject: [PATCH 1/2] feat(operator): Add Org `DeleteOn` and Account `CancelledAt` dates --- package.json | 2 +- src/operator/OrgOverlay.tsx | 22 ++++++++++++++++++++++ src/operator/account/AccountGrid.tsx | 13 +++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3296560760..e94ac28a54 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "prettier:fix": "pretty-quick --config .prettierrc.json --write '{src,cypress}/**/*.{ts,tsx}'", "tsc": "tsc -p ./tsconfig.json --noEmit --pretty --skipLibCheck", "tsc:watch": "yarn tsc --watch", - "generate": "export SHA=eec3a9ed87d664529e6a5dddad76232ed9e823bf && export REMOTE=https://raw.githubusercontent.com/influxdata/openapi/${SHA}/ && yarn generate-meta", + "generate": "export SHA=993f6756500aebe47903a3ddaee62f9f75d207c1 && export REMOTE=https://raw.githubusercontent.com/influxdata/openapi/${SHA}/ && yarn generate-meta", "generate-local": "export REMOTE=../openapi/ && yarn generate-meta", "generate-local-cloud": "export REMOTE=../openapi/ && yarn generate-meta-cloud", "generate-meta": "if [ -z \"${CLOUD_URL}\" ]; then yarn generate-meta-oss; else yarn generate-meta-cloud; fi", diff --git a/src/operator/OrgOverlay.tsx b/src/operator/OrgOverlay.tsx index 5118187b6f..bdd52f10ae 100644 --- a/src/operator/OrgOverlay.tsx +++ b/src/operator/OrgOverlay.tsx @@ -88,6 +88,10 @@ const OrgOverlay: FC = () => { history.goBack() } + const deleteOn = organization?.deleteOn + ? new Date(organization?.deleteOn) + : null + return ( {

{organization?.account?.type ?? ''}

+ + + +

{organization?.state ?? ''}

+
+ + +

+ {organization?.state === 'suspended' && deleteOn + ? `${deleteOn.toLocaleTimeString()} ${deleteOn.toDateString()}` + : 'N/A'} +

+
+
} diff --git a/src/operator/account/AccountGrid.tsx b/src/operator/account/AccountGrid.tsx index 32f9695b06..20fa0c94c1 100644 --- a/src/operator/account/AccountGrid.tsx +++ b/src/operator/account/AccountGrid.tsx @@ -20,6 +20,10 @@ const AccountGrid: FC = () => { return account?.marketplaceSubscription?.subscriberId ?? 'N/A' } + const cancelledAt = account?.cancelledAt + ? new Date(account?.cancelledAt) + : null + return ( { body={organizations?.[0]?.provider ?? 'N/A'} testID="cloud-provider" /> + Date: Wed, 21 Jun 2023 11:53:20 -0500 Subject: [PATCH 2/2] chore: Use `Boolean()` to render dates --- src/operator/OrgOverlay.tsx | 3 ++- src/operator/account/AccountGrid.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/operator/OrgOverlay.tsx b/src/operator/OrgOverlay.tsx index bdd52f10ae..bc86084325 100644 --- a/src/operator/OrgOverlay.tsx +++ b/src/operator/OrgOverlay.tsx @@ -91,6 +91,7 @@ const OrgOverlay: FC = () => { const deleteOn = organization?.deleteOn ? new Date(organization?.deleteOn) : null + const hasDeleteDate = Boolean(deleteOn) return ( { Delete On

- {organization?.state === 'suspended' && deleteOn + {organization?.state === 'suspended' && hasDeleteDate ? `${deleteOn.toLocaleTimeString()} ${deleteOn.toDateString()}` : 'N/A'}

diff --git a/src/operator/account/AccountGrid.tsx b/src/operator/account/AccountGrid.tsx index 20fa0c94c1..be5ebc11c1 100644 --- a/src/operator/account/AccountGrid.tsx +++ b/src/operator/account/AccountGrid.tsx @@ -23,6 +23,7 @@ const AccountGrid: FC = () => { const cancelledAt = account?.cancelledAt ? new Date(account?.cancelledAt) : null + const hasCancelledAt = Boolean(cancelledAt) return ( {