New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OCRVS-3148] Hide registrar signature from field agents #3200
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3200 +/- ##
===========================================
+ Coverage 79.87% 79.90% +0.02%
===========================================
Files 605 606 +1
Lines 27785 27848 +63
Branches 8841 8858 +17
===========================================
+ Hits 22194 22252 +58
- Misses 5536 5541 +5
Partials 55 55
Continue to review full report at Codecov.
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that we don't actually use the signature
returned from here.
opencrvs-core/packages/client/src/utils/userUtils.ts
Lines 59 to 140 in b1ac595
export function getUserDetails(user: GQLUser): IUserDetails { | |
const { | |
catchmentArea, | |
primaryOffice, | |
name, | |
mobile, | |
role, | |
type, | |
status, | |
userMgntUserID, | |
practitionerId, | |
localRegistrar, | |
avatar | |
} = user | |
const userDetails: IUserDetails = {} | |
if (localRegistrar) { | |
userDetails.localRegistrar = localRegistrar | |
} | |
if (userMgntUserID) { | |
userDetails.userMgntUserID = userMgntUserID | |
} | |
if (practitionerId) { | |
userDetails.practitionerId = practitionerId | |
} | |
if (name) { | |
userDetails.name = name | |
} | |
if (mobile) { | |
userDetails.mobile = mobile | |
} | |
if (role) { | |
userDetails.role = role | |
} | |
if (type) { | |
userDetails.type = type | |
} | |
if (status) { | |
userDetails.status = status | |
} | |
if (primaryOffice) { | |
userDetails.primaryOffice = { | |
id: primaryOffice.id, | |
name: primaryOffice.name, | |
alias: primaryOffice.alias, | |
status: primaryOffice.status | |
} | |
} | |
if (catchmentArea) { | |
const areaWithLocations: GQLLocation[] = catchmentArea as GQLLocation[] | |
const potentialCatchmentAreas = areaWithLocations.map( | |
(cArea: GQLLocation) => { | |
if (cArea.identifier) { | |
const identifiers: GQLIdentifier[] = | |
cArea.identifier as GQLIdentifier[] | |
return { | |
id: cArea.id, | |
name: cArea.name, | |
alias: cArea.alias, | |
status: cArea.status, | |
identifier: identifiers.map((identifier: GQLIdentifier) => { | |
return { | |
system: identifier.system, | |
value: identifier.value | |
} | |
}) | |
} | |
} | |
return {} | |
} | |
) as IGQLLocation[] | |
if (potentialCatchmentAreas !== undefined) { | |
userDetails.catchmentArea = potentialCatchmentAreas | |
} | |
} | |
if (avatar) { | |
userDetails.avatar = avatar | |
} | |
return userDetails | |
} |
Maybe we can remove it from the schema?
IUserDetails
doesn't have any signature field.
Isn't the signature part of the export interface IUserDetails {
userMgntUserID?: string
practitionerId?: string
mobile?: string
role?: string
type?: string
status?: string
name?: Array<GQLHumanName | null>
catchmentArea?: IGQLLocation[]
primaryOffice?: IGQLLocation
localRegistrar?: {
name: Array<GQLHumanName | null>
role?: string
signature?: GQLSignature
}
avatar?: IAvatar
} |
I was talking about this one
|
…lways be read through localRegistrar
I removed the signature field now. We might need to add it back if we implement a feature for sysadmins to update signatures or something like that. For now it's good though 👍 |
jest wasnt waiting for a test in registration/root-resolvers and it was silently failing
I tried writing a test for this, but there's just so many FHIR requests being made in type resolvers, that I gave up