ocrvs-6363 use the new id handlebars with the "location" helper #815
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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.