@@ -19,6 +19,7 @@ import {
19
19
ButtonStyleType ,
20
20
ButtonVariantType ,
21
21
ComponentSizeType ,
22
+ handleAnalyticsEvent ,
22
23
Icon ,
23
24
noop ,
24
25
stopPropagation ,
@@ -54,15 +55,18 @@ const ChartCard = ({
54
55
const addChartTab = ( e ) : void => {
55
56
stopPropagation ( e )
56
57
addChart ( chart . id )
58
+ handleAnalyticsEvent ( { category : 'Chart store add icon' , action : 'CS_BULK_DEPLOY_ADD_CHART' } )
57
59
}
58
60
59
61
const removeChartTab = ( e ) : void => {
60
62
stopPropagation ( e )
61
63
subtractChart ( chart . id )
64
+ handleAnalyticsEvent ( { category : 'Chart store remove icon' , action : 'CS_BULK_DEPLOY_REMOVE_CHART' } )
62
65
}
63
66
64
67
const onClickChartSelect = ( ) : void => {
65
68
onClick ( chart . id )
69
+ handleAnalyticsEvent ( { category : 'Chart store card' , action : 'CS_CHART_CARD_CLICKED' } )
66
70
}
67
71
68
72
const renderAddIcon = ( ) => (
@@ -74,7 +78,7 @@ const ChartCard = ({
74
78
variant = { ButtonVariantType . borderLess }
75
79
size = { ComponentSizeType . small }
76
80
style = { ButtonStyleType . default }
77
- ariaLabel = "Add charts to deploy "
81
+ ariaLabel = "Add chart to selection "
78
82
/>
79
83
</ div >
80
84
)
@@ -88,7 +92,7 @@ const ChartCard = ({
88
92
size = { ComponentSizeType . small }
89
93
style = { ButtonStyleType . negativeGrey }
90
94
showAriaLabelInTippy = { selectedCount > 0 }
91
- ariaLabel = "Remove charts from selection"
95
+ ariaLabel = "Remove chart from selection"
92
96
/>
93
97
)
94
98
@@ -102,6 +106,15 @@ const ChartCard = ({
102
106
</ div >
103
107
)
104
108
109
+ const getDescriptionTruncate = ( ) => {
110
+ if ( isListView ) {
111
+ return 'dc__truncate--clamp-4'
112
+ }
113
+
114
+ if ( chart . deprecated ) return 'dc__truncate'
115
+ return 'dc__truncate--clamp-2'
116
+ }
117
+
105
118
const renderCardInfo = ( ) => (
106
119
< div className = "flexbox-col flex-grow-1 dc__gap-8" >
107
120
< div className = "flexbox-col dc__gap-2" >
@@ -118,7 +131,7 @@ const ChartCard = ({
118
131
{ chart . deprecated && renderDeprecatedWarning ( ) }
119
132
</ div >
120
133
121
- < span className = { `fw-4 fs-13 lh-20 ${ chart . deprecated ? 'dc__truncate' : 'dc__truncate--clamp-2' } ` } >
134
+ < span className = { `fw-4 fs-13 lh-20 ${ getDescriptionTruncate ( ) } ` } >
122
135
{ chart . description || 'No description' }
123
136
</ span >
124
137
</ div >
0 commit comments