@@ -11,16 +11,12 @@ import { disabledPropertyView } from "comps/utils/propertyUtils";
11
11
import styled , { css } from "styled-components" ;
12
12
import { styleControl } from "comps/controls/styleControl" ;
13
13
import { TableColumnLinkStyle } from "comps/controls/styleControlConstants" ;
14
- import { clickEvent , eventHandlerControl } from "comps/controls/eventHandlerControl" ;
15
14
16
15
export const ColumnValueTooltip = trans ( "table.columnValueTooltip" ) ;
17
16
18
- const LinkEventOptions = [ clickEvent ] as const ;
19
-
20
17
const childrenMap = {
21
18
text : StringControl ,
22
19
onClick : ActionSelectorControlInContext ,
23
- onEvent : eventHandlerControl ( LinkEventOptions ) ,
24
20
disabled : BoolCodeControl ,
25
21
style : styleControl ( TableColumnLinkStyle ) ,
26
22
} ;
@@ -37,16 +33,13 @@ const StyledLink = styled.a<{ $disabled: boolean }>`
37
33
${ ( props ) => props . $disabled && disableCss } ;
38
34
` ;
39
35
40
- // Updated link component to handle both legacy and new event handlers
41
- export const ColumnLink = React . memo ( ( { disabled, label, onClick, onEvent } : { disabled : boolean ; label : string ; onClick ?: ( ) => void ; onEvent ?: ( eventName : string ) => void } ) => {
36
+ // Memoized link component
37
+ export const ColumnLink = React . memo ( ( { disabled, label, onClick } : { disabled : boolean ; label : string ; onClick ?: ( ) => void } ) => {
42
38
const handleClick = useCallback ( ( ) => {
43
- if ( ! disabled ) {
44
- // Trigger legacy onClick action for backward compatibility
45
- onClick ?.( ) ;
46
- // Trigger new event handlers
47
- onEvent ?.( "click" ) ;
39
+ if ( ! disabled && onClick ) {
40
+ onClick ( ) ;
48
41
}
49
- } , [ disabled , onClick , onEvent ] ) ;
42
+ } , [ disabled , onClick ] ) ;
50
43
51
44
return (
52
45
< StyledLink
@@ -113,7 +106,7 @@ export const LinkComp = (function () {
113
106
childrenMap ,
114
107
( props , dispatch ) => {
115
108
const value = props . changeValue ?? getBaseValue ( props , dispatch ) ;
116
- return < ColumnLink disabled = { props . disabled } label = { value } onClick = { props . onClick } onEvent = { props . onEvent } /> ;
109
+ return < ColumnLink disabled = { props . disabled } label = { value } onClick = { props . onClick } /> ;
117
110
} ,
118
111
( nodeValue ) => nodeValue . text . value ,
119
112
getBaseValue
@@ -125,27 +118,19 @@ export const LinkComp = (function () {
125
118
onChangeEnd = { props . onChangeEnd }
126
119
/>
127
120
) )
128
- . setPropertyViewFn ( ( children ) => {
129
- // Check if there's a legacy action configured
130
- const hasLegacyAction = children . onClick . getView ( ) &&
131
- typeof children . onClick . getView ( ) === 'function' &&
132
- children . onClick . displayName ( ) !== trans ( "eventHandler.incomplete" ) ;
133
-
134
- return (
135
- < >
136
- { children . text . propertyView ( {
137
- label : trans ( "table.columnValue" ) ,
138
- tooltip : ColumnValueTooltip ,
139
- } ) }
140
- { disabledPropertyView ( children ) }
141
- { children . onEvent . propertyView ( ) }
142
- { hasLegacyAction && children . onClick . propertyView ( {
143
- label : trans ( "table.action" ) ,
144
- placement : "table" ,
145
- } ) }
146
- </ >
147
- ) ;
148
- } )
121
+ . setPropertyViewFn ( ( children ) => (
122
+ < >
123
+ { children . text . propertyView ( {
124
+ label : trans ( "table.columnValue" ) ,
125
+ tooltip : ColumnValueTooltip ,
126
+ } ) }
127
+ { disabledPropertyView ( children ) }
128
+ { children . onClick . propertyView ( {
129
+ label : trans ( "table.action" ) ,
130
+ placement : "table" ,
131
+ } ) }
132
+ </ >
133
+ ) )
149
134
. setStylePropertyViewFn ( ( children ) => (
150
135
< >
151
136
{ children . style . getPropertyView ( ) }
0 commit comments