Skip to content

Commit 9d269b9

Browse files
committed
fix: OU-1236 Kebab icon should be disable while "Checking permissions" is happening
1 parent 57f0b76 commit 9d269b9

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

web/src/components/dashboards/perses/dashboard-list.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {
3636
DuplicateActionModal,
3737
RenameActionModal,
3838
} from './dashboard-action-modals';
39+
import { useEditableProjects } from './hooks/useEditableProjects';
3940
const perPageOptions = [
4041
{ title: '10', value: 10 },
4142
{ title: '20', value: 20 },
@@ -58,7 +59,9 @@ const DashboardActionsCell = React.memo(
5859
emptyActions: any[];
5960
}) => {
6061
const { t } = useTranslation(process.env.I18N_NAMESPACE);
61-
const { canEdit, loading } = usePersesEditPermissions(project);
62+
63+
const { permissionsLoading } = useEditableProjects();
64+
const { canEdit } = usePersesEditPermissions(project);
6265
const disabled = !canEdit;
6366

6467
const rowSpecificActions = useMemo(
@@ -79,7 +82,7 @@ const DashboardActionsCell = React.memo(
7982
[dashboard, onRename, onDuplicate, onDelete, t],
8083
);
8184

82-
if (disabled || loading) {
85+
if (disabled) {
8386
return (
8487
<Tooltip content={t("You don't have permissions for dashboard actions")}>
8588
<div>
@@ -88,6 +91,15 @@ const DashboardActionsCell = React.memo(
8891
</Tooltip>
8992
);
9093
}
94+
if (permissionsLoading) {
95+
return (
96+
<Tooltip content={t('Permissions are loading')}>
97+
<div>
98+
<ActionsColumn items={emptyActions} isDisabled={true} />
99+
</div>
100+
</Tooltip>
101+
);
102+
}
91103

92104
return <ActionsColumn items={rowSpecificActions} isDisabled={false} />;
93105
},

0 commit comments

Comments
 (0)