grid
grid copied to clipboard
'Original Media ID'
To support https://trello.com/c/8bt9DhyB/1013-spike-imaging-requests-for-web-via-pinboard we need a way of recording the 'Original Media ID' when we upload cutouts, retouches etc.
Fortunately image-loader's /images POST endpoint supports an identifiers query param (which is parsed as JSON - Map[String, String] to be precise), which is written to the S3 user-metadata, e.g.
.
It's also surfaced in the 'Additional Metadata' section of the sidebar, in this PR we improve the display of this identifier by...
- mapping the label such that it displays as
Original Media ID - making the value clickable, which does a search for that media ID (see below for that might bring back)

... we also make picdarurn display as Picdar URN whilst we're there.
Being able to search for a media ID and see its 'derivatives' is useful, so in this PR we add identifiers.original-media-id as one of the fields in the 'catch-all' search, such that we get back the following for example...

... you'll note the 🖌 icon on one of the results, this is a flag to show which images have an Original Media ID i.e. are modified (which is explained via a tooltip) and is clickable to perform a search for that media ID.
It's worth noting that here we're not changing the data model in any way, just changing how things are rendered, so quite a light touch way of getting the MVP behaviour we need for https://trello.com/c/8bt9DhyB/1013-spike-imaging-requests-for-web-via-pinboard without having to design a whole architecture for 'image relationships/derivatives/versions'.
converted to draft since this needs a rethink now we've moved to queue based ingestion (see https://github.com/guardian/pinboard/pull/226/commits/2eec74195c44db2f0e65ed77486191d6f3043eb1#diff-10e1f19e6d1320d3ced1d8cf65afd0cd0d6eaa0df77e2300eec8adef273b0ec3R41-R55) as a thought about how we might be able to use the new /prepare endpoint
hey @AndyKilmory - sorry for the mega delay on reviewing your PR, but I think this PR satisfies your use case (and more) without the need for force-soft-delete etc. This means that when POSTing the new image (since you don't yet use queues [though 🙏 soon]) you can pass the id of the old/previous image via query params /images?identifiers={"replaces-media-id":"MEDIA ID BEING REPLACED HERE"} ... nice and easy no orchestrating extra calls etc... and you'll get the linkage in both directions (incl. banner) and the hiding of the replaced image from search.
Please let me know what you think? I'll demo at grid hour on Monday and look to review/merge ASAP.