File tree Expand file tree Collapse file tree 1 file changed +36
-38
lines changed
src/Shared/Components/ImageCard/SequentialCDCardTitle Expand file tree Collapse file tree 1 file changed +36
-38
lines changed Original file line number Diff line number Diff line change @@ -68,54 +68,52 @@ const SequentialCDCardTitle = ({
68
68
}
69
69
70
70
const addFlexGap = stageType !== STAGE_TYPE . CD
71
+ const noContent =
72
+ ( stageType !== STAGE_TYPE . CD && ! isLatest && ! additionalInfo ) ||
73
+ ( stageType === STAGE_TYPE . CD &&
74
+ ! isLatest &&
75
+ ! isRunningOnParentCD &&
76
+ ! Object . values ( ARTIFACT_STATUS ) . includes ( artifactStatus ) &&
77
+ ! showLatestTag &&
78
+ ! deployedOn ?. length &&
79
+ ! additionalInfo )
80
+
81
+ if ( noContent ) {
82
+ return null
83
+ }
71
84
72
85
const renderContent = ( ) => {
73
86
if ( stageType !== STAGE_TYPE . CD ) {
74
- if ( isLatest || additionalInfo ) {
75
- return (
76
- < >
77
- { isLatest && < span className = "last-deployed-status" > Last Run</ span > }
78
- { additionalInfo }
79
- </ >
80
- )
81
- }
82
-
83
- return null
84
- }
85
-
86
- if (
87
- isLatest ||
88
- isRunningOnParentCD ||
89
- Object . values ( ARTIFACT_STATUS ) . includes ( artifactStatus ) ||
90
- showLatestTag ||
91
- deployedOn ?. length ||
92
- additionalInfo
93
- ) {
94
87
return (
95
88
< >
96
- { renderDeployedEnvironmentName ( ) }
97
- { artifactStatus === ARTIFACT_STATUS . PROGRESSING && (
98
- < DeploymentEnvState envStateText = { DEPLOYMENT_ENV_TEXT . DEPLOYING } title = { environmentName } />
99
- ) }
100
- { ( artifactStatus === ARTIFACT_STATUS . DEGRADED || artifactStatus === ARTIFACT_STATUS . FAILED ) && (
101
- < DeploymentEnvState envStateText = { DEPLOYMENT_ENV_TEXT . FAILED } title = { environmentName } />
102
- ) }
103
- { showLatestTag && (
104
- < ImageTagButton
105
- text = "Latest"
106
- isSoftDeleted = { false }
107
- isEditing = { false }
108
- tagId = { 0 }
109
- softDeleteTags = { [ ] }
110
- isSuperAdmin
111
- />
112
- ) }
89
+ { isLatest && < span className = "last-deployed-status" > Last Run</ span > }
113
90
{ additionalInfo }
114
91
</ >
115
92
)
116
93
}
117
94
118
- return null
95
+ return (
96
+ < >
97
+ { renderDeployedEnvironmentName ( ) }
98
+ { artifactStatus === ARTIFACT_STATUS . PROGRESSING && (
99
+ < DeploymentEnvState envStateText = { DEPLOYMENT_ENV_TEXT . DEPLOYING } title = { environmentName } />
100
+ ) }
101
+ { ( artifactStatus === ARTIFACT_STATUS . DEGRADED || artifactStatus === ARTIFACT_STATUS . FAILED ) && (
102
+ < DeploymentEnvState envStateText = { DEPLOYMENT_ENV_TEXT . FAILED } title = { environmentName } />
103
+ ) }
104
+ { showLatestTag && (
105
+ < ImageTagButton
106
+ text = "Latest"
107
+ isSoftDeleted = { false }
108
+ isEditing = { false }
109
+ tagId = { 0 }
110
+ softDeleteTags = { [ ] }
111
+ isSuperAdmin
112
+ />
113
+ ) }
114
+ { additionalInfo }
115
+ </ >
116
+ )
119
117
}
120
118
121
119
return (
You can’t perform that action at this time.
0 commit comments