@@ -81,6 +81,10 @@ export interface ActivityControlWidgetProps extends TestableComponent {
8181 * execution timer messages for waiting and running times.
8282 */
8383 timerExecutionMsg ?: JSX . Element | null ;
84+ /**
85+ * additional actions that can serve as a complex component, positioned between the default actions and the context menu
86+ */
87+ additionalActions ?: React . ReactElement < unknown > [ ] ;
8488}
8589
8690interface IActivityContextMenu extends TestableComponent {
@@ -110,11 +114,13 @@ interface IActivityMenuAction extends ActivityControlWidgetAction {
110114/** Shows the status of activities and supports actions on these activities. */
111115export function ActivityControlWidget ( props : ActivityControlWidgetProps ) {
112116 const {
113- "data-test-id" : dataTestId ,
117+ "data-test-id" : dataTestIdLegacy ,
118+ "data-testid" : dataTestId ,
114119 progressBar,
115120 progressSpinner,
116121 activityActions,
117122 activityContextMenu,
123+ additionalActions,
118124 small,
119125 border,
120126 hasSpacing,
@@ -126,10 +132,19 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) {
126132 } = props ;
127133 const spinnerClassNames = ( progressSpinner ?. className ?? "" ) + ` ${ eccgui } -spinner--permanent` ;
128134 const widget = (
129- < OverviewItem data-test-id = { dataTestId } hasSpacing = { border || hasSpacing } densityHigh = { small } >
135+ < OverviewItem
136+ data-test-id = { dataTestIdLegacy }
137+ data-testid = { dataTestId }
138+ hasSpacing = { border || hasSpacing }
139+ densityHigh = { small }
140+ >
130141 { progressBar && < ProgressBar { ...progressBar } /> }
131142 { ( progressSpinner || progressSpinnerFinishedIcon ) && (
132- < OverviewItemDepiction keepColors >
143+ < OverviewItemDepiction
144+ data-testid = { dataTestId ? `${ dataTestId } -progress-spinner` : undefined }
145+ data-test-id = { dataTestIdLegacy ? `${ dataTestIdLegacy } -progress-spinner` : undefined }
146+ keepColors
147+ >
133148 { progressSpinnerFinishedIcon ? (
134149 React . cloneElement ( progressSpinnerFinishedIcon as JSX . Element , { small, large : ! small } )
135150 ) : (
@@ -145,13 +160,21 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) {
145160 ) }
146161 < OverviewItemDescription >
147162 { props . label && (
148- < OverviewItemLine small = { small } >
163+ < OverviewItemLine
164+ data-testid = { dataTestId ? `${ dataTestId } -label` : undefined }
165+ data-test-id = { dataTestIdLegacy ? `${ dataTestIdLegacy } -label` : undefined }
166+ small = { small }
167+ >
149168 { React . cloneElement ( labelWrapper , { } , props . label ) }
150169 { timerExecutionMsg && ( props . statusMessage || tags ) && < > ({ timerExecutionMsg } )</ > }
151170 </ OverviewItemLine >
152171 ) }
153172 { ( props . statusMessage || tags ) && (
154- < OverviewItemLine small >
173+ < OverviewItemLine
174+ data-testid = { dataTestId ? `${ dataTestId } -status-message` : undefined }
175+ data-test-id = { dataTestIdLegacy ? `${ dataTestIdLegacy } -status-message` : undefined }
176+ small
177+ >
155178 { tags }
156179 { props . statusMessage && (
157180 < OverflowText passDown >
@@ -172,28 +195,43 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) {
172195 </ OverviewItemLine >
173196 ) }
174197 { timerExecutionMsg && ! ( props . statusMessage || tags ) && (
175- < OverviewItemLine small > { timerExecutionMsg } </ OverviewItemLine >
198+ < OverviewItemLine
199+ data-testid = { dataTestId ? `${ dataTestId } -status-message` : undefined }
200+ data-test-id = { dataTestIdLegacy ? `${ dataTestIdLegacy } -status-message` : undefined }
201+ small
202+ >
203+ { timerExecutionMsg }
204+ </ OverviewItemLine >
176205 ) }
177206 </ OverviewItemDescription >
178- < OverviewItemActions >
207+ < OverviewItemActions
208+ data-testid = { dataTestId ? `${ dataTestId } -actions` : undefined }
209+ data-test-id = { dataTestIdLegacy ? `${ dataTestIdLegacy } -actions` : undefined }
210+ >
179211 { activityActions &&
180212 activityActions . map ( ( action , idx ) => {
181213 return (
182214 < IconButton
183- key = { typeof action . icon === "string" ? action . icon : action [ "data-test-id" ] ?? idx }
215+ key = {
216+ typeof action . icon === "string"
217+ ? action . icon
218+ : action [ "data-test-id" ] ?? action [ "data-testid" ] ?? idx
219+ }
184220 data-test-id = { action [ "data-test-id" ] }
221+ data-testid = { action [ "data-testid" ] }
185222 name = { action . icon }
186223 text = { action . tooltip }
187224 onClick = { action . action }
188225 disabled = { action . disabled }
189- hasStateWarning = { action . hasStateWarning }
226+ intent = { action . hasStateWarning ? "warning" : undefined }
190227 tooltipProps = { {
191228 hoverOpenDelay : 200 ,
192229 placement : "bottom" ,
193230 } }
194231 />
195232 ) ;
196233 } ) }
234+ { additionalActions }
197235 { activityContextMenu && activityContextMenu . menuItems . length > 0 && (
198236 < ContextMenu
199237 data-test-id = { activityContextMenu [ "data-test-id" ] }
0 commit comments