Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 4df2084

Browse files
#327 - do not show deactivated users in group based search
1 parent 830c106 commit 4df2084

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

client/src/components/ProfileCard/helper.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import config from "../../config";
22
import * as groupLib from "../../lib/groups";
3+
import { getSingleOrg } from "../../services/user-org";
34

45
/**
56
* Checks if the skill exists by using its provider id and external id
@@ -425,3 +426,18 @@ export async function updateUserInDb(
425426
}
426427
}
427428
}
429+
430+
/**
431+
* Determines if the user is deactivated in the current org
432+
* @param {Object} profile The user profile
433+
*/
434+
export function isUserDeactivated(profile) {
435+
const { externalProfiles } = profile;
436+
const organizationId = getSingleOrg();
437+
438+
const externalProfile = externalProfiles.find(
439+
(ep) => ep.organizationId === organizationId
440+
);
441+
442+
return externalProfile.isInactive;
443+
}

client/src/components/ProfileCard/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function ProfileCard({
5858
avatarColor,
5959
// Indicates if the user has been deactivated. The user is still shown in this case, but with a
6060
// clear indicator about its deactivated status.
61-
isDeactivated: false,
61+
isDeactivated: cardHelper.isUserDeactivated(profile),
6262
};
6363
} else {
6464
// Data is already in the format seen above. No further processing needed

0 commit comments

Comments
 (0)