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 delete to admin tab #2416

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Add delete to admin tab #2416

merged 1 commit into from
Nov 18, 2024

Conversation

syed-ali-tw
Copy link
Contributor

@syed-ali-tw syed-ali-tw commented Nov 14, 2024

Trello

Add delete addition functionality to admin page.

Draft edition
delete_draft_edition

fact check edition
delete_fact_check_edition

confirm delete page
confirm_delete

delete success message
delete_success

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

@syed-ali-tw syed-ali-tw force-pushed the admin-tab-delete-link branch 16 times, most recently from 2aee9b7 to 9a4acc4 Compare November 17, 2024 22:45
@syed-ali-tw syed-ali-tw marked this pull request as ready for review November 17, 2024 22:45
@syed-ali-tw syed-ali-tw changed the title WIP Add delete to admin tab Nov 17, 2024
<%= render "govuk_publishing_components/components/button", {
text: "Skip fact check",
} %>
<div class="govuk-button-group">
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should use the govuk-button-group class here and then over-ride it with a custom style. I think this class is designed to display multiple buttons and links horizontally so if that isn't what we want to do we should probably display those items as list items, the same as we do for the options sidebar on the edit page.

def destroyable_edition?
return if @resource.can_destroy?

flash[:danger] = "Cannot delete a #{description(@resource).downcase} that has ever been published."
Copy link
Contributor

@ellohez ellohez Nov 18, 2024

Choose a reason for hiding this comment

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

Is there any way that we can re-word this? Just worried that we could display something grammatically incorrect such as:
"Cannot delete a answer that has ever been published"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been copied from existing error message and I think we have decided not to change error messages for now.

I have made the note of this to be added to the doc where we are maintaining list of all error messages to be reviewed.

@syed-ali-tw syed-ali-tw force-pushed the admin-tab-delete-link branch 2 times, most recently from 08e9e99 to 1ea08e7 Compare November 18, 2024 12:47
<% end %>
</div>
</div>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like there's an extra closing </div> tag here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good spot, a carry over from confirm unpublish, have updated both files now

@syed-ali-tw syed-ali-tw force-pushed the admin-tab-delete-link branch from 1ea08e7 to 058a9f2 Compare November 18, 2024 12:57
@syed-ali-tw syed-ali-tw force-pushed the admin-tab-delete-link branch from 058a9f2 to eb7d05b Compare November 18, 2024 13:00
Copy link
Contributor

@baisa baisa left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@davidtrussler davidtrussler left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@syed-ali-tw syed-ali-tw merged commit eb43db7 into main Nov 18, 2024
12 checks passed
@syed-ali-tw syed-ali-tw deleted the admin-tab-delete-link branch November 18, 2024 14:46
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.

4 participants