Skip to content

Commit

Permalink
Merge pull request #568 from Ferlab-Ste-Justine/feat/presc-341
Browse files Browse the repository at this point in the history
feat: PRESC-341 add option to remove user assigment
  • Loading branch information
claudia1296 authored Jan 24, 2025
2 parents 2796ee4 + ceb017d commit 7892a9e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/ui/Release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 10.15.5 2025-01-24
- feat: PRESC-341 no show user in assignment option

### 10.15.4 2025-01-22
- feat: PRESC-341 fix showldm assigment

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ferlab/ui",
"version": "10.15.4",
"version": "10.15.5",
"description": "Core components for scientific research data portals",
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type TAssignmentsSelect = {
dictionary?: IAssignmentsDictionary | Record<string, never>;
loading?: boolean;
showLdm?: boolean;
userIdToRemove?: string;
};

const tagRender =
Expand Down Expand Up @@ -61,8 +62,10 @@ const renderOptions = (
selectedItems: TPractitionnerInfo[],
setSelectedItems: React.Dispatch<React.SetStateAction<TPractitionnerInfo[]>>,
showLdm: boolean,
) =>
options?.map((value: TPractitionnerInfo) => (
userIdToRemove?: string,
) => {
const optionWithoutUser = userIdToRemove ? options.filter((o) => o.practitioner !== userIdToRemove) : options;
return optionWithoutUser?.map((value: TPractitionnerInfo) => (
<Button
className={styles.assignmentOption}
key={value.practitionerRoles_Id}
Expand All @@ -81,6 +84,7 @@ const renderOptions = (
/>
</Button>
));
};

export const AssignmentsSelect = ({
assignedPractionnerRoles,
Expand All @@ -89,6 +93,7 @@ export const AssignmentsSelect = ({
loading,
options,
showLdm = true,
userIdToRemove,
visibleOptions = false,
}: TAssignmentsSelect): ReactElement => {
const noAssignDefaultValue = [
Expand Down Expand Up @@ -171,6 +176,7 @@ export const AssignmentsSelect = ({
selectedItems,
setSelectedItems,
showLdm,
userIdToRemove,
)}
</ScrollContent>
</div>
Expand Down

0 comments on commit 7892a9e

Please sign in to comment.