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
388b143b
Commit
388b143b
authored
May 14, 2020
by
Mayra Cabrera
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'expose-a11y-report-path' into 'master'
Expose a11y report path See merge request gitlab-org/gitlab!31921
parents
d2e9a476
4039b06e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
33 deletions
+41
-33
app/assets/javascripts/reports/accessibility_report/store/getters.js
...javascripts/reports/accessibility_report/store/getters.js
+6
-17
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
...avascripts/vue_merge_request_widget/mr_widget_options.vue
+1
-3
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-1
app/serializers/merge_request_poll_widget_entity.rb
app/serializers/merge_request_poll_widget_entity.rb
+6
-0
spec/frontend/reports/accessibility_report/store/getters_spec.js
...ontend/reports/accessibility_report/store/getters_spec.js
+6
-12
spec/serializers/merge_request_poll_widget_entity_spec.rb
spec/serializers/merge_request_poll_widget_entity_spec.rb
+22
-0
No files found.
app/assets/javascripts/reports/accessibility_report/store/getters.js
View file @
388b143b
...
...
@@ -37,23 +37,12 @@ export const summaryStatus = state => {
export
const
shouldRenderIssuesList
=
state
=>
Object
.
values
(
state
.
report
).
some
(
x
=>
Array
.
isArray
(
x
)
&&
x
.
length
>
0
);
export
const
unresolvedIssues
=
state
=>
[
...
state
.
report
.
existing_errors
,
...
state
.
report
.
existing_warnings
,
...
state
.
report
.
existing_notes
,
];
export
const
resolvedIssues
=
state
=>
[
...
state
.
report
.
resolved_errors
,
...
state
.
report
.
resolved_warnings
,
...
state
.
report
.
resolved_notes
,
];
export
const
newIssues
=
state
=>
[
...
state
.
report
.
new_errors
,
...
state
.
report
.
new_warnings
,
...
state
.
report
.
new_notes
,
];
// We could just map state, but we're going to iterate in the future
// to add notes and warnings to these issue lists, so I'm going to
// keep these as getters
export
const
unresolvedIssues
=
state
=>
state
.
report
.
existing_errors
;
export
const
resolvedIssues
=
state
=>
state
.
report
.
resolved_errors
;
export
const
newIssues
=
state
=>
state
.
report
.
new_errors
;
// prevent babel-plugin-rewire from generating an invalid default during karma tests
export
default
()
=>
{};
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
View file @
388b143b
...
...
@@ -40,7 +40,6 @@ import TerraformPlan from './components/mr_widget_terraform_plan.vue';
import
GroupedTestReportsApp
from
'
../reports/components/grouped_test_reports_app.vue
'
;
import
{
setFaviconOverlay
}
from
'
../lib/utils/common_utils
'
;
import
GroupedAccessibilityReportsApp
from
'
../reports/accessibility_report/grouped_accessibility_reports_app.vue
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
export
default
{
el
:
'
#js-vue-mr-widget
'
,
...
...
@@ -80,7 +79,6 @@ export default {
TerraformPlan
,
GroupedAccessibilityReportsApp
,
},
mixins
:
[
glFeatureFlagsMixin
()],
props
:
{
mrData
:
{
type
:
Object
,
...
...
@@ -146,7 +144,7 @@ export default {
});
},
shouldShowAccessibilityReport
()
{
return
this
.
mr
.
accessibilityReportPath
&&
this
.
glFeatures
.
accessibilityMergeRequestWidget
;
return
this
.
mr
.
accessibilityReportPath
;
},
},
watch
:
{
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
388b143b
...
...
@@ -32,7 +32,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
push_frontend_feature_flag
(
:code_navigation
,
@project
)
push_frontend_feature_flag
(
:widget_visibility_polling
,
@project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:merge_ref_head_comments
,
@project
)
push_frontend_feature_flag
(
:accessibility_merge_request_widget
,
@project
)
push_frontend_feature_flag
(
:mr_commit_neighbor_nav
,
@project
,
default_enabled:
true
)
end
...
...
app/serializers/merge_request_poll_widget_entity.rb
View file @
388b143b
...
...
@@ -71,6 +71,12 @@ class MergeRequestPollWidgetEntity < Grape::Entity
end
end
expose
:accessibility_report_path
do
|
merge_request
|
if
merge_request
.
has_accessibility_reports?
accessibility_reports_project_merge_request_path
(
merge_request
.
project
,
merge_request
,
format: :json
)
end
end
expose
:terraform_reports_path
do
|
merge_request
|
if
merge_request
.
has_terraform_reports?
terraform_reports_project_merge_request_path
(
merge_request
.
project
,
merge_request
,
format: :json
)
...
...
spec/frontend/reports/accessibility_report/store/getters_spec.js
View file @
388b143b
...
...
@@ -115,39 +115,33 @@ describe('Accessibility reports store getters', () => {
});
describe
(
'
unresolvedIssues
'
,
()
=>
{
it
(
'
returns
concatenated array of unresolved errors, warnings, and note
s
'
,
()
=>
{
it
(
'
returns
the array unresolved error
s
'
,
()
=>
{
localState
.
report
=
{
existing_errors
:
[
1
],
existing_warnings
:
[
2
],
existing_notes
:
[
3
],
};
const
result
=
[
1
,
2
,
3
];
const
result
=
[
1
];
expect
(
getters
.
unresolvedIssues
(
localState
)).
toEqual
(
result
);
});
});
describe
(
'
resolvedIssues
'
,
()
=>
{
it
(
'
returns
concatenated array of resolved errors, warnings, and note
s
'
,
()
=>
{
it
(
'
returns
array of resolved error
s
'
,
()
=>
{
localState
.
report
=
{
resolved_errors
:
[
1
],
resolved_warnings
:
[
2
],
resolved_notes
:
[
3
],
};
const
result
=
[
1
,
2
,
3
];
const
result
=
[
1
];
expect
(
getters
.
resolvedIssues
(
localState
)).
toEqual
(
result
);
});
});
describe
(
'
newIssues
'
,
()
=>
{
it
(
'
returns
concatenated array of new errors, warnings, and note
s
'
,
()
=>
{
it
(
'
returns
array of new error
s
'
,
()
=>
{
localState
.
report
=
{
new_errors
:
[
1
],
new_warnings
:
[
2
],
new_notes
:
[
3
],
};
const
result
=
[
1
,
2
,
3
];
const
result
=
[
1
];
expect
(
getters
.
newIssues
(
localState
)).
toEqual
(
result
);
});
...
...
spec/serializers/merge_request_poll_widget_entity_spec.rb
View file @
388b143b
...
...
@@ -93,6 +93,28 @@ describe MergeRequestPollWidgetEntity do
end
end
describe
'accessibility_report_path'
do
context
'when merge request has accessibility reports'
do
before
do
allow
(
resource
).
to
receive
(
:has_accessibility_reports?
).
and_return
(
true
)
end
it
'set the path to poll data'
do
expect
(
subject
[
:accessibility_report_path
]).
to
be_present
end
end
context
'when merge request has no accessibility reports'
do
before
do
allow
(
resource
).
to
receive
(
:has_accessibility_reports?
).
and_return
(
false
)
end
it
'set the path to poll data'
do
expect
(
subject
[
:accessibility_report_path
]).
to
be_nil
end
end
end
describe
'exposed_artifacts_path'
do
context
'when merge request has exposed artifacts'
do
before
do
...
...
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