Skip to content
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

Bug/cot 726 final #443

Merged
merged 20 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e8e07de
Allow assigned users to be passed as a string or an array of strings
richardhenryash Jan 25, 2024
ff789eb
Merge branch 'bug/cot-726' into bug/cot-726-v3
richardhenryash Jan 25, 2024
bd5da91
Initialise assignedUser to a blank array
richardhenryash Jan 29, 2024
79c216e
Revert changes to ng-package.json
richardhenryash Jan 30, 2024
f5e1244
Fix logic if assignedUser is passed as a single string and update uni…
richardhenryash Jan 30, 2024
69a64b3
Update version number
richardhenryash Jan 30, 2024
24d8076
Update logic to compare singe assignedUser, add unit test to test add…
richardhenryash Jan 30, 2024
c07db70
Update version
richardhenryash Jan 30, 2024
59f2cf5
merge with master to update the branch and package versions
shahedhmcts Mar 20, 2024
42f7b2b
merge with master to update the branch and package versions
shahedhmcts Mar 20, 2024
276aa92
updated release version to package.json
shahedhmcts Mar 20, 2024
e2e26f5
Merge branch 'master' into bug/cot-726-final
anthonydummer Jul 31, 2024
97a1fa1
EXUI-1741 - resolving merge conflicts and updating version
anthonydummer Aug 1, 2024
d6d4ca1
EXUI-1741 - resolving merge conflicts and updating version in second …
anthonydummer Aug 1, 2024
2f8c5bb
EXUI-1741 - Modified logic in searchInCaseworkers.
anthonydummer Aug 5, 2024
9653bfc
EXUI-1741 - updating dev version number
anthonydummer Aug 5, 2024
3daac4c
EXUI-1741 - updating dev version number
anthonydummer Aug 5, 2024
ff6465d
Merge branch 'master' into bug/cot-726-final
anthonydummer Aug 20, 2024
ab5c6d7
Merge branch 'master' into bug/cot-726-final
anthonydummer Aug 20, 2024
38dfa87
Update ver num
Josh-HMCTS Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion projects/exui-common-lib/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"lib": {
"entryFile": "src/public-api.ts"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class FindPersonComponent implements OnInit, OnDestroy {
@Input() public selectedPerson: string;
@Input() public submitted: boolean = true;
@Input() public userIncluded?: boolean = false;
@Input() public assignedUser?: string;
@Input() public assignedUser?: string | string[];
@Input() public placeholderContent: string = '';
@Input() public isNoResultsShown: boolean = true;
@Input() public showUpdatedColor: boolean = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export interface SearchOptions {
userRole: PersonRole;
services: string[];
userIncluded?: boolean;
assignedUser?: string;
assignedUser?: string | string[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class FindAPersonService {

public static caseworkersKey: string = 'caseworkers';
public userId: string;
public assignedUser: string;
public assignedUser: string | string[] = [];

constructor(private readonly http: HttpClient, private readonly sessionStorageService: SessionStorageService) {
}
Expand All @@ -36,9 +36,9 @@ export class FindAPersonService {
const userInfo = JSON.parse(userInfoStr);
this.userId = userInfo.id ? userInfo.id : userInfo.uid;
}
this.assignedUser = searchOptions.assignedUser ? searchOptions.assignedUser : null;
this.assignedUser = searchOptions.assignedUser ? searchOptions.assignedUser : [];
return this.http.post<Person[]>('/workallocation/findPerson', { searchOptions })
.pipe(map(judiciary => judiciary.filter(judge => !([this.assignedUser].includes(judge.id)))));
.pipe(map(judiciary => judiciary.filter(judge => !(this.assignedUser.includes(judge.id)))));
// Removed the current user id to fix EUI-8465.
}

Expand All @@ -48,7 +48,7 @@ export class FindAPersonService {
const userInfo = JSON.parse(userInfoStr);
this.userId = userInfo.id ? userInfo.id : userInfo.uid;
}
this.assignedUser = searchOptions.assignedUser ? searchOptions.assignedUser : null;
this.assignedUser = searchOptions.assignedUser ? searchOptions.assignedUser : [];
const fullServices = searchOptions.services;
const storedServices = [];
const newServices: string[] = [];
Expand Down Expand Up @@ -116,7 +116,7 @@ export class FindAPersonService {
const people = caseworkers ? this.mapCaseworkers(caseworkers, roleCategory) : [];
const finalPeopleList = people.filter(person => person && person.name && person.name.toLowerCase().includes(searchTerm));
return searchOptions.userIncluded ? finalPeopleList.filter(person => person && person.id !== this.assignedUser)
: finalPeopleList.filter(person => person && person.id !== this.userId && person.id !== this.assignedUser);
: finalPeopleList.filter(person => person && person.id !== this.userId && !this.assignedUser.includes(person.id));
}

public searchJudicial(value: string, serviceId: string): Observable<JudicialUserModel[]> {
Expand Down
Loading