guardian / grid

The Guardian’s image management system
https://www.theguardian.com/info/developer-blog/2015/aug/12/open-sourcing-grid-image-service
Apache License 2.0
1.44k stars 120 forks source link

IMAGEDAM-1667: Metadata panel displays send to photo sales usages #4283

Closed Conalb97 closed 1 month ago

Conalb97 commented 4 months ago

What does this change?

Note: this PR should be reviewed after https://github.com/guardian/grid/pull/4267 as it builds on the changes included in that PR

The relevant files for this PR are:

Previously, after the user had completed the process of adding a photo sales and they navigated to the usages panel the usage was presented as if it was a standard syndication usage. Now a custom photo sales 'usage' is rendered instead. Additionally, as deleting the usage from the image, does not cause the image to be deleted in photo sales, changes have been made to usagesAPI so that the 'Delete All' button does not delete a syndication usage when it has a partnerName = Capture (i.e. is a photo sales usage).

The Photosales functionality is BBC specific, hence it is disabled by default via the showSendToPhotoSales feature flag.

How should a reviewer test this change?

As a user with elevated permissions and with the showSendToPhotoSales flag set to true:

How can success be measured?

Confirm that the added photo sales usage has the following appearance:

Screenshot 2024-05-31 at 16 07 37

And confirm that after clicking the 'delete all button' the 'Added to Photo Sales' usage remains on the image.

Who should look at this?

Tested? Documented?

Conalb97 commented 1 month ago

Thanks for the review @rebecca-thompson, just going to go through your comments now to try and resolve them :)

Conalb97 commented 1 month ago

Hi @rebecca-thompson :)

After internal discussion and speaking with @paperboyo, we've removed the BBC specific logic from the delete-all endpoint.

As a replacement we now hide the 'delete all' button on images that have syndication usages (but only if the photosales feature flag is turned on). That way we retain the protection against orphaned images in BBC Photosales, without impacting the Guardian or the code base. This does mean that we will be unable to delete images. However, we are okay with this for now as future work will introduce the functionality to delete images from photosales, at which point we can 'reintroduce' the delete all button. In the meantime, situations where an image needs to be deleted is seen as unlikely, and manageable manually.

Thanks!

prout-bot commented 1 month ago

Seen on auth, usage, image-loader, metadata-editor, thrall, leases, cropper, collections, media-api, kahuna (created by @Conalb97 and merged by @paperboyo 10 minutes and 21 seconds ago) Please check your changes!