Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
48c2fc42
Commit
48c2fc42
authored
Feb 23, 2022
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide old MR widgets when the extension flag is enabled
Closes
https://gitlab.com/gitlab-org/gitlab/-/issues/352761
parent
76a9c8c7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
5 deletions
+37
-5
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
...avascripts/vue_merge_request_widget/mr_widget_options.vue
+1
-1
ee/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
...avascripts/vue_merge_request_widget/mr_widget_options.vue
+8
-4
ee/spec/features/merge_request/user_sees_status_checks_widget_spec.rb
...ures/merge_request/user_sees_status_checks_widget_spec.rb
+28
-0
No files found.
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
View file @
48c2fc42
...
...
@@ -574,7 +574,7 @@ export default {
/>
<grouped-accessibility-reports-app
v-if=
"shouldShowAccessibilityReport"
v-if=
"shouldShowAccessibilityReport
&& !shouldShowExtension
"
:endpoint=
"mr.accessibilityReportPath"
/>
...
...
ee/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
View file @
48c2fc42
...
...
@@ -83,7 +83,11 @@ export default {
return
threshold
+
totalScoreDelta
<=
0
;
},
shouldRenderBrowserPerformance
()
{
return
this
.
hasBrowserPerformancePaths
&&
this
.
hasBrowserPerformanceDegradation
;
return
(
this
.
hasBrowserPerformancePaths
&&
this
.
hasBrowserPerformanceDegradation
&&
!
this
.
shouldShowExtension
);
},
hasLoadPerformanceMetrics
()
{
return
(
...
...
@@ -352,7 +356,7 @@ export default {
:has-issues=
"hasBrowserPerformanceMetrics"
/>
<grouped-load-performance-reports-app
v-if=
"hasLoadPerformancePaths"
v-if=
"hasLoadPerformancePaths
&& !shouldShowExtension
"
:status=
"loadPerformanceStatus"
:loading-text=
"translateText('load-performance').loading"
:error-text=
"translateText('load-performance').error"
...
...
@@ -472,12 +476,12 @@ export default {
/>
<grouped-accessibility-reports-app
v-if=
"shouldShowAccessibilityReport"
v-if=
"shouldShowAccessibilityReport
&& !shouldShowExtension
"
:endpoint=
"mr.accessibilityReportPath"
/>
<status-checks-reports-app
v-if=
"shouldRenderStatusReport"
v-if=
"shouldRenderStatusReport
&& !shouldShowExtension
"
:endpoint=
"mr.apiStatusChecksPath"
/>
...
...
ee/spec/features/merge_request/user_sees_status_checks_widget_spec.rb
View file @
48c2fc42
...
...
@@ -23,6 +23,9 @@ RSpec.describe 'Merge request > User sees status checks widget', :js do
context
'user is authorized'
do
before
do
stub_feature_flags
(
refactor_mr_widgets_extensions:
false
)
stub_feature_flags
(
refactor_mr_widgets_extensions_user:
false
)
project
.
add_maintainer
(
user
)
sign_in
(
user
)
...
...
@@ -48,6 +51,31 @@ RSpec.describe 'Merge request > User sees status checks widget', :js do
end
end
context
'widget extension flag is enabled'
do
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
it
'shows the widget'
do
expect
(
page
).
to
have_content
(
'Status checks 1 pending'
)
end
it
'shows the status check issues'
,
:aggregate_failures
do
within
'[data-testid="widget-extension"]'
do
find
(
'[data-testid="toggle-button"]'
).
click
end
[
check1
,
check2
].
each
do
|
rule
|
icon_type
=
rule
.
approved?
(
merge_request
,
merge_request
.
source_branch_sha
)
?
'success'
:
'neutral'
expect
(
page
).
to
have_css
(
"[data-testid='status-
#{
icon_type
}
-icon']"
)
expect
(
page
).
to
have_content
(
"
#{
rule
.
name
}
:
#{
rule
.
external_url
}
"
)
end
end
end
context
'user is not logged in'
do
before
do
visit
project_merge_request_path
(
project
,
merge_request
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment