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