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
fc10af3a
Commit
fc10af3a
authored
Oct 23, 2019
by
Coung Ngo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update hide labels from issue board cards
This commit fixes comments given on a merge request
parent
20da9965
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
41 additions
and
38 deletions
+41
-38
app/assets/javascripts/boards/stores/getters.js
app/assets/javascripts/boards/stores/getters.js
+1
-1
app/assets/stylesheets/pages/boards.scss
app/assets/stylesheets/pages/boards.scss
+6
-3
app/views/shared/issuable/_search_bar.html.haml
app/views/shared/issuable/_search_bar.html.haml
+1
-1
ee/app/assets/javascripts/boards/stores/actions.js
ee/app/assets/javascripts/boards/stores/actions.js
+1
-1
ee/app/assets/javascripts/boards/stores/mutation_types.js
ee/app/assets/javascripts/boards/stores/mutation_types.js
+1
-1
ee/app/assets/javascripts/boards/stores/mutations.js
ee/app/assets/javascripts/boards/stores/mutations.js
+1
-1
ee/app/assets/javascripts/boards/toggle_labels.js
ee/app/assets/javascripts/boards/toggle_labels.js
+16
-12
ee/spec/frontend/boards/stores/actions_spec.js
ee/spec/frontend/boards/stores/actions_spec.js
+2
-9
ee/spec/frontend/boards/stores/mutations_spec.js
ee/spec/frontend/boards/stores/mutations_spec.js
+3
-3
locale/gitlab.pot
locale/gitlab.pot
+6
-3
spec/frontend/boards/stores/getters_spec.js
spec/frontend/boards/stores/getters_spec.js
+3
-3
No files found.
app/assets/javascripts/boards/stores/getters.js
View file @
fc10af3a
export
default
{
get
Snowplow
LabelToggleState
:
state
=>
(
state
.
isShowingLabels
?
'
on
'
:
'
off
'
),
getLabelToggleState
:
state
=>
(
state
.
isShowingLabels
?
'
on
'
:
'
off
'
),
};
app/assets/stylesheets/pages/boards.scss
View file @
fc10af3a
...
...
@@ -546,9 +546,12 @@
cursor
:
help
;
}
.boards-labels-toggle-wrapper
{
display
:
flex
;
align-items
:
center
;
.board-labels-toggle-wrapper
{
/**
* Make the wrapper the same height as a button so it aligns properly when the
* filtered-search-box input element increases in size on Linux smaller breakpoints
*/
height
:
34px
;
label
{
font-weight
:
$gl-font-weight-normal
;
...
...
app/views/shared/issuable/_search_bar.html.haml
View file @
fc10af3a
...
...
@@ -147,7 +147,7 @@
%button
.clear-search.hidden
{
type:
'button'
}
=
icon
(
'times'
)
#
boards
-labels-toggle
#
js-board
-labels-toggle
.filter-dropdown-container.d-flex.flex-column.flex-md-row
-
if
type
==
:boards
.js-board-config
{
data:
{
can_admin_list:
user_can_admin_list
,
has_scope:
board
.
scoped?
}
}
...
...
ee/app/assets/javascripts/boards/stores/actions.js
View file @
fc10af3a
...
...
@@ -10,7 +10,7 @@ export default {
...
actionsCE
,
toggleShowLabels
({
commit
})
{
commit
(
types
.
TOGGLE_
SHOW_
LABELS
);
commit
(
types
.
TOGGLE_LABELS
);
},
fetchAllBoards
:
()
=>
{
...
...
ee/app/assets/javascripts/boards/stores/mutation_types.js
View file @
fc10af3a
...
...
@@ -11,4 +11,4 @@ export const REQUEST_REMOVE_BOARD = 'REQUEST_REMOVE_BOARD';
export
const
RECEIVE_REMOVE_BOARD_SUCCESS
=
'
RECEIVE_REMOVE_BOARD_SUCCESS
'
;
export
const
RECEIVE_REMOVE_BOARD_ERROR
=
'
RECEIVE_REMOVE_BOARD_ERROR
'
;
export
const
TOGGLE_PROMOTION_STATE
=
'
TOGGLE_PROMOTION_STATE
'
;
export
const
TOGGLE_
SHOW_LABELS
=
'
TOGGLE_SHOW
_LABELS
'
;
export
const
TOGGLE_
LABELS
=
'
TOGGLE
_LABELS
'
;
ee/app/assets/javascripts/boards/stores/mutations.js
View file @
fc10af3a
...
...
@@ -6,7 +6,7 @@ const notImplemented = () => {
};
export
default
{
[
mutationTypes
.
TOGGLE_
SHOW_
LABELS
]:
state
=>
{
[
mutationTypes
.
TOGGLE_LABELS
]:
state
=>
{
Object
.
assign
(
state
,
{
isShowingLabels
:
!
state
.
isShowingLabels
,
});
...
...
ee/app/assets/javascripts/boards/toggle_labels.js
View file @
fc10af3a
...
...
@@ -7,17 +7,21 @@ import store from '~/boards/stores';
export
default
()
=>
new
Vue
({
el
:
document
.
getElementById
(
'
boards
-labels-toggle
'
),
el
:
document
.
getElementById
(
'
js-board
-labels-toggle
'
),
components
:
{
GlToggle
,
},
store
,
data
:
{
toggleLabel
:
__
(
'
Show labels
'
),
},
computed
:
{
...
mapState
([
'
isShowingLabels
'
]),
...
mapGetters
([
'
getSnowplowLabelToggleState
'
]),
...
mapGetters
([
'
getLabelToggleState
'
]),
toggleOnLabel
()
{
return
__
(
'
Showing all labels
'
);
},
toggleOffLabel
()
{
return
__
(
'
Hiding all labels
'
);
},
},
methods
:
{
...
mapActions
([
'
toggleShowLabels
'
]),
...
...
@@ -27,21 +31,21 @@ export default () =>
Tracking
.
event
(
document
.
body
.
dataset
.
page
,
'
toggle
'
,
{
label
:
'
show_labels
'
,
property
:
this
.
get
Snowplow
LabelToggleState
,
property
:
this
.
getLabelToggleState
,
});
},
},
template
:
`
<div class="board
s-labels-toggle-wrapp
er prepend-left-10">
<span id="board
s
-labels-toggle-text">
{{
toggleLabel
}}
<div class="board
-labels-toggle-wrapper d-flex align-items-cent
er prepend-left-10">
<span id="board-labels-toggle-text">
{{
__('Show labels')
}}
</span>
<gl-toggle
:value="isShowingLabels"
class="prepend-left-10"
label-on="Showing all labels
"
label-off="Hiding all labels
"
aria-describedby="board
s
-labels-toggle-text"
:label-on="toggleOnLabel
"
:label-off="toggleOffLabel
"
aria-describedby="board-labels-toggle-text"
data-qa-selector="show_labels_toggle"
@change="onToggle"
/>
...
...
ee/spec/frontend/boards/stores/actions_spec.js
View file @
fc10af3a
...
...
@@ -9,19 +9,12 @@ const expectNotImplemented = action => {
};
describe
(
'
toggleShowLabels
'
,
()
=>
{
it
(
'
should commit mutation TOGGLE_
SHOW_
LABELS
'
,
done
=>
{
it
(
'
should commit mutation TOGGLE_LABELS
'
,
done
=>
{
const
state
=
{
isShowingLabels
:
true
,
};
testAction
(
actions
.
toggleShowLabels
,
null
,
state
,
[{
type
:
types
.
TOGGLE_SHOW_LABELS
}],
[],
done
,
);
testAction
(
actions
.
toggleShowLabels
,
null
,
state
,
[{
type
:
types
.
TOGGLE_LABELS
}],
[],
done
);
});
});
...
...
ee/spec/frontend/boards/stores/mutations_spec.js
View file @
fc10af3a
...
...
@@ -6,13 +6,13 @@ const expectNotImplemented = action => {
});
};
describe
(
'
TOGGLE_
SHOW_
LABELS
'
,
()
=>
{
describe
(
'
TOGGLE_LABELS
'
,
()
=>
{
it
(
'
toggles isShowingLabels from true to false
'
,
()
=>
{
const
state
=
{
isShowingLabels
:
true
,
};
mutations
.
TOGGLE_
SHOW_
LABELS
(
state
);
mutations
.
TOGGLE_LABELS
(
state
);
expect
(
state
.
isShowingLabels
).
toBe
(
false
);
});
...
...
@@ -22,7 +22,7 @@ describe('TOGGLE_SHOW_LABELS', () => {
isShowingLabels
:
false
,
};
mutations
.
TOGGLE_
SHOW_
LABELS
(
state
);
mutations
.
TOGGLE_LABELS
(
state
);
expect
(
state
.
isShowingLabels
).
toBe
(
true
);
});
...
...
locale/gitlab.pot
View file @
fc10af3a
...
...
@@ -8593,6 +8593,9 @@ msgstr[1] ""
msgid "Hide values"
msgstr ""
msgid "Hiding all labels"
msgstr ""
msgid "Highest number of requests per minute for each raw path, default to 300. To disable throttling set to 0."
msgstr ""
...
...
@@ -15050,9 +15053,6 @@ msgstr ""
msgid "Show file browser"
msgstr ""
msgid "Show labels"
msgstr ""
msgid "Show latest version"
msgstr ""
...
...
@@ -15082,6 +15082,9 @@ msgstr ""
msgid "Showing all issues"
msgstr ""
msgid "Showing all labels"
msgstr ""
msgid "Showing last %{size} of log -"
msgstr ""
...
...
spec/frontend/boards/stores/getters_spec.js
View file @
fc10af3a
import
getters
from
'
~/boards/stores/getters
'
;
describe
(
'
Boards - Getters
'
,
()
=>
{
describe
(
'
get
Snowplow
LabelToggleState
'
,
()
=>
{
describe
(
'
getLabelToggleState
'
,
()
=>
{
it
(
'
should return "on" when isShowingLabels is true
'
,
()
=>
{
const
state
=
{
isShowingLabels
:
true
,
};
expect
(
getters
.
get
Snowplow
LabelToggleState
(
state
)).
toBe
(
'
on
'
);
expect
(
getters
.
getLabelToggleState
(
state
)).
toBe
(
'
on
'
);
});
it
(
'
should return "off" when isShowingLabels is false
'
,
()
=>
{
...
...
@@ -15,7 +15,7 @@ describe('Boards - Getters', () => {
isShowingLabels
:
false
,
};
expect
(
getters
.
get
Snowplow
LabelToggleState
(
state
)).
toBe
(
'
off
'
);
expect
(
getters
.
getLabelToggleState
(
state
)).
toBe
(
'
off
'
);
});
});
});
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