fix: disable agent app buttons while a blocking startup script is running (#13667)

This commit is contained in:
Kayla Washburn-Love
2024-06-27 11:25:03 -06:00
committed by GitHub
parent 093ec3d05b
commit 8b615f4522
2 changed files with 19 additions and 7 deletions
@@ -151,3 +151,15 @@ export const InternalApp: Story = {
agent: MockWorkspaceAgent,
},
};
export const BlockingStartupScriptRunning: Story = {
args: {
workspace: MockWorkspace,
app: MockWorkspaceApp,
agent: {
...MockWorkspaceAgent,
lifecycle_state: "starting",
startup_script_behavior: "blocking",
},
},
};
@@ -94,19 +94,19 @@ export const AppLink: FC<AppLinkProps> = ({ app, workspace, agent }) => {
}
if (!appsHost && app.subdomain) {
canClick = false;
icon = (
<ErrorOutlineIcon
css={{
color: theme.palette.grey[300],
}}
/>
);
icon = <ErrorOutlineIcon css={{ color: theme.palette.grey[300] }} />;
primaryTooltip =
"Your admin has not configured subdomain application access";
}
if (fetchingSessionToken) {
canClick = false;
}
if (
agent.lifecycle_state === "starting" &&
agent.startup_script_behavior === "blocking"
) {
canClick = false;
}
const isPrivateApp = app.sharing_level === "owner";