Commit 982e2c63 authored by Simon Knox's avatar Simon Knox

Merge branch...

Merge branch '291160-merge-request-doesn-t-fully-render-when-user-is-a-tool-admin-if-not-part-of-project' into 'master'

Fix MR rendering issue when user is tool admin

See merge request gitlab-org/gitlab!49258
parents fc3f3330 a0323939
...@@ -197,6 +197,9 @@ export default { ...@@ -197,6 +197,9 @@ export default {
shouldShowAccessibilityReport() { shouldShowAccessibilityReport() {
return this.mr.accessibilityReportPath; return this.mr.accessibilityReportPath;
}, },
formattedHumanAccess() {
return (this.mr.humanAccess || '').toLowerCase();
},
}, },
watch: { watch: {
state(newVal, oldVal) { state(newVal, oldVal) {
...@@ -434,7 +437,7 @@ export default { ...@@ -434,7 +437,7 @@ export default {
class="mr-widget-workflow" class="mr-widget-workflow"
:pipeline-path="mr.mergeRequestAddCiConfigPath" :pipeline-path="mr.mergeRequestAddCiConfigPath"
:pipeline-svg-path="mr.pipelinesEmptySvgPath" :pipeline-svg-path="mr.pipelinesEmptySvgPath"
:human-access="mr.humanAccess.toLowerCase()" :human-access="formattedHumanAccess"
:user-callouts-path="mr.userCalloutsPath" :user-callouts-path="mr.userCalloutsPath"
:user-callout-feature-id="mr.suggestPipelineFeatureId" :user-callout-feature-id="mr.suggestPipelineFeatureId"
@dismiss="dismissSuggestPipelines" @dismiss="dismissSuggestPipelines"
......
---
title: Fix MR rendering issue when user is tool admin and not project member
merge_request: 49258
author:
type: fixed
...@@ -250,7 +250,7 @@ export default { ...@@ -250,7 +250,7 @@ export default {
class="mr-widget-workflow" class="mr-widget-workflow"
:pipeline-path="mr.mergeRequestAddCiConfigPath" :pipeline-path="mr.mergeRequestAddCiConfigPath"
:pipeline-svg-path="mr.pipelinesEmptySvgPath" :pipeline-svg-path="mr.pipelinesEmptySvgPath"
:human-access="mr.humanAccess.toLowerCase()" :human-access="formattedHumanAccess"
:user-callouts-path="mr.userCalloutsPath" :user-callouts-path="mr.userCalloutsPath"
:user-callout-feature-id="mr.suggestPipelineFeatureId" :user-callout-feature-id="mr.suggestPipelineFeatureId"
@dismiss="dismissSuggestPipelines" @dismiss="dismissSuggestPipelines"
......
...@@ -260,6 +260,20 @@ describe('mrWidgetOptions', () => { ...@@ -260,6 +260,20 @@ describe('mrWidgetOptions', () => {
}); });
}); });
}); });
describe('formattedHumanAccess', () => {
it('when user is a tool admin but not a member of project', () => {
vm.mr.humanAccess = null;
expect(vm.formattedHumanAccess).toEqual('');
});
it('when user a member of the project', () => {
vm.mr.humanAccess = 'Owner';
expect(vm.formattedHumanAccess).toEqual('owner');
});
});
}); });
describe('methods', () => { describe('methods', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment