Skip to content

Commit

Permalink
Merge pull request #2715 from techmatters/gian_CHI-3107
Browse files Browse the repository at this point in the history
feat: add isPII flag to form definitions [CHI-3107]
  • Loading branch information
GPaoloni authored Jan 21, 2025
2 parents 3691707 + 4f5048e commit 5df492b
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"summary": { "isPII": true }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
"name": "firstName",
"type": "input",
"label": "First Name",
"required": { "value": true, "message": "RequiredFieldError" }
"required": { "value": true, "message": "RequiredFieldError" },
"isPII": true
},
{
"name": "lastName",
"type": "input",
"label": "Last Name",
"required": { "value": true, "message": "RequiredFieldError" }
"required": { "value": true, "message": "RequiredFieldError" },
"isPII": true
},
{
"name": "relationshipToChild",
Expand All @@ -32,7 +34,8 @@
{
"name": "streetAddress",
"label": "Street Address",
"type": "input"
"type": "input",
"isPII": true
},
{
"name": "province",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
"name": "firstName",
"type": "input",
"label": "First Name",
"required": { "value": true, "message": "RequiredFieldError" }
"required": { "value": true, "message": "RequiredFieldError" },
"isPII": true
},
{
"name": "lastName",
"type": "input",
"label": "Last Name",
"required": { "value": true, "message": "RequiredFieldError" }
"required": { "value": true, "message": "RequiredFieldError" },
"isPII": true
},
{
"name": "relationshipToChild",
Expand All @@ -32,7 +34,8 @@
{
"name": "streetAddress",
"label": "Street Address",
"type": "input"
"type": "input",
"isPII": true
},
{
"name": "province",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": { "isPII": true },
"identifiers": { "isPII": true }
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"type": "textarea",
"rows": 20,
"width": 500,
"placeholder": "Enter Details"
"placeholder": "Enter Details",
"isPII": true
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
{
"name": "firstName",
"label": "First Name",
"type": "input"
"type": "input",
"isPII": true
},
{
"name": "lastName",
"label": "Last Name",
"type": "input"
"type": "input",
"isPII": true
},
{
"name": "relationshipToChild",
Expand All @@ -31,7 +33,8 @@
{
"name": "streetAddress",
"label": "Street Address",
"type": "input"
"type": "input",
"isPII": true
},
{
"name": "province",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"name": "callSummary",
"label": "Contact Summary",
"type": "textarea",
"required": { "value": true, "message": "RequiredFieldError" }
"required": { "value": true, "message": "RequiredFieldError" },
"isPII": true
},
{
"name": "repeatCaller",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
{
"name": "firstName",
"label": "First Name",
"type": "input"
"type": "input",
"isPII": true
},
{
"name": "lastName",
"label": "Last Name",
"type": "input"
"type": "input",
"isPII": true
},
{
"name": "gender",
Expand Down Expand Up @@ -63,7 +65,8 @@
{
"name": "streetAddress",
"label": "Street Address",
"type": "input"
"type": "input",
"isPII": true
},
{
"name": "city",
Expand Down Expand Up @@ -126,12 +129,14 @@
{
"name": "phone1",
"label": "Phone #1",
"type": "input"
"type": "input",
"isPII": true
},
{
"name": "phone2",
"label": "Phone #2",
"type": "input"
"type": "input",
"isPII": true
},
{
"name": "language",
Expand Down
2 changes: 2 additions & 0 deletions hrm-form-definitions/src/__tests__/fetchDefinitionsMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const BASE_URL_MOCK = 'http://base_url_mock';

const files = [
'LayoutDefinitions.json',
'caseForms/CaseOverview.json',
'caseForms/HouseholdForm.json',
'caseForms/IncidentForm.json',
'caseForms/NoteForm.json',
Expand All @@ -47,6 +48,7 @@ const files = [
'PrepopulateKeys.json',
'ReferenceData.json',
'BlockedEmojis.json',
'profileForms/ProfileOverview.json',
'profileForms/Sections.json',
'profileForms/FlagDurations.json',
];
Expand Down
22 changes: 20 additions & 2 deletions hrm-form-definitions/src/formDefinition/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export enum FormInputType {
CustomContactComponent = 'custom-contact-component',
}

type IsPIIFlag = {
isPII?: boolean;
};

/**
* Types used for customizable forms
*/
Expand All @@ -57,7 +61,8 @@ type ItemBase = {
label: string;
type: FormInputType;
metadata?: Record<string, any>;
} & RegisterOptions;
} & IsPIIFlag &
RegisterOptions;

type NonSaveable = {
saveable: false;
Expand Down Expand Up @@ -201,7 +206,7 @@ export declare type ProfileSectionDefinition = {
rows: number;
placeholder: string;
width: number;
};
} & IsPIIFlag;

export declare type ProfileFlagDurationDefinition = {
flag: string;
Expand Down Expand Up @@ -307,11 +312,23 @@ export type StatusInfo = {
transitions: string[]; // possible statuses this one can transition to (further update may be to include who can make such a transition for a more granular control)
};

export type CaseOverviewDefinition = {
followUpDate?: IsPIIFlag;
childIsAtRisk?: IsPIIFlag;
summary?: IsPIIFlag;
};

export type ProfileOverviewDefinition = {
name?: IsPIIFlag;
identifiers?: IsPIIFlag;
};

/**
* Type that defines a complete version for all the customizable forms used across the app
*/
export type DefinitionVersion = {
caseForms: {
// CaseOverview: CaseOverviewDefinition;
HouseholdForm: FormDefinition;
IncidentForm: FormDefinition;
NoteForm: FormDefinition;
Expand Down Expand Up @@ -352,6 +369,7 @@ export type DefinitionVersion = {
referenceData?: Record<string, any>;
blockedEmojis: string[];
profileForms?: {
// ProfileOverview: ProfileOverviewDefinition;
Sections: ProfileSectionDefinition[];
FlagDurations: ProfileFlagDurationDefinition[];
};
Expand Down
2 changes: 0 additions & 2 deletions plugin-hrm-form/src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export type CSAMReportEntry = {
} & Omit<EntryInfo, 'id'>;

export type CaseOverview = {

followUpDate?: string;
childIsAtRisk?: boolean;
summary?: string;
Expand Down Expand Up @@ -97,7 +96,6 @@ export type Case = {
previousStatus?: string;
categories: Record<string, string[]>;
firstContact?: Contact;

};

export type TwilioStoredMedia = {
Expand Down

0 comments on commit 5df492b

Please sign in to comment.