Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f5ed9b7c
Commit
f5ed9b7c
authored
Jul 29, 2021
by
Simon Knox
Committed by
Natalia Tepluhina
Jul 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some apollo cache issues moving between pages
parent
73f7feb1
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
29 additions
and
7 deletions
+29
-7
ee/app/assets/javascripts/iterations/components/iteration_report.vue
...ts/javascripts/iterations/components/iteration_report.vue
+4
-2
ee/app/assets/javascripts/iterations/queries/iteration.query.graphql
...ts/javascripts/iterations/queries/iteration.query.graphql
+2
-0
ee/app/assets/javascripts/iterations/queries/iteration_cadence.query.graphql
...cripts/iterations/queries/iteration_cadence.query.graphql
+1
-0
ee/app/assets/javascripts/iterations/queries/iteration_issues.query.graphql
...scripts/iterations/queries/iteration_issues.query.graphql
+2
-0
ee/app/assets/javascripts/iterations/queries/iteration_issues_with_label_filter.query.graphql
.../queries/iteration_issues_with_label_filter.query.graphql
+2
-0
ee/app/assets/javascripts/iterations/queries/iterations.query.graphql
...s/javascripts/iterations/queries/iterations.query.graphql
+2
-0
ee/spec/frontend/iterations/components/iteration_cadence_form_spec.js
...tend/iterations/components/iteration_cadence_form_spec.js
+1
-0
ee/spec/frontend/iterations/components/iteration_form_spec.js
...pec/frontend/iterations/components/iteration_form_spec.js
+3
-1
ee/spec/frontend/iterations/components/iteration_report_issues_spec.js
...end/iterations/components/iteration_report_issues_spec.js
+0
-1
ee/spec/frontend/iterations/components/iteration_report_spec.js
...c/frontend/iterations/components/iteration_report_spec.js
+10
-3
ee/spec/frontend/iterations/mock_data.js
ee/spec/frontend/iterations/mock_data.js
+2
-0
No files found.
ee/app/assets/javascripts/iterations/components/iteration_report.vue
View file @
f5ed9b7c
...
@@ -13,7 +13,7 @@ import BurnCharts from 'ee/burndown_chart/components/burn_charts.vue';
...
@@ -13,7 +13,7 @@ import BurnCharts from 'ee/burndown_chart/components/burn_charts.vue';
import
{
TYPE_ITERATION
}
from
'
~/graphql_shared/constants
'
;
import
{
TYPE_ITERATION
}
from
'
~/graphql_shared/constants
'
;
import
{
convertToGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
convertToGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
,
s__
}
from
'
~/locale
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
{
Namespace
}
from
'
../constants
'
;
import
{
Namespace
}
from
'
../constants
'
;
import
query
from
'
../queries/iteration.query.graphql
'
;
import
query
from
'
../queries/iteration.query.graphql
'
;
...
@@ -51,7 +51,9 @@ export default {
...
@@ -51,7 +51,9 @@ export default {
return
data
[
this
.
namespaceType
]?.
iterations
?.
nodes
[
0
]
||
{};
return
data
[
this
.
namespaceType
]?.
iterations
?.
nodes
[
0
]
||
{};
},
},
error
(
err
)
{
error
(
err
)
{
this
.
error
=
err
.
message
;
this
.
error
=
s__
(
'
Iterations|Unable to find iteration.
'
);
// eslint-disable-next-line no-console
console
.
error
(
err
.
message
);
},
},
},
},
},
},
...
...
ee/app/assets/javascripts/iterations/queries/iteration.query.graphql
View file @
f5ed9b7c
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
query
Iteration
(
$fullPath
:
ID
!,
$id
:
ID
!,
$isGroup
:
Boolean
=
true
)
{
query
Iteration
(
$fullPath
:
ID
!,
$id
:
ID
!,
$isGroup
:
Boolean
=
true
)
{
group
(
fullPath
:
$fullPath
)
@include
(
if
:
$isGroup
)
{
group
(
fullPath
:
$fullPath
)
@include
(
if
:
$isGroup
)
{
id
iterations
(
id
:
$id
,
first
:
1
,
includeAncestors
:
true
)
{
iterations
(
id
:
$id
,
first
:
1
,
includeAncestors
:
true
)
{
nodes
{
nodes
{
...
IterationReport
...
IterationReport
...
@@ -10,6 +11,7 @@ query Iteration($fullPath: ID!, $id: ID!, $isGroup: Boolean = true) {
...
@@ -10,6 +11,7 @@ query Iteration($fullPath: ID!, $id: ID!, $isGroup: Boolean = true) {
}
}
project
(
fullPath
:
$fullPath
)
@skip
(
if
:
$isGroup
)
{
project
(
fullPath
:
$fullPath
)
@skip
(
if
:
$isGroup
)
{
id
iterations
(
id
:
$id
,
first
:
1
,
includeAncestors
:
true
)
{
iterations
(
id
:
$id
,
first
:
1
,
includeAncestors
:
true
)
{
nodes
{
nodes
{
...
IterationReport
...
IterationReport
...
...
ee/app/assets/javascripts/iterations/queries/iteration_cadence.query.graphql
View file @
f5ed9b7c
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
# todo: should this use IterationsCadenceID! ?
# todo: should this use IterationsCadenceID! ?
query
IterationCadence
(
$fullPath
:
ID
!,
$id
:
ID
!)
{
query
IterationCadence
(
$fullPath
:
ID
!,
$id
:
ID
!)
{
group
(
fullPath
:
$fullPath
)
{
group
(
fullPath
:
$fullPath
)
{
id
iterationCadences
(
id
:
$id
)
{
iterationCadences
(
id
:
$id
)
{
nodes
{
nodes
{
...
IterationCadence
...
IterationCadence
...
...
ee/app/assets/javascripts/iterations/queries/iteration_issues.query.graphql
View file @
f5ed9b7c
...
@@ -10,6 +10,7 @@ query IterationIssues(
...
@@ -10,6 +10,7 @@ query IterationIssues(
$lastPageSize
:
Int
$lastPageSize
:
Int
)
{
)
{
group
(
fullPath
:
$fullPath
)
@include
(
if
:
$isGroup
)
{
group
(
fullPath
:
$fullPath
)
@include
(
if
:
$isGroup
)
{
id
issues
(
issues
(
iterationId
:
[
$id
]
iterationId
:
[
$id
]
before
:
$beforeCursor
before
:
$beforeCursor
...
@@ -22,6 +23,7 @@ query IterationIssues(
...
@@ -22,6 +23,7 @@ query IterationIssues(
}
}
}
}
project
(
fullPath
:
$fullPath
)
@skip
(
if
:
$isGroup
)
{
project
(
fullPath
:
$fullPath
)
@skip
(
if
:
$isGroup
)
{
id
issues
(
issues
(
iterationId
:
[
$id
]
iterationId
:
[
$id
]
before
:
$beforeCursor
before
:
$beforeCursor
...
...
ee/app/assets/javascripts/iterations/queries/iteration_issues_with_label_filter.query.graphql
View file @
f5ed9b7c
...
@@ -11,6 +11,7 @@ query IterationIssuesWithLabelFilter(
...
@@ -11,6 +11,7 @@ query IterationIssuesWithLabelFilter(
$lastPageSize
:
Int
$lastPageSize
:
Int
)
{
)
{
group
(
fullPath
:
$fullPath
)
@include
(
if
:
$isGroup
)
{
group
(
fullPath
:
$fullPath
)
@include
(
if
:
$isGroup
)
{
id
issues
(
issues
(
iterationId
:
[
$id
]
iterationId
:
[
$id
]
labelName
:
$labelName
labelName
:
$labelName
...
@@ -24,6 +25,7 @@ query IterationIssuesWithLabelFilter(
...
@@ -24,6 +25,7 @@ query IterationIssuesWithLabelFilter(
}
}
}
}
project
(
fullPath
:
$fullPath
)
@skip
(
if
:
$isGroup
)
{
project
(
fullPath
:
$fullPath
)
@skip
(
if
:
$isGroup
)
{
id
issues
(
issues
(
iterationId
:
[
$id
]
iterationId
:
[
$id
]
labelName
:
$labelName
labelName
:
$labelName
...
...
ee/app/assets/javascripts/iterations/queries/iterations.query.graphql
View file @
f5ed9b7c
...
@@ -11,6 +11,7 @@ query Iterations(
...
@@ -11,6 +11,7 @@ query Iterations(
$lastPageSize
:
Int
$lastPageSize
:
Int
)
{
)
{
group
(
fullPath
:
$fullPath
)
@include
(
if
:
$isGroup
)
{
group
(
fullPath
:
$fullPath
)
@include
(
if
:
$isGroup
)
{
id
iterations
(
iterations
(
state
:
$state
state
:
$state
before
:
$beforeCursor
before
:
$beforeCursor
...
@@ -27,6 +28,7 @@ query Iterations(
...
@@ -27,6 +28,7 @@ query Iterations(
}
}
}
}
project
(
fullPath
:
$fullPath
)
@skip
(
if
:
$isGroup
)
{
project
(
fullPath
:
$fullPath
)
@skip
(
if
:
$isGroup
)
{
id
iterations
(
iterations
(
state
:
$state
state
:
$state
before
:
$beforeCursor
before
:
$beforeCursor
...
...
ee/spec/frontend/iterations/components/iteration_cadence_form_spec.js
View file @
f5ed9b7c
...
@@ -51,6 +51,7 @@ describe('Iteration cadence form', () => {
...
@@ -51,6 +51,7 @@ describe('Iteration cadence form', () => {
const
getCadenceSuccess
=
{
const
getCadenceSuccess
=
{
data
:
{
data
:
{
group
:
{
group
:
{
id
:
'
gid://gitlab/Group/114
'
,
iterationCadences
:
{
iterationCadences
:
{
nodes
:
[
iterationCadence
],
nodes
:
[
iterationCadence
],
},
},
...
...
ee/spec/frontend/iterations/components/iteration_form_spec.js
View file @
f5ed9b7c
...
@@ -38,7 +38,9 @@ describe('Iteration Form', () => {
...
@@ -38,7 +38,9 @@ describe('Iteration Form', () => {
};
};
const
readMutationSuccess
=
{
const
readMutationSuccess
=
{
data
:
{
group
:
{
iterations
:
{
nodes
:
[
iteration
]
},
errors
:
[]
}
},
data
:
{
group
:
{
id
:
'
gid://gitlab/Group/114
'
,
iterations
:
{
nodes
:
[
iteration
]
},
errors
:
[]
},
},
};
};
const
createMutationSuccess
=
{
data
:
{
iterationCreate
:
{
iteration
,
errors
:
[]
}
}
};
const
createMutationSuccess
=
{
data
:
{
iterationCreate
:
{
iteration
,
errors
:
[]
}
}
};
const
createMutationFailure
=
{
const
createMutationFailure
=
{
...
...
ee/spec/frontend/iterations/components/iteration_report_issues_spec.js
View file @
f5ed9b7c
...
@@ -56,7 +56,6 @@ describe('Iterations report issues', () => {
...
@@ -56,7 +56,6 @@ describe('Iterations report issues', () => {
afterEach
(()
=>
{
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
.
destroy
();
wrapper
=
null
;
});
});
it
(
'
shows spinner while loading
'
,
()
=>
{
it
(
'
shows spinner while loading
'
,
()
=>
{
...
...
ee/spec/frontend/iterations/components/iteration_report_spec.js
View file @
f5ed9b7c
...
@@ -39,7 +39,8 @@ describe('Iterations report', () => {
...
@@ -39,7 +39,8 @@ describe('Iterations report', () => {
const
mountComponent
=
({
const
mountComponent
=
({
props
=
defaultProps
,
props
=
defaultProps
,
iterationQueryHandler
=
jest
.
fn
().
mockResolvedValue
(
mockGroupIterations
),
mockQueryResponse
=
mockGroupIterations
,
iterationQueryHandler
=
jest
.
fn
().
mockResolvedValue
(
mockQueryResponse
),
}
=
{})
=>
{
}
=
{})
=>
{
localVue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
mockApollo
=
createMockApollo
([[
query
,
iterationQueryHandler
]]);
mockApollo
=
createMockApollo
([[
query
,
iterationQueryHandler
]]);
...
@@ -104,7 +105,7 @@ describe('Iterations report', () => {
...
@@ -104,7 +105,7 @@ describe('Iterations report', () => {
],
],
])(
'
when viewing an iteration in a %s
'
,
(
_
,
props
,
mockIteration
,
expectedParams
)
=>
{
])(
'
when viewing an iteration in a %s
'
,
(
_
,
props
,
mockIteration
,
expectedParams
)
=>
{
it
(
'
calls a query with correct parameters
'
,
()
=>
{
it
(
'
calls a query with correct parameters
'
,
()
=>
{
const
iterationQueryHandler
=
jest
.
fn
();
const
iterationQueryHandler
=
jest
.
fn
()
.
mockResolvedValue
(
mockIteration
)
;
mountComponent
({
mountComponent
({
props
,
props
,
iterationQueryHandler
,
iterationQueryHandler
,
...
@@ -128,7 +129,6 @@ describe('Iterations report', () => {
...
@@ -128,7 +129,6 @@ describe('Iterations report', () => {
afterEach
(()
=>
{
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
.
destroy
();
wrapper
=
null
;
});
});
describe
(
'
empty state
'
,
()
=>
{
describe
(
'
empty state
'
,
()
=>
{
...
@@ -137,6 +137,7 @@ describe('Iterations report', () => {
...
@@ -137,6 +137,7 @@ describe('Iterations report', () => {
iterationQueryHandler
:
jest
.
fn
().
mockResolvedValue
({
iterationQueryHandler
:
jest
.
fn
().
mockResolvedValue
({
data
:
{
data
:
{
group
:
{
group
:
{
id
:
'
gid://gitlab/Group/1
'
,
iterations
:
{
iterations
:
{
nodes
:
[],
nodes
:
[],
},
},
...
@@ -212,12 +213,18 @@ describe('Iterations report', () => {
...
@@ -212,12 +213,18 @@ describe('Iterations report', () => {
'
when user $description and they are viewing an iteration within a $namespaceType
'
,
'
when user $description and they are viewing an iteration within a $namespaceType
'
,
({
canEdit
,
namespaceType
,
canEditIteration
})
=>
{
({
canEdit
,
namespaceType
,
canEditIteration
})
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
const
mockQueryResponse
=
{
[
Namespace
.
Group
]:
mockGroupIterations
,
[
Namespace
.
Project
]:
mockProjectIterations
,
}[
namespaceType
];
mountComponent
({
mountComponent
({
props
:
{
props
:
{
...
defaultProps
,
...
defaultProps
,
canEditIteration
,
canEditIteration
,
namespaceType
,
namespaceType
,
},
},
mockQueryResponse
,
});
});
});
});
...
...
ee/spec/frontend/iterations/mock_data.js
View file @
f5ed9b7c
...
@@ -14,6 +14,7 @@ export const mockIterationNode = {
...
@@ -14,6 +14,7 @@ export const mockIterationNode = {
export
const
mockGroupIterations
=
{
export
const
mockGroupIterations
=
{
data
:
{
data
:
{
group
:
{
group
:
{
id
:
'
gid://gitlab/Group/114
'
,
iterations
:
{
iterations
:
{
nodes
:
[
mockIterationNode
],
nodes
:
[
mockIterationNode
],
__typename
:
'
IterationConnection
'
,
__typename
:
'
IterationConnection
'
,
...
@@ -26,6 +27,7 @@ export const mockGroupIterations = {
...
@@ -26,6 +27,7 @@ export const mockGroupIterations = {
export
const
mockProjectIterations
=
{
export
const
mockProjectIterations
=
{
data
:
{
data
:
{
project
:
{
project
:
{
id
:
'
gid://gitlab/Project/114
'
,
iterations
:
{
iterations
:
{
nodes
:
[
mockIterationNode
],
nodes
:
[
mockIterationNode
],
__typename
:
'
IterationConnection
'
,
__typename
:
'
IterationConnection
'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment