mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-24 15:25:10 +00:00
MINOR: fix the add team error placeholder using wrong permission (#23522)
* fix the team error placeholder using wrong permission * remvoe the unwanted file (cherry picked from commit 11226b2b3fffaeb6d73e85d9ff5e7eb60b03d192)
This commit is contained in:
parent
21d36b0a79
commit
d080a58473
@ -206,13 +206,6 @@ const TeamDetailsV1 = ({
|
||||
navigate({ search: Qs.stringify({ activeTab: key }) });
|
||||
};
|
||||
|
||||
const { editUserPermission } = useMemo(() => {
|
||||
return {
|
||||
editUserPermission:
|
||||
entityPermissions.EditAll || entityPermissions.EditUsers,
|
||||
};
|
||||
}, [entityPermissions]);
|
||||
|
||||
/**
|
||||
* Take user id as input to find out the user data and set it for delete
|
||||
* @param id - user id
|
||||
@ -620,12 +613,12 @@ const TeamDetailsV1 = ({
|
||||
);
|
||||
|
||||
const teamsTableRender = useMemo(() => {
|
||||
let addUserButtonTitle = editUserPermission
|
||||
let addTeamButtonTitle = entityPermissions.Create
|
||||
? t('label.add-entity', { entity: t('label.team') })
|
||||
: t('message.no-permission-for-action');
|
||||
|
||||
if (isTeamDeleted) {
|
||||
addUserButtonTitle = t(
|
||||
addTeamButtonTitle = t(
|
||||
'message.this-action-is-not-allowed-for-deleted-entities'
|
||||
);
|
||||
}
|
||||
@ -651,11 +644,11 @@ const TeamDetailsV1 = ({
|
||||
}}
|
||||
/>
|
||||
</Typography.Paragraph>
|
||||
<Tooltip placement="top" title={addUserButtonTitle}>
|
||||
<Tooltip placement="top" title={addTeamButtonTitle}>
|
||||
<Button
|
||||
ghost
|
||||
data-testid="add-placeholder-button"
|
||||
disabled={!editUserPermission || isTeamDeleted}
|
||||
disabled={!entityPermissions.Create || isTeamDeleted}
|
||||
icon={<PlusOutlined />}
|
||||
type="primary"
|
||||
onClick={handleAddTeamButtonClick}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user