diff --git a/.github/workflows/clear-environment.yml b/.github/workflows/clear-environment.yml index 35ddc9163..c01188f43 100644 --- a/.github/workflows/clear-environment.yml +++ b/.github/workflows/clear-environment.yml @@ -6,9 +6,6 @@ on: environment: required: true type: string - outputs: - outcome: - value: ${{ jobs.reset-data.outputs.outcome }} workflow_dispatch: inputs: environment: @@ -25,9 +22,9 @@ jobs: name: 'Reset data' environment: ${{ inputs.environment }} runs-on: ubuntu-22.04 - timeout-minutes: 60 outputs: - outcome: ${{ steps.reset.outcome }} + outcome: ${{ steps.reset-data.outcome }} + timeout-minutes: 60 steps: - name: Clone country config resource package uses: actions/checkout@v3 @@ -50,7 +47,7 @@ jobs: known_hosts: ${{ env.KNOWN_HOSTS }} - name: Reset data - id: reset + id: reset-data env: HOST: ${{ vars.DOMAIN }} ENV: ${{ vars.ENVIRONMENT_TYPE }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 3ffcabf0c..d03dd8251 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -7,8 +7,9 @@ on: description: Branch to build from default: master required: true + release_version: - description: Release tag. It will be prepended by your repository name + description: Release tag. It will be prepended by your repository name (e.g. v1.5.3 or 20240501) required: true jobs: @@ -22,12 +23,8 @@ jobs: - name: Install jq run: sudo apt-get install jq -y - - name: Read version from package.json - id: get_version - run: echo "::set-output name=version::$(jq -r '.version' package.json)" - - name: Set TAG environment variable - run: echo "TAG=v${{ steps.get_version.outputs.version }}" >> $GITHUB_ENV + run: echo "TAG=${{ github.event.inputs.release_version }}" >> $GITHUB_ENV - uses: trstringer/manual-approval@v1 with: @@ -45,6 +42,7 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} tag_prefix: ${{ github.event.repository.name }}- custom_tag: ${{ env.TAG }} + release_branches: ${{ github.event.inputs.branch_name }} - name: Login to DockerHub uses: docker/login-action@v3 @@ -74,6 +72,7 @@ jobs: type: now from_branch: ${{ github.event.inputs.branch_name }} target_branch: master + message: Merge ${{ github.event.inputs.branch_name }} to master github_token: ${{ secrets.GITHUB_TOKEN }} - name: Merge master -> develop @@ -82,4 +81,5 @@ jobs: type: now from_branch: master target_branch: develop + message: Merge master back to develop github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 70182cf06..35c45e5b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,23 +4,81 @@ ### Breaking changes +- **Notification Flags** The configuration of various notifications is now controlled from `countryconfig` instead of being handled in the UI, as notification settings are not something that should be changed on the fly. To simplify this process, we have moved the settings to the `application-config.ts` file. From now on, the notifications can be managed in the `notificationForRecord` object defined in the mentioned file. Any changes will take effect after a new deployment. + + **_Country implementors must define the `notificationForRecord` object in the `application-config.ts` file to enable the notifications they want. Not doing so will keep notifications disabled by default._** + +- **Gateways searchEvents API updated** `operationHistories` only returns `operationType` & `operatedOn` due to the other fields being unused in OpenCRVS +- **Config changes to review/preview and signatures** Core used to provide review/preview section by default which are now removed and need to be provided from countryconfig. The signature field definitions (e.g. informant signature, bride signature etc.) were hard coded in core which also have now been removed. The signatures can now be added through the review/preview sections defined in countryconfig just like any other field. You can use the following section definition as the default which is without any additional fields. We highly recommend checking out our reference country repository which has the signature fields in it's review/preview sections + +``` +{ + id: 'preview', + viewType: 'preview', + name: { + defaultMessage: 'Preview', + description: 'Form section name for Preview', + id: 'register.form.section.preview.name' + }, + title: { + defaultMessage: 'Preview', + description: 'Form section title for Preview', + id: 'register.form.section.preview.title' + }, + groups: [ + { + id: 'preview-view-group', + fields: [] + } + ] +} +``` + - Remove `splitView` option from DOCUMENT_UPLOADER_WITH_OPTION field - New required sections preview & review added. Signature field definitions are now part of these two sections same as normal form fields. - Remove `inputFieldWidth` from Number type form field - You can now configure the home screen application’s name and icons in your country configuration package as manifest.json and app icon files are moved from core to country config (check `src/client-static` folder) - Updated `allowedFileFormats` in signature fields to use MIME types (`image/png`, `image/jpg`, `image/jpeg`, `image/svg`) instead of simple file extensions. If you are already using the `allowedFileFormats` field in your implementation, please ensure to update the format accordingly. +- Remove unnecessary UI dividers that add in various sections of the declaration forms(e.g the Death, Birth and Marriage forms) [#244](https://github.com/opencrvs/opencrvs-countryconfig/pull/244) ### Bug fixes - Protect individual certificate endpoint with token - Kibana disk space alerts now work regardless of your disk device names. Alerts listen devices mounted both to `/` and `/data` (encrypted data partition) +- "Publish release" pipeline now correctly uses the "Branch to build from" value as the branch to be tagged. Previously it tried tagging "master". "Release tag" is also now used as the release version as is instead of it being read from `package.json`. - Environment creator script now requires countries to provide a Github token with no expiry date. This is to reduce effort in keeping the token up to date. +- Added the missing outputs for the clear environment workflow which was causing the seed data workflow to not run even if the reset option was checked when deploying ### New features - The select options in DOCUMENT_UPLOADER_WITH_OPTION field can now be hidden using the new `optionCondition` property. It works similarly to the same property available in SELECT_WITH_OPTIONS field -## 1.5.0 +* **ElasticSearch reindexing** Allows reindexing ElasticSearch via a new search-service endpoint `reindex`. We're replacing the original `ocrvs` index with timestamped ones. This is done automatically when upgrading and migrating, but this is an important architectural change that should be noted. More details in [#7033](https://github.com/opencrvs/opencrvs-core/pull/7033). + +- Introduce a new certificate handlebar "preview" which can be used to conditionally render some svg element when previewing the certificate e.g. background image similar to security paper + +- **Notification flags**: Added notification flags for `BIRTH`, `DEATH`, and `MARRIAGE` events, including: + + - `sent-notification` + - `sent-notification-for-review` + - `sent-for-approval` + - `registered` + - `sent-for-updates` + +- **`/record-notification` API**: Endpoint to check enabled notifications for records. The API returns the `notificationForRecord` object for `BIRTH` and `DEATH` events, listing their respective flags. Route configuration includes description and tags for API documentation. + +### New content keys requiring translation + +``` +INSERT CSV ROWS IN ENGLISH ONLY +``` + +## Bug fixes + +- Github pipeline dedicated for reading secrets and variables from other environments now checks if GH_TOKEN is still valid before attempting other operations +- Remove unnecessary UI dividers that add in various sections of the declaration forms(e.g the Death, Birth and Marriage forms) [#244](https://github.com/opencrvs/opencrvs-countryconfig/pull/244) + +## 1.5.0 (https://github.com/opencrvs/opencrvs-countryconfig/compare/v1.4.1...v1.5.0) ### Breaking changes diff --git a/src/api/application/application-config.ts b/src/api/application/application-config.ts index 064420aa4..5e972ba36 100644 --- a/src/api/application/application-config.ts +++ b/src/api/application/application-config.ts @@ -56,3 +56,34 @@ export const applicationConfig = { } export const COUNTRY_WIDE_CRUDE_DEATH_RATE = 10 + +type EventNotificationFlags = { + 'sent-notification'?: boolean + 'sent-notification-for-review'?: boolean + 'sent-for-approval'?: boolean + registered?: boolean + 'sent-for-updates'?: boolean +} + +type NotificationFlags = { + BIRTH?: EventNotificationFlags + DEATH?: EventNotificationFlags + MARRIAGE?: EventNotificationFlags +} + +export const notificationForRecord: NotificationFlags = { + BIRTH: { + 'sent-notification': true, + 'sent-notification-for-review': true, + 'sent-for-approval': true, + registered: true, + 'sent-for-updates': true + }, + DEATH: { + 'sent-notification': true, + 'sent-notification-for-review': true, + 'sent-for-approval': true, + registered: true, + 'sent-for-updates': true + } +} diff --git a/src/api/record-notification/handler.ts b/src/api/record-notification/handler.ts new file mode 100644 index 000000000..a10916e07 --- /dev/null +++ b/src/api/record-notification/handler.ts @@ -0,0 +1,9 @@ +import * as Hapi from '@hapi/hapi' +import { notificationForRecord } from '../application/application-config' + +export function recordNotificationHandler( + request: Hapi.Request, + h: Hapi.ResponseToolkit +) { + return h.response(notificationForRecord) +} diff --git a/src/form/addresses/index.ts b/src/form/addresses/index.ts index 6cdf5bf9a..36a61ca1f 100644 --- a/src/form/addresses/index.ts +++ b/src/form/addresses/index.ts @@ -95,7 +95,8 @@ export const defaultAddressConfiguration: IAddressConfiguration[] = [ }, { // MOTHER ADDRESS FIELDS - precedingFieldId: 'birth.mother.mother-view-group.mother-nid-seperator', + precedingFieldId: + 'birth.mother.mother-view-group.motherBirthRegistrationNumber', configurations: [ { config: AddressSubsections.PRIMARY_ADDRESS_SUBSECTION, @@ -119,7 +120,8 @@ export const defaultAddressConfiguration: IAddressConfiguration[] = [ }, { // FATHER ADDRESS FIELDS - precedingFieldId: 'birth.father.father-view-group.father-nid-seperator', + precedingFieldId: + 'birth.father.father-view-group.fatherBirthRegistrationNumber', configurations: [ { config: AddressSubsections.PRIMARY_ADDRESS_SUBSECTION, @@ -272,7 +274,8 @@ export const defaultAddressConfiguration: IAddressConfiguration[] = [ },*/ { // SPOUSE ADDRESS FIELDS - precedingFieldId: 'death.spouse.spouse-view-group.spouse-nid-seperator', + precedingFieldId: + 'death.spouse.spouse-view-group.spouseBirthRegistrationNumber', configurations: [ { config: AddressSubsections.PRIMARY_ADDRESS_SUBSECTION, @@ -311,7 +314,7 @@ export const defaultAddressConfiguration: IAddressConfiguration[] = [ { // PLACE OF MARRIAGE ADDRESS FIELDS precedingFieldId: - 'marriage.marriageEvent.marriage-event-details.place-of-marriage-seperator', + 'marriage.marriageEvent.marriage-event-details.placeOfMarriageTitle', configurations: [{ config: EventLocationAddressCases.PLACE_OF_MARRIAGE }] }, { diff --git a/src/form/birth/index.ts b/src/form/birth/index.ts index c89e43ad7..54b7fc512 100644 --- a/src/form/birth/index.ts +++ b/src/form/birth/index.ts @@ -354,8 +354,6 @@ export const birthForm: ISerializedForm = { hideIfNidIntegrationEnabled.concat(detailsExist), true ), - // preceding field of address fields - divider('mother-nid-seperator', detailsExist), // ADDRESS FIELDS WILL RENDER HERE divider('mother-address-seperator', detailsExist), getMaritalStatus(certificateHandlebars.motherMaritalStatus, [ @@ -443,8 +441,6 @@ export const birthForm: ISerializedForm = { hideIfNidIntegrationEnabled.concat(detailsExist), true ), - // preceding field of address fields - divider('father-nid-seperator', detailsExist), // ADDRESS FIELDS WILL RENDER HERE divider('father-address-seperator', [ ...detailsExist, diff --git a/src/form/death/index.ts b/src/form/death/index.ts index e10cba78b..2264e6a13 100644 --- a/src/form/death/index.ts +++ b/src/form/death/index.ts @@ -365,11 +365,6 @@ export const deathForm = { ), getIDType('death', 'spouse', detailsExist, true), ...getIDNumberFields('spouse', detailsExist, true), - // preceding field of address fields - divider('spouse-nid-seperator', [ - ...detailsExist, - ...hideIfDeceasedAddressNotAvailable - ]), // ADDRESS FIELDS WILL RENDER HERE divider( 'spouse-address-separator', diff --git a/src/form/marriage/index.ts b/src/form/marriage/index.ts index 3b77628e5..1892e2dff 100644 --- a/src/form/marriage/index.ts +++ b/src/form/marriage/index.ts @@ -264,8 +264,7 @@ export const marriageForm: ISerializedForm = { fields: [ getMarriageDate, // Required field getTypeOfMarriage, - placeOfMarriageSubsection, - divider('place-of-marriage-seperator') + placeOfMarriageSubsection // PLACE OF MARRIAGE FIELDS WILL RENDER HERE ] } diff --git a/src/index.ts b/src/index.ts index 3114d0daf..68792645a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -62,6 +62,7 @@ import { trackingIDHandler } from './api/tracking-id/handler' import { dashboardQueriesHandler } from './api/dashboards/handler' import { fontsHandler } from './api/fonts/handler' import { certificateConfigurationHandler } from './api/certificate-configuration/handler' +import { recordNotificationHandler } from './api/record-notification/handler' export interface ITokenPayload { sub: string @@ -546,6 +547,16 @@ export async function createServer() { } }) + server.route({ + method: 'GET', + path: '/record-notification', + handler: recordNotificationHandler, + options: { + tags: ['api'], + description: 'Checks for enabled notification for record' + } + }) + server.ext({ type: 'onRequest', method(request: Hapi.Request & { sentryScope?: any }, h) {