From bcbb438a65563d19fa67f28bd8410c53e7133254 Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Thu, 14 Nov 2024 13:22:06 +0100 Subject: [PATCH] fix(list): disable edit buttons when no access --- .../sectionList/listActions/DefaultListActions.tsx | 10 ++++++++-- .../sectionList/listActions/SectionListActions.tsx | 10 +++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/components/sectionList/listActions/DefaultListActions.tsx b/src/components/sectionList/listActions/DefaultListActions.tsx index 5bff8796..cd1fa369 100644 --- a/src/components/sectionList/listActions/DefaultListActions.tsx +++ b/src/components/sectionList/listActions/DefaultListActions.tsx @@ -1,6 +1,7 @@ import React from 'react' -import { BaseListModel, useSchemaFromHandle } from '../../../lib' +import { BaseListModel, TOOLTIPS, useSchemaFromHandle } from '../../../lib' import { canEditModel, canDeleteModel } from '../../../lib/models/access' +import { TooltipWrapper } from '../../tooltip' import { ListActions, ActionEdit, ActionMore } from './SectionListActions' type DefaultListActionProps = { @@ -26,7 +27,12 @@ export const DefaultListActions = ({ return ( - + + + { ) } -export const ActionEdit = ({ modelId }: { modelId: string }) => { +export const ActionEdit = ({ + modelId, + disabled, +}: { + modelId: string + disabled?: boolean +}) => { const preservedSearchState = useLocationSearchState() return ( } onClick={(_, e) => {