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
Show 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
{
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 @@
...
@@ -546,9 +546,12 @@
cursor
:
help
;
cursor
:
help
;
}
}
.boards-labels-toggle-wrapper
{
.board-labels-toggle-wrapper
{
display
:
flex
;
/**
align-items
:
center
;
* 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
{
label
{
font-weight
:
$gl-font-weight-normal
;
font-weight
:
$gl-font-weight-normal
;
...
...
app/views/shared/issuable/_search_bar.html.haml
View file @
fc10af3a
...
@@ -147,7 +147,7 @@
...
@@ -147,7 +147,7 @@
%button
.clear-search.hidden
{
type:
'button'
}
%button
.clear-search.hidden
{
type:
'button'
}
=
icon
(
'times'
)
=
icon
(
'times'
)
#
boards
-labels-toggle
#
js-board
-labels-toggle
.filter-dropdown-container.d-flex.flex-column.flex-md-row
.filter-dropdown-container.d-flex.flex-column.flex-md-row
-
if
type
==
:boards
-
if
type
==
:boards
.js-board-config
{
data:
{
can_admin_list:
user_can_admin_list
,
has_scope:
board
.
scoped?
}
}
.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 {
...
@@ -10,7 +10,7 @@ export default {
...
actionsCE
,
...
actionsCE
,
toggleShowLabels
({
commit
})
{
toggleShowLabels
({
commit
})
{
commit
(
types
.
TOGGLE_
SHOW_
LABELS
);
commit
(
types
.
TOGGLE_LABELS
);
},
},
fetchAllBoards
:
()
=>
{
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';
...
@@ -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_SUCCESS
=
'
RECEIVE_REMOVE_BOARD_SUCCESS
'
;
export
const
RECEIVE_REMOVE_BOARD_ERROR
=
'
RECEIVE_REMOVE_BOARD_ERROR
'
;
export
const
RECEIVE_REMOVE_BOARD_ERROR
=
'
RECEIVE_REMOVE_BOARD_ERROR
'
;
export
const
TOGGLE_PROMOTION_STATE
=
'
TOGGLE_PROMOTION_STATE
'
;
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 = () => {
...
@@ -6,7 +6,7 @@ const notImplemented = () => {
};
};
export
default
{
export
default
{
[
mutationTypes
.
TOGGLE_
SHOW_
LABELS
]:
state
=>
{
[
mutationTypes
.
TOGGLE_LABELS
]:
state
=>
{
Object
.
assign
(
state
,
{
Object
.
assign
(
state
,
{
isShowingLabels
:
!
state
.
isShowingLabels
,
isShowingLabels
:
!
state
.
isShowingLabels
,
});
});
...
...
ee/app/assets/javascripts/boards/toggle_labels.js
View file @
fc10af3a
...
@@ -7,17 +7,21 @@ import store from '~/boards/stores';
...
@@ -7,17 +7,21 @@ import store from '~/boards/stores';
export
default
()
=>
export
default
()
=>
new
Vue
({
new
Vue
({
el
:
document
.
getElementById
(
'
boards
-labels-toggle
'
),
el
:
document
.
getElementById
(
'
js-board
-labels-toggle
'
),
components
:
{
components
:
{
GlToggle
,
GlToggle
,
},
},
store
,
store
,
data
:
{
toggleLabel
:
__
(
'
Show labels
'
),
},
computed
:
{
computed
:
{
...
mapState
([
'
isShowingLabels
'
]),
...
mapState
([
'
isShowingLabels
'
]),
...
mapGetters
([
'
getSnowplowLabelToggleState
'
]),
...
mapGetters
([
'
getLabelToggleState
'
]),
toggleOnLabel
()
{
return
__
(
'
Showing all labels
'
);
},
toggleOffLabel
()
{
return
__
(
'
Hiding all labels
'
);
},
},
},
methods
:
{
methods
:
{
...
mapActions
([
'
toggleShowLabels
'
]),
...
mapActions
([
'
toggleShowLabels
'
]),
...
@@ -27,21 +31,21 @@ export default () =>
...
@@ -27,21 +31,21 @@ export default () =>
Tracking
.
event
(
document
.
body
.
dataset
.
page
,
'
toggle
'
,
{
Tracking
.
event
(
document
.
body
.
dataset
.
page
,
'
toggle
'
,
{
label
:
'
show_labels
'
,
label
:
'
show_labels
'
,
property
:
this
.
get
Snowplow
LabelToggleState
,
property
:
this
.
getLabelToggleState
,
});
});
},
},
},
},
template
:
`
template
:
`
<div class="board
s-labels-toggle-wrapp
er prepend-left-10">
<div class="board
-labels-toggle-wrapper d-flex align-items-cent
er prepend-left-10">
<span id="board
s
-labels-toggle-text">
<span id="board-labels-toggle-text">
{{
toggleLabel
}}
{{
__('Show labels')
}}
</span>
</span>
<gl-toggle
<gl-toggle
:value="isShowingLabels"
:value="isShowingLabels"
class="prepend-left-10"
class="prepend-left-10"
label-on="Showing all labels
"
:label-on="toggleOnLabel
"
label-off="Hiding all labels
"
:label-off="toggleOffLabel
"
aria-describedby="board
s
-labels-toggle-text"
aria-describedby="board-labels-toggle-text"
data-qa-selector="show_labels_toggle"
data-qa-selector="show_labels_toggle"
@change="onToggle"
@change="onToggle"
/>
/>
...
...
ee/spec/frontend/boards/stores/actions_spec.js
View file @
fc10af3a
...
@@ -9,19 +9,12 @@ const expectNotImplemented = action => {
...
@@ -9,19 +9,12 @@ const expectNotImplemented = action => {
};
};
describe
(
'
toggleShowLabels
'
,
()
=>
{
describe
(
'
toggleShowLabels
'
,
()
=>
{
it
(
'
should commit mutation TOGGLE_
SHOW_
LABELS
'
,
done
=>
{
it
(
'
should commit mutation TOGGLE_LABELS
'
,
done
=>
{
const
state
=
{
const
state
=
{
isShowingLabels
:
true
,
isShowingLabels
:
true
,
};
};
testAction
(
testAction
(
actions
.
toggleShowLabels
,
null
,
state
,
[{
type
:
types
.
TOGGLE_LABELS
}],
[],
done
);
actions
.
toggleShowLabels
,
null
,
state
,
[{
type
:
types
.
TOGGLE_SHOW_LABELS
}],
[],
done
,
);
});
});
});
});
...
...
ee/spec/frontend/boards/stores/mutations_spec.js
View file @
fc10af3a
...
@@ -6,13 +6,13 @@ const expectNotImplemented = action => {
...
@@ -6,13 +6,13 @@ const expectNotImplemented = action => {
});
});
};
};
describe
(
'
TOGGLE_
SHOW_
LABELS
'
,
()
=>
{
describe
(
'
TOGGLE_LABELS
'
,
()
=>
{
it
(
'
toggles isShowingLabels from true to false
'
,
()
=>
{
it
(
'
toggles isShowingLabels from true to false
'
,
()
=>
{
const
state
=
{
const
state
=
{
isShowingLabels
:
true
,
isShowingLabels
:
true
,
};
};
mutations
.
TOGGLE_
SHOW_
LABELS
(
state
);
mutations
.
TOGGLE_LABELS
(
state
);
expect
(
state
.
isShowingLabels
).
toBe
(
false
);
expect
(
state
.
isShowingLabels
).
toBe
(
false
);
});
});
...
@@ -22,7 +22,7 @@ describe('TOGGLE_SHOW_LABELS', () => {
...
@@ -22,7 +22,7 @@ describe('TOGGLE_SHOW_LABELS', () => {
isShowingLabels
:
false
,
isShowingLabels
:
false
,
};
};
mutations
.
TOGGLE_
SHOW_
LABELS
(
state
);
mutations
.
TOGGLE_LABELS
(
state
);
expect
(
state
.
isShowingLabels
).
toBe
(
true
);
expect
(
state
.
isShowingLabels
).
toBe
(
true
);
});
});
...
...
locale/gitlab.pot
View file @
fc10af3a
...
@@ -8593,6 +8593,9 @@ msgstr[1] ""
...
@@ -8593,6 +8593,9 @@ msgstr[1] ""
msgid "Hide values"
msgid "Hide values"
msgstr ""
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."
msgid "Highest number of requests per minute for each raw path, default to 300. To disable throttling set to 0."
msgstr ""
msgstr ""
...
@@ -15050,9 +15053,6 @@ msgstr ""
...
@@ -15050,9 +15053,6 @@ msgstr ""
msgid "Show file browser"
msgid "Show file browser"
msgstr ""
msgstr ""
msgid "Show labels"
msgstr ""
msgid "Show latest version"
msgid "Show latest version"
msgstr ""
msgstr ""
...
@@ -15082,6 +15082,9 @@ msgstr ""
...
@@ -15082,6 +15082,9 @@ msgstr ""
msgid "Showing all issues"
msgid "Showing all issues"
msgstr ""
msgstr ""
msgid "Showing all labels"
msgstr ""
msgid "Showing last %{size} of log -"
msgid "Showing last %{size} of log -"
msgstr ""
msgstr ""
...
...
spec/frontend/boards/stores/getters_spec.js
View file @
fc10af3a
import
getters
from
'
~/boards/stores/getters
'
;
import
getters
from
'
~/boards/stores/getters
'
;
describe
(
'
Boards - Getters
'
,
()
=>
{
describe
(
'
Boards - Getters
'
,
()
=>
{
describe
(
'
get
Snowplow
LabelToggleState
'
,
()
=>
{
describe
(
'
getLabelToggleState
'
,
()
=>
{
it
(
'
should return "on" when isShowingLabels is true
'
,
()
=>
{
it
(
'
should return "on" when isShowingLabels is true
'
,
()
=>
{
const
state
=
{
const
state
=
{
isShowingLabels
:
true
,
isShowingLabels
:
true
,
};
};
expect
(
getters
.
get
Snowplow
LabelToggleState
(
state
)).
toBe
(
'
on
'
);
expect
(
getters
.
getLabelToggleState
(
state
)).
toBe
(
'
on
'
);
});
});
it
(
'
should return "off" when isShowingLabels is false
'
,
()
=>
{
it
(
'
should return "off" when isShowingLabels is false
'
,
()
=>
{
...
@@ -15,7 +15,7 @@ describe('Boards - Getters', () => {
...
@@ -15,7 +15,7 @@ describe('Boards - Getters', () => {
isShowingLabels
:
false
,
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