Skip to content
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

Add extra validation for showing delete template #5109

Merged
merged 1 commit into from Nov 11, 2020

Conversation

SaraVieira
Copy link
Contributor

@SaraVieira SaraVieira commented Nov 10, 2020

Currently, to delete a template we let you do it if the template's team is null and this resulted in people having a button to delete recently used templates that had no team but also had no author id either

These are Github templates you cannot delete

This adds a check for that

closes #5026

@lbogdan
Copy link
Contributor

lbogdan commented Nov 10, 2020

Build for latest commit 031c25d is at https://pr5109.build.csb.dev/s/new.

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 031c25d:

Sandbox Source
Notifications Test Configuration

Copy link
Member

@CompuIves CompuIves left a comment

Choose a reason for hiding this comment

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

One comment!

return false;
}

return true;
Copy link
Member

Choose a reason for hiding this comment

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

We might need to check if author id on the sandbox is the same as current user ID. Other than that this looks good!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But in teams you can delete other people's templates, no?

Copy link
Member

Choose a reason for hiding this comment

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

Gooooood point... LGTM!

@SaraVieira SaraVieira merged commit 7ba2e80 into master Nov 11, 2020
@SaraVieira SaraVieira deleted the only-show-delete-when-your-template branch November 11, 2020 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't delete template
3 participants