@@ -10,6 +10,7 @@ import { visitUrl } from '../../lib/utils/url_utility';
10
10
import createFlash from ' ../../flash' ;
11
11
import MemoryUsage from ' ./memory_usage.vue' ;
12
12
import StatusIcon from ' ./mr_widget_status_icon.vue' ;
13
+ import ReviewAppLink from ' ./review_app_link.vue' ;
13
14
import MRWidgetService from ' ../services/mr_widget_service' ;
14
15
15
16
export default {
@@ -21,6 +22,7 @@ export default {
21
22
Icon,
22
23
TooltipOnTruncate,
23
24
FilteredSearchDropdown,
25
+ ReviewAppLink,
24
26
},
25
27
directives: {
26
28
tooltip,
@@ -63,6 +65,12 @@ export default {
63
65
deployedText () {
64
66
return this .$options .deployedTextMap [this .deployment .status ];
65
67
},
68
+ shouldRenderDropdown () {
69
+ return (
70
+ this .enableCiEnvironmentsStatusChanges &&
71
+ (this .deployment .changes && this .deployment .changes .length > 0 )
72
+ );
73
+ },
66
74
},
67
75
methods: {
68
76
stopEnvironment () {
@@ -133,7 +141,7 @@ export default {
133
141
<div >
134
142
<template v-if =" hasExternalUrls " >
135
143
<filtered-search-dropdown
136
- v-if =" enableCiEnvironmentsStatusChanges "
144
+ v-if =" shouldRenderDropdown "
137
145
class =" js-mr-wigdet-deployment-dropdown inline"
138
146
:items =" deployment.changes"
139
147
:main-action-link =" deployment.external_url"
@@ -143,18 +151,10 @@ export default {
143
151
slot="mainAction"
144
152
slot-scope="slotProps"
145
153
>
146
- <a
147
- :href =" deployment.external_url"
148
- target =" _blank"
149
- rel =" noopener noreferrer nofollow"
150
- class =" deploy-link js-deploy-url inline"
151
- :class =" slotProps.className"
152
- >
153
- <span >
154
- {{ __('View app') }}
155
- <icon name =" external-link" />
156
- </span >
157
- </a >
154
+ <review-app-link
155
+ :link =" deployment.external_url"
156
+ :css-class =" `deploy-link js-deploy-url inline ${slotProps.className}`"
157
+ />
158
158
</template >
159
159
160
160
<template
@@ -177,18 +177,11 @@ export default {
177
177
</a >
178
178
</template >
179
179
</filtered-search-dropdown >
180
- <a
180
+ <review-app-link
181
181
v-else
182
- :href =" deployment.external_url"
183
- target =" _blank"
184
- rel =" noopener noreferrer nofollow"
185
- class =" js-deploy-url js-deploy-url-feature-flag deploy-link btn btn-default btn-sm inline"
186
- >
187
- <span >
188
- {{ __('View app') }}
189
- <icon name =" external-link" />
190
- </span >
191
- </a >
182
+ :link =" deployment.external_url"
183
+ css-class =" js-deploy-url js-deploy-url-feature-flag deploy-link btn btn-default btn-sm inlin"
184
+ />
192
185
</template >
193
186
<loading-button
194
187
v-if =" deployment.stop_url"
0 commit comments