-
Notifications
You must be signed in to change notification settings - Fork 481
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 ability to delete a project from the featured_projects table #56532
Conversation
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.
LGTM! I'm wondering if "Delete" feels a bit too intense since this doesn't actually delete the project from our system? But so long as users know what's happening it's probably fine
@@ -151,6 +151,17 @@ const feature = (channel, publishedAt) => { | |||
.fail(handleFeatureFailure); | |||
}; | |||
|
|||
const onDelete = channel => { | |||
var url = `/featured_projects/${channel}`; | |||
$.ajax({ |
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.
nit: can we use fetch
here? looks like we have other usages of $.ajax
in this file though so also okay if you want to keep it consistent (and we can upgrade this file up later as a follow-up)
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.
Sure! I'll wait till #56555 is merged since the authenticity token was required when fetch
was used.
@@ -151,6 +151,17 @@ const feature = (channel, publishedAt) => { | |||
.fail(handleFeatureFailure); | |||
}; | |||
|
|||
const onDelete = channel => { | |||
var url = `/featured_projects/${channel}`; |
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.
nit const
Good point! I asked @samantha-code about this and she said 'Remove' sounds good. Thanks! |
This PR allows an admin user to delete a project from the
featured_projects
table displayed at 'projects/featured' (must have project validator permission to have access to this page). Currently there are 232 featured projects, and 550 projects in the ‘Archive of Previously Featured Projects’.Many of the projects are no longer available (project deleted) and some of them were added unintentionally. There are currently too many to be able to manage effectively for an admin user.
Note that deleting a project from the
featured_projects
does NOT delete the project itself, and it is possible to re-add it to thefeatured_projects
table.Updates include:
This is part 1 of 2 steps described here.
Screencast video AFTER update: Note that button now displays 'Remove' instead of 'Delete' based on this feedback.
delete-featured-project.mp4
Links
jira
Testing story
I tested locally, and I also checked the
featured_projects
table usingmysql-client-dashboard-reader
to confirm the entry was removed from the table.Deployment strategy
Follow-up work
Follow-up work includes adding a confirmation modal when an admin users clicks on the 'Delete' button to delete a featured project. https://codedotorg.atlassian.net/browse/LABS-507Asked @samantha-code about this and she prefers no confirmation dialog for 'Delete/Remove' button.
Privacy
Security
Caching
PR Checklist: