diff --git a/.changeset/dry-bats-pay.md b/.changeset/dry-bats-pay.md new file mode 100644 index 000000000..e91770524 --- /dev/null +++ b/.changeset/dry-bats-pay.md @@ -0,0 +1,5 @@ +--- +'hive': patch +--- + +Add created at, last used, and total docs to app deployment view diff --git a/packages/web/app/src/pages/target-app-version.tsx b/packages/web/app/src/pages/target-app-version.tsx index 0966a402e..13fd52ec1 100644 --- a/packages/web/app/src/pages/target-app-version.tsx +++ b/packages/web/app/src/pages/target-app-version.tsx @@ -27,8 +27,11 @@ import { TableRow, } from '@/components/ui/table'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; +import { TimeAgo } from '@/components/v2'; import { graphql } from '@/gql'; +import { AppDeploymentStatus } from '@/gql/graphql'; import { useRedirect } from '@/lib/access/common'; +import { cn } from '@/lib/utils'; import { DotsHorizontalIcon } from '@radix-ui/react-icons'; import { Link, useRouter } from '@tanstack/react-router'; @@ -57,6 +60,10 @@ const TargetAppsVersionQuery = graphql(` id name version + createdAt + lastUsed + totalDocumentCount + status documents(first: $first, filter: $documentsFilter) { pageInfo { hasNextPage @@ -196,7 +203,8 @@ function TargetAppVersionContent(props: { return null; } - if (!data.fetching && !data.stale && !data?.data?.target?.appDeployment) { + const appDeployment = data.data?.target?.appDeployment; + if (!data.fetching && !data.stale && !appDeployment) { return ( <> @@ -226,8 +234,8 @@ function TargetAppVersionContent(props: { App Deployments {' '} /{' '} - {data.data?.target?.appDeployment ? ( - `${data.data.target.appDeployment.name}@${data.data.target.appDeployment.version}` + {appDeployment ? ( + `${appDeployment.name}@${appDeployment.version}` ) : ( )} @@ -301,6 +309,43 @@ function TargetAppVersionContent(props: { /> ) : ( <> +
+
+
+
Status
+
+ {appDeployment?.status.toUpperCase() ?? '...'} +
+
+
+
Total Documents
+
+ {appDeployment?.totalDocumentCount ?? '...'} +
+
+
+ Created{' '} + {appDeployment?.createdAt ? : '...'} +
+
+ {data.fetching ? ( + '...' + ) : appDeployment?.lastUsed ? ( + <> + Last Used + + ) : ( + 'No Usage Data' + )} +
+
+
@@ -391,7 +436,13 @@ function TargetAppVersionContent(props: {
-
+