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

Release v1.6.2 #8149

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
36b9d83
feat: Add 6th level support for addresses
tumbledwyer Dec 2, 2024
4368528
start release 1.6.2
rikukissa Dec 4, 2024
f51defd
Set node options and initialise elastic index in setup script
euanmillar Dec 4, 2024
020b2c0
remove elastic index creation
euanmillar Dec 4, 2024
5c54bc3
Merge pull request #8167 from opencrvs/auto-pr-release-v1.6.2-8158-13974
euanmillar Dec 6, 2024
edf056f
Fix conflict in yarn lock
euanmillar Nov 19, 2024
db54568
Refactor approach to sending files from workflow to documents
euanmillar Nov 20, 2024
bbfb844
Fixed test
euanmillar Nov 20, 2024
32fe714
Revert mistaken removal of response code
euanmillar Nov 20, 2024
345d887
renamed method
euanmillar Dec 4, 2024
7ee3db7
Affidavt is not an SVG
euanmillar Dec 6, 2024
0fda0af
Apply suggestions from code review
rikukissa Dec 9, 2024
8c8b46b
Merge pull request #8170 from opencrvs/auto-pr-release-v1.6.2-8010-80
euanmillar Dec 9, 2024
46b93f9
Revert "🍒 Merge changes from PR #8010 to release-v1.6.2"
euanmillar Dec 9, 2024
595c3c9
Merge pull request #8171 from opencrvs/revert-8170-auto-pr-release-v1…
euanmillar Dec 9, 2024
364fb9f
Merge branch 'release-v1.6.1' into release-v1.6.2
rikukissa Dec 10, 2024
42ec9b7
Merge pull request #8121 from opencrvs/ocrvs-6956-add-6th-level
tumbledwyer Dec 17, 2024
d718cb8
Update changelog
tumbledwyer Sep 26, 2024
5e9b117
Modify location builder so it does not edit health facilities
tumbledwyer Sep 26, 2024
5650586
fix: only revalidate with updated values
Zangetsu101 Dec 11, 2024
8351c6f
docs: update CHANGELOG
Zangetsu101 Dec 24, 2024
cb78f23
Merge pull request #8254 from opencrvs/auto-pr-release-v1.6.2-8193-2867
Zangetsu101 Dec 24, 2024
22834e1
fix(v1.6.2): handle unexpected state when a record is viewed before r…
ocrvs-bot Jan 9, 2025
d51c562
docs: update CHANGELOG
Zangetsu101 Jan 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 19 additions & 38 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,29 @@
# Changelog

## 1.6.1
## [1.6.2](https://github.com/opencrvs/opencrvs-core/compare/v1.6.1...v1.6.2)

### Bug fixes

- Maximum upload file size limit is now based on the size of the uploaded files after compression and not before. [#7840](https://github.com/opencrvs/opencrvs-core/issues/7840)
- Stops local sys admins creating national level users. [#7698](https://github.com/opencrvs/opencrvs-core/issues/7698)

### New features

- Add an optional configurable field in section `canContinue` which takes an expression. Falsy value of this expression will disable the continue button in forms. This can be used to work with fetch field which has a loading state and prevent the user to get past the section while the request is still in progress.
- Fix task history getting corrupted if a user views a record while it's in external validation [#8278](https://github.com/opencrvs/opencrvs-core/issues/8278)
- Fix health facilities missing from dropdown after correcting a record address [#7528](https://github.com/opencrvs/opencrvs-core/issues/7528)
- Fix stale validations showing for document uploader with options form field

## [1.6.0](https://github.com/opencrvs/opencrvs-core/compare/v1.5.1...v1.6.0)
### Improvements

#### ElasticSearch reindexing
- Support for 6th administrative level

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).
## [1.6.1](https://github.com/opencrvs/opencrvs-core/compare/v1.6.0...v1.6.1)

- 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
### Bug fixes

### Improvements
- Maximum upload file size limit is now based on the size of the uploaded files after compression and not before. [#7840](https://github.com/opencrvs/opencrvs-core/issues/7840)
- Stops local sys admins creating national level users. [#7698](https://github.com/opencrvs/opencrvs-core/issues/7698)

- Internally we were storing the `family` name field as a required property which was limiting what how you could capture the name of a person in the forms. Now we are storing it as an optional property which would make more flexible.
- Remove the leftover features from the application config pages, such as certificates and informant notification. [#7156](https://github.com/opencrvs/opencrvs-core/issues/7156)
- **PDF page size** The generated PDF used to be defaulted to A4 size. Now it respects the SVG dimensions if specified
- Support html content wrapped in `foreignObject` used in svg template in certificate PDF output
### New features

## Bug fixes
- Add an optional configurable field in section `canContinue` which takes an expression. Falsy value of this expression will disable the continue button in forms. This can be used to work with fetch field which has a loading state and prevent the user to get past the section while the request is still in progress.

- Custom form field validators from country config will work offline. [#7478](https://github.com/opencrvs/opencrvs-core/issues/7478)
- Registrar had to retry from outbox every time they corrected a record. [#7583](https://github.com/opencrvs/opencrvs-core/issues/7583)
- Local environment setup command (`bash setup.sh`) could fail in machines that didn't have a unrelated `compose` binary. Fixed to check for Docker Compose. [#7609](https://github.com/opencrvs/opencrvs-core/pull/7609)
- Fix date validation not working correctly in Firefox [#7615](https://github.com/opencrvs/opencrvs-core/issues/7615)
- Fix layout issue that was causing the edit button on the AdvancedSearch's date range picker to not show on mobile view. [#7417](https://github.com/opencrvs/opencrvs-core/issues/7417)
- Fix hardcoded placeholder copy of input when saving a query in advanced search
- Handle label params used in form inputs when rendering in action details modal
- Fix health facilities missing from dropdown after correcting a record address [#7528](https://github.com/opencrvs/opencrvs-core/issues/7528)
- "Choose a new password" form now allows the user to submit the form using the "Enter/Return" key [#5502](https://github.com/opencrvs/opencrvs-core/issues/5502)
- Dropdown options now flow to multiple rows in forms [#7653](https://github.com/opencrvs/opencrvs-core/pull/7653)
- Only render units/postfix when field has a value [#7055](https://github.com/opencrvs/opencrvs-core/issues/7055)
- Only show items with values in review [#5192](https://github.com/opencrvs/opencrvs-core/pull/5192)
- Fix prefix text overlap issue in form text inputs
- **Staged files getting reset on precommit hook failure** We were running lint-staged separately on each package using lerna which potentially created a race condition causing staged changes to get lost on failure. Now we are running lint-staged directly without depending on lerna. **_This is purely a DX improvement without affecting any functionality of the system_**
- Fix `informantType` missing in template object which prevented rendering informant relationship data in the certificates [#5952](https://github.com/opencrvs/opencrvs-core/issues/5952)
- Fix users hitting rate limit when multiple users authenticated the same time with different usernames [#7728](https://github.com/opencrvs/opencrvs-core/issues/7728)
## [1.6.0](https://github.com/opencrvs/opencrvs-core/compare/v1.5.1...v1.6.0)

### Breaking changes

Expand Down Expand Up @@ -106,6 +86,11 @@ Allows reindexing ElasticSearch via a new search-service endpoint `reindex`. We'
- **Staged files getting reset on precommit hook failure** We were running lint-staged separately on each package using lerna which potentially created a race condition causing staged changes to get lost on failure. Now we are running lint-staged directly without depending on lerna. **_This is purely a DX improvement without affecting any functionality of the system_**
- Fix `informantType` missing in template object which prevented rendering informant relationship data in the certificates [#5952](https://github.com/opencrvs/opencrvs-core/issues/5952)
- Fix users hitting rate limit when multiple users authenticated the same time with different usernames [#7728](https://github.com/opencrvs/opencrvs-core/issues/7728)
- "Choose a new password" form now allows the user to submit the form using the "Enter/Return" key [#5502](https://github.com/opencrvs/opencrvs-core/issues/5502)
- Dropdown options now flow to multiple rows in forms [#7653](https://github.com/opencrvs/opencrvs-core/pull/7653)
- Only render units/postfix when field has a value [#7055](https://github.com/opencrvs/opencrvs-core/issues/7055)
- Only show items with values in review [#5192](https://github.com/opencrvs/opencrvs-core/pull/5192)
- Fix prefix text overlap issue in form text inputs

## 1.5.1

Expand Down Expand Up @@ -153,11 +138,7 @@ Allows reindexing ElasticSearch via a new search-service endpoint `reindex`. We'
- **Set Metabase default credentials.** These must be configured via countryconfig repository environment variables and secrets otherwise the dashboard service won't start: OPENCRVS_METABASE_ADMIN_EMAIL & OPENCRVS_METABASE_ADMIN_PASSWORD
- **Check your Metabase map file.** For Metabase configuration, we renamed `farajaland-map.geojson` to `map.geojson` to not tie implementations into example country naming conventions.
- **Feature flags** In order to make application config settings more readable, we re-organised `src/api/application/application-config-default.ts` with a clear feature flag block like so. These are then used across the front and back end of the application to control configurable functionality. New feature flags DEATH_REGISTRATION allow you to optionally run off death registration if your country doesnt want to run its first pilot including death and PRINT_DECLARATION (see New Features) have been added.
`FEATURES: {
DEATH_REGISTRATION: true,
MARRIAGE_REGISTRATION: false,
...
} `
`FEATURES: { DEATH_REGISTRATION: true, MARRIAGE_REGISTRATION: false, ... } `
- **Improve rendering of addresses in review page where addresses match** When entering father's address details, some countries make use of a checkbox which says "Address is the same as the mothers. " which, when selected, makes the mother's address and fathers address the same. The checkbox has a programatic value of "Yes" or "No". As a result on the review page, the value "Yes" was displayed which didn't make grammatical sense as a response. We decided to use a custom label: "Same as mother's", which is what was asked on the form. This requires some code changes in the src/form/addresses/index.ts file to pull in the `hideInPreview` prop which will hide the value "Yes" on the review page and replace with a content managed label. Associated bug [#5086](https://github.com/opencrvs/opencrvs-core/issues/5086)

### Infrastructure breaking changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"description": "OpenCRVS core workspace",
"license": "MPL-2.0",
"version": "1.6.1",
"version": "1.6.2",
"private": true,
"os": [
"darwin",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencrvs/auth",
"version": "1.6.1",
"version": "1.6.2",
"description": "OpenCRVS authentication service",
"license": "MPL-2.0",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencrvs/client",
"version": "1.6.1",
"version": "1.6.2",
"description": "OpenCRVS client application",
"license": "MPL-2.0",
"private": true,
Expand Down
16 changes: 13 additions & 3 deletions packages/client/src/components/form/FormFieldGenerator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ type GeneratedInputFieldProps = {
disabled?: boolean
onUploadingStateChanged?: (isUploading: boolean) => void
requiredErrorMessage?: MessageDescriptor
setFieldTouched: (name: string, isTouched?: boolean) => void
setFieldTouched: FormikProps<IFormSectionData>['setFieldTouched']
} & Omit<IDispatchProps, 'writeDeclaration'>

const GeneratedInputField = React.memo<GeneratedInputFieldProps>(
Expand Down Expand Up @@ -280,8 +280,18 @@ const GeneratedInputField = React.memo<GeneratedInputFieldProps>(
extraValue={fieldDefinition.extraValue || ''}
hideOnEmptyOption={fieldDefinition.hideOnEmptyOption}
onComplete={(files: IFileValue[]) => {
/*
* calling both setFieldTouched and setFieldValue causes the validate
* function to be called twice, once with the stale values (due to
* setFieldTouched) and the other with the updated values (due to
* setFieldValue). So if setFieldTouched is called after
* setFieldValue then wrong validations are shown due to the stale
* values. We can prevent that by supplying shouldRevalidate =
* false to the setFieldTouch function or calling it before
* calling setFieldValue.
*/
setFieldTouched(fieldDefinition.name, true, false)
setFieldValue(fieldDefinition.name, files)
setFieldTouched && setFieldTouched(fieldDefinition.name, true)
}}
compressImagesToSizeMB={fieldDefinition.compressImagesToSizeMB}
maxSizeMB={fieldDefinition.maxSizeMB}
Expand All @@ -302,7 +312,7 @@ const GeneratedInputField = React.memo<GeneratedInputFieldProps>(
files={value as IAttachmentValue}
error={error}
onComplete={(file) => {
setFieldTouched && setFieldTouched(fieldDefinition.name, true)
setFieldTouched(fieldDefinition.name, true, false)
setFieldValue(fieldDefinition.name, file)
}}
onUploadingStateChanged={onUploadingStateChanged}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ const getDefaultAddressLines = (): string[] => [
'',
'',
'',
'',
''
] // lines must be available as empty strings for GraphQL to parse all options

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@ enum SupportedFacilityFHIRProp {
locationLevel3 = 'locationLevel3',
locationLevel4 = 'locationLevel4',
locationLevel5 = 'locationLevel5',
locationLevel6 = 'locationLevel6',
district = 'district',
state = 'state',
country = 'country'
Expand Down
1 change: 1 addition & 0 deletions packages/client/src/profile/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const ADVANCED_SEARCH_PARAM_FIELDS = gql`
eventLocationLevel3
eventLocationLevel4
eventLocationLevel5
eventLocationLevel6
childFirstNames
childLastName
childDoB
Expand Down
2 changes: 2 additions & 0 deletions packages/client/src/search/advancedSearch/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type IAdvancedSearchParamState = {
eventLocationLevel3?: string
eventLocationLevel4?: string
eventLocationLevel5?: string
eventLocationLevel6?: string
childFirstNames?: string
childLastName?: string
childDoB?: string
Expand Down Expand Up @@ -82,6 +83,7 @@ export const advancedSearchInitialState: IAdvancedSearchParamState = {
eventLocationLevel3: '',
eventLocationLevel4: '',
eventLocationLevel5: '',
eventLocationLevel6: '',
childFirstNames: '',
childLastName: '',
childDoB: '',
Expand Down
2 changes: 2 additions & 0 deletions packages/client/src/search/advancedSearch/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const baseKeysSameAsStore = [
'eventLocationLevel3',
'eventLocationLevel4',
'eventLocationLevel5',
'eventLocationLevel6',
'childFirstNames',
'childLastName',
'childGender',
Expand Down Expand Up @@ -111,6 +112,7 @@ export interface IAdvancedSearchFormState {
eventLocationLevel3?: string
eventLocationLevel4?: string
eventLocationLevel5?: string
eventLocationLevel6?: string
childFirstNames?: string
childLastName?: string
childDoB?: IDateRangePickerValue
Expand Down
2 changes: 2 additions & 0 deletions packages/client/src/tests/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type AdvancedSeachParameters {
eventLocationLevel3: String
eventLocationLevel4: String
eventLocationLevel5: String
eventLocationLevel6: String
childFirstNames: String
childLastName: String
childDoB: String
Expand Down Expand Up @@ -141,6 +142,7 @@ input AdvancedSearchParametersInput {
eventLocationLevel3: String
eventLocationLevel4: String
eventLocationLevel5: String
eventLocationLevel6: String
childFirstNames: String
childLastName: String
childDoB: String
Expand Down
4 changes: 4 additions & 0 deletions packages/client/src/utils/locationUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,11 @@ export function generateFullAddress(
const eventLocationLevel5 =
address?.line?.[12] && offlineData.locations[address.line[12]]?.name

const eventLocationLevel6 =
address?.line?.[13] && offlineData.locations[address.line[13]]?.name

return [
eventLocationLevel6,
eventLocationLevel5,
eventLocationLevel4,
eventLocationLevel3,
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencrvs/commons",
"version": "1.6.1",
"version": "1.6.2",
"description": "OpenCRVS common modules and utils",
"license": "MPL-2.0",
"main": "./build/dist/index.js",
Expand Down
4 changes: 4 additions & 0 deletions packages/commons/src/fhir/location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,7 @@ export function isHealthFacility(
): location is HealthFacility {
return location.type?.coding?.[0].code === 'HEALTH_FACILITY'
}

export function getLocationType(location: Location): string | undefined {
return location.type?.coding?.[0].code
}
131 changes: 130 additions & 1 deletion packages/commons/src/fhir/transformers/fhir-builders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,19 @@ import {
findExtension,
isTask,
taskBundleWithExtension,
updateFHIRTaskBundle
updateFHIRTaskBundle,
updateFHIRBundle,
Bundle,
Location,
Encounter,
BundleEntry,
getLocationType
} from '..'

import * as fetchMock from 'jest-fetch-mock'

import { DeathRegistration } from './input'
import { UUID } from 'src/uuid'

const fetch = fetchMock as fetchMock.FetchMock

Expand Down Expand Up @@ -445,3 +452,125 @@ describe('taskBundleWithExtension()', () => {
)
})
})

describe('updateFhirBundle', () => {
describe('when the type of a location is changed from HEALTH_FACILITY to another type', () => {
const facilityId = 'TestFacility1'
const encounterId = 'Encounter1'

const bundle = {
resourceType: 'Bundle',
type: 'document',
entry: [
{
resource: {
resourceType: 'Composition',
title: 'Birth Declaration',
section: [
{
title: 'Birth encounter',
code: {
coding: [
{
system: 'http://opencrvs.org/specs/sections',
code: 'birth-encounter'
}
],
text: 'Birth encounter'
},
entry: [
{
reference: `Encounter/${encounterId}`
}
]
}
],
id: 'Composition1'
}
},
{
resource: {
resourceType: 'Encounter',
status: 'finished',
id: encounterId as UUID,
location: [
{
location: {
reference: `Location/${facilityId}` as ResourceIdentifier
}
}
]
}
} as BundleEntry<Encounter>,
{
resource: {
resourceType: 'Location',
name: 'My Test Facility',
type: {
coding: [
{
system: 'http://opencrvs.org/specs/location-type',
code: 'HEALTH_FACILITY'
}
]
},
id: facilityId
}
}
]
} as Bundle

const updatedBundle = updateFHIRBundle(
bundle,
{
eventLocation: {
address: {
country: 'FAR',
state: 'State1',
district: 'District1',
city: 'City1',
postalCode: 'Code1',
line: ['line1', 'line2', 'line3', 'line4'],
partOf: 'Dictrict1'
},
type: 'PRIVATE_HOME'
}
},
'BIRTH' as EVENT_TYPE
)

const encounter = updatedBundle.entry.find(
(e) => e.resource.resourceType === 'Encounter'
) as BundleEntry<Encounter>

const encounterLocationreference =
encounter.resource.location![0].location?.reference

const originalFacility = updatedBundle.entry.find(
(e) => e.resource.id === facilityId
)! as BundleEntry<Location>

const newLocation = updatedBundle.entry.find(
(e) =>
e.resource.resourceType === 'Location' && e.resource.id !== facilityId
) as BundleEntry<Location>

const locations = updatedBundle.entry.filter(
(entry) => entry.resource.resourceType === 'Location'
)

it('should create a new location', () => {
expect(locations.length).toEqual(2)
expect(encounterLocationreference).toEqual(newLocation.fullUrl)
expect(getLocationType(newLocation.resource)).toEqual('PRIVATE_HOME')
expect(newLocation.resource.address).not.toBeUndefined()
})

it('should not edit the original facility', () => {
expect(getLocationType(originalFacility.resource)).toEqual(
'HEALTH_FACILITY'
)
expect(originalFacility.resource.address).toBeUndefined()
})
})
})
Loading
Loading