File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Brokers/Broker/Configs/TableComponents/InputCell
common/ActionComponent/ActionButton/ActionCanButton Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 11import React , { type FC } from 'react' ;
2- import { Button } from 'components/common/Button/Button' ;
32import EditIcon from 'components/common/Icons/EditIcon' ;
43import type { ConfigUnit } from 'components/Brokers/Broker/Configs/lib/types' ;
54import Tooltip from 'components/common/Tooltip/Tooltip' ;
65import { getConfigDisplayValue } from 'components/Brokers/Broker/Configs/lib/utils' ;
6+ import { ActionButton } from 'components/common/ActionComponent' ;
7+ import { Action , ResourceType } from 'generated-sources' ;
78
89import * as S from './styled' ;
910
@@ -37,15 +38,20 @@ const InputCellViewMode: FC<InputCellViewModeProps> = ({
3738 </ S . Value >
3839 < Tooltip
3940 value = {
40- < Button
41+ < ActionButton
4142 buttonType = "primary"
4243 buttonSize = "S"
4344 aria-label = "editAction"
4445 onClick = { onEdit }
4546 disabled = { isReadOnly }
47+ message = { isReadOnly ? '' : undefined }
48+ permission = { {
49+ resource : ResourceType . CLUSTERCONFIG ,
50+ action : Action . EDIT ,
51+ } }
4652 >
4753 < EditIcon /> Edit
48- </ Button >
54+ </ ActionButton >
4955 }
5056 showTooltip = { isReadOnly }
5157 content = "Property is read-only"
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const ActionButton: React.FC<Props> = ({
2828 return (
2929 < S . Wrapper ref = { refs . setReference } >
3030 < Button { ...props } disabled = { disabled || isDisabled } />
31- { open && (
31+ { open && message && (
3232 < S . MessageTooltipLimited
3333 ref = { refs . setFloating }
3434 style = { {
You can’t perform that action at this time.
0 commit comments