mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: display None when there are no apps (#4797)
This commit is contained in:
@@ -33,3 +33,12 @@ BunchOfApps.args = {
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
export const NoApps = Template.bind({})
|
||||
NoApps.args = {
|
||||
...Example.args,
|
||||
agent: {
|
||||
...MockWorkspaceAgent,
|
||||
apps: [],
|
||||
},
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
@@ -91,6 +92,11 @@ export const AgentRowPreview: FC<AgentRowPreviewProps> = ({
|
||||
{agent.apps.map((app) => (
|
||||
<AppPreviewLink key={app.slug} app={app} />
|
||||
))}
|
||||
<Maybe condition={agent.apps.length === 0}>
|
||||
<span className={styles.agentDataValue}>
|
||||
{t("labels.noApps")}
|
||||
</span>
|
||||
</Maybe>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"labels": {
|
||||
"agent": "Agent",
|
||||
"os": "OS",
|
||||
"apps": "Apps"
|
||||
"apps": "Apps",
|
||||
"noApps": "None"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user