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 gdoc tombstones #3979

Merged
merged 6 commits into from
Oct 7, 2024
Merged

Add gdoc tombstones #3979

merged 6 commits into from
Oct 7, 2024

Conversation

rakyi
Copy link
Contributor

@rakyi rakyi commented Sep 19, 2024

Closes #3902

Without reason or related link specified:

image

With reason and related link specified:

image

Generic 404:

image

Modified existing delete modal in the admin (remaining fields are visible only when the checkbox is checked):

image

@owidbot
Copy link
Contributor

owidbot commented Sep 19, 2024

Quick links (staging server):

Site Admin Wizard

Login: ssh owid@staging-site-add-gdoc-tombstones

SVG tester:

Number of differences (default views): 428 (89b864) ❌
Number of differences (all views): 318 (b37617) ❌

Edited: 2024-10-03 16:16:57 UTC
Execution time: 1.24 seconds

@rakyi rakyi force-pushed the add-gdoc-tombstones branch 3 times, most recently from ce053c1 to c6cdca9 Compare September 20, 2024 14:22
site/owid.scss Show resolved Hide resolved
Copy link
Member

@ikesau ikesau left a comment

Choose a reason for hiding this comment

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

Nice! I like it 👍

I wonder if we should have some admin UI to manage tombstones with, though. Obviously I couldn't resist trying to redelete a slug that already had a tombstone (which fails) plus I can imagine people potentially wanting to read/update/delete the tombstones. Just a simple table would work well, I think?

adminSiteClient/GdocsMoreMenu.tsx Show resolved Hide resolved
adminSiteServer/mockSiteRouter.tsx Show resolved Hide resolved
baker/SiteBaker.tsx Show resolved Hide resolved
site/owid.scss Show resolved Hide resolved
@rakyi rakyi force-pushed the add-gdoc-tombstones branch 2 times, most recently from a825865 to 914fc8a Compare September 30, 2024 16:28
@rakyi rakyi marked this pull request as ready for review October 1, 2024 09:39
`SELECT *
FROM images
WHERE id IN (SELECT DISTINCT imageId FROM posts_gdocs_x_images)
OR filename IN (SELECT DISTINCT relatedLinkThumbnail FROM posts_gdocs_tombstones)`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this make sense, @ikesau?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BTW, is subquery faster than a join, or why are we doing that?

Copy link
Member

Choose a reason for hiding this comment

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

Will finish the review tomorrow but one thing that jumps out here is that we could get duplicates in images now, I think? Maybe SELECT DISTINCT * could help.

I don't know of a particular reason to subqueries over joins in this case. Feel free to change it to whichever's more legible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added DISTINCT and index on relatedLinkThumbnail.

@rakyi
Copy link
Contributor Author

rakyi commented Oct 3, 2024

@ikesau could you review the new comments since your last review, pls?

@rakyi rakyi force-pushed the add-gdoc-tombstones branch 2 times, most recently from cecbc74 to a400bb1 Compare October 3, 2024 15:41
- Copy fixes
- Allow external related links
- Include Wayback Machine link based on a checkbox
Copy link
Member

@ikesau ikesau left a comment

Choose a reason for hiding this comment

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

Nice! Tested all the cases and it all seems good.

2 teeny tiny little comments 🤏

site/TombstonePage.tsx Outdated Show resolved Hide resolved
site/gdocs/components/centered-article.scss Show resolved Hide resolved
@rakyi rakyi merged commit 5541b49 into master Oct 7, 2024
17 of 19 checks passed
@rakyi rakyi deleted the add-gdoc-tombstones branch October 7, 2024 08:55
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.

Add the ability to mark a page as deleted
3 participants