@@ -18,39 +18,33 @@ export interface ActionButtonProps {
1818handleAction :( buildParameters ?:WorkspaceBuildParameter [ ] ) => void ;
1919disabled ?:boolean ;
2020tooltipText ?:string ;
21+ isRunning ?:boolean ;
22+ requireActiveVersion ?:boolean ;
2123}
2224
23- export const UpdateAndStartButton :FC < ActionButtonProps > = ( {
25+ export const UpdateButton :FC < ActionButtonProps > = ( {
2426handleAction,
2527loading,
28+ isRunning,
29+ requireActiveVersion,
2630} ) => {
2731return (
28- < Tooltip title = "Start workspace with the latest template version." >
32+ < Tooltip
33+ title = {
34+ requireActiveVersion
35+ ?"This template requires automatic updates on workspace startup. Contact your administrator if you want to preserve the template version."
36+ :isRunning
37+ ?"Stop workspace and restart it with the latest template version."
38+ :"Start workspace with the latest template version."
39+ }
40+ >
2941< TopbarButton
30- disabled = { loading }
3142data-testid = "workspace-update-button"
32- onClick = { ( ) => handleAction ( ) }
33- >
34- < CirclePlayIcon />
35- { loading ?< > Updating…</ > :< > Update…</ > }
36- </ TopbarButton >
37- </ Tooltip >
38- ) ;
39- } ;
40-
41- export const UpdateAndRestartButton :FC < ActionButtonProps > = ( {
42- handleAction,
43- loading,
44- } ) => {
45- return (
46- < Tooltip title = "Stop workspace, if running, and restart it with the latest template version." >
47- < TopbarButton
4843disabled = { loading }
49- data-testid = "workspace-update-and-restart-button"
5044onClick = { ( ) => handleAction ( ) }
5145>
52- < RotateCcwIcon />
53- { loading ?< > Updating…</ > :< > Update and restart …</ > }
46+ { isRunning ? < RotateCcwIcon /> : < CirclePlayIcon /> }
47+ { loading ?< > Updating…</ > :< > Update…</ > }
5448</ TopbarButton >
5549</ Tooltip >
5650) ;
@@ -103,19 +97,6 @@ export const StartButton: FC<ActionButtonPropsWithWorkspace> = ({
10397) ;
10498} ;
10599
106- export const UpdateAndStartButtonRequireActiveVersion :FC <
107- ActionButtonProps
108- > = ( { handleAction} ) => {
109- return (
110- < Tooltip title = "This template requires automatic updates on workspace startup. Contact your administrator if you want to preserve the template version." >
111- < TopbarButton onClick = { ( ) => handleAction ( ) } >
112- < CirclePlayIcon />
113- Update and start…
114- </ TopbarButton >
115- </ Tooltip >
116- ) ;
117- } ;
118-
119100export const StopButton :FC < ActionButtonProps > = ( {
120101handleAction,
121102loading,
@@ -157,19 +138,6 @@ export const RestartButton: FC<ActionButtonPropsWithWorkspace> = ({
157138) ;
158139} ;
159140
160- export const UpdateAndRestartButtonRequireActiveVersion :FC <
161- ActionButtonProps
162- > = ( { handleAction} ) => {
163- return (
164- < Tooltip title = "This template requires automatic updates on workspace startup. Contact your administrator if you want to preserve the template version." >
165- < TopbarButton onClick = { ( ) => handleAction ( ) } >
166- < RotateCcwIcon />
167- Update and restart…
168- </ TopbarButton >
169- </ Tooltip >
170- ) ;
171- } ;
172-
173141export const CancelButton :FC < ActionButtonProps > = ( { handleAction} ) => {
174142return (
175143< TopbarButton onClick = { ( ) => handleAction ( ) } >