Skip to content

Commit

Permalink
Merge pull request #506 from hmcts/nfdiv-4461-support-search-fields-f…
Browse files Browse the repository at this point in the history
…or-multiple-roles

[NFDIV-4461] Allow same search field to be used by different roles
  • Loading branch information
adamg-hmcts authored Dec 6, 2024
2 parents f20292a + 5fe4b41 commit e4855e3
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ protected static <T, R extends HasRole> void generateFields(
result.add(map);
}
}

Path output = Paths.get(root.getPath(), fileName + ".json");
JsonUtils.mergeInto(output, result, new AddMissing(), "CaseFieldID");
JsonUtils.mergeInto(output, result, new AddMissing(), "CaseFieldID", "UserRole");
}

protected static Map<String, Object> buildField(String caseType, String fieldId, String label, int displayOrder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ private void buildSearchInputFields() {
.field(CaseData::getCaseName, "Case name")
.field(CaseData::getFamilyManCaseNumber, "FamilyMan case number")
.field(CaseData::getDateOfIssue, "Date of Issue", HMCTS_ADMIN)
.field(CaseData::getDateOfIssue, "Date of Issue", LOCAL_AUTHORITY)
.field("hearingPreferencesWelsh", "Is in Welsh")
.caseReferenceField()
.field("allocatedJudge", "Allocated Judge", "judgeTitle", "hearingPreferencesWelsh=\"no\"")
Expand Down Expand Up @@ -220,6 +221,7 @@ private void buildWorkBasketInputFields() {
.field(CaseData::getCaseName, "Case name")
.field(CaseData::getFamilyManCaseNumber, "FamilyMan case number")
.field(CaseData::getHearingDetails, "Hearing Details", LOCAL_AUTHORITY)
.field(CaseData::getHearingDetails, "Hearing Details", HMCTS_ADMIN)
.field("hearingPreferencesWelsh", "Is in Welsh")
.caseReferenceField()
.field(CaseData::getDateSubmitted, "Date submitted", "", "#DATETIMEDISPLAY(d MMMM yyyy)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
"LiveFrom": "01/01/2017",
"CaseFieldID": "standardDirectionOrder"
},
{
"CRUD": "R",
"CaseTypeID": "CARE_SUPERVISION_EPO",
"UserRole": "caseworker-publiclaw-courtadmin",
"LiveFrom": "01/01/2017",
"CaseFieldID": "hearingDetails"
},
{
"CRUD": "R",
"CaseTypeID": "CARE_SUPERVISION_EPO",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@
"LiveFrom": "01/01/2017",
"CaseFieldID": "allocatedJudgeLabel"
},
{
"CRUD" : "R",
"CaseTypeID" : "CARE_SUPERVISION_EPO",
"UserRole" : "caseworker-publiclaw-solicitor",
"LiveFrom" : "01/01/2017",
"CaseFieldID" : "dateOfIssue"
},
{
"CRUD": "CR",
"CaseTypeID": "CARE_SUPERVISION_EPO",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
"UserRole" : "caseworker-publiclaw-courtadmin",
"Label" : "Date of Issue"
},
{
"LiveFrom" : "01/01/2017",
"CaseTypeID" : "CARE_SUPERVISION_EPO",
"CaseFieldID" : "dateOfIssue",
"UserRole" : "caseworker-publiclaw-solicitor",
"Label" : "Date of Issue"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
"UserRole" : "caseworker-publiclaw-solicitor",
"Label" : "Hearing Details"
},
{
"LiveFrom" : "01/01/2017",
"CaseTypeID" : "CARE_SUPERVISION_EPO",
"CaseFieldID" : "hearingDetails",
"UserRole" : "caseworker-publiclaw-courtadmin",
"Label" : "Hearing Details"
},
{
"LiveFrom": "01/01/2017",
"CaseTypeID": "CARE_SUPERVISION_EPO",
Expand Down

0 comments on commit e4855e3

Please sign in to comment.