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
43326f78
Commit
43326f78
authored
Jan 30, 2020
by
Natalia Tepluhina
Committed by
Kushal Pandya
Jan 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable Apollo cache if Apollo Client is used within Vuex
parent
bb5e82e5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
18 deletions
+45
-18
app/assets/javascripts/lib/graphql.js
app/assets/javascripts/lib/graphql.js
+13
-0
app/assets/javascripts/monitoring/stores/utils.js
app/assets/javascripts/monitoring/stores/utils.js
+7
-2
ee/app/assets/javascripts/design_management/pages/design/index.vue
...sets/javascripts/design_management/pages/design/index.vue
+3
-2
ee/app/assets/javascripts/epic/utils/epic_utils.js
ee/app/assets/javascripts/epic/utils/epic_utils.js
+7
-2
ee/app/assets/javascripts/related_items_tree/store/actions.js
...pp/assets/javascripts/related_items_tree/store/actions.js
+1
-6
ee/app/assets/javascripts/related_items_tree/utils/epic_utils.js
...assets/javascripts/related_items_tree/utils/epic_utils.js
+7
-2
ee/app/assets/javascripts/roadmap/utils/epic_utils.js
ee/app/assets/javascripts/roadmap/utils/epic_utils.js
+7
-2
ee/spec/frontend/related_items_tree/utils/epic_utils_spec.js
ee/spec/frontend/related_items_tree/utils/epic_utils_spec.js
+0
-2
No files found.
app/assets/javascripts/lib/graphql.js
View file @
43326f78
...
@@ -5,6 +5,14 @@ import { ApolloLink } from 'apollo-link';
...
@@ -5,6 +5,14 @@ import { ApolloLink } from 'apollo-link';
import
{
BatchHttpLink
}
from
'
apollo-link-batch-http
'
;
import
{
BatchHttpLink
}
from
'
apollo-link-batch-http
'
;
import
csrf
from
'
~/lib/utils/csrf
'
;
import
csrf
from
'
~/lib/utils/csrf
'
;
export
const
fetchPolicies
=
{
CACHE_FIRST
:
'
cache-first
'
,
CACHE_AND_NETWORK
:
'
cache-and-network
'
,
NETWORK_ONLY
:
'
network-only
'
,
NO_CACHE
:
'
no-cache
'
,
CACHE_ONLY
:
'
cache-only
'
,
};
export
default
(
resolvers
=
{},
config
=
{})
=>
{
export
default
(
resolvers
=
{},
config
=
{})
=>
{
let
uri
=
`
${
gon
.
relative_url_root
}
/api/graphql`
;
let
uri
=
`
${
gon
.
relative_url_root
}
/api/graphql`
;
...
@@ -32,5 +40,10 @@ export default (resolvers = {}, config = {}) => {
...
@@ -32,5 +40,10 @@ export default (resolvers = {}, config = {}) => {
}),
}),
resolvers
,
resolvers
,
assumeImmutableResults
:
config
.
assumeImmutableResults
,
assumeImmutableResults
:
config
.
assumeImmutableResults
,
defaultOptions
:
{
query
:
{
fetchPolicy
:
config
.
fetchPolicy
||
fetchPolicies
.
CACHE_FIRST
,
},
},
});
});
};
};
app/assets/javascripts/monitoring/stores/utils.js
View file @
43326f78
import
{
omit
}
from
'
lodash
'
;
import
{
omit
}
from
'
lodash
'
;
import
createGqClient
from
'
~/lib/graphql
'
;
import
createGqClient
,
{
fetchPolicies
}
from
'
~/lib/graphql
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
export
const
gqClient
=
createGqClient
();
export
const
gqClient
=
createGqClient
(
{},
{
fetchPolicy
:
fetchPolicies
.
NO_CACHE
,
},
);
export
const
uniqMetricsId
=
metric
=>
`
${
metric
.
metric_id
}
_
${
metric
.
id
}
`
;
export
const
uniqMetricsId
=
metric
=>
`
${
metric
.
metric_id
}
_
${
metric
.
id
}
`
;
...
...
ee/app/assets/javascripts/design_management/pages/design/index.vue
View file @
43326f78
...
@@ -3,6 +3,7 @@ import { ApolloMutation } from 'vue-apollo';
...
@@ -3,6 +3,7 @@ import { ApolloMutation } from 'vue-apollo';
import
Mousetrap
from
'
mousetrap
'
;
import
Mousetrap
from
'
mousetrap
'
;
import
{
GlLoadingIcon
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
{
fetchPolicies
}
from
'
~/lib/graphql
'
;
import
allVersionsMixin
from
'
../../mixins/all_versions
'
;
import
allVersionsMixin
from
'
../../mixins/all_versions
'
;
import
Toolbar
from
'
../../components/toolbar/index.vue
'
;
import
Toolbar
from
'
../../components/toolbar/index.vue
'
;
import
DesignDiscussion
from
'
../../components/design_notes/design_discussion.vue
'
;
import
DesignDiscussion
from
'
../../components/design_notes/design_discussion.vue
'
;
...
@@ -70,7 +71,7 @@ export default {
...
@@ -70,7 +71,7 @@ export default {
},
},
design
:
{
design
:
{
query
:
getDesignQuery
,
query
:
getDesignQuery
,
fetchPolicy
:
'
network-only
'
,
fetchPolicy
:
fetchPolicies
.
NETWORK_ONLY
,
variables
()
{
variables
()
{
return
this
.
designVariables
;
return
this
.
designVariables
;
},
},
...
@@ -215,7 +216,7 @@ export default {
...
@@ -215,7 +216,7 @@ export default {
@
done=
"$router.push(
{ name: $options.DESIGNS_ROUTE_NAME })"
@
done=
"$router.push(
{ name: $options.DESIGNS_ROUTE_NAME })"
@error="onDesignDeleteError"
@error="onDesignDeleteError"
>
>
<template
v-slot=
"
{ mutate, loading
, error
}">
<template
v-slot=
"
{ mutate, loading }">
<toolbar
<toolbar
:id=
"id"
:id=
"id"
:is-deleting=
"loading"
:is-deleting=
"loading"
...
...
ee/app/assets/javascripts/epic/utils/epic_utils.js
View file @
43326f78
...
@@ -3,13 +3,18 @@ import Cookies from 'js-cookie';
...
@@ -3,13 +3,18 @@ import Cookies from 'js-cookie';
import
{
__
,
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
__
,
s__
,
sprintf
}
from
'
~/locale
'
;
import
createGqClient
from
'
~/lib/graphql
'
;
import
createGqClient
,
{
fetchPolicies
}
from
'
~/lib/graphql
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
{
dateInWords
,
parsePikadayDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
dateInWords
,
parsePikadayDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
dateTypes
}
from
'
../constants
'
;
import
{
dateTypes
}
from
'
../constants
'
;
const
gqClient
=
createGqClient
();
const
gqClient
=
createGqClient
(
{},
{
fetchPolicy
:
fetchPolicies
.
NO_CACHE
,
},
);
const
triggerDocumentEvent
=
(
eventName
,
eventParam
)
=>
{
const
triggerDocumentEvent
=
(
eventName
,
eventParam
)
=>
{
$
(
document
).
trigger
(
eventName
,
eventParam
);
$
(
document
).
trigger
(
eventName
,
eventParam
);
...
...
ee/app/assets/javascripts/related_items_tree/store/actions.js
View file @
43326f78
...
@@ -75,10 +75,7 @@ export const receiveItemsFailure = ({ commit }, data) => {
...
@@ -75,10 +75,7 @@ export const receiveItemsFailure = ({ commit }, data) => {
flash
(
s__
(
'
Epics|Something went wrong while fetching child epics.
'
));
flash
(
s__
(
'
Epics|Something went wrong while fetching child epics.
'
));
commit
(
types
.
RECEIVE_ITEMS_FAILURE
,
data
);
commit
(
types
.
RECEIVE_ITEMS_FAILURE
,
data
);
};
};
export
const
fetchItems
=
(
export
const
fetchItems
=
({
dispatch
},
{
parentItem
,
isSubItem
=
false
})
=>
{
{
dispatch
},
{
parentItem
,
isSubItem
=
false
,
fetchPolicy
=
'
cache-first
'
},
)
=>
{
const
{
iid
,
fullPath
}
=
parentItem
;
const
{
iid
,
fullPath
}
=
parentItem
;
dispatch
(
'
requestItems
'
,
{
dispatch
(
'
requestItems
'
,
{
...
@@ -90,7 +87,6 @@ export const fetchItems = (
...
@@ -90,7 +87,6 @@ export const fetchItems = (
.
query
({
.
query
({
query
:
epicChildren
,
query
:
epicChildren
,
variables
:
{
iid
,
fullPath
},
variables
:
{
iid
,
fullPath
},
fetchPolicy
,
})
})
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
const
children
=
processQueryResponse
(
data
.
group
);
const
children
=
processQueryResponse
(
data
.
group
);
...
@@ -458,7 +454,6 @@ export const createNewIssue = ({ state, dispatch }, { issuesEndpoint, title }) =
...
@@ -458,7 +454,6 @@ export const createNewIssue = ({ state, dispatch }, { issuesEndpoint, title }) =
.
then
(()
=>
.
then
(()
=>
dispatch
(
'
fetchItems
'
,
{
dispatch
(
'
fetchItems
'
,
{
parentItem
,
parentItem
,
fetchPolicy
:
'
network-only
'
,
}),
}),
)
)
.
catch
(
e
=>
{
.
catch
(
e
=>
{
...
...
ee/app/assets/javascripts/related_items_tree/utils/epic_utils.js
View file @
43326f78
import
{
PathIdSeparator
}
from
'
ee/related_issues/constants
'
;
import
{
PathIdSeparator
}
from
'
ee/related_issues/constants
'
;
import
createGqClient
from
'
~/lib/graphql
'
;
import
createGqClient
,
{
fetchPolicies
}
from
'
~/lib/graphql
'
;
import
{
ChildType
}
from
'
../constants
'
;
import
{
ChildType
}
from
'
../constants
'
;
export
const
gqClient
=
createGqClient
();
export
const
gqClient
=
createGqClient
(
{},
{
fetchPolicy
:
fetchPolicies
.
NO_CACHE
,
},
);
/**
/**
* Returns a numeric representation of item
* Returns a numeric representation of item
...
...
ee/app/assets/javascripts/roadmap/utils/epic_utils.js
View file @
43326f78
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
{
newDate
,
parsePikadayDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
newDate
,
parsePikadayDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
createGqClient
from
'
~/lib/graphql
'
;
import
createGqClient
,
{
fetchPolicies
}
from
'
~/lib/graphql
'
;
export
const
gqClient
=
createGqClient
();
export
const
gqClient
=
createGqClient
(
{},
{
fetchPolicy
:
fetchPolicies
.
NO_CACHE
,
},
);
/**
/**
* Updates provided `epic` object with necessary props
* Updates provided `epic` object with necessary props
...
...
ee/spec/frontend/related_items_tree/utils/epic_utils_spec.js
View file @
43326f78
...
@@ -9,8 +9,6 @@ import {
...
@@ -9,8 +9,6 @@ import {
mockIssue1
,
mockIssue1
,
}
from
'
../../../javascripts/related_items_tree/mock_data
'
;
}
from
'
../../../javascripts/related_items_tree/mock_data
'
;
jest
.
mock
(
'
~/lib/graphql
'
,
()
=>
jest
.
fn
());
describe
(
'
RelatedItemsTree
'
,
()
=>
{
describe
(
'
RelatedItemsTree
'
,
()
=>
{
describe
(
'
epicUtils
'
,
()
=>
{
describe
(
'
epicUtils
'
,
()
=>
{
describe
(
'
sortChildren
'
,
()
=>
{
describe
(
'
sortChildren
'
,
()
=>
{
...
...
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