Commit 59856d1 1 parent 261a585 commit 59856d1 Copy full SHA for 59856d1
File tree 6 files changed +52
-11
lines changed
packages/components/src/components
6 files changed +52
-11
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,11 @@ class DetailsHeader extends Component {
52
52
const { intl, reason, status, taskRun } = this . props ;
53
53
const { reason : taskReason , status : taskStatus } = getStatus ( taskRun ) ;
54
54
55
- if ( status === 'cancelled' ) {
55
+ if (
56
+ status === 'cancelled' ||
57
+ ( status === 'terminated' &&
58
+ ( reason === 'TaskRunCancelled' || reason === 'TaskRunTimeout' ) )
59
+ ) {
56
60
return intl . formatMessage ( {
57
61
id : 'dashboard.taskRun.status.cancelled' ,
58
62
defaultMessage : 'Cancelled'
Original file line number Diff line number Diff line change @@ -98,7 +98,8 @@ limitations under the License.
98
98
}
99
99
& [data-status = ' cancelled' ],
100
100
& [data-reason = ' PipelineRunCancelled' ],
101
- & [data-reason = ' TaskRunCancelled' ] {
101
+ & [data-reason = ' TaskRunCancelled' ],
102
+ & [data-reason = ' TaskRunTimeout' ] {
102
103
.tkn--status-icon {
103
104
fill : $failed ;
104
105
}
Original file line number Diff line number Diff line change @@ -45,6 +45,20 @@ it('DetailsHeader renders the cancelled state', () => {
45
45
expect ( queryByText ( / C a n c e l l e d / i) ) . toBeTruthy ( ) ;
46
46
} ) ;
47
47
48
+ it ( 'DetailsHeader renders the cancelled state for TaskRunCancelled' , ( ) => {
49
+ const { queryByText } = renderWithIntl (
50
+ < DetailsHeader { ...props } status = "terminated" reason = "TaskRunCancelled" />
51
+ ) ;
52
+ expect ( queryByText ( / C a n c e l l e d / i) ) . toBeTruthy ( ) ;
53
+ } ) ;
54
+
55
+ it ( 'DetailsHeader renders the cancelled state for TaskRunTimeout' , ( ) => {
56
+ const { queryByText } = renderWithIntl (
57
+ < DetailsHeader { ...props } status = "terminated" reason = "TaskRunTimeout" />
58
+ ) ;
59
+ expect ( queryByText ( / C a n c e l l e d / i) ) . toBeTruthy ( ) ;
60
+ } ) ;
61
+
48
62
it ( 'DetailsHeader renders the failed state' , ( ) => {
49
63
const { queryByText } = renderWithIntl (
50
64
< DetailsHeader { ...props } status = "terminated" />
Original file line number Diff line number Diff line change @@ -57,7 +57,11 @@ class Step extends Component {
57
57
statusLabel ( ) {
58
58
const { intl, reason, status } = this . props ;
59
59
60
- if ( status === 'cancelled' ) {
60
+ if (
61
+ status === 'cancelled' ||
62
+ ( status === 'terminated' &&
63
+ ( reason === 'TaskRunCancelled' || reason === 'TaskRunTimeout' ) )
64
+ ) {
61
65
return intl . formatMessage ( {
62
66
id : 'dashboard.taskRun.status.cancelled' ,
63
67
defaultMessage : 'Cancelled'
Original file line number Diff line number Diff line change @@ -112,14 +112,18 @@ limitations under the License.
112
112
font-weight : bold ;
113
113
}
114
114
}
115
- & [data-status = ' cancelled' ] > a .tkn--step-link {
116
- opacity : 1 ;
117
- .tkn--step-icon {
118
- fill : $failed ;
119
- }
120
- .tkn--status-label {
121
- color : $failed ;
122
- font-weight : bold ;
115
+ & [data-status = ' cancelled' ],
116
+ & [data-status = ' terminated' ][data-reason = ' TaskRunCancelled' ],
117
+ & [data-status = ' terminated' ][data-reason = ' TaskRunTimeout' ] {
118
+ > a .tkn--step-link {
119
+ opacity : 1 ;
120
+ .tkn--step-icon {
121
+ fill : $failed ;
122
+ }
123
+ .tkn--status-label {
124
+ color : $failed ;
125
+ font-weight : bold ;
126
+ }
123
127
}
124
128
}
125
129
}
Original file line number Diff line number Diff line change @@ -47,6 +47,20 @@ it('Step renders cancelled state', () => {
47
47
expect ( queryByText ( / C a n c e l l e d / i) ) . toBeTruthy ( ) ;
48
48
} ) ;
49
49
50
+ it ( 'Step renders cancelled state for TaskRunCancelled' , ( ) => {
51
+ const { queryByText } = renderWithIntl (
52
+ < Step status = "terminated" reason = "TaskRunCancelled" />
53
+ ) ;
54
+ expect ( queryByText ( / C a n c e l l e d / i) ) . toBeTruthy ( ) ;
55
+ } ) ;
56
+
57
+ it ( 'Step renders cancelled state for TaskRunTimeout' , ( ) => {
58
+ const { queryByText } = renderWithIntl (
59
+ < Step status = "terminated" reason = "TaskRunTimeout" />
60
+ ) ;
61
+ expect ( queryByText ( / C a n c e l l e d / i) ) . toBeTruthy ( ) ;
62
+ } ) ;
63
+
50
64
it ( 'Step renders completed state' , ( ) => {
51
65
const { queryByText } = renderWithIntl (
52
66
< Step status = "terminated" reason = "Completed" />
You can’t perform that action at this time.
0 commit comments