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

Add new programme usage rights #4112

Closed ochiengolanga closed 1 year ago

ochiengolanga commented 1 year ago

What does this change?

This PR (co-authored by @Conalb97) introduces 3 new programme usage rights meant to replace the "Programme Promotional" usage right that was introduced by this PR #3774.

These new programme rights are:

Adding the new usage rights to the usageRights.applicable configuration should allow a user to select either in usage rights edit form and allow image(s) to be searched using the +category: programme-organisation-owned or +category: programme-independents or +category: programme-acquisitions chip.

Applying new programme usage rights to an image

Select and save programme usage rights

Searching using new programme usage rights / categories

Search using programme usage rights

The objective of this PR and a follow-up PR, is to replace / deprecate the "Programme Promotional" usage rights. Before the "Programme Promotional" usages rights is deprecated, images with the "Programme Promotional" usage rights should be reassigned the new programme usage rights where applicable.

To deploy these new image rights, an update to the Elasticsearch mapping and a migration (if there are existing documents in Elasticsearch) has to be done to index the "Independent Type" and "Production Company" fields in the "ProgrammeIndependents" usage rights model.

How should a reviewer test this change?

Add the new usage rights to the usageRights.applicable list and this should add the new usage rights to the "Usage rights" select box and add them to the category: search chip.

usageRights.applicable = [
  "com.gu.mediaservice.model.ProgrammesOrganisationOwned",
  "com.gu.mediaservice.model.ProgrammesIndependents",
  "com.gu.mediaservice.model.ProgrammesAcquisitions"
]

Add these new configurations programmesOrganisationOwned, programmesIndependents and programmesAcquisitions in the application.conf file to configure custom descriptions of the usage rights and options to select from that should appear on the "usage rights edit form".

usageRightsConfigProvider = {
  className: "com.gu.mediaservice.lib.config.RuntimeUsageRightsConfig"
  config {
    programmesOrganisationOwned {
      description = "This is a configurable description of the usage right." # Optional config - if not sensible default description is used
    }
    programmesIndependents {
      description = "This is a configurable description of the usage right." # Optional config - if not sensible default description is used
      independentTypes = [
        {
          name = "BBC Studios"
          productionsCompanies = ["Studio 1", "Studio 2"]
        }
        {
          name = "Independent"
          productionsCompanies = ["A", "B", "C"]
        }
        {
          name = "Joint Production"
          productionsCompanies = ["Joint Prod 1", "Joint Prod 2"]
        }
      ]
    }
    programmesAcquisitions {
      description = "This is a configurable description of the usage right." # Optional config - if not sensible default description is used
    }
  }
}

How can success be measured?

Who should look at this?

@guardian/digital-cms

Tested? Documented?

honorcb commented 1 year ago

The current programme rights is mis spelt Program Promotional, And with just one right it makes it hard to distinguish by who and where when these images can be used

Conalb97 commented 1 year ago

The current programme rights is mis spelt Program Promotional and makes it hard to distinguish who and where then these images can be used

Hi Honor,

I think the idea is that this change will deprecate the need for the current programme promotional rights, so the mispelling and confusion over its purpose might not be an issue?

Although in that case the current programme promotional rights could be removed from the UI - is that something we would want to do?

Conalb97 commented 1 year ago

@rebecca-thompson thanks for the review, added to the example as per your comment

prout-bot commented 1 year ago

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