Skip to content

Commit

Permalink
Merge pull request #6014 from opencrvs/release-v1.3.1
Browse files Browse the repository at this point in the history
Hotfix release v1.3.1
  • Loading branch information
euanmillar authored Nov 9, 2023
2 parents 4bd36a5 + 0e8cfcc commit 6bae418
Show file tree
Hide file tree
Showing 216 changed files with 10,600 additions and 10,831 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'"]
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 @@ -165,7 +165,7 @@
"typescript": "^4.7.4",
"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 @@ -922,6 +922,7 @@ class FormSectionComponent extends React.Component<Props> {
offlineCountryConfig,
intl,
draftData,
userDetails,
setValues,
dynamicDispatch
} = this.props
Expand All @@ -947,7 +948,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 @@ -523,7 +523,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 6bae418

Please sign in to comment.