Commit dad353e4 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch '216966-remove-the-caneditstages-property-from-vsa' into 'master'

Remove the `canEditStages` property from VSA

Closes #216966

See merge request gitlab-org/gitlab!34830
parents 8a2c838c bef6968b
...@@ -25,11 +25,6 @@ export default { ...@@ -25,11 +25,6 @@ export default {
default: '', default: '',
required: false, required: false,
}, },
canEdit: {
type: Boolean,
default: false,
required: false,
},
}, },
computed: { computed: {
hasValue() { hasValue() {
......
...@@ -342,7 +342,6 @@ export default { ...@@ -342,7 +342,6 @@ export default {
:stages="activeStages" :stages="activeStages"
:medians="medians" :medians="medians"
:is-creating-custom-stage="isCreatingCustomStage" :is-creating-custom-stage="isCreatingCustomStage"
:can-edit-stages="true"
:custom-ordering="enableCustomOrdering" :custom-ordering="enableCustomOrdering"
@reorderStage="onStageReorder" @reorderStage="onStageReorder"
@selectStage="onStageSelect" @selectStage="onStageSelect"
......
...@@ -6,11 +6,6 @@ export default { ...@@ -6,11 +6,6 @@ export default {
type: Boolean, type: Boolean,
required: true, required: true,
}, },
canEdit: {
type: Boolean,
default: false,
required: false,
},
}, },
data() { data() {
return { return {
......
...@@ -31,11 +31,6 @@ export default { ...@@ -31,11 +31,6 @@ export default {
default: 0, default: 0,
required: false, required: false,
}, },
canEdit: {
type: Boolean,
default: false,
required: false,
},
id: { id: {
// The IDs of stages are strings until custom stages have been added. // The IDs of stages are strings until custom stages have been added.
// Only at this point the IDs become numbers, so we have to allow both. // Only at this point the IDs become numbers, so we have to allow both.
...@@ -56,14 +51,8 @@ export default { ...@@ -56,14 +51,8 @@ export default {
median() { median() {
return approximateDuration(this.value); return approximateDuration(this.value);
}, },
editable() {
return this.canEdit;
},
menuOpen() {
return this.canEdit && this.isHover;
},
openMenuClasses() { openMenuClasses() {
return this.menuOpen ? 'd-flex justify-content-end' : ''; return this.isHover ? 'd-flex justify-content-end' : '';
}, },
}, },
mounted() { mounted() {
...@@ -100,11 +89,7 @@ export default { ...@@ -100,11 +89,7 @@ export default {
@mouseover="handleHover(true)" @mouseover="handleHover(true)"
@mouseleave="handleHover()" @mouseleave="handleHover()"
> >
<stage-card-list-item <stage-card-list-item :is-active="isActive" class="d-flex justify-space-between">
:is-active="isActive"
:can-edit="editable"
class="d-flex justify-space-between"
>
<div <div
ref="title" ref="title"
class="stage-nav-item-cell stage-name text-truncate w-50 pr-2" class="stage-nav-item-cell stage-name text-truncate w-50 pr-2"
...@@ -120,7 +105,7 @@ export default { ...@@ -120,7 +105,7 @@ export default {
<span v-if="hasValue">{{ median }}</span> <span v-if="hasValue">{{ median }}</span>
<span v-else class="stage-empty">{{ __('Not enough data') }}</span> <span v-else class="stage-empty">{{ __('Not enough data') }}</span>
</div> </div>
<div v-show="menuOpen" ref="dropdown" :class="[openMenuClasses]" class="dropdown w-25"> <div v-show="isHover" ref="dropdown" :class="[openMenuClasses]" class="dropdown w-25">
<gl-deprecated-button <gl-deprecated-button
:title="__('More actions')" :title="__('More actions')"
class="more-actions-toggle btn btn-transparent p-0" class="more-actions-toggle btn btn-transparent p-0"
......
...@@ -29,10 +29,6 @@ export default { ...@@ -29,10 +29,6 @@ export default {
type: Boolean, type: Boolean,
required: true, required: true,
}, },
canEditStages: {
type: Boolean,
required: true,
},
customOrdering: { customOrdering: {
type: Boolean, type: Boolean,
required: false, required: false,
...@@ -92,7 +88,6 @@ export default { ...@@ -92,7 +88,6 @@ export default {
:title="stage.title" :title="stage.title"
:value="medianValue(stage.id)" :value="medianValue(stage.id)"
:is-active="!isCreatingCustomStage && stage.id === currentStage.id" :is-active="!isCreatingCustomStage && stage.id === currentStage.id"
:can-edit="canEditStages"
:is-default-stage="!stage.custom" :is-default-stage="!stage.custom"
@remove="$emit($options.STAGE_ACTIONS.REMOVE, stage.id)" @remove="$emit($options.STAGE_ACTIONS.REMOVE, stage.id)"
@hide="$emit($options.STAGE_ACTIONS.HIDE, { id: stage.id, hidden: true })" @hide="$emit($options.STAGE_ACTIONS.HIDE, { id: stage.id, hidden: true })"
...@@ -100,7 +95,6 @@ export default { ...@@ -100,7 +95,6 @@ export default {
@edit="$emit($options.STAGE_ACTIONS.EDIT, stage)" @edit="$emit($options.STAGE_ACTIONS.EDIT, stage)"
/> />
<add-stage-button <add-stage-button
v-if="canEditStages"
:class="$options.noDragClass" :class="$options.noDragClass"
:active="isCreatingCustomStage" :active="isCreatingCustomStage"
@showform="$emit('showAddStageForm')" @showform="$emit('showAddStageForm')"
......
...@@ -13,7 +13,6 @@ describe('StageTableNav', () => { ...@@ -13,7 +13,6 @@ describe('StageTableNav', () => {
stages, stages,
isCreatingCustomStage: false, isCreatingCustomStage: false,
customStageFormActive: false, customStageFormActive: false,
canEditStages: false,
customOrdering: false, customOrdering: false,
errorSavingStageOrder: false, errorSavingStageOrder: false,
...props, ...props,
...@@ -61,22 +60,10 @@ describe('StageTableNav', () => { ...@@ -61,22 +60,10 @@ describe('StageTableNav', () => {
}); });
}); });
describe('canEditStages = true', () => {
beforeEach(() => {
wrapper = createComponent({
props: {
canEditStages: true,
},
});
});
afterEach(() => {
wrapper.destroy();
});
it('will render the add a stage button', () => { it('will render the add a stage button', () => {
wrapper = createComponent();
expect(wrapper.find(AddStageButton).exists()).toBe(true); expect(wrapper.find(AddStageButton).exists()).toBe(true);
}); });
});
describe.each` describe.each`
flag | value flag | value
......
...@@ -10,7 +10,6 @@ describe('StageNavItem', () => { ...@@ -10,7 +10,6 @@ describe('StageNavItem', () => {
const func = shallow ? shallowMount : mount; const func = shallow ? shallowMount : mount;
return func(StageNavItem, { return func(StageNavItem, {
propsData: { propsData: {
canEdit: false,
isActive: false, isActive: false,
isUserAllowed: false, isUserAllowed: false,
isDefaultStage: true, isDefaultStage: true,
...@@ -125,7 +124,7 @@ describe('StageNavItem', () => { ...@@ -125,7 +124,7 @@ describe('StageNavItem', () => {
describe('User can edit stages', () => { describe('User can edit stages', () => {
beforeEach(() => { beforeEach(() => {
wrapper = createComponent({ canEdit: true, isUserAllowed: true }, false); wrapper = createComponent({ isUserAllowed: true }, false);
}); });
afterEach(() => { afterEach(() => {
......
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