-
Notifications
You must be signed in to change notification settings - Fork 929
fix: hide actions and notifications from deleted workspaces #12563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,6 +106,10 @@ export const WorkspaceTopbar: FC<WorkspaceProps> = ({ | |
allowAdvancedScheduling, | ||
); | ||
|
||
const isImmutable = | ||
workspace.latest_build.status === "deleted" || | ||
workspace.latest_build.status === "deleting"; | ||
Comment on lines
+109
to
+111
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quick shout: we do still have logic in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, let's go with that. :) (it probably is helpful to make sure we don't regress in a big way) |
||
|
||
return ( | ||
<Topbar css={{ gridArea: "topbar" }}> | ||
<Tooltip title="Back to workspaces"> | ||
|
@@ -196,11 +200,13 @@ export const WorkspaceTopbar: FC<WorkspaceProps> = ({ | |
</Popover> | ||
</TopbarData> | ||
|
||
<WorkspaceScheduleControls | ||
workspace={workspace} | ||
template={template} | ||
canUpdateSchedule={canUpdateWorkspace} | ||
/> | ||
{!isImmutable && ( | ||
<WorkspaceScheduleControls | ||
workspace={workspace} | ||
template={template} | ||
canUpdateSchedule={canUpdateWorkspace} | ||
/> | ||
)} | ||
|
||
{shouldDisplayDormantData && ( | ||
<TopbarData> | ||
|
@@ -247,36 +253,40 @@ export const WorkspaceTopbar: FC<WorkspaceProps> = ({ | |
gap: 12, | ||
}} | ||
> | ||
<WorkspaceNotifications | ||
workspace={workspace} | ||
template={template} | ||
latestVersion={latestVersion} | ||
permissions={permissions} | ||
onRestartWorkspace={handleRestart} | ||
onUpdateWorkspace={handleUpdate} | ||
onActivateWorkspace={handleDormantActivate} | ||
/> | ||
<WorkspaceStatusBadge workspace={workspace} /> | ||
<WorkspaceActions | ||
workspace={workspace} | ||
handleStart={handleStart} | ||
handleStop={handleStop} | ||
handleRestart={handleRestart} | ||
handleDelete={handleDelete} | ||
handleUpdate={handleUpdate} | ||
handleCancel={handleCancel} | ||
handleSettings={handleSettings} | ||
handleRetry={handleRetry} | ||
handleDebug={handleDebug} | ||
handleChangeVersion={handleChangeVersion} | ||
handleDormantActivate={handleDormantActivate} | ||
handleToggleFavorite={handleToggleFavorite} | ||
canDebug={canDebugMode} | ||
canChangeVersions={canChangeVersions} | ||
isUpdating={isUpdating} | ||
isRestarting={isRestarting} | ||
isOwner={isOwner} | ||
/> | ||
{!isImmutable && ( | ||
<> | ||
<WorkspaceNotifications | ||
workspace={workspace} | ||
template={template} | ||
latestVersion={latestVersion} | ||
permissions={permissions} | ||
onRestartWorkspace={handleRestart} | ||
onUpdateWorkspace={handleUpdate} | ||
onActivateWorkspace={handleDormantActivate} | ||
/> | ||
<WorkspaceStatusBadge workspace={workspace} /> | ||
<WorkspaceActions | ||
workspace={workspace} | ||
handleStart={handleStart} | ||
handleStop={handleStop} | ||
handleRestart={handleRestart} | ||
handleDelete={handleDelete} | ||
handleUpdate={handleUpdate} | ||
handleCancel={handleCancel} | ||
handleSettings={handleSettings} | ||
handleRetry={handleRetry} | ||
handleDebug={handleDebug} | ||
handleChangeVersion={handleChangeVersion} | ||
handleDormantActivate={handleDormantActivate} | ||
handleToggleFavorite={handleToggleFavorite} | ||
canDebug={canDebugMode} | ||
canChangeVersions={canChangeVersions} | ||
isUpdating={isUpdating} | ||
isRestarting={isRestarting} | ||
isOwner={isOwner} | ||
/> | ||
</> | ||
)} | ||
</div> | ||
</Topbar> | ||
); | ||
|
Uh oh!
There was an error while loading. Please reload this page.