Commit f90a8af4 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'vs/enable-several-vue-eslint-rules' into 'master'

Enable several Vue.js ESLint rules

See merge request gitlab-org/gitlab!63918
parents db7ead88 62cb5422
...@@ -31,11 +31,6 @@ rules: ...@@ -31,11 +31,6 @@ rules:
- error - error
- allowElseIf: true - allowElseIf: true
lines-between-class-members: off lines-between-class-members: off
# Disabled for now, to make the plugin-vue 4.5 -> 5.0 update smoother
vue/no-confusing-v-for-v-if: error
vue/no-use-v-if-with-v-for: off
vue/no-v-html: error
vue/use-v-on-exact: off
# all offenses of no-jquery/no-animate-toggle are false positives ( $toast.show() ) # all offenses of no-jquery/no-animate-toggle are false positives ( $toast.show() )
no-jquery/no-animate-toggle: off no-jquery/no-animate-toggle: off
no-jquery/no-event-shorthand: off no-jquery/no-event-shorthand: off
......
...@@ -95,6 +95,9 @@ export default { ...@@ -95,6 +95,9 @@ export default {
} }
return __('Blocked issue'); return __('Blocked issue');
}, },
assignees() {
return this.issue.assignees.filter((_, index) => this.shouldRenderAssignee(index));
},
}, },
methods: { methods: {
isIndexLessThanlimit(index) { isIndexLessThanlimit(index) {
...@@ -215,8 +218,7 @@ export default { ...@@ -215,8 +218,7 @@ export default {
</div> </div>
<div class="board-card-assignee gl-display-flex"> <div class="board-card-assignee gl-display-flex">
<user-avatar-link <user-avatar-link
v-for="(assignee, index) in issue.assignees" v-for="assignee in assignees"
v-if="shouldRenderAssignee(index)"
:key="assignee.id" :key="assignee.id"
:link-href="assigneeUrl(assignee)" :link-href="assigneeUrl(assignee)"
:img-alt="avatarUrlTitle(assignee)" :img-alt="avatarUrlTitle(assignee)"
......
...@@ -70,6 +70,13 @@ export default { ...@@ -70,6 +70,13 @@ export default {
? this.getNotePositionStyle(this.movingNoteNewPosition) ? this.getNotePositionStyle(this.movingNoteNewPosition)
: this.getNotePositionStyle(this.currentCommentForm); : this.getNotePositionStyle(this.currentCommentForm);
}, },
visibleNotes() {
if (this.resolvedDiscussionsExpanded) {
return this.notes;
}
return this.notes.filter((note) => !note.resolved);
},
}, },
methods: { methods: {
setNewNoteCoordinates({ x, y }) { setNewNoteCoordinates({ x, y }) {
...@@ -272,8 +279,7 @@ export default { ...@@ -272,8 +279,7 @@ export default {
></button> ></button>
<design-note-pin <design-note-pin
v-for="note in notes" v-for="note in visibleNotes"
v-if="resolvedDiscussionsExpanded || !note.resolved"
:key="note.id" :key="note.id"
:label="note.index" :label="note.index"
:position=" :position="
......
...@@ -12,6 +12,11 @@ export default { ...@@ -12,6 +12,11 @@ export default {
ServiceLevelAgreementForm: () => ServiceLevelAgreementForm: () =>
import('ee_component/incidents_settings/components/service_level_agreement_form.vue'), import('ee_component/incidents_settings/components/service_level_agreement_form.vue'),
}, },
computed: {
activeTabs() {
return this.$options.tabs.filter((tab) => tab.active);
},
},
tabs: INTEGRATION_TABS_CONFIG, tabs: INTEGRATION_TABS_CONFIG,
i18n: I18N_INTEGRATION_TABS, i18n: I18N_INTEGRATION_TABS,
}; };
...@@ -42,8 +47,7 @@ export default { ...@@ -42,8 +47,7 @@ export default {
<gl-tabs> <gl-tabs>
<service-level-agreement-form /> <service-level-agreement-form />
<gl-tab <gl-tab
v-for="(tab, index) in $options.tabs" v-for="(tab, index) in activeTabs"
v-if="tab.active"
:key="`${tab.title}_${index}`" :key="`${tab.title}_${index}`"
:title="tab.title" :title="tab.title"
> >
......
...@@ -24,6 +24,9 @@ export default { ...@@ -24,6 +24,9 @@ export default {
hasPDF() { hasPDF() {
return this.pdf && this.pdf.length > 0; return this.pdf && this.pdf.length > 0;
}, },
availablePages() {
return this.pages.filter(Boolean);
},
}, },
watch: { pdf: 'load' }, watch: { pdf: 'load' },
mounted() { mounted() {
...@@ -61,13 +64,7 @@ export default { ...@@ -61,13 +64,7 @@ export default {
<template> <template>
<div v-if="hasPDF" class="pdf-viewer"> <div v-if="hasPDF" class="pdf-viewer">
<page <page v-for="(page, index) in availablePages" :key="index" :page="page" :number="index + 1" />
v-for="(page, index) in pages"
v-if="page"
:key="index"
:page="page"
:number="index + 1"
/>
</div> </div>
</template> </template>
......
...@@ -52,7 +52,6 @@ exports[`IncidentsSettingTabs should render the component 1`] = ` ...@@ -52,7 +52,6 @@ exports[`IncidentsSettingTabs should render the component 1`] = `
data-testid="PagerDutySettingsForm-tab" data-testid="PagerDutySettingsForm-tab"
/> />
</gl-tab-stub> </gl-tab-stub>
<!---->
</gl-tabs-stub> </gl-tabs-stub>
</div> </div>
</section> </section>
......
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