Skip to content

Commit

Permalink
Release v1.3.1 (#6183)
Browse files Browse the repository at this point in the history
* Bump release number

* Hotfix v1.2.1 (#5139)

* Bump hotfix version

* Informant address has nullable fields causing GraphQL error (#5138)

* 4750 Fix local - international - local phone number transformations (#5143)

* 4750 Fix local - international - local phone number transformations for all countries

* Restore country-data dependency to login app

* Force disk encryption (#5144)

* Add informant type handlebar and localise handlebars (#5140)

* Add informant type handlebar and localise all message descriptors in cert

* Fix test

* Fix certificate preview

* Combine approaches to localisation of certs

* Fixed PDFUtils test

* Bump hotfix release number

* Show correct button for certified declarations (#6041)

* ocrvs 5795 - search by email (#5872)

* email add for ui in search

* contactEmail add in gateway and search query

* search with email update

* rename contact relation for search

* rename elastic field in migration

* search result test fix

* form field condition add for email

* search migration func name update

* swap params of rename func of search

* ocrvs-6063 query validation for location endpoint (#6076)

* Validate location search query params

* Pass the type parameter to location query

* Restrict locationId param to a valid uuid

* Remove empty braces

* Ocrvs 5793 Cameroon improvements (#6054)

* Add separate validator dateNotPastLimit

* Minor tweak masking strategy in login two step to avoid text overflow

* Fixed select placeholder french lang (#5576)

* change how alive ES connection is detected

* one more check to see if elastic is connected

* improve ping endpoint in gateway to give out all statuses of all services

* remove old query validation from ping endpoint

* Add past date validation in child birth date

* use process env DOMAIN as sentry environment so it doesnt get populated with docker containers id

* add sourcemaps to build

* Fixed failed test for health check

* Remove unused import

---------

Co-authored-by: Sadman Anik <36187489+sadmananik@users.noreply.github.com>
Co-authored-by: Riku Rouvila <riku.rouvila@gmail.com>
Co-authored-by: Sadman Anik <sadman.anik@dsinnovators.com>

* Ocrvs 6021 - in progress declaration data fix  (#6050)

* unnecessary import fix

* original data set only for registered declaration

* Ocrvs 5794 - configurable signature for different users (#6024)

* validation add for signature of different roles

* add config constant in window

* conditional add for signature section

* fix validation for signature roles

* allow signature in history for more reg status

* mock data fix for config

* system roles array update for signtature

* signature row fix for create user (#6003)

* signature row fix for create user

* type fix for form data

* Make signatre not required

* create user test fix

---------

Co-authored-by: euanmillar <euanmillar77@gmail.com>

* Fix deps vulnerabilities (#5999)

* Upgrade problematic packages

* Update yarn lock file

* Remove minio type module

* Remove patch files

* Remove stub type modules @types/pino, @types/hapi-pino and upgraded those packages which have their own type definitions

* Minor type assertion amends

* Fix tests with type non null assertion

* Remove caret from vitest as we dont want to upgrade vitest for now

* Fix type error

* Apply new patch to the newer version of pdfmake that solves an old problem

* Requirements for Niue (#6016)

* No reason that titles should be mandatory

* Hide a field based on the user type

* Move background image into login INdexedDB

* Hide questions on review page from users

* OCRVS 6085: Configurable handlebar helpers (#6086)

* No reason that titles should be mandatory

* Hide a field based on the user type

* Move background image into login INdexedDB

* Hide questions on review page from users

* Make it possible to confgure handlebars

* remove output

* fix test

* Fix import handlebar helpers

* Ocrvs 5994 - list for certificator collector and correction requester (#6058)

* collector form section update

* collector form section array update

* message update for print cert

* filter informant type option for mother father bride groom

* print reducer remove

* delete unused objects

* refactor collector section form

* issue collector form refactor

* clean up collector section

* unnecessary variable remove

* unused exports remove

* correction form refactor with informant

* corrector message update

* filter options func fix

* new key generate for additional param in radio option

* collector form test fix for refactor collector section

* revert mock data and fix collector form test

* corrector form test fix for collector section refactor

* clean up collector section functions

* refactor id verifier for print and issue

* message description fix

* id verfier for corrector refactor

* message for age field fix

* id number fix for id verifier by gql transformer

---------

Co-authored-by: Euan Millar <euanmillar@users.noreply.github.com>
Co-authored-by: euanmillar <euanmillar77@gmail.com>

* Update yarn lock

* Add registration location to email as a variable (#6104)

* Add registration location to email

* Fix test

* Fix another test

* Fix uploadSVG handler and tests

* Add configurable support for death registration (#6116)

* Add support for passing intl and other context variables to custom handlebar helpers (#6115)

* add support for passing intl and other context variables to custom handlebar helpers

* mock custom handlebar helpers fetching in unit tests

* add a comment warning anyone who wants to expose more values through custom handlebar helpers

* Replace hard coded messages (#6122)

* Replace hard coded messages of UserList table

* Uppercase table header texts

* path for nginx default config when building client images (#6127)

* Configurable domains & whitelist (#6123)

* Pass whitelist as a string array from env vars

* different approach to whitelist

* Strip https

* revert tslint change

* Rename variable

* No need to strip https

* Id verifier and collector form fix (#6106)

* set collector type from declaration

* collector and corrector type set conditionally

* informant name fix for underscore

* deprecate legal guardian option if informant already

* fix record audit history for correction

* title messages fix for id verifiers

* comment add for label mapper for record audit history

* messages update for id verifier buttons

* collector and corrector type fix

* Remove hard-coded collector/corrector check

---------

Co-authored-by: Tameem Bin Haider <tameem.haider@dsinnovators.com>

* Skip decorative types when checking for unknowns (#6135)

Co-authored-by: Riku Rouvila <riku.rouvila@gmail.com>

* Fix crude birth rates & pass performance metrics as a Float to 2 decimal places to support small populations (#6109)

* No need for these users to update workqueues

* remove unnecessary change

* wip

* Tests for estimates array

* Update schema

* Deduplication doesnt work if another type of ID is submitted (#6144)

* Store whatever supported identifier is supplied to Elasticsearch

* comment out dejavu again

* revert changes to de-dupe command

* Fis de-dupe

* minor refactor

---------

Co-authored-by: Riku Rouvila <riku.rouvila@gmail.com>

* Introduce a new handlebar "printInAdvance" (#6146)

* feat(v1.3.1): allow configuring dashboard queries from country config (#6121)

* feat: allow configuring dashboard queries from country config

* chore: rename the queries to be descriptive of what they edit

* Handle empty deceased/child resource in search (#6152)

* Support one location level in verify certificate (#6151)

* Fix death reg notification and copy amend on review page (#6159)

* fix bug sending reg location to death email handler

* Copy amend

* Fix mother / father details getting mixed up when informant type is changed (#6149)

* OCRVS-6022:  Allow null values for user mobile and emailForNotification when creating users but still check for uniqueness (#6166)

* Allow null values for users mobile

* Migration for email and mobile uniqueness

* Fetch certificate configuration from country config (#6165)

* Load fonts from country-config

* Cache font & cert config in service worker

* Update cache routes for validators, handlebars etc

* Use NotoSans as fallback for backward compatibility

* Remove auth header from cert config request

* Add retry on load failed

* Provide mock for the fonts

* Mock loadCertificateConfiguration function

* Remove dev certificate handler

---------

Co-authored-by: euanmillar <euanmillar77@gmail.com>

* Initialize object before setting value (#6173)

---------

Co-authored-by: Tahmid Rahman <42269993+tahmidrahman-dsi@users.noreply.github.com>
Co-authored-by: Md. Ashikul Alam <32668488+Nil20@users.noreply.github.com>
Co-authored-by: Tameem Bin Haider <tameem.haider@dsinnovators.com>
Co-authored-by: Sadman Anik <36187489+sadmananik@users.noreply.github.com>
Co-authored-by: Riku Rouvila <riku.rouvila@gmail.com>
Co-authored-by: Sadman Anik <sadman.anik@dsinnovators.com>
Co-authored-by: Pyry Rouvila <pyry.rouvila@gmail.com>
  • Loading branch information
8 people committed Nov 13, 2023
1 parent b3d64ad commit 582cce1
Show file tree
Hide file tree
Showing 213 changed files with 10,330 additions and 10,612 deletions.
2 changes: 1 addition & 1 deletion infrastructure/nginx-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ add_header X-Permitted-Cross-Domain-Policies master-only;
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'
# directives for css and js(if you have inline css or js, you will need to keep it too).
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful
add_header Content-Security-Policy "default-src 'self' *.{{hostname}} *.logrocket.io/ *.sentry.io/ sentry.io/; font-src fonts.gstatic.com; object-src 'none'; script-src 'self' 'unsafe-eval' blob: https: http: storage.googleapis.com/workbox-cdn/ sentry.io/api/embed/error-page/; style-src 'self' fonts.googleapis.com 'unsafe-inline'; img-src 'self' data: http: https: ";
add_header Content-Security-Policy "default-src 'self' {{CONTENT_SECURITY_POLICY_WILDCARD}} *.logrocket.io/ *.sentry.io/ sentry.io/; font-src fonts.gstatic.com; object-src 'none'; script-src 'self' 'unsafe-eval' blob: https: http: storage.googleapis.com/workbox-cdn/ sentry.io/api/embed/error-page/; style-src 'self' fonts.googleapis.com 'unsafe-inline'; img-src 'self' data: http: https: ";

server {
listen 80;
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/nginx-deploy-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
set -e

sed -i s~THIS_WILL_BE_REPLACED_BY_RUNTIME_ENV_VARIABLE~$COUNTRY_CONFIG_URL~g /usr/share/nginx/html/index.html
sed -i s~{{hostname}}~$HOST~g /etc/nginx/conf.d/default.conf
sed -i s~{{CONTENT_SECURITY_POLICY_WILDCARD}}~$CONTENT_SECURITY_POLICY_WILDCARD~g /etc/nginx/conf.d/default.conf
nginx -g 'daemon off;'
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.0",
"version": "1.3.1",
"private": true,
"workspaces": [
"packages/*"
Expand Down
8 changes: 3 additions & 5 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencrvs/auth",
"version": "1.3.0",
"version": "1.3.1",
"description": "OpenCRVS authentication service",
"license": "MPL-2.0",
"private": true,
Expand All @@ -22,19 +22,17 @@
"@hapi/boom": "^9.1.1",
"@hapi/hapi": "^20.0.1",
"@opencrvs/commons": "^1.3.0",
"@types/hapi-pino": "^8.0.5",
"@types/pino": "^6.3.12",
"app-module-path": "^2.2.0",
"dotenv": "^6.1.0",
"fp-ts": "^2.12.3",
"hapi-pino": "^8.5.0",
"hapi-pino": "^9.0.0",
"hapi-sentry": "^3.1.0",
"io-ts": "^2.2.18",
"joi": "^17.3.0",
"jsonwebtoken": "^9.0.0",
"lint-staged": "^7.1.0",
"node-fetch": "^2.6.7",
"pino": "^6.0.0",
"pino": "^7.0.0",
"redis": "^3.1.1",
"tsconfig-paths": "^3.13.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/config/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function getPlugins() {
plugin: Sentry,
options: {
client: {
environment: process.env.HOSTNAME,
environment: process.env.DOMAIN,
dsn: SENTRY_DSN
},
catchLogErrors: true
Expand Down
8 changes: 6 additions & 2 deletions packages/auth/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@
export const REDIS_HOST = process.env.REDIS_HOST || 'localhost'
export const AUTH_HOST = process.env.AUTH_HOST || '0.0.0.0'
export const AUTH_PORT = process.env.AUTH_PORT || 4040
export const HOSTNAME = process.env.DOMAIN || '*'
export const USER_MANAGEMENT_URL =
process.env.USER_MANAGEMENT_URL || 'http://localhost:3030/'
export const METRICS_URL = process.env.METRICS_URL || 'http://localhost:1050'

export const NOTIFICATION_SERVICE_URL =
process.env.NOTIFICATION_SERVICE_URL || 'http://localhost:2020/'
export const HOSTNAME = process.env.DOMAIN || '*'
export const COUNTRY_CONFIG_URL =
process.env.COUNTRY_CONFIG_URL || 'http://localhost:3040/'
export const LOGIN_URL = process.env.LOGIN_URL || 'http://localhost:3020/'
export const CLIENT_APP_URL =
process.env.CLIENT_APP_URL || 'http://localhost:3000/'

export const CERT_PRIVATE_KEY_PATH =
(process.env.CERT_PRIVATE_KEY_PATH as string) ||
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
*/
import * as pino from 'pino'
import pino from 'pino'
export const logger = pino()

const level = process.env.NODE_ENV === 'test' ? 'silent' : process.env.LOG_LEVEL
Expand Down
11 changes: 5 additions & 6 deletions packages/auth/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ import * as Hapi from '@hapi/hapi'
import {
AUTH_HOST,
AUTH_PORT,
CLIENT_APP_URL,
COUNTRY_CONFIG_URL,
DEFAULT_TIMEOUT,
HOSTNAME
HOSTNAME,
LOGIN_URL
} from '@auth/constants'
import authenticateHandler, {
requestSchema as reqAuthSchema,
Expand Down Expand Up @@ -73,11 +76,7 @@ import anonymousTokenHandler, {
export async function createServer() {
let whitelist: string[] = [HOSTNAME]
if (HOSTNAME[0] !== '*') {
whitelist = [
`https://countryconfig.${HOSTNAME}`,
`https://login.${HOSTNAME}`,
`https://register.${HOSTNAME}`
]
whitelist = [COUNTRY_CONFIG_URL, LOGIN_URL, CLIENT_APP_URL]
}
logger.info(`Whitelist: ${JSON.stringify(whitelist)}`)
const server = new Hapi.Server({
Expand Down
4 changes: 2 additions & 2 deletions packages/client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ WORKDIR /app/packages/components
RUN yarn build

WORKDIR /app/packages/client
ENV HOST "{{hostname}}"
ENV CONTENT_SECURITY_POLICY_WILDCARD "{{CONTENT_SECURITY_POLICY_WILDCARD}}"
ENV COUNTRY_CONFIG_URL "THIS_WILL_BE_REPLACED_BY_RUNTIME_ENV_VARIABLE"
RUN yarn build

Expand All @@ -34,7 +34,7 @@ FROM nginx
COPY --from=0 /app/packages/client/build/ /usr/share/nginx/html/

COPY infrastructure/nginx-deploy-config.sh /
COPY infrastructure/nginx-default.conf /app/etc/nginx/conf.d/default.conf
COPY infrastructure/nginx-default.conf /etc/nginx/conf.d/default.conf

RUN chmod +x /nginx-deploy-config.sh
CMD ["bash", "-c", "'./nginx-deploy-config.sh'"]
1 change: 0 additions & 1 deletion packages/client/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ generates:
* & Healthcare Disclaimer located at http://opencrvs.org/license.
*
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
*
*/
/*
Expand Down
4 changes: 2 additions & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencrvs/client",
"version": "1.3.0",
"version": "1.3.1",
"description": "OpenCRVS client application",
"license": "MPL-2.0",
"private": true,
Expand Down Expand Up @@ -167,7 +167,7 @@
"typescript": "4.9.3",
"typescript-react-intl": "^0.3.0",
"vite-plugin-pwa": "^0.16.4",
"vitest": "^0.25.5",
"vitest": "0.25.5",
"vitest-fetch-mock": "^0.2.1",
"whatwg-fetch": "^3.0.0"
},
Expand Down
11 changes: 10 additions & 1 deletion packages/client/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ import {
REGISTRAR_ROLES,
SYS_ADMIN_ROLES,
TRACKING_ID_TEXT,
PERFORMANCE_MANAGEMENT_ROLES
PERFORMANCE_MANAGEMENT_ROLES,
EMAIL
} from '@client/utils/constants'
import { Event } from '@client/utils/gateway'
import { UserDetails } from '@client/utils/userUtils'
Expand Down Expand Up @@ -368,6 +369,14 @@ class HeaderComp extends React.Component<IFullProps, IState> {
placeHolderText: intl.formatMessage(messages.placeHolderNationalId)
})
}
if (fieldNames.includes('registrationEmail')) {
searchTypeList.push({
label: intl.formatMessage(messages.email),
value: EMAIL,
icon: <Icon name="Envelope" size="small" />,
placeHolderText: intl.formatMessage(messages.placeHolderEmail)
})
}

const navigationList: INavigationType[] = [
{
Expand Down
6 changes: 5 additions & 1 deletion packages/client/src/components/charts/RegRatesLineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ class RegRatesLineChartComponent extends React.Component<IProps, IState> {
})}
</LegendDataLabel>
<br />
<LegendDataValue>{activeTotalEstimate.value}</LegendDataValue>
<LegendDataValue>
{activeTotalEstimate.value < 10
? activeTotalEstimate.value.toFixed(2)
: Math.round(activeTotalEstimate.value)}
</LegendDataValue>
</LegendData>
</LegendDetails>
<LegendDetails>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const ErrorMessage = styled.div`
type IFullProps = {
name: string
label: string
placeholder?: string
extraValue: IFormFieldValue
options: ISelectOption[]
splitView?: boolean
Expand Down Expand Up @@ -280,12 +281,13 @@ class DocumentUploaderWithOptionComp extends React.Component<
}

renderDocumentUploaderWithDocumentTypeBlock = () => {
const { name, intl } = this.props
const { name, intl, placeholder } = this.props
return this.props.splitView ? (
this.state.dropDownOptions.map((opt, idx) => (
<Flex splitView key={idx}>
<Select
id={`${name}${idx}`}
placeholder={placeholder}
options={[opt]}
value={opt.value}
onChange={this.onChange}
Expand All @@ -307,6 +309,7 @@ class DocumentUploaderWithOptionComp extends React.Component<
<Flex>
<Select
id={name}
placeholder={placeholder}
options={this.state.dropDownOptions}
value={this.state.fields.documentType}
onChange={this.onChange}
Expand Down
4 changes: 3 additions & 1 deletion packages/client/src/components/form/FormFieldGenerator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,7 @@ class FormSectionComponent extends React.Component<Props> {
offlineCountryConfig,
intl,
draftData,
userDetails,
setValues,
dynamicDispatch
} = this.props
Expand All @@ -950,7 +951,8 @@ class FormSectionComponent extends React.Component<Props> {
field,
{ ...draftData?.[sectionName], ...values },
offlineCountryConfig,
draftData
draftData,
userDetails
)

if (conditionalActions.includes('hide')) {
Expand Down
10 changes: 5 additions & 5 deletions packages/client/src/components/form/ReviewActionComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const ACTION_TO_CONTENT_MAP: { [key: string]: any } = {
},
false: {
title: {
message: messages.reviewActionTitle,
message: messages.approvalActionTitle,
payload: { completeDeclaration: false }
},
description: {
Expand Down Expand Up @@ -215,7 +215,7 @@ const ACTION_TO_CONTENT_MAP: { [key: string]: any } = {
},
false: {
title: {
message: messages.reviewActionTitle,
message: messages.approvalActionTitle,
payload: { completeDeclaration: false }
},
description: {
Expand All @@ -232,7 +232,7 @@ const ACTION_TO_CONTENT_MAP: { [key: string]: any } = {
completionStatus: {
true: {
title: {
message: messages.reviewActionTitle,
message: messages.registerActionTitle,
payload: { completeDeclaration: true }
},
description: {
Expand All @@ -246,7 +246,7 @@ const ACTION_TO_CONTENT_MAP: { [key: string]: any } = {
},
false: {
title: {
message: messages.reviewActionTitle,
message: messages.registerActionTitle,
payload: { completeDeclaration: false }
},
description: {
Expand All @@ -272,7 +272,7 @@ const ACTION_TO_CONTENT_MAP: { [key: string]: any } = {
},
false: {
title: {
message: messages.reviewActionTitle,
message: messages.registerActionTitle,
payload: { completeDeclaration: false }
},
description: {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/interface/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import { IS_PROD_ENVIRONMENT } from '@client/utils/constants'
const SCREEN_LOCK = 'screenLock'

type Keys = keyof typeof WORKQUEUE_TABS
export type IWORKQUEUE_TABS = typeof WORKQUEUE_TABS[Keys]
export type IWORKQUEUE_TABS = (typeof WORKQUEUE_TABS)[Keys]

export const WORKQUEUE_TABS = {
inProgress: 'progress',
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/declarations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ export function createReviewDeclaration(
id: declarationId,
data: formData,
duplicates,
originalData: formData,
originalData: status !== 'IN_PROGRESS' ? formData : {},
localData: formData,
review: true,
event,
Expand Down
Loading

0 comments on commit 582cce1

Please sign in to comment.