-
Notifications
You must be signed in to change notification settings - Fork 886
fix: remove cancel button if user cannot cancel job #11553
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
Conversation
@@ -55,7 +55,7 @@ export interface WorkspaceProps { | |||
workspaceErrors: WorkspaceErrors; | |||
buildInfo?: TypesGen.BuildInfoResponse; | |||
sshPrefix?: string; | |||
template?: TypesGen.Template; | |||
template: TypesGen.Template; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we change this type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed it didn't need to be conditional and see those as a liability so I just drive-by fixed it while I was reading the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making this change! Looks good to me.
Can we add a storybook test before we merge it up? Your screenshots would be good test cases.
You'll need to mock the user value the useMe
hook returns and the way to do this is to mock out the AuthContext.Provider
Here's an example of how we mock providers in a Storybook file.
As discussed over Slack, we'll need to move this hook invocation up to fix the broken stories. Since you'll be accessing isOwner
as a prop, you won't need to mock that auth provider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Closes #11449
The user can only cancel under the following circumstances according to the backend:
OR
Owner View if user cancelation is disabled:

Member View if user cancelation is disabled:
