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

Recrop option to disable if image is not from Grid #1698

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

Divs-B
Copy link
Contributor

@Divs-B Divs-B commented Oct 16, 2024

What's changed?

  • This will fix missing background image when we open the form to edit it.
  • This will remove Recrop Image option from Chef card because we found that the image is not available on the grid to edit on. At present chef images are uploaded on S3.

Note: Need to check with CoPro team on using Recrop Image when article has author's cutout images. I think recrop will not be working on those images too.


Before:

On CHEF card

Screen.Recording.2024-10-16.at.17.38.29.mov

On UK Daily Edition, one of the article

Screen.Recording.2024-10-16.at.17.57.48.mov

After:

On CHEF card

Screen.Recording.2024-10-16.at.15.05.45.mov

On UK Daily Edition, one of the article

Screen.Recording.2024-10-16.at.18.03.34.mov

Implementation notes

Checklist

General

  • 🤖 Relevant tests added
  • ✅ CI checks / tests run locally
  • 🔍 Checked on CODE

Client

  • 🚫 No obvious console errors on the client (i.e. React dev mode errors)
  • 🎛️ No regressions with existing user interactions (i.e. all existing buttons, inputs etc. work)
  • 📷 Screenshots / GIFs of relevant UI changes included

@Divs-B Divs-B changed the title Recrop selection on chef Recrop selection to disable on chef Oct 16, 2024
@@ -257,6 +257,8 @@ interface ComponentState {
const dragImage = new Image();
dragImage.src = imageDragIcon;

const regexToCheckGridImage: RegExp = /^https?:\/\/(www\.)?media\.(?:dev-|)guim\.co\.uk\/([0-9a-fA-F]+)\//;
Copy link
Contributor Author

@Divs-B Divs-B Oct 16, 2024

Choose a reason for hiding this comment

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

Thanks to @fredex42 for suggesting regex to check endpoint to distinguish between endpoint poiting to grid or pointing to normal s3 uploader (like chef's image)

Co-authored-by: Emily Bourke <emily.bourke@guardian.co.uk>
@Divs-B Divs-B marked this pull request as ready for review October 16, 2024 17:08
@Divs-B Divs-B requested a review from a team as a code owner October 16, 2024 17:08
@Divs-B Divs-B changed the title Recrop selection to disable on chef Recrop option to disable if image is not from Grid Oct 17, 2024
Copy link
Contributor

@fredex42 fredex42 left a comment

Choose a reason for hiding this comment

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

👍

@Divs-B
Copy link
Contributor Author

Divs-B commented Oct 17, 2024

Checked with CoPro team as well.
Thanks to @twrichards for replying that this change is fine.

@Divs-B Divs-B merged commit 702fc73 into main Oct 17, 2024
12 checks passed
@Divs-B Divs-B deleted the db/decide-recrop-selection-on-chef branch October 17, 2024 11:01
@prout-bot
Copy link

Seen on PROD (merged by @Divs-B 6 minutes and 28 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants