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
7f13bc9e
Commit
7f13bc9e
authored
Oct 21, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consolidate labels widget architecture
Review feedback
parent
2584c5b5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
16 deletions
+23
-16
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/labels_select_root.vue
...nents/sidebar/labels_select_widget/labels_select_root.vue
+23
-16
No files found.
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/labels_select_root.vue
View file @
7f13bc9e
...
...
@@ -162,20 +162,18 @@ export default {
labelIds
=
labels
.
map
(({
id
})
=>
id
);
const
currentIid
=
this
.
oldIid
||
this
.
iid
;
switch
(
this
.
issuableType
)
{
case
IssuableType
.
Issue
:
return
{
const
updateVariables
=
{
iid
:
currentIid
,
projectPath
:
this
.
fullPath
,
labelIds
,
};
switch
(
this
.
issuableType
)
{
case
IssuableType
.
Issue
:
return
updateVariables
;
case
IssuableType
.
MergeRequest
:
return
{
iid
:
currentIid
,
labelIds
,
operationMode
:
MutationOperationMode
.
Replace
,
projectPath
:
this
.
fullPath
,
};
updateVariables
.
operationMode
=
MutationOperationMode
.
Replace
;
return
updateVariables
;
default
:
return
{};
}
...
...
@@ -200,25 +198,34 @@ export default {
labels
:
data
[
mutationName
]?.[
this
.
issuableType
].
labels
?.
nodes
,
});
})
.
catch
(()
=>
createFlash
({
message
:
__
(
'
An error occurred while updating labels.
'
)
}))
.
catch
((
error
)
=>
createFlash
({
message
:
__
(
'
An error occurred while updating labels.
'
),
captureError
:
true
,
error
,
}),
)
.
finally
(()
=>
{
this
.
labelsSelectInProgress
=
false
;
});
},
getRemoveVariables
(
labelId
)
{
const
removeVariables
=
{
iid
:
this
.
iid
,
projectPath
:
this
.
fullPath
,
};
switch
(
this
.
issuableType
)
{
case
IssuableType
.
Issue
:
return
{
iid
:
this
.
iid
,
projectPath
:
this
.
fullPath
,
...
removeVariables
,
removeLabelIds
:
[
labelId
],
};
case
IssuableType
.
MergeRequest
:
return
{
iid
:
this
.
iid
,
...
removeVariables
,
labelIds
:
[
labelId
],
operationMode
:
MutationOperationMode
.
Remove
,
projectPath
:
this
.
fullPath
,
};
default
:
return
{};
...
...
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