Commit 821936f8 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'fix-version-dropdown' into 'master'

Fix designCollection object after design is uploaded

See merge request gitlab-org/gitlab!68521
parents 5cae1278 1c367ecf
fragment VersionListItem on DesignVersion { fragment VersionListItem on DesignVersion {
id id
sha sha
createdAt
author {
__typename
id
name
avatarUrl
}
} }
#import "../fragments/design.fragment.graphql" #import "../fragments/design.fragment.graphql"
#import "../fragments/version.fragment.graphql"
mutation uploadDesign($files: [Upload!]!, $projectPath: ID!, $iid: ID!) { mutation uploadDesign($files: [Upload!]!, $projectPath: ID!, $iid: ID!) {
designManagementUpload(input: { projectPath: $projectPath, iid: $iid, files: $files }) { designManagementUpload(input: { projectPath: $projectPath, iid: $iid, files: $files }) {
designs { designs {
...DesignItem ...DesignItem
versions { versions {
__typename
nodes { nodes {
id __typename
sha ...VersionListItem
} }
} }
} }
......
...@@ -85,6 +85,13 @@ export const designUploadOptimisticResponse = (files) => { ...@@ -85,6 +85,13 @@ export const designUploadOptimisticResponse = (files) => {
__typename: 'DesignVersion', __typename: 'DesignVersion',
id: -uniqueId(), id: -uniqueId(),
sha: -uniqueId(), sha: -uniqueId(),
createdAt: '',
author: {
__typename: 'UserCore',
id: -uniqueId(),
name: '',
avatarUrl: '',
},
}, },
}, },
})); }));
......
...@@ -338,6 +338,13 @@ describe('Design management index page', () => { ...@@ -338,6 +338,13 @@ describe('Design management index page', () => {
__typename: 'DesignVersion', __typename: 'DesignVersion',
id: expect.anything(), id: expect.anything(),
sha: expect.anything(), sha: expect.anything(),
createdAt: '',
author: {
__typename: 'UserCore',
id: expect.anything(),
name: '',
avatarUrl: '',
},
}, },
}, },
}, },
......
...@@ -101,7 +101,13 @@ describe('optimistic responses', () => { ...@@ -101,7 +101,13 @@ describe('optimistic responses', () => {
discussions: { __typename: 'DesignDiscussion', nodes: [] }, discussions: { __typename: 'DesignDiscussion', nodes: [] },
versions: { versions: {
__typename: 'DesignVersionConnection', __typename: 'DesignVersionConnection',
nodes: { __typename: 'DesignVersion', id: -1, sha: -1 }, nodes: {
__typename: 'DesignVersion',
id: expect.anything(),
sha: expect.anything(),
createdAt: '',
author: { __typename: 'UserCore', avatarUrl: '', name: '', id: expect.anything() },
},
}, },
}, },
], ],
......
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