Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
f0ssel merged 6 commits intomainfromf0ssel/disable-cancel
Jan 11, 2024

Conversation

f0ssel
Copy link
Contributor

@f0sself0ssel commentedJan 10, 2024
edited
Loading

Closes#11449

The user can only cancel under the following circumstances according to the backend:

  1. You have the owner role.
    OR
  2. The template specifies that ANY user can cancel the builds based on it.

Owner View if user cancelation is disabled:
Screenshot 2024-01-10 at 11 42 10 AM

Member View if user cancelation is disabled:
Screenshot 2024-01-10 at 11 41 50 AM

ericpaulsen and Kira-Pilot reacted with hooray emoji
@f0sself0ssel marked this pull request as ready for reviewJanuary 10, 2024 16:27
@@ -55,7 +55,7 @@ export interface WorkspaceProps {
workspaceErrors: WorkspaceErrors;
buildInfo?: TypesGen.BuildInfoResponse;
sshPrefix?: string;
template?: TypesGen.Template;
template: TypesGen.Template;
Copy link
Member

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?

Copy link
ContributorAuthor

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.

Kira-Pilot and BrunoQuaresma reacted with thumbs up emoji
Copy link
Member

@Kira-PilotKira-Pilot left a comment
edited
Loading

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 theuseMe hook returns and the way to do this is to mock out theAuthContext.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 accessingisOwner as a prop, you won't need to mock that auth provider.

Copy link
Collaborator

@BrunoQuaresmaBrunoQuaresma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks good!

@f0sself0ssel merged commitf9f94b5 intomainJan 11, 2024
@f0sself0ssel deleted the f0ssel/disable-cancel branchJanuary 11, 2024 18:48
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 11, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma approved these changes

@Kira-PilotKira-PilotKira-Pilot approved these changes

Assignees

@f0sself0ssel

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

disableCancel button entirely for non-Owners
3 participants
@f0ssel@BrunoQuaresma@Kira-Pilot

[8]ページ先頭

©2009-2025 Movatter.jp