-
Notifications
You must be signed in to change notification settings - Fork 17
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
Allow certain users to delete a site and all its data #1380
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CristinaRO
force-pushed
the
816-improve-the-process-for-deleting-a-site
branch
2 times, most recently
from
September 4, 2023 11:44
ded06da
to
45e8c72
Compare
CristinaRO
changed the title
Allow admins to delete a site and all its data
Allow certain users to delete a site and all its data
Sep 4, 2023
CristinaRO
force-pushed
the
816-improve-the-process-for-deleting-a-site
branch
2 times, most recently
from
September 8, 2023 12:51
daaee65
to
ee20177
Compare
features/site.feature
Outdated
Comment on lines
123
to
144
|
||
Scenario: Deleting a site as a Site Manager | ||
Given I have logged in as a Site Manager | ||
And a site bis exists | ||
And I visit this site page | ||
When I delete this site | ||
Then I should be prompted to confirm the deletion | ||
When I fail to confirm the deletion | ||
Then I should see "The confirmation did not match" | ||
And I should be prompted to confirm the deletion | ||
When I confirm the deletion | ||
Then I should be redirected to the organisation dashboard | ||
And I should see the deletion confirmation message | ||
|
||
Scenario: Deleting a site as a non-Site Manager | ||
Given I have logged in as a member of DCLG | ||
And a site dclg exists | ||
And I visit this site page | ||
Then I should not see "Delete" | ||
When I visit the path /sites/dclg/confirm_destroy | ||
Then I should be redirected to the site dashboard | ||
And I should see "Only certain users can access that." |
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.
Really like this test walk through, thank you :)
JonathanHallam
approved these changes
Sep 11, 2023
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.
Awesome thank you, really like how this is looking
Allows users with the "Site Manager" permission to delete a site via the interface. I've opted for a two-step, JavaScript-free process, for simplicity. I've also opted for a GitHub-style confirmation prompt, where rather than a yes/no question, the user has to input some text (the site slug AKA abbreviation in our case) to confirm a destructive action.
There's no `highlight-danger` style in the govuk-admin-template, which this site still uses. Adding proper support for govuk-components would be a huge amount of work, so we've decided to add the least amount of style customisation to make this feature viable.
CristinaRO
force-pushed
the
816-improve-the-process-for-deleting-a-site
branch
from
September 11, 2023 15:34
ee20177
to
a17f142
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trello
Allows users granted the newly introduced "Site Manager" permission to delete a site via the interface.
I've opted for a two-step, JavaScript-free process, for simplicity.
I've also opted for a GitHub-style confirmation prompt, where rather than a yes/no question, the user has to input some text (the site slug AKA abbreviation in our case) to confirm a destructive action.
UI changes
"Danger" link
Confirmation form
Confirmation form with mismatched confirmation
Again, there's not much to lean on in terms of prior art.Deletion confirmation
Redirects to the organisation dashboard.
This application is owned by the publishing platform team. Please let us know in #govuk-publishing-platform when you raise any PRs.
Follow these steps if you are doing a Rails upgrade.