@@ -11,16 +11,12 @@ import { disabledPropertyView } from "comps/utils/propertyUtils";
1111import styled , { css } from "styled-components" ;
1212import { styleControl } from "comps/controls/styleControl" ;
1313import { TableColumnLinkStyle } from "comps/controls/styleControlConstants" ;
14- import { clickEvent , eventHandlerControl } from "comps/controls/eventHandlerControl" ;
1514
1615export const ColumnValueTooltip = trans ( "table.columnValueTooltip" ) ;
1716
18- const LinkEventOptions = [ clickEvent ] as const ;
19-
2017const childrenMap = {
2118 text : StringControl ,
2219 onClick : ActionSelectorControlInContext ,
23- onEvent : eventHandlerControl ( LinkEventOptions ) ,
2420 disabled : BoolCodeControl ,
2521 style : styleControl ( TableColumnLinkStyle ) ,
2622} ;
@@ -37,16 +33,13 @@ const StyledLink = styled.a<{ $disabled: boolean }>`
3733 ${ ( props ) => props . $disabled && disableCss } ;
3834` ;
3935
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 } ) => {
4238 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 ( ) ;
4841 }
49- } , [ disabled , onClick , onEvent ] ) ;
42+ } , [ disabled , onClick ] ) ;
5043
5144 return (
5245 < StyledLink
@@ -113,7 +106,7 @@ export const LinkComp = (function () {
113106 childrenMap ,
114107 ( props , dispatch ) => {
115108 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 } /> ;
117110 } ,
118111 ( nodeValue ) => nodeValue . text . value ,
119112 getBaseValue
@@ -125,27 +118,19 @@ export const LinkComp = (function () {
125118 onChangeEnd = { props . onChangeEnd }
126119 />
127120 ) )
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+ ) )
149134 . setStylePropertyViewFn ( ( children ) => (
150135 < >
151136 { children . style . getPropertyView ( ) }
0 commit comments