From 30acd2c0c03bbac31eb73d52eb879ca6665d39ab Mon Sep 17 00:00:00 2001 From: Bruno Quaresma Date: Fri, 28 Oct 2022 16:58:51 +0000 Subject: [PATCH] fix: display None when there are no apps --- .../src/components/Resources/AgentRowPreview.stories.tsx | 9 +++++++++ site/src/components/Resources/AgentRowPreview.tsx | 6 ++++++ site/src/i18n/en/agent.json | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/site/src/components/Resources/AgentRowPreview.stories.tsx b/site/src/components/Resources/AgentRowPreview.stories.tsx index 86a92319e737e..76ec878eea1c4 100644 --- a/site/src/components/Resources/AgentRowPreview.stories.tsx +++ b/site/src/components/Resources/AgentRowPreview.stories.tsx @@ -33,3 +33,12 @@ BunchOfApps.args = { ], }, } + +export const NoApps = Template.bind({}) +NoApps.args = { + ...Example.args, + agent: { + ...MockWorkspaceAgent, + apps: [], + }, +} diff --git a/site/src/components/Resources/AgentRowPreview.tsx b/site/src/components/Resources/AgentRowPreview.tsx index 53e6ce0a139b4..1da4f9db7a41f 100644 --- a/site/src/components/Resources/AgentRowPreview.tsx +++ b/site/src/components/Resources/AgentRowPreview.tsx @@ -1,5 +1,6 @@ import { makeStyles } from "@material-ui/core/styles" import { AppPreviewLink } from "components/AppLink/AppPreviewLink" +import { Maybe } from "components/Conditionals/Maybe" import { FC } from "react" import { useTranslation } from "react-i18next" import { combineClasses } from "util/combineClasses" @@ -75,6 +76,11 @@ export const AgentRowPreview: FC = ({ agent }) => { {agent.apps.map((app) => ( ))} + + + {t("labels.noApps")} + + diff --git a/site/src/i18n/en/agent.json b/site/src/i18n/en/agent.json index cd4203bb5f368..208954aa0e1ec 100644 --- a/site/src/i18n/en/agent.json +++ b/site/src/i18n/en/agent.json @@ -7,6 +7,7 @@ "labels": { "agent": "Agent", "os": "OS", - "apps": "Apps" + "apps": "Apps", + "noApps": "None" } }