Commit b5e9e299 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'fix-vue-order-in-components-design_management' into 'master'

Fix component option order in design_management

See merge request gitlab-org/gitlab!51361
parents b1a77a8b 062778f9
...@@ -8,12 +8,6 @@ export default { ...@@ -8,12 +8,6 @@ export default {
components: { components: {
ApolloMutation, ApolloMutation,
}, },
props: {
filenames: {
type: Array,
required: true,
},
},
inject: { inject: {
projectPath: { projectPath: {
default: '', default: '',
...@@ -23,6 +17,12 @@ export default { ...@@ -23,6 +17,12 @@ export default {
defaut: '', defaut: '',
}, },
}, },
props: {
filenames: {
type: Array,
required: true,
},
},
computed: { computed: {
projectQueryBody() { projectQueryBody() {
return { return {
......
...@@ -21,6 +21,14 @@ export default { ...@@ -21,6 +21,14 @@ export default {
DesignTodoButton, DesignTodoButton,
}, },
mixins: [glFeatureFlagsMixin()], mixins: [glFeatureFlagsMixin()],
inject: {
projectPath: {
default: '',
},
issueIid: {
default: '',
},
},
props: { props: {
design: { design: {
type: Object, type: Object,
...@@ -41,14 +49,6 @@ export default { ...@@ -41,14 +49,6 @@ export default {
discussionWithOpenForm: '', discussionWithOpenForm: '',
}; };
}, },
inject: {
projectPath: {
default: '',
},
issueIid: {
default: '',
},
},
computed: { computed: {
discussions() { discussions() {
return extractDiscussions(this.design.discussions); return extractDiscussions(this.design.discussions);
......
...@@ -13,12 +13,6 @@ export default { ...@@ -13,12 +13,6 @@ export default {
TodoButton, TodoButton,
}, },
mixins: [allVersionsMixin], mixins: [allVersionsMixin],
props: {
design: {
type: Object,
required: true,
},
},
inject: { inject: {
projectPath: { projectPath: {
default: '', default: '',
...@@ -27,6 +21,12 @@ export default { ...@@ -27,6 +21,12 @@ export default {
default: '', default: '',
}, },
}, },
props: {
design: {
type: Object,
required: true,
},
},
data() { data() {
return { return {
todoLoading: false, todoLoading: false,
......
...@@ -18,6 +18,14 @@ export default { ...@@ -18,6 +18,14 @@ export default {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
mixins: [timeagoMixin], mixins: [timeagoMixin],
inject: {
projectPath: {
default: '',
},
issueIid: {
default: '',
},
},
props: { props: {
id: { id: {
type: String, type: String,
...@@ -58,14 +66,6 @@ export default { ...@@ -58,14 +66,6 @@ export default {
}, },
}; };
}, },
inject: {
projectPath: {
default: '',
},
issueIid: {
default: '',
},
},
apollo: { apollo: {
permissions: { permissions: {
query: permissionsQuery, query: permissionsQuery,
......
...@@ -57,6 +57,27 @@ export default { ...@@ -57,6 +57,27 @@ export default {
DesignSidebar, DesignSidebar,
}, },
mixins: [allVersionsMixin, glFeatureFlagsMixin()], mixins: [allVersionsMixin, glFeatureFlagsMixin()],
beforeRouteUpdate(to, from, next) {
// reset scale when the active design changes
this.scale = DEFAULT_SCALE;
next();
},
beforeRouteEnter(to, from, next) {
const pageEl = getPageLayoutElement();
if (pageEl) {
pageEl.classList.add(...DESIGN_DETAIL_LAYOUT_CLASSLIST);
}
next();
},
beforeRouteLeave(to, from, next) {
const pageEl = getPageLayoutElement();
if (pageEl) {
pageEl.classList.remove(...DESIGN_DETAIL_LAYOUT_CLASSLIST);
}
next();
},
props: { props: {
id: { id: {
type: String, type: String,
...@@ -161,11 +182,6 @@ export default { ...@@ -161,11 +182,6 @@ export default {
beforeDestroy() { beforeDestroy() {
Mousetrap.unbind('esc', this.closeDesign); Mousetrap.unbind('esc', this.closeDesign);
}, },
beforeRouteUpdate(to, from, next) {
// reset scale when the active design changes
this.scale = DEFAULT_SCALE;
next();
},
methods: { methods: {
addImageDiffNoteToStore(store, { data: { createImageDiffNote } }) { addImageDiffNoteToStore(store, { data: { createImageDiffNote } }) {
updateStoreAfterAddImageDiffNote( updateStoreAfterAddImageDiffNote(
...@@ -296,22 +312,6 @@ export default { ...@@ -296,22 +312,6 @@ export default {
this.resolvedDiscussionsExpanded = !this.resolvedDiscussionsExpanded; this.resolvedDiscussionsExpanded = !this.resolvedDiscussionsExpanded;
}, },
}, },
beforeRouteEnter(to, from, next) {
const pageEl = getPageLayoutElement();
if (pageEl) {
pageEl.classList.add(...DESIGN_DETAIL_LAYOUT_CLASSLIST);
}
next();
},
beforeRouteLeave(to, from, next) {
const pageEl = getPageLayoutElement();
if (pageEl) {
pageEl.classList.remove(...DESIGN_DETAIL_LAYOUT_CLASSLIST);
}
next();
},
createImageDiffNoteMutation, createImageDiffNoteMutation,
DESIGNS_ROUTE_NAME, DESIGNS_ROUTE_NAME,
}; };
......
...@@ -72,6 +72,10 @@ export default { ...@@ -72,6 +72,10 @@ export default {
update: (data) => data.project.issue.userPermissions, update: (data) => data.project.issue.userPermissions,
}, },
}, },
beforeRouteUpdate(to, from, next) {
this.selectedDesigns = [];
next();
},
data() { data() {
return { return {
permissions: { permissions: {
...@@ -324,10 +328,6 @@ export default { ...@@ -324,10 +328,6 @@ export default {
this.reorderedDesigns = designs; this.reorderedDesigns = designs;
}, },
}, },
beforeRouteUpdate(to, from, next) {
this.selectedDesigns = [];
next();
},
dragOptions: { dragOptions: {
animation: 200, animation: 200,
ghostClass: 'gl-visibility-hidden', ghostClass: 'gl-visibility-hidden',
......
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