diff options
Diffstat (limited to 'app/assets/javascripts/design_management/mixins')
-rw-r--r-- | app/assets/javascripts/design_management/mixins/all_designs.js | 15 | ||||
-rw-r--r-- | app/assets/javascripts/design_management/mixins/all_versions.js | 25 |
2 files changed, 21 insertions, 19 deletions
diff --git a/app/assets/javascripts/design_management/mixins/all_designs.js b/app/assets/javascripts/design_management/mixins/all_designs.js index f7d6551c46c..0c2858bb14b 100644 --- a/app/assets/javascripts/design_management/mixins/all_designs.js +++ b/app/assets/javascripts/design_management/mixins/all_designs.js @@ -1,8 +1,7 @@ import { propertyOf } from 'lodash'; -import createFlash from '~/flash'; +import { deprecatedCreateFlash as createFlash } from '~/flash'; import { s__ } from '~/locale'; import getDesignListQuery from '../graphql/queries/get_design_list.query.graphql'; -import { extractNodes } from '../utils/design_management_utils'; import allVersionsMixin from './all_versions'; import { DESIGNS_ROUTE_NAME } from '../router/constants'; @@ -19,9 +18,15 @@ export default { }; }, update: data => { - const designEdges = propertyOf(data)(['project', 'issue', 'designCollection', 'designs']); - if (designEdges) { - return extractNodes(designEdges); + const designNodes = propertyOf(data)([ + 'project', + 'issue', + 'designCollection', + 'designs', + 'nodes', + ]); + if (designNodes) { + return designNodes; } return []; }, diff --git a/app/assets/javascripts/design_management/mixins/all_versions.js b/app/assets/javascripts/design_management/mixins/all_versions.js index 3966fe71732..7a094f23378 100644 --- a/app/assets/javascripts/design_management/mixins/all_versions.js +++ b/app/assets/javascripts/design_management/mixins/all_versions.js @@ -1,17 +1,8 @@ import getDesignListQuery from '../graphql/queries/get_design_list.query.graphql'; -import appDataQuery from '../graphql/queries/app_data.query.graphql'; import { findVersionId } from '../utils/design_management_utils'; export default { apollo: { - appData: { - query: appDataQuery, - manual: true, - result({ data: { projectPath, issueIid } }) { - this.projectPath = projectPath; - this.issueIid = issueIid; - }, - }, allVersions: { query: getDesignListQuery, variables() { @@ -21,7 +12,15 @@ export default { atVersion: null, }; }, - update: data => data.project.issue.designCollection.versions.edges, + update: data => data.project.issue.designCollection.versions.nodes, + }, + }, + inject: { + projectPath: { + default: '', + }, + issueIid: { + default: '', }, }, computed: { @@ -29,7 +28,7 @@ export default { return ( this.$route.query.version && this.allVersions && - this.allVersions.some(version => version.node.id.endsWith(this.$route.query.version)) + this.allVersions.some(version => version.id.endsWith(this.$route.query.version)) ); }, designsVersion() { @@ -39,7 +38,7 @@ export default { }, latestVersionId() { const latestVersion = this.allVersions[0]; - return latestVersion && findVersionId(latestVersion.node.id); + return latestVersion && findVersionId(latestVersion.id); }, isLatestVersion() { if (this.allVersions.length > 0) { @@ -55,8 +54,6 @@ export default { data() { return { allVersions: [], - projectPath: '', - issueIid: null, }; }, }; |