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

ocrvs-6363 use the new id handlebars with the "location" helper #815

Merged
merged 6 commits into from
Jan 22, 2024

Conversation

Zangetsu101
Copy link
Collaborator

@Zangetsu101 Zangetsu101 commented Dec 18, 2023

The goal of this PR is to consolidate all the location related handlebars that we provide in the certificates to enable a country to customize the certificates according to their needs. Also introduce the "location" handlebar helper that gives us greater flexibility in using the location data.

The various admin level handlebars e.g. statePlaceofbirth, districtPrimaryMother only contained the name of that location which was not able to take advantage of all the information OpenCRVS had available about the various admin levels e.g. the name of that location in the secondary language. So we are introducing a new set of admin level handlebars that would contain the id of that location which we can resolve into a value of the shape

{
  name: string
  alias: string
}

using the new handlebar helper. Here name is the primary label of the location and alias being the secondary one. Currently only these 2 fields are available but we will be adding more fields depending on various countries requirements. Using the handlebar helper is also very simple, if previously the certificate svg used to contain {{districtPlaceofbirth}} then now we just need to replace it with {{location districtPlaceofbirthId 'name'}}. To access alias, just the 'name' needs to be replaced with 'alias'.

Below is a list of all the new handlebars that can be used with the "location" handlebar helper.

statePrimaryInformantId
districtPrimaryInformantId
statePlaceofbirthId
districtPlaceofbirthId
statePrimaryMotherId
districtPrimaryMotherId
statePrimaryFatherId
districtPrimaryFatherId
statePrimaryDeceasedId
districtPrimaryDeceasedId
statePlaceofdeathId
districtPlaceofdeathId
statePrimaryGroomId
districtPrimaryGroomId
statePrimaryBrideId
districtPrimaryBrideId
statePlaceofmarriageId
districtPlaceofmarriageId
registrar.stateId
registrar.districtId
registrar.officeId
registrationAgent.stateId
registrationAgent.districtId
registrationAgent.officeId

We will be deprecating the counterpart of the above mentioned handlebars that contains only the label of the specified location in a future version so we highly recommend that implementers update their certificates to use these new ones.

@Zangetsu101 Zangetsu101 changed the title ocrvs-6363 Use the "location" handlebar helper for locations ocrvs-6363 Use the new id handlebars with the "location" helper Jan 10, 2024
@Zangetsu101 Zangetsu101 changed the title ocrvs-6363 Use the new id handlebars with the "location" helper ocrvs-6363 use the new id handlebars with the "location" helper Jan 10, 2024
@rikukissa rikukissa changed the base branch from release-v1.3.2 to release-v1.3.3 January 10, 2024 08:04
@rikukissa rikukissa merged commit 28b3d9d into release-v1.3.3 Jan 22, 2024
1 check passed
rikukissa pushed a commit that referenced this pull request Jan 24, 2024
* Use the location handlebar helper in certificates

* Update the location test template

* Use the new id handlebars in certificates

* Update CHANGELOG

* Document the new handlebars & the deprecated ones
@rikukissa rikukissa deleted the ocrvs-6363 branch May 7, 2024 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants