mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-12 15:57:44 +00:00
This commit is contained in:
parent
ad22292bc3
commit
a93584de12
@ -161,19 +161,31 @@ const Users = ({
|
||||
(role) => role.value !== toLower(TERM_ADMIN)
|
||||
);
|
||||
|
||||
// get the admin role and send it as boolean value `iaAdmin=Boolean(isAdmin)
|
||||
// get the admin role and send it as boolean value `isAdmin=Boolean(isAdmin)
|
||||
const isAdmin = selectedRoles.find(
|
||||
(role) => role.value === toLower(TERM_ADMIN)
|
||||
);
|
||||
updateUserDetails({
|
||||
roles: updatedRoles.map((role) => role.value),
|
||||
roles: updatedRoles.map((item) => {
|
||||
const roleId = item.value;
|
||||
const role = roles.find((r) => r.id === roleId);
|
||||
|
||||
return { id: roleId, type: 'role', name: role?.name || '' };
|
||||
}),
|
||||
isAdmin: Boolean(isAdmin),
|
||||
});
|
||||
|
||||
setIsRolesEdit(false);
|
||||
};
|
||||
const handleTeamsChange = () => {
|
||||
updateUserDetails({ teams: selectedTeams.map((team) => team.value) });
|
||||
updateUserDetails({
|
||||
teams: selectedTeams.map((item) => {
|
||||
const teamId = item.value;
|
||||
const team = teams.find((t) => t.id === teamId);
|
||||
|
||||
return { id: teamId, type: 'team', name: team?.name || '' };
|
||||
}),
|
||||
});
|
||||
|
||||
setIsTeamsEdit(false);
|
||||
};
|
||||
|
||||
@ -20,8 +20,16 @@ export interface Option {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
export interface PatchObject {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export type UserDetails = Record<string, string | Array<string> | boolean>;
|
||||
export type UserDetails = Record<
|
||||
string,
|
||||
string | Array<string> | boolean | Array<PatchObject>
|
||||
>;
|
||||
|
||||
export interface Props {
|
||||
userData: User;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user