Commit a0323939 authored by Doug Stull's avatar Doug Stull Committed by Simon Knox

Resolve if user is tool admin on MR

- issues with humanAccess not having value
parent fa0fb8d8
......@@ -197,6 +197,9 @@ export default {
shouldShowAccessibilityReport() {
return this.mr.accessibilityReportPath;
},
formattedHumanAccess() {
return (this.mr.humanAccess || '').toLowerCase();
},
},
watch: {
state(newVal, oldVal) {
......@@ -434,7 +437,7 @@ export default {
class="mr-widget-workflow"
:pipeline-path="mr.mergeRequestAddCiConfigPath"
:pipeline-svg-path="mr.pipelinesEmptySvgPath"
:human-access="mr.humanAccess.toLowerCase()"
:human-access="formattedHumanAccess"
:user-callouts-path="mr.userCalloutsPath"
:user-callout-feature-id="mr.suggestPipelineFeatureId"
@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 {
class="mr-widget-workflow"
:pipeline-path="mr.mergeRequestAddCiConfigPath"
:pipeline-svg-path="mr.pipelinesEmptySvgPath"
:human-access="mr.humanAccess.toLowerCase()"
:human-access="formattedHumanAccess"
:user-callouts-path="mr.userCalloutsPath"
:user-callout-feature-id="mr.suggestPipelineFeatureId"
@dismiss="dismissSuggestPipelines"
......
......@@ -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', () => {
......
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