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
aa14b441
Commit
aa14b441
authored
Aug 03, 2021
by
Natalia Tepluhina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a hack to set labels
Changelog: changed
parent
5e43724c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
8 deletions
+18
-8
app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue
...mponents/sidebar/labels_select_vue/labels_select_root.vue
+2
-1
app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/actions.js
...red/components/sidebar/labels_select_vue/store/actions.js
+2
-0
app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/mutation_types.js
...ponents/sidebar/labels_select_vue/store/mutation_types.js
+2
-0
app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/mutations.js
...d/components/sidebar/labels_select_vue/store/mutations.js
+12
-7
No files found.
app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue
View file @
aa14b441
...
...
@@ -142,6 +142,7 @@ export default {
this
.
setInitialState
({
selectedLabels
,
});
this
.
updateLabelsSetState
();
},
showDropdownContents
(
showDropdownContents
)
{
this
.
setContentIsOnViewport
(
showDropdownContents
);
...
...
@@ -184,7 +185,7 @@ export default {
document
.
removeEventListener
(
'
click
'
,
this
.
handleDocumentClick
);
},
methods
:
{
...
mapActions
([
'
setInitialState
'
,
'
toggleDropdownContents
'
]),
...
mapActions
([
'
setInitialState
'
,
'
toggleDropdownContents
'
,
'
updateLabelsSetState
'
]),
/**
* This method differentiates between
* dispatched actions and calls necessary method.
...
...
app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/actions.js
View file @
aa14b441
...
...
@@ -65,3 +65,5 @@ export const createLabel = ({ state, dispatch }, label) => {
export
const
updateSelectedLabels
=
({
commit
},
labels
)
=>
commit
(
types
.
UPDATE_SELECTED_LABELS
,
{
labels
});
export
const
updateLabelsSetState
=
({
commit
})
=>
commit
(
types
.
UPDATE_LABELS_SET_STATE
);
app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/mutation_types.js
View file @
aa14b441
...
...
@@ -18,3 +18,5 @@ export const TOGGLE_DROPDOWN_CONTENTS = 'TOGGLE_DROPDOWN_CONTENTS';
export
const
UPDATE_SELECTED_LABELS
=
'
UPDATE_SELECTED_LABELS
'
;
export
const
TOGGLE_DROPDOWN_CONTENTS_CREATE_VIEW
=
'
TOGGLE_DROPDOWN_CONTENTS_CREATE_VIEW
'
;
export
const
UPDATE_LABELS_SET_STATE
=
'
UPDATE_LABELS_SET_STATE
'
;
app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/mutations.js
View file @
aa14b441
...
...
@@ -37,13 +37,10 @@ export default {
const
selectedLabelIds
=
state
.
selectedLabels
.
map
((
label
)
=>
label
.
id
);
state
.
labelsFetchInProgress
=
false
;
state
.
labelsFetched
=
true
;
state
.
labels
=
labels
.
reduce
((
allLabels
,
label
)
=>
{
allLabels
.
push
({
...
label
,
set
:
selectedLabelIds
.
includes
(
label
.
id
),
});
return
allLabels
;
},
[]);
state
.
labels
=
labels
.
map
((
label
)
=>
({
...
label
,
set
:
selectedLabelIds
.
includes
(
label
.
id
),
}));
},
[
types
.
RECEIVE_SET_LABELS_FAILURE
](
state
)
{
state
.
labelsFetchInProgress
=
false
;
...
...
@@ -80,4 +77,12 @@ export default {
}
}
},
[
types
.
UPDATE_LABELS_SET_STATE
](
state
)
{
const
selectedLabelIds
=
state
.
selectedLabels
.
map
((
label
)
=>
label
.
id
);
state
.
labels
=
state
.
labels
.
map
((
label
)
=>
({
...
label
,
set
:
selectedLabelIds
.
includes
(
label
.
id
),
}));
},
};
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