Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:opencrvs/opencrvs-core into opti…
Browse files Browse the repository at this point in the history
…mise_docker_builds
  • Loading branch information
rikukissa committed Jun 25, 2024
2 parents f0e2023 + 58f2bc7 commit feb7ae4
Show file tree
Hide file tree
Showing 11 changed files with 610 additions and 441 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-pr-to-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Get PR details from workflow dispatch
if: ${{ github.event_name == 'workflow_dispatch' }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
- Fix Reset pagination to default page (1) when location changes in UserList [#6481](https://github.com/opencrvs/opencrvs-core/issues/6481)
- Fix unassign action not appearing in audit history [#7035](https://github.com/opencrvs/opencrvs-core/pull/7072)
- Fix client modal glitches on integrations page [#7002](https://github.com/opencrvs/opencrvs-core/issues/7002)
- Fix address property handling and corrected country data transformation logic [#6989](https://github.com/opencrvs/opencrvs-core/issues/6989)
- Fix "Print and issue to groom|bride" is added to a different variable [#7066](https://github.com/opencrvs/opencrvs-core/pull/7066)
- Fix search query is not being saved in the advanced search results [#7110](https://github.com/opencrvs/opencrvs-core/pull/7117)
- Fix Removed duplicateTrackingId check in createDuplicateTask method [#7081](https://github.com/opencrvs/opencrvs-core/pull/7081)
Expand Down
6 changes: 2 additions & 4 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"lerna": "2.11.0",
"packages": [
"packages/*"
],
"packages": ["packages/*"],
"version": "0.0.0",
"npmClient": "yarn",
"npmClient": "yarn"
}
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
],
"husky": {
"hooks": {
"pre-commit": "yarn check:license && lerna run --parallel precommit"
"pre-commit": "yarn check:license && lerna run --stream --parallel precommit"
}
},
"scripts": {
"postinstall": "patch-package",
"start": "lerna run build --scope @opencrvs/commons && lerna run build --scope @opencrvs/components && lerna run --parallel --ignore @opencrvs/dashboards --ignore @opencrvs/mobile-proxy $OTHER_LERNA_FLAGS start",
"start:prod": "yarn build && lerna run --parallel --ignore @opencrvs/components --ignore @opencrvs/dashboards --ignore @opencrvs/mobile-proxy $OTHER_LERNA_FLAGS start:prod",
"start": "lerna run build --scope @opencrvs/commons && lerna run build --scope @opencrvs/components && lerna run --stream --parallel --ignore @opencrvs/dashboards --ignore @opencrvs/mobile-proxy $OTHER_LERNA_FLAGS start",
"start:prod": "yarn build && lerna run --stream --parallel --ignore @opencrvs/components --ignore @opencrvs/dashboards --ignore @opencrvs/mobile-proxy $OTHER_LERNA_FLAGS start:prod",
"dev": "bash development-environment/dev.sh",
"dev:secrets:gen": "openssl genrsa -out .secrets/private-key.pem 2048 && openssl rsa -pubout -in .secrets/private-key.pem -out .secrets/public-key.pem",
"open": "opener 'http://localhost:6060/' && opener 'http://localhost:3020/'",
Expand All @@ -47,8 +47,9 @@
"@types/dotenv": "^6.1.0",
"concurrently": "^8.0.0",
"husky": "1.3.1",
"js-yaml": "^3.13.1",
"lerna": "^8.0.0",
"lint-staged": "^7.1.0",
"lint-staged": "^15.0.0",
"prettier": "2.8.8"
},
"dependencies": {
Expand Down
23 changes: 13 additions & 10 deletions packages/client/src/components/interface/DownloadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,23 +246,25 @@ function DownloadButtonComponent(props: DownloadButtonProps & HOCProps) {
status === DOWNLOAD_STATUS.FAILED_NETWORK,
[status]
)
const isSentForApprovalDeclaration =

// reg agent can only retrieve validated and correction requested declarations
const isRetrieveableDeclarationsOfRegAgent =
downloadConfigs.declarationStatus &&
['VALIDATED', 'CORRECTION_REQUESTED'].includes(
downloadConfigs.declarationStatus
)
) &&
userRole === ROLE_REGISTRATION_AGENT

// user roles of users who can not retrieve a declaration
const nonRetrievalUserRoles =
userRole !== ROLE_REGISTRATION_AGENT &&
!FIELD_AGENT_ROLES.includes(String(userRole))
// field agents can only retrieve declarations
const isNotFieldAgent = !FIELD_AGENT_ROLES.includes(String(userRole))

const onClickDownload = useCallback(
(e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
if (
(assignment?.practitionerId !== practitionerId ||
status === DOWNLOAD_STATUS.DOWNLOADED) &&
(!isSentForApprovalDeclaration || nonRetrievalUserRoles)
!isRetrieveableDeclarationsOfRegAgent &&
isNotFieldAgent
) {
setAssignModal(
getAssignModalOptions(
Expand All @@ -283,6 +285,7 @@ function DownloadButtonComponent(props: DownloadButtonProps & HOCProps) {
)
)
} else if (status !== DOWNLOAD_STATUS.DOWNLOADED) {
// retrieve declaration
download()
}
e.stopPropagation()
Expand All @@ -291,10 +294,10 @@ function DownloadButtonComponent(props: DownloadButtonProps & HOCProps) {
assignment,
practitionerId,
status,
isSentForApprovalDeclaration,
nonRetrievalUserRoles,
userRole,
isRetrieveableDeclarationsOfRegAgent,
isNotFieldAgent,
hideModal,
userRole,
download,
unassign
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -831,13 +831,12 @@ const setAddressPropFromFHIRProp = (
fieldName: string,
offlineData?: IOfflineData
) => {
const value =
fhirProp === 'country'
? (countries.find(({ value }) => value === addressFromQuery?.[fhirProp])
?.label.defaultMessage as string) || ''
: addressFromQuery[fhirProp] || ''
const value = addressFromQuery[fhirProp] || ''

if (fhirProp === 'country') {
transformedData[sectionId][fieldName] = value
transformedData[sectionId][fieldName] =
(countries.find(({ value }) => value === addressFromQuery?.[fhirProp])
?.label as MessageDescriptor as IFormData) || ''
} else if (
addressFromQuery?.['country'] === window.config.COUNTRY &&
!fieldName.includes('international')
Expand Down
3 changes: 1 addition & 2 deletions packages/gateway/src/features/user/root-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ import {
GQLUserIdentifierInput,
GQLUserInput
} from '@gateway/graphql/schema'
import { logger } from '@opencrvs/commons'
import { logger, isBase64FileString } from '@opencrvs/commons'
import { checkVerificationCode } from '@gateway/routes/verifyCode/handler'
import { UserInputError } from 'apollo-server-hapi'
import fetch from '@gateway/fetch'
import { validateAttachments } from '@gateway/utils/validators'
import { postMetrics } from '@gateway/features/metrics/service'
import { uploadBase64ToMinio } from '@gateway/features/documents/service'
import { isBase64FileString } from '@opencrvs/commons'
import { rateLimitedResolver } from '@gateway/rate-limit'

export const resolvers: GQLResolver = {
Expand Down
3 changes: 1 addition & 2 deletions packages/gateway/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ import {
LOGIN_URL
} from '@gateway/constants'
import { readFileSync } from 'fs'
import { validateFunc } from '@opencrvs/commons'
import { validateFunc, logger } from '@opencrvs/commons'
import {
ApolloServer,
ApolloServerPluginStopHapiServer
} from 'apollo-server-hapi'
import { ApolloServerPluginLandingPageGraphQLPlayground } from 'apollo-server-core'
import { getApolloConfig } from '@gateway/graphql/config'
import * as database from '@gateway/utils/redis'
import { logger } from '@opencrvs/commons'
import { badRequest, Boom } from '@hapi/boom'
import { RateLimitError } from './rate-limit'

Expand Down
3 changes: 1 addition & 2 deletions packages/gateway/src/utils/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
import fetch from '@gateway/fetch'
import { DOCUMENTS_URL } from '@gateway/constants'
import { internal } from '@hapi/boom'
import { logger } from '@opencrvs/commons'
import { IAuthHeader } from '@opencrvs/commons'
import { logger, IAuthHeader } from '@opencrvs/commons'

export async function uploadSvg(fileData: string, authHeader: IAuthHeader) {
const url = new URL('upload-svg', DOCUMENTS_URL).toString()
Expand Down
3 changes: 1 addition & 2 deletions packages/workflow/src/records/handler/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ import * as z from 'zod'
import { validateRequest } from '@workflow/utils/index'
import { getValidRecordById } from '@workflow/records/index'
import { getToken } from '@workflow/utils/auth-utils'
import { IAuthHeader } from '@opencrvs/commons'
import { IAuthHeader, logger } from '@opencrvs/commons'
import { toDownloaded } from '@workflow/records/state-transitions'
import { hasScope, inScope } from '@opencrvs/commons/authentication'
import { sendBundleToHearth } from '@workflow/records/fhir'
import { indexBundleToRoute } from '@workflow/records/search'
import { logger } from '@opencrvs/commons'
import { auditEvent } from '@workflow/records/audit'
import { findAssignment } from '@opencrvs/commons/assignment'
import { getUserOrSystem } from '@workflow/records/user'
Expand Down
Loading

0 comments on commit feb7ae4

Please sign in to comment.