Skip to content

Commit

Permalink
Merge pull request #6182 from opencrvs/release-v1.3.2
Browse files Browse the repository at this point in the history
Hotfix v1.3.2
  • Loading branch information
rikukissa authored Jan 9, 2024
2 parents 6bae418 + 91ece60 commit eb7d3c6
Show file tree
Hide file tree
Showing 48 changed files with 483 additions and 263 deletions.
57 changes: 57 additions & 0 deletions .github/DISCUSSION_TEMPLATE/Installation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
title: 'Installation'
body:
- type: markdown
attributes:
value: |
## Explain the issue & help you require
## What git branch are you on in Core?
## What git branch are you on in Countryconfig?
If we are unable to help you here we can offer dedicated support.
Email us at team@opencrvs.org and please answer the following questions:
Please tell us your full name and how you wish to be referred to.
Please tell us the name of the organisation or company you work for.
Are you working with a government on an active country implementation? If so, ...
Which country’s implementation are you working on?
Tell us about your project, brief, the client and timeline if you can?
- type: input
id: core-version
attributes:
label: OpenCRVS Core version
description: e.g 1.3.2
validations:
required: true
- type: input
id: countryconfig-version
attributes:
label: OpenCRVS Countryconfig version
description: e.g 1.3.2
validations:
required: true
- type: input
id: os
attributes:
label: Your operating system and version
description: e.g Ubuntu 22.04
validations:
required: true
- type: input
id: node
attributes:
label: Your node version
description: e.g v16.20.0
validations:
required: true
- type: checkboxes
attributes:
label: Which of these describes your project best?
options:
- label: Testing OpenCRVS for business development, educational purposes or for personal interest.
- label: A research project to evaluate, configure and test OpenCRVS as a possible solution for a government, an active brief or proposal.
- label: Actively installing and configuring OpenCRVS Core for production use in a country.
- label: Customising OpenCRVS Core code in production in a country
validations:
required: true
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/---bug.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: "\U0001F479 Bug"
name: 'Bug'
about: Used to submit bugs and things that appear broken.
title: ''
labels: "\U0001F479Bug"
labels: 'Bug'
assignees: ''
---

Expand Down
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/---feature.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: "\U0001F680 Feature"
name: 'Feature'
about: Used to suggest something that you wish OpenCRVS could do
title: ''
labels: "☕️ Discussion"
labels: 'Feature'
assignees: ''

---

## 🚀 Feature
Expand Down
34 changes: 0 additions & 34 deletions .github/ISSUE_TEMPLATE/epic.md

This file was deleted.

25 changes: 0 additions & 25 deletions .github/ISSUE_TEMPLATE/user-story.md

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ services:
- NODE_ENV=development
- NOTIFICATION_SERVICE_URL=http://notification:2020/
- USER_MANAGEMENT_URL=http://user-mgnt:3030/
- RESOURCE_SERVICE_URL=http://countryconfig:3040/
- COUNTRY_CONFIG_URL=http://countryconfig:3040
- HEARTH_URL=http://hearth:3447/fhir
- OPENHIM_URL=http://openhim-core:5001
- APPLICATION_CONFIG_URL=http://config:2021/
Expand Down
1 change: 1 addition & 0 deletions license-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"ignore": [
"**/*.@(editorconfig|md|log|lock|patch|prettierrc|gitignore|eslintignore|stylelintrc|csv|gz|geojson|woff2|woff|xml|yarnrc|yarn-integrity|ttf|map|pdf|snap|dockerignore|jsonc|idea|env|info|key|pub|cjs|sql)",
".git",
".github/DISCUSSION_TEMPLATE/Installation.yml",
".idea",
"**/patches",
".secrets",
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.3.1",
"version": "1.3.2",
"private": true,
"workspaces": [
"packages/*"
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.3.1",
"version": "1.3.2",
"description": "OpenCRVS authentication service",
"license": "MPL-2.0",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/features/authenticate/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export async function generateAndSendVerificationCode(
mobile?: string,
email?: string
) {
const isDemoUser = scope.indexOf('demo') > -1
const isDemoUser = scope.indexOf('demo') > -1 || QA_ENV
logger.info(
`isDemoUser,
${JSON.stringify({
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.3.1",
"version": "1.3.2",
"description": "OpenCRVS client application",
"license": "MPL-2.0",
"private": true,
Expand Down
23 changes: 18 additions & 5 deletions packages/client/src/components/form/ReviewActionComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ interface IReviewActionProps extends React.HTMLAttributes<HTMLDivElement> {
id?: string
draftDeclaration?: boolean
completeDeclaration: boolean
hasErrorsOnFields?: boolean
totalFileSizeExceeded: boolean
declarationToBeValidated?: boolean
declarationToBeRegistered?: boolean
Expand Down Expand Up @@ -103,7 +104,12 @@ enum ACTION {
DECLARATION_TO_BE_REGISTERED = 'DECLARATION_TO_BE_REGISTERED'
}

const ACTION_TO_CONTENT_MAP: { [key: string]: any } = {
const ACTION_TO_CONTENT_MAP_SKELETON: (
deliveryMethod: string,
hasErrorsOnFields: boolean
) => {
[key: string]: any
} = (deliveryMethod, hasErrorsOnFields) => ({
[String(ACTION.DECLARATION_TO_BE_DECLARED)]: {
draftStatus: {
true: {
Expand Down Expand Up @@ -137,7 +143,9 @@ const ACTION_TO_CONTENT_MAP: { [key: string]: any } = {
payload: { completeDeclaration: false }
},
description: {
message: messages.reviewActionDescriptionIncomplete,
message: !hasErrorsOnFields
? messages.reviewActionDescriptionIncomplete
: messages.reviewActionDescriptionForErrors,
payload: {
deliveryMethod:
window.config.INFORMANT_NOTIFICATION_DELIVERY_METHOD
Expand Down Expand Up @@ -283,7 +291,7 @@ const ACTION_TO_CONTENT_MAP: { [key: string]: any } = {
}
}
}
}
})

interface IReviewActionState {
showSubmitModal: boolean
Expand All @@ -310,8 +318,13 @@ class ReviewActionComponent extends React.Component<
submitDeclarationAction,
draftDeclaration,
rejectDeclarationAction,
intl
intl,
hasErrorsOnFields
} = this.props
const ACTION_TO_CONTENT_MAP = ACTION_TO_CONTENT_MAP_SKELETON(
window.config.INFORMANT_NOTIFICATION_DELIVERY_METHOD,
!!hasErrorsOnFields
)

const background = !completeDeclaration
? 'error'
Expand Down Expand Up @@ -377,7 +390,7 @@ class ReviewActionComponent extends React.Component<
size="large"
id="submit_form"
onClick={this.toggleSubmitModalOpen}
disabled={totalFileSizeExceeded}
disabled={hasErrorsOnFields || totalFileSizeExceeded}
>
<Upload />
{intl.formatMessage(
Expand Down
11 changes: 7 additions & 4 deletions packages/client/src/forms/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ const getValidationErrors = {
values: IFormSectionData,
offlineCountryConfig?: IOfflineData,
drafts?: IFormData,
requiredErrorMessage?: MessageDescriptor
requiredErrorMessage?: MessageDescriptor,
checkValidationErrorsOnly?: boolean
) {
const value =
field.nestedFields && values[field.name]
Expand All @@ -66,7 +67,7 @@ const getValidationErrors = {

validators.push(...getFieldValidation(field as IDynamicFormField, values))

if (field.required) {
if (field.required && !checkValidationErrorsOnly) {
validators.push(required(requiredErrorMessage))
} else if (field.validateEmpty) {
} else if (!value && value !== 0) {
Expand Down Expand Up @@ -127,7 +128,8 @@ export function getValidationErrorsForForm(
values: IFormSectionData,
resource?: IOfflineData,
drafts?: IFormData,
requiredErrorMessage?: MessageDescriptor
requiredErrorMessage?: MessageDescriptor,
checkValidationErrorsOnly?: boolean
) {
return fields.reduce(
(errorsForAllFields: Errors, field) =>
Expand All @@ -141,7 +143,8 @@ export function getValidationErrorsForForm(
values,
resource,
drafts,
requiredErrorMessage
requiredErrorMessage,
checkValidationErrorsOnly
)
},
{}
Expand Down
9 changes: 8 additions & 1 deletion packages/client/src/i18n/messages/views/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,18 @@ const messagesToDefine = {
},
reviewActionDescriptionIncomplete: {
defaultMessage:
'By sending this incomplete declaration, there will be a digital record made.\n\nTell the informant that they will receive an {deliveryMethod} with a tracking ID. They will need this to complete the declaration at a registration office within 30 days. The informant will need to provide all mandatory information before the {eventType, select, birth {birth declaration} death {death declaration}} can be registered.',
'The informant will receive an {deliveryMethod} with a tracking ID that they can use to provide the additional mandatory information required for registration.',
description:
'Description for review action component when incomplete declaration',
id: 'review.actions.description.confirmInComplete'
},
reviewActionDescriptionForErrors: {
defaultMessage:
'Please ensure all fields are either empty or have a valid value in them.',
description:
'Description for review action component when declaration has errors on fields',
id: 'review.actions.description.hasError'
},
reviewActionTitle: {
defaultMessage:
'Declaration {completeDeclaration, select, true {complete} false {incomplete}}',
Expand Down
3 changes: 3 additions & 0 deletions packages/client/src/i18n/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ const getNextMessages = (
language: string,
languages: ILanguageState
): IntlMessages => {
if (!languages[language]) {
return languages[getDefaultLanguage()].messages
}
return languages[language].messages
}

Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/tests/util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ export const mockDeathDeclarationData = {
registrationEmail: 'sesrthsthsr@sdfsgt.com',
informantIdType: 'NATIONAL_ID',
iDType: 'NATIONAL_ID',
informantID: '1230000000000',
informantID: '123456789',
informantFirstNames: '',
informantFamilyName: 'ইসলাম',
informantFirstNamesEng: 'Islam',
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ export const DESKTOP_TIME_OUT_MILLISECONDS = 900000
export const INFORMANT_MINIMUM_AGE = 16

/** Current application version used in the left navigation. It's saved to localStorage to determine if a user logged into a newer version of the app for the first time */
export const APPLICATION_VERSION = 'v1.3.1'
export const APPLICATION_VERSION = 'v1.3.2'
export const IS_PROD_ENVIRONMENT = import.meta.env.PROD
18 changes: 1 addition & 17 deletions packages/client/src/utils/persistence/persistenceMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ import {
NATL_ADMIN_ROLES
} from '@client/utils/constants'
import { client } from '@client/utils/apolloClient'
import { READY } from '@client/offline/actions'
import startOfMonth from 'date-fns/startOfMonth'
import subMonths from 'date-fns/subMonths'
import { QueryOptions } from '@apollo/client'
import { QueryOptions } from '@apollo/client/core'

const isUserOfNationalScope = (userDetails: UserDetails) =>
[...NATIONAL_REGISTRAR_ROLES, ...NATL_ADMIN_ROLES].includes(
Expand Down Expand Up @@ -109,20 +108,5 @@ export const persistenceMiddleware: Middleware<{}, IStoreState> =
client.query(query)
}
}
} else if (action.type === READY) {
const { locations } = getState().offline.offlineData
const userDetails = getState().profile.userDetails
if (!isFieldAgent(userDetails!)) {
const stateIds = Object.values(locations!)
.filter((location) => location.partOf === 'Location/0')
.map((location) => location.id)

for (const stateId of stateIds) {
const queriesToPrefetch = getQueriesToPrefetch(stateId, false)
for (const query of queriesToPrefetch) {
client.query(query)
}
}
}
}
}
Loading

0 comments on commit eb7d3c6

Please sign in to comment.