@@ -33,6 +33,7 @@ export const VersionRow: React.FC<VersionRowProps> = ({
33
33
} ) ;
34
34
35
35
const jobStatus = version . job . status ;
36
+ const showActions = onPromoteClick || onArchiveClick ;
36
37
37
38
return (
38
39
< TimelineEntry
@@ -77,6 +78,7 @@ export const VersionRow: React.FC<VersionRowProps> = ({
77
78
< Stack direction = "row" alignItems = "center" spacing = { 2 } >
78
79
{ isActive && < Pill text = "Active" type = "success" /> }
79
80
{ isLatest && < Pill text = "Newest" type = "info" /> }
81
+
80
82
{ jobStatus === "pending" && (
81
83
< Pill text = { < > Pending…</ > } type = "warning" lightBorder />
82
84
) }
@@ -87,34 +89,35 @@ export const VersionRow: React.FC<VersionRowProps> = ({
87
89
< Pill text = "Canceled" type = "neutral" lightBorder />
88
90
) }
89
91
{ jobStatus === "failed" && < Pill text = "Failed" type = "error" /> }
90
- { jobStatus === "failed" ? (
91
- < Button
92
- css = { styles . promoteButton }
93
- disabled = { isActive || version . archived }
94
- onClick = { ( e ) => {
95
- e . preventDefault ( ) ;
96
- e . stopPropagation ( ) ;
97
- if ( onArchiveClick ) {
98
- onArchiveClick ( version . id ) ;
99
- }
100
- } }
101
- >
102
- Archive…
103
- </ Button >
104
- ) : (
105
- < Button
106
- css = { styles . promoteButton }
107
- disabled = { isActive || jobStatus !== "succeeded" }
108
- onClick = { ( e ) => {
109
- e . preventDefault ( ) ;
110
- e . stopPropagation ( ) ;
111
- if ( onPromoteClick ) {
112
- onPromoteClick ( version . id ) ;
113
- }
114
- } }
115
- >
116
- Promote…
117
- </ Button >
92
+
93
+ { showActions && (
94
+ < >
95
+ { jobStatus === "failed" ? (
96
+ < Button
97
+ css = { styles . promoteButton }
98
+ disabled = { isActive || version . archived }
99
+ onClick = { ( e ) => {
100
+ e . preventDefault ( ) ;
101
+ e . stopPropagation ( ) ;
102
+ onArchiveClick ?.( version . id ) ;
103
+ } }
104
+ >
105
+ Archive…
106
+ </ Button >
107
+ ) : (
108
+ < Button
109
+ css = { styles . promoteButton }
110
+ disabled = { isActive || jobStatus !== "succeeded" }
111
+ onClick = { ( e ) => {
112
+ e . preventDefault ( ) ;
113
+ e . stopPropagation ( ) ;
114
+ onPromoteClick ?.( version . id ) ;
115
+ } }
116
+ >
117
+ Promote…
118
+ </ Button >
119
+ ) }
120
+ </ >
118
121
) }
119
122
</ Stack >
120
123
</ Stack >
0 commit comments