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 button to see which posts images are used in #4286

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

ikesau
Copy link
Member

@ikesau ikesau commented Dec 11, 2024

One more feature for the images admin! Last one! I promise! πŸ˜…

image.usage.button.demo.mp4

@ikesau ikesau requested a review from rakyi December 11, 2024 23:03
@ikesau ikesau self-assigned this Dec 11, 2024
@@ -3138,17 +3138,6 @@ getRouteNonIdempotentWithRWTransaction(
postRouteWithRWTransaction(apiRouter, "/images", async (req, res, trx) => {
const { filename, type, content } = validateImagePayload(req.body)

const preexisting = await trx<DbEnrichedImage>("images")
Copy link
Member Author

@ikesau ikesau Dec 11, 2024

Choose a reason for hiding this comment

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

This is a change that Daniel suggested - it's annoying to be told to rename an image, only to find out that the hash collides after.

So now we check for the hash collision first.

@owidbot
Copy link
Contributor

owidbot commented Dec 11, 2024

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs

Login: ssh owid@staging-site-cloudflare-images-usage

SVG tester:

Number of differences (default views): 0 βœ…
Number of differences (all views): 0 βœ…

Edited: 2024-12-11 23:16:07 UTC
Execution time: 1.24 seconds

Copy link
Contributor

@rakyi rakyi left a comment

Choose a reason for hiding this comment

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

Cool feature! Have you tested whether the list for images that are used a lot still looks fine?

@ikesau
Copy link
Member Author

ikesau commented Dec 12, 2024

Cool feature! Have you tested whether the list for images that are used a lot still looks fine?

nah, but the currently most-reused image is 5, which looked fine.

@ikesau ikesau merged commit 100aa78 into master Dec 12, 2024
28 checks passed
@ikesau ikesau deleted the cloudflare-images-usage branch December 12, 2024 17:10
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.

3 participants