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';
import
{
TYPE_ITERATION
}
from
'
~/graphql_shared/constants
'
;
import
{
convertToGraphQLId
}
from
'
~/graphql_shared/utils
'
;
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
{
Namespace
}
from
'
../constants
'
;
import
query
from
'
../queries/iteration.query.graphql
'
;
...
...
@@ -51,7 +51,9 @@ export default {
return
data
[
this
.
namespaceType
]?.
iterations
?.
nodes
[
0
]
||
{};
},
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 @@
query
Iteration
(
$fullPath
:
ID
!,
$id
:
ID
!,
$isGroup
:
Boolean
=
true
)
{
group
(
fullPath
:
$fullPath
)
@include
(
if
:
$isGroup
)
{
id
iterations
(
id
:
$id
,
first
:
1
,
includeAncestors
:
true
)
{
nodes
{
...
IterationReport
...
...
@@ -10,6 +11,7 @@ query Iteration($fullPath: ID!, $id: ID!, $isGroup: Boolean = true) {
}
project
(
fullPath
:
$fullPath
)
@skip
(
if
:
$isGroup
)
{
id
iterations
(
id
:
$id
,
first
:
1
,
includeAncestors
:
true
)
{
nodes
{
...
IterationReport
...
...
ee/app/assets/javascripts/iterations/queries/iteration_cadence.query.graphql
View file @
f5ed9b7c
...
...
@@ -3,6 +3,7 @@
# todo: should this use IterationsCadenceID! ?
query
IterationCadence
(
$fullPath
:
ID
!,
$id
:
ID
!)
{
group
(
fullPath
:
$fullPath
)
{
id
iterationCadences
(
id
:
$id
)
{
nodes
{
...
IterationCadence
...
...
ee/app/assets/javascripts/iterations/queries/iteration_issues.query.graphql
View file @
f5ed9b7c
...
...
@@ -10,6 +10,7 @@ query IterationIssues(
$lastPageSize
:
Int
)
{
group
(
fullPath
:
$fullPath
)
@include
(
if
:
$isGroup
)
{
id
issues
(
iterationId
:
[
$id
]
before
:
$beforeCursor
...
...
@@ -22,6 +23,7 @@ query IterationIssues(
}
}
project
(
fullPath
:
$fullPath
)
@skip
(
if
:
$isGroup
)
{
id
issues
(
iterationId
:
[
$id
]
before
:
$beforeCursor
...
...
ee/app/assets/javascripts/iterations/queries/iteration_issues_with_label_filter.query.graphql
View file @
f5ed9b7c
...
...
@@ -11,6 +11,7 @@ query IterationIssuesWithLabelFilter(
$lastPageSize
:
Int
)
{
group
(
fullPath
:
$fullPath
)
@include
(
if
:
$isGroup
)
{
id
issues
(
iterationId
:
[
$id
]
labelName
:
$labelName
...
...
@@ -24,6 +25,7 @@ query IterationIssuesWithLabelFilter(
}
}
project
(
fullPath
:
$fullPath
)
@skip
(
if
:
$isGroup
)
{
id
issues
(
iterationId
:
[
$id
]
labelName
:
$labelName
...
...
ee/app/assets/javascripts/iterations/queries/iterations.query.graphql
View file @
f5ed9b7c
...
...
@@ -11,6 +11,7 @@ query Iterations(
$lastPageSize
:
Int
)
{
group
(
fullPath
:
$fullPath
)
@include
(
if
:
$isGroup
)
{
id
iterations
(
state
:
$state
before
:
$beforeCursor
...
...
@@ -27,6 +28,7 @@ query Iterations(
}
}
project
(
fullPath
:
$fullPath
)
@skip
(
if
:
$isGroup
)
{
id
iterations
(
state
:
$state
before
:
$beforeCursor
...
...
ee/spec/frontend/iterations/components/iteration_cadence_form_spec.js
View file @
f5ed9b7c
...
...
@@ -51,6 +51,7 @@ describe('Iteration cadence form', () => {
const
getCadenceSuccess
=
{
data
:
{
group
:
{
id
:
'
gid://gitlab/Group/114
'
,
iterationCadences
:
{
nodes
:
[
iterationCadence
],
},
...
...
ee/spec/frontend/iterations/components/iteration_form_spec.js
View file @
f5ed9b7c
...
...
@@ -38,7 +38,9 @@ describe('Iteration Form', () => {
};
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
createMutationFailure
=
{
...
...
ee/spec/frontend/iterations/components/iteration_report_issues_spec.js
View file @
f5ed9b7c
...
...
@@ -56,7 +56,6 @@ describe('Iterations report issues', () => {
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
});
it
(
'
shows spinner while loading
'
,
()
=>
{
...
...
ee/spec/frontend/iterations/components/iteration_report_spec.js
View file @
f5ed9b7c
...
...
@@ -39,7 +39,8 @@ describe('Iterations report', () => {
const
mountComponent
=
({
props
=
defaultProps
,
iterationQueryHandler
=
jest
.
fn
().
mockResolvedValue
(
mockGroupIterations
),
mockQueryResponse
=
mockGroupIterations
,
iterationQueryHandler
=
jest
.
fn
().
mockResolvedValue
(
mockQueryResponse
),
}
=
{})
=>
{
localVue
.
use
(
VueApollo
);
mockApollo
=
createMockApollo
([[
query
,
iterationQueryHandler
]]);
...
...
@@ -104,7 +105,7 @@ describe('Iterations report', () => {
],
])(
'
when viewing an iteration in a %s
'
,
(
_
,
props
,
mockIteration
,
expectedParams
)
=>
{
it
(
'
calls a query with correct parameters
'
,
()
=>
{
const
iterationQueryHandler
=
jest
.
fn
();
const
iterationQueryHandler
=
jest
.
fn
()
.
mockResolvedValue
(
mockIteration
)
;
mountComponent
({
props
,
iterationQueryHandler
,
...
...
@@ -128,7 +129,6 @@ describe('Iterations report', () => {
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
});
describe
(
'
empty state
'
,
()
=>
{
...
...
@@ -137,6 +137,7 @@ describe('Iterations report', () => {
iterationQueryHandler
:
jest
.
fn
().
mockResolvedValue
({
data
:
{
group
:
{
id
:
'
gid://gitlab/Group/1
'
,
iterations
:
{
nodes
:
[],
},
...
...
@@ -212,12 +213,18 @@ describe('Iterations report', () => {
'
when user $description and they are viewing an iteration within a $namespaceType
'
,
({
canEdit
,
namespaceType
,
canEditIteration
})
=>
{
beforeEach
(()
=>
{
const
mockQueryResponse
=
{
[
Namespace
.
Group
]:
mockGroupIterations
,
[
Namespace
.
Project
]:
mockProjectIterations
,
}[
namespaceType
];
mountComponent
({
props
:
{
...
defaultProps
,
canEditIteration
,
namespaceType
,
},
mockQueryResponse
,
});
});
...
...
ee/spec/frontend/iterations/mock_data.js
View file @
f5ed9b7c
...
...
@@ -14,6 +14,7 @@ export const mockIterationNode = {
export
const
mockGroupIterations
=
{
data
:
{
group
:
{
id
:
'
gid://gitlab/Group/114
'
,
iterations
:
{
nodes
:
[
mockIterationNode
],
__typename
:
'
IterationConnection
'
,
...
...
@@ -26,6 +27,7 @@ export const mockGroupIterations = {
export
const
mockProjectIterations
=
{
data
:
{
project
:
{
id
:
'
gid://gitlab/Project/114
'
,
iterations
:
{
nodes
:
[
mockIterationNode
],
__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