Skip to content

Commit

Permalink
Merge branch 'develop' into ocrvs-7302
Browse files Browse the repository at this point in the history
  • Loading branch information
jamil314 authored Oct 31, 2024
2 parents ea55caf + b48fdfc commit 12c07d4
Show file tree
Hide file tree
Showing 27 changed files with 775 additions and 576 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@
- Handle label params used in form inputs when rendering in action details modal
- **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)

### Breaking changes

- Remove informant notification configuration from the UI and read notification configuration settings from `record-notification` endpoint in countryconfig
- **Gateways searchEvents API updated** `operationHistories` only returns `operationType` & `operatedOn` due to the other fields being unused in OpenCRVS
- **Config changes to review/preview and signatures** Core used to provide review/preview section by default which are now removed and need to be provided from countryconfig. The signature field definitions (e.g. informant signature, bride signature etc.) were hard coded in core which also have now been removed. The signatures can now be added through the review/preview sections defined in countryconfig just like any other field. You can use the following section definition as the default which is without any additional fields. We highly recommend checking out our reference country repository which has the signature fields in it's review/preview sections
- **Config changes to review/preview and signatures** Core used to provide review/preview section by default which are now removed and need to be provided from countryconfig. The signature field definitions (e.g. informant signature, bride signature etc.) were hard coded in core which also have now been removed. The signatures can now be added through the review/preview sections defined in countryconfig just like any other field. You can use the following section definition as the default which is without any additional fields. We highly recommend checking out our reference country repository which has the signature fields in its review/preview sections
- `hasChildLocation` query has been removed from gateway. We have created the query `isLeafLevelLocation` instead which is more descriptive on its intended use.

```
{
Expand Down
5 changes: 4 additions & 1 deletion packages/auth/src/config/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export default function getPlugins() {
options: {
client: {
environment: process.env.DOMAIN,
dsn: env.SENTRY_DSN
dsn: env.SENTRY_DSN,
initialScope: {
tags: { service: 'auth' }
}
},
catchLogErrors: true
}
Expand Down
14 changes: 9 additions & 5 deletions packages/client/graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13607,11 +13607,11 @@
"deprecationReason": null
},
{
"name": "hasChildLocation",
"name": "isLeafLevelLocation",
"description": null,
"args": [
{
"name": "parentId",
"name": "locationId",
"description": null,
"type": {
"kind": "NON_NULL",
Expand All @@ -13628,9 +13628,13 @@
}
],
"type": {
"kind": "OBJECT",
"name": "Location",
"ofType": null
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
Expand Down
1 change: 0 additions & 1 deletion packages/client/src/tests/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,6 @@ type Query {
): RegistrationCountResult
fetchMarriageRegistration(id: ID!): MarriageRegistration
fetchRecordDetailsForVerification(id: String!): RecordDetails
hasChildLocation(parentId: String!): Location
getUser(userId: String): User
getUserByMobile(mobile: String): User
getUserByEmail(email: String): User
Expand Down
2 changes: 0 additions & 2 deletions packages/client/src/utils/gateway-deprecated-do-not-use.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export interface GQLQuery {
fetchRecordDetailsForVerification?: GQLRecordDetails
locationsByParent?: Array<GQLLocation | null>
locationById?: GQLLocation
hasChildLocation?: GQLLocation
getUser?: GQLUser
getUserByMobile?: GQLUser
getUserByEmail?: GQLUser
Expand Down Expand Up @@ -2053,7 +2052,6 @@ export interface GQLQueryTypeResolver<TParent = any> {
fetchRecordDetailsForVerification?: QueryToFetchRecordDetailsForVerificationResolver<TParent>
locationsByParent?: QueryToLocationsByParentResolver<TParent>
locationById?: QueryToLocationByIdResolver<TParent>
hasChildLocation?: QueryToHasChildLocationResolver<TParent>
getUser?: QueryToGetUserResolver<TParent>
getUserByMobile?: QueryToGetUserByMobileResolver<TParent>
getUserByEmail?: QueryToGetUserByEmailResolver<TParent>
Expand Down
163 changes: 74 additions & 89 deletions packages/client/src/utils/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ export type Query = {
getUserByEmail?: Maybe<User>
getUserByMobile?: Maybe<User>
getVSExports?: Maybe<TotalVsExport>
hasChildLocation?: Maybe<Location>
isLeafLevelLocation: Scalars['Boolean']
listBirthRegistrations?: Maybe<BirthRegResultSet>
queryPersonByIdentifier?: Maybe<Person>
queryPersonByNidIdentifier?: Maybe<Person>
Expand Down Expand Up @@ -1531,8 +1531,8 @@ export type QueryGetUserByMobileArgs = {
mobile?: InputMaybe<Scalars['String']>
}

export type QueryHasChildLocationArgs = {
parentId: Scalars['String']
export type QueryIsLeafLevelLocationArgs = {
locationId: Scalars['String']
}

export type QueryListBirthRegistrationsArgs = {
Expand Down Expand Up @@ -7206,22 +7206,13 @@ export type GetLocationStatisticsQuery = {
} | null
}

export type HasChildLocationQueryVariables = Exact<{
parentId: Scalars['String']
export type IsLeafLevelLocationQueryVariables = Exact<{
locationId: Scalars['String']
}>

export type HasChildLocationQuery = {
export type IsLeafLevelLocationQuery = {
__typename?: 'Query'
hasChildLocation?: {
__typename?: 'Location'
id: string
type?: string | null
identifier?: Array<{
__typename?: 'Identifier'
system?: string | null
value?: string | null
}> | null
} | null
isLeafLevelLocation: boolean
}

export type FetchMonthWiseEventMetricsQueryVariables = Exact<{
Expand Down Expand Up @@ -7350,82 +7341,76 @@ export type GetRegistrationsListByFilterQueryVariables = Exact<{
size: Scalars['Int']
}>

export type RegistrationsListByLocationFilter = {
__typename: 'TotalMetricsByLocation'
total?: number | null
results: Array<{
__typename?: 'EventMetricsByLocation'
total: number
late: number
delayed: number
home: number
healthFacility: number
location: { __typename?: 'Location'; name?: string | null }
}>
}

export type RegistrationsListByRegistrarFilter = {
__typename: 'TotalMetricsByRegistrar'
total?: number | null
results: Array<{
__typename?: 'EventMetricsByRegistrar'
total: number
late: number
delayed: number
registrarPractitioner?: {
__typename?: 'User'
id: string
systemRole: SystemRoleType
role: {
__typename?: 'Role'
_id: string
labels: Array<{
__typename?: 'RoleLabel'
lang: string
label: string
}>
}
primaryOffice?: {
__typename?: 'Location'
name?: string | null
id: string
} | null
name: Array<{
__typename?: 'HumanName'
firstNames?: string | null
familyName?: string | null
use?: string | null
}>
avatar?: {
__typename?: 'Avatar'
type: string
data: string
} | null
} | null
}>
}

export type RegistrationsListByTimeFilter = {
__typename: 'TotalMetricsByTime'
total?: number | null
results: Array<{
__typename?: 'EventMetricsByTime'
total: number
delayed: number
late: number
home: number
healthFacility: number
month: string
time: string
}>
}

export type GetRegistrationsListByFilterQuery = {
__typename?: 'Query'
getRegistrationsListByFilter?:
| RegistrationsListByLocationFilter
| RegistrationsListByRegistrarFilter
| RegistrationsListByTimeFilter
| {
__typename: 'TotalMetricsByLocation'
total?: number | null
results: Array<{
__typename?: 'EventMetricsByLocation'
total: number
late: number
delayed: number
home: number
healthFacility: number
location: { __typename?: 'Location'; name?: string | null }
}>
}
| {
__typename: 'TotalMetricsByRegistrar'
total?: number | null
results: Array<{
__typename?: 'EventMetricsByRegistrar'
total: number
late: number
delayed: number
registrarPractitioner?: {
__typename?: 'User'
id: string
systemRole: SystemRoleType
role: {
__typename?: 'Role'
_id: string
labels: Array<{
__typename?: 'RoleLabel'
lang: string
label: string
}>
}
primaryOffice?: {
__typename?: 'Location'
name?: string | null
id: string
} | null
name: Array<{
__typename?: 'HumanName'
firstNames?: string | null
familyName?: string | null
use?: string | null
}>
avatar?: {
__typename?: 'Avatar'
type: string
data: string
} | null
} | null
}>
}
| {
__typename: 'TotalMetricsByTime'
total?: number | null
results: Array<{
__typename?: 'EventMetricsByTime'
total: number
delayed: number
late: number
home: number
healthFacility: number
month: string
time: string
}>
}
| null
}

Expand Down
18 changes: 12 additions & 6 deletions packages/client/src/views/Performance/RegistrationsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ import { IStoreState } from '@client/store'
import {
GetRegistrationsListByFilterQuery,
QueryGetRegistrationsListByFilterArgs,
RegistrationsListByLocationFilter,
RegistrationsListByRegistrarFilter,
RegistrationsListByTimeFilter,
RegistrationType
} from '@client/utils/gateway'
import { generateLocations } from '@client/utils/locationUtils'
Expand Down Expand Up @@ -398,7 +395,10 @@ function RegistrationListComponent(props: IProps) {
}

const getTableContentByRegistrar = (
result: RegistrationsListByRegistrarFilter['results'][0],
result: Extract<
GetRegistrationsListByFilterQuery['getRegistrationsListByFilter'],
{ __typename: 'TotalMetricsByRegistrar' }
>['results'][0],
index: number
) => ({
...result,
Expand Down Expand Up @@ -463,7 +463,10 @@ function RegistrationListComponent(props: IProps) {
})

const getTableContentByLocation = (
result: RegistrationsListByLocationFilter['results'][0],
result: Extract<
GetRegistrationsListByFilterQuery['getRegistrationsListByFilter'],
{ __typename: 'TotalMetricsByLocation' }
>['results'][0],
index: number
) => ({
...result,
Expand All @@ -485,7 +488,10 @@ function RegistrationListComponent(props: IProps) {
})

const getTableContentByTime = (
result: RegistrationsListByTimeFilter['results'][0],
result: Extract<
GetRegistrationsListByFilterQuery['getRegistrationsListByFilter'],
{ __typename: 'TotalMetricsByTime' }
>['results'][0],
index: number
) => {
return {
Expand Down
Loading

0 comments on commit 12c07d4

Please sign in to comment.