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
640eb291
Commit
640eb291
authored
Dec 13, 2021
by
Mario Celi
Committed by
Natalia Tepluhina
Dec 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed local GraphQL Work Item types
parent
1d211d12
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
54 additions
and
55 deletions
+54
-55
app/assets/javascripts/work_items/graphql/create_work_item.mutation.graphql
...ipts/work_items/graphql/create_work_item.mutation.graphql
+3
-3
app/assets/javascripts/work_items/graphql/fragmentTypes.json
app/assets/javascripts/work_items/graphql/fragmentTypes.json
+1
-1
app/assets/javascripts/work_items/graphql/provider.js
app/assets/javascripts/work_items/graphql/provider.js
+3
-3
app/assets/javascripts/work_items/graphql/resolvers.js
app/assets/javascripts/work_items/graphql/resolvers.js
+10
-10
app/assets/javascripts/work_items/graphql/typedefs.graphql
app/assets/javascripts/work_items/graphql/typedefs.graphql
+23
-23
app/assets/javascripts/work_items/graphql/update_work_item.mutation.graphql
...ipts/work_items/graphql/update_work_item.mutation.graphql
+3
-3
app/assets/javascripts/work_items/graphql/widget.fragment.graphql
...ts/javascripts/work_items/graphql/widget.fragment.graphql
+1
-1
app/assets/javascripts/work_items/graphql/work_item.query.graphql
...ts/javascripts/work_items/graphql/work_item.query.graphql
+1
-1
app/assets/javascripts/work_items/pages/create_work_item.vue
app/assets/javascripts/work_items/pages/create_work_item.vue
+2
-3
spec/frontend/work_items/mock_data.js
spec/frontend/work_items/mock_data.js
+7
-7
No files found.
app/assets/javascripts/work_items/graphql/create_work_item.mutation.graphql
View file @
640eb291
#import './widget.fragment.graphql'
#import './widget.fragment.graphql'
mutation
createWorkItem
(
$input
:
CreateWorkItemInput
)
{
mutation
createWorkItem
(
$input
:
Local
CreateWorkItemInput
)
{
c
reateWorkItem
(
input
:
$input
)
@client
{
localC
reateWorkItem
(
input
:
$input
)
@client
{
workItem
{
workItem
{
id
id
type
type
widgets
{
widgets
{
nodes
{
nodes
{
...
WidgetBase
...
WidgetBase
...
on
TitleWidget
{
...
on
Local
TitleWidget
{
contentText
contentText
}
}
}
}
...
...
app/assets/javascripts/work_items/graphql/fragmentTypes.json
View file @
640eb291
{
"__schema"
:{
"types"
:[{
"kind"
:
"INTERFACE"
,
"name"
:
"
WorkItemWidget"
,
"possibleTypes"
:[{
"name"
:
"
TitleWidget"
}]}]}}
{
"__schema"
:{
"types"
:[{
"kind"
:
"INTERFACE"
,
"name"
:
"
LocalWorkItemWidget"
,
"possibleTypes"
:[{
"name"
:
"Local
TitleWidget"
}]}]}}
app/assets/javascripts/work_items/graphql/provider.js
View file @
640eb291
...
@@ -28,14 +28,14 @@ export function createApolloProvider() {
...
@@ -28,14 +28,14 @@ export function createApolloProvider() {
},
},
data
:
{
data
:
{
workItem
:
{
workItem
:
{
__typename
:
'
WorkItem
'
,
__typename
:
'
Local
WorkItem
'
,
id
:
'
1
'
,
id
:
'
1
'
,
type
:
'
FEATURE
'
,
type
:
'
FEATURE
'
,
widgets
:
{
widgets
:
{
__typename
:
'
WorkItemWidgetConnection
'
,
__typename
:
'
Local
WorkItemWidgetConnection
'
,
nodes
:
[
nodes
:
[
{
{
__typename
:
'
TitleWidget
'
,
__typename
:
'
Local
TitleWidget
'
,
type
:
'
TITLE
'
,
type
:
'
TITLE
'
,
enabled
:
true
,
enabled
:
true
,
// eslint-disable-next-line @gitlab/require-i18n-strings
// eslint-disable-next-line @gitlab/require-i18n-strings
...
...
app/assets/javascripts/work_items/graphql/resolvers.js
View file @
640eb291
...
@@ -3,17 +3,17 @@ import workItemQuery from './work_item.query.graphql';
...
@@ -3,17 +3,17 @@ import workItemQuery from './work_item.query.graphql';
export
const
resolvers
=
{
export
const
resolvers
=
{
Mutation
:
{
Mutation
:
{
c
reateWorkItem
(
_
,
{
input
},
{
cache
})
{
localC
reateWorkItem
(
_
,
{
input
},
{
cache
})
{
const
id
=
uuids
()[
0
];
const
id
=
uuids
()[
0
];
const
workItem
=
{
const
workItem
=
{
__typename
:
'
WorkItem
'
,
__typename
:
'
Local
WorkItem
'
,
type
:
'
FEATURE
'
,
type
:
'
FEATURE
'
,
id
,
id
,
widgets
:
{
widgets
:
{
__typename
:
'
WorkItemWidgetConnection
'
,
__typename
:
'
Local
WorkItemWidgetConnection
'
,
nodes
:
[
nodes
:
[
{
{
__typename
:
'
TitleWidget
'
,
__typename
:
'
Local
TitleWidget
'
,
type
:
'
TITLE
'
,
type
:
'
TITLE
'
,
enabled
:
true
,
enabled
:
true
,
contentText
:
input
.
title
,
contentText
:
input
.
title
,
...
@@ -25,24 +25,24 @@ export const resolvers = {
...
@@ -25,24 +25,24 @@ export const resolvers = {
cache
.
writeQuery
({
query
:
workItemQuery
,
variables
:
{
id
},
data
:
{
workItem
}
});
cache
.
writeQuery
({
query
:
workItemQuery
,
variables
:
{
id
},
data
:
{
workItem
}
});
return
{
return
{
__typename
:
'
CreateWorkItemPayload
'
,
__typename
:
'
Local
CreateWorkItemPayload
'
,
workItem
,
workItem
,
};
};
},
},
u
pdateWorkItem
(
_
,
{
input
},
{
cache
})
{
localU
pdateWorkItem
(
_
,
{
input
},
{
cache
})
{
const
workItemTitle
=
{
const
workItemTitle
=
{
__typename
:
'
TitleWidget
'
,
__typename
:
'
Local
TitleWidget
'
,
type
:
'
TITLE
'
,
type
:
'
TITLE
'
,
enabled
:
true
,
enabled
:
true
,
contentText
:
input
.
title
,
contentText
:
input
.
title
,
};
};
const
workItem
=
{
const
workItem
=
{
__typename
:
'
WorkItem
'
,
__typename
:
'
Local
WorkItem
'
,
type
:
'
FEATURE
'
,
type
:
'
FEATURE
'
,
id
:
input
.
id
,
id
:
input
.
id
,
widgets
:
{
widgets
:
{
__typename
:
'
WorkItemWidgetConnection
'
,
__typename
:
'
Local
WorkItemWidgetConnection
'
,
nodes
:
[
workItemTitle
],
nodes
:
[
workItemTitle
],
},
},
};
};
...
@@ -50,7 +50,7 @@ export const resolvers = {
...
@@ -50,7 +50,7 @@ export const resolvers = {
cache
.
writeQuery
({
query
:
workItemQuery
,
variables
:
{
id
:
input
.
id
},
data
:
{
workItem
}
});
cache
.
writeQuery
({
query
:
workItemQuery
,
variables
:
{
id
:
input
.
id
},
data
:
{
workItem
}
});
return
{
return
{
__typename
:
'
UpdateWorkItemPayload
'
,
__typename
:
'
Local
UpdateWorkItemPayload
'
,
workItem
,
workItem
,
};
};
},
},
...
...
app/assets/javascripts/work_items/graphql/typedefs.graphql
View file @
640eb291
enum
WorkItemType
{
enum
Local
WorkItemType
{
FEATURE
FEATURE
}
}
enum
WidgetType
{
enum
Local
WidgetType
{
TITLE
TITLE
}
}
interface
WorkItemWidget
{
interface
Local
WorkItemWidget
{
type
:
WidgetType
!
type
:
Local
WidgetType
!
}
}
# Replicating Relay connection type for client schema
# Replicating Relay connection type for client schema
type
WorkItemWidgetEdge
{
type
Local
WorkItemWidgetEdge
{
cursor
:
String
!
cursor
:
String
!
node
:
WorkItemWidget
node
:
Local
WorkItemWidget
}
}
type
WorkItemWidgetConnection
{
type
Local
WorkItemWidgetConnection
{
edges
:
[
WorkItemWidgetEdge
]
edges
:
[
Local
WorkItemWidgetEdge
]
nodes
:
[
WorkItemWidget
]
nodes
:
[
Local
WorkItemWidget
]
pageInfo
:
PageInfo
!
pageInfo
:
PageInfo
!
}
}
type
TitleWidget
implements
WorkItemWidget
{
type
LocalTitleWidget
implements
Local
WorkItemWidget
{
type
:
WidgetType
!
type
:
Local
WidgetType
!
contentText
:
String
!
contentText
:
String
!
}
}
type
WorkItem
{
type
Local
WorkItem
{
id
:
ID
!
id
:
ID
!
type
:
WorkItemType
!
type
:
Local
WorkItemType
!
widgets
:
[
WorkItemWidgetConnection
]
widgets
:
[
Local
WorkItemWidgetConnection
]
}
}
type
CreateWorkItemInput
{
type
Local
CreateWorkItemInput
{
title
:
String
!
title
:
String
!
}
}
type
UpdateWorkItemInput
{
type
Local
UpdateWorkItemInput
{
id
:
ID
!
id
:
ID
!
title
:
String
title
:
String
}
}
type
CreateWorkItemPayload
{
type
Local
CreateWorkItemPayload
{
workItem
:
WorkItem
!
workItem
:
Local
WorkItem
!
}
}
type
UpdateWorkItemPayload
{
type
Local
UpdateWorkItemPayload
{
workItem
:
WorkItem
!
workItem
:
Local
WorkItem
!
}
}
extend
type
Query
{
extend
type
Query
{
workItem
(
id
:
ID
!):
WorkItem
!
workItem
(
id
:
ID
!):
Local
WorkItem
!
}
}
extend
type
Mutation
{
extend
type
Mutation
{
createWorkItem
(
input
:
CreateWorkItemInput
!):
CreateWorkItemPayload
!
localCreateWorkItem
(
input
:
LocalCreateWorkItemInput
!):
Local
CreateWorkItemPayload
!
updateWorkItem
(
input
:
UpdateWorkItemInput
!):
UpdateWorkItemPayload
!
localUpdateWorkItem
(
input
:
LocalUpdateWorkItemInput
!):
Local
UpdateWorkItemPayload
!
}
}
app/assets/javascripts/work_items/graphql/update_work_item.mutation.graphql
View file @
640eb291
#import './widget.fragment.graphql'
#import './widget.fragment.graphql'
mutation
updateWorkItem
(
$input
:
UpdateWorkItemInput
)
{
mutation
updateWorkItem
(
$input
:
Local
UpdateWorkItemInput
)
{
u
pdateWorkItem
(
input
:
$input
)
@client
{
localU
pdateWorkItem
(
input
:
$input
)
@client
{
workItem
{
workItem
{
id
id
type
type
widgets
{
widgets
{
nodes
{
nodes
{
...
WidgetBase
...
WidgetBase
...
on
TitleWidget
{
...
on
Local
TitleWidget
{
contentText
contentText
}
}
}
}
...
...
app/assets/javascripts/work_items/graphql/widget.fragment.graphql
View file @
640eb291
fragment
WidgetBase
on
WorkItemWidget
{
fragment
WidgetBase
on
Local
WorkItemWidget
{
type
type
}
}
app/assets/javascripts/work_items/graphql/work_item.query.graphql
View file @
640eb291
...
@@ -7,7 +7,7 @@ query WorkItem($id: ID!) {
...
@@ -7,7 +7,7 @@ query WorkItem($id: ID!) {
widgets
{
widgets
{
nodes
{
nodes
{
...
WidgetBase
...
WidgetBase
...
on
TitleWidget
{
...
on
Local
TitleWidget
{
contentText
contentText
}
}
}
}
...
...
app/assets/javascripts/work_items/pages/create_work_item.vue
View file @
640eb291
...
@@ -30,7 +30,7 @@ export default {
...
@@ -30,7 +30,7 @@ export default {
const
{
const
{
data
:
{
data
:
{
c
reateWorkItem
:
{
localC
reateWorkItem
:
{
workItem
:
{
id
},
workItem
:
{
id
},
},
},
},
},
...
@@ -60,11 +60,10 @@ export default {
...
@@ -60,11 +60,10 @@ export default {
class=
"gl-mr-3"
class=
"gl-mr-3"
data-testid=
"create-button"
data-testid=
"create-button"
type=
"submit"
type=
"submit"
@
click=
"createWorkItem"
>
>
{{
__
(
'
Create
'
)
}}
{{
__
(
'
Create
'
)
}}
</gl-button>
</gl-button>
<gl-button
data-testid=
"cancel-button"
@
click=
"$router.go(-1)"
>
<gl-button
type=
"button"
data-testid=
"cancel-button"
@
click=
"$router.go(-1)"
>
{{
__
(
'
Cancel
'
)
}}
{{
__
(
'
Cancel
'
)
}}
</gl-button>
</gl-button>
</div>
</div>
...
...
spec/frontend/work_items/mock_data.js
View file @
640eb291
export
const
workItemQueryResponse
=
{
export
const
workItemQueryResponse
=
{
workItem
:
{
workItem
:
{
__typename
:
'
WorkItem
'
,
__typename
:
'
Local
WorkItem
'
,
id
:
'
1
'
,
id
:
'
1
'
,
type
:
'
FEATURE
'
,
type
:
'
FEATURE
'
,
widgets
:
{
widgets
:
{
__typename
:
'
WorkItemWidgetConnection
'
,
__typename
:
'
Local
WorkItemWidgetConnection
'
,
nodes
:
[
nodes
:
[
{
{
__typename
:
'
TitleWidget
'
,
__typename
:
'
Local
TitleWidget
'
,
type
:
'
TITLE
'
,
type
:
'
TITLE
'
,
contentText
:
'
Test
'
,
contentText
:
'
Test
'
,
},
},
...
@@ -17,15 +17,15 @@ export const workItemQueryResponse = {
...
@@ -17,15 +17,15 @@ export const workItemQueryResponse = {
};
};
export
const
updateWorkItemMutationResponse
=
{
export
const
updateWorkItemMutationResponse
=
{
__typename
:
'
UpdateWorkItemPayload
'
,
__typename
:
'
Local
UpdateWorkItemPayload
'
,
workItem
:
{
workItem
:
{
__typename
:
'
WorkItem
'
,
__typename
:
'
Local
WorkItem
'
,
id
:
'
1
'
,
id
:
'
1
'
,
widgets
:
{
widgets
:
{
__typename
:
'
WorkItemWidgetConnection
'
,
__typename
:
'
Local
WorkItemWidgetConnection
'
,
nodes
:
[
nodes
:
[
{
{
__typename
:
'
TitleWidget
'
,
__typename
:
'
Local
TitleWidget
'
,
type
:
'
TITLE
'
,
type
:
'
TITLE
'
,
enabled
:
true
,
enabled
:
true
,
contentText
:
'
Updated title
'
,
contentText
:
'
Updated title
'
,
...
...
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