Skip to content

Commit

Permalink
Merge branch 'release-v1.6.0' of github.com:opencrvs/opencrvs-country…
Browse files Browse the repository at this point in the history
…config into release-v1.6.0
  • Loading branch information
Zangetsu101 committed Sep 20, 2024
2 parents acffd03 + b3720ae commit 044db55
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 28 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/clear-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
environment:
required: true
type: string
outputs:
outcome:
value: ${{ jobs.reset-data.outputs.outcome }}
workflow_dispatch:
inputs:
environment:
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -82,4 +81,5 @@ jobs:
type: now
from_branch: master
target_branch: develop
message: Merge master back to develop
github_token: ${{ secrets.GITHUB_TOKEN }}
60 changes: 59 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
31 changes: 31 additions & 0 deletions src/api/application/application-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
9 changes: 9 additions & 0 deletions src/api/record-notification/handler.ts
Original file line number Diff line number Diff line change
@@ -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)
}
11 changes: 7 additions & 4 deletions src/form/addresses/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 }]
},
{
Expand Down
4 changes: 0 additions & 4 deletions src/form/birth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, [
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions src/form/death/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 1 addition & 2 deletions src/form/marriage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
}
Expand Down
11 changes: 11 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 044db55

Please sign in to comment.