mirror of
https://github.com/coder/coder.git
synced 2026-09-21 20:51:01 +08:00
fix: disable agent app buttons while a blocking startup script is running (#13667)
This commit is contained in:
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user