Commit 023c978d authored by Florie Guibert's avatar Florie Guibert Committed by Heinrich Lee Yu

Refactor labels in board sidebar

parent 33ad59e2
...@@ -147,6 +147,17 @@ export default Vue.extend({ ...@@ -147,6 +147,17 @@ export default Vue.extend({
showScopedLabels(label) { showScopedLabels(label) {
return boardsStore.scopedLabels.enabled && isScopedLabel(label); return boardsStore.scopedLabels.enabled && isScopedLabel(label);
}, },
splitScopedLabel(label) {
return label.title.split('::');
},
scopedLabelScope(label) {
const splitLabel = this.splitScopedLabel(label)
return splitLabel[0];
},
scopedValue(label) {
const splitLabel = this.splitScopedLabel(label)
return splitLabel[1];
},
helpLink() { helpLink() {
return boardsStore.scopedLabels.helpLink; return boardsStore.scopedLabels.helpLink;
}, },
......
...@@ -86,9 +86,23 @@ ...@@ -86,9 +86,23 @@
} }
.issuable-show-labels { .issuable-show-labels {
a { .gl-label-scoped {
border-style: solid;
border-width: 2px;
&.gl-label-sm {
border-width: 1px;
}
.gl-label-text:last-child {
padding-right: 22px;
}
}
.gl-label {
margin-bottom: 5px; margin-bottom: 5px;
margin-right: 5px; margin-right: 5px;
}
a {
display: inline-block; display: inline-block;
.color-label { .color-label {
......
...@@ -9,14 +9,18 @@ ...@@ -9,14 +9,18 @@
= _("None") = _("None")
%span{ "v-for" => "label in issue.labels" } %span{ "v-for" => "label in issue.labels" }
%span.d-inline-block.position-relative.scoped-label-wrapper{ "v-if" => "showScopedLabels(label)" } %span.d-inline-block.position-relative.scoped-label-wrapper{ "v-if" => "showScopedLabels(label)" }
%a{ href: '#' } %span.gl-label.gl-label-scoped{ ":style" => "{ borderColor: label.color }" }
%span.badge.color-label.label{ ":style" => "{ backgroundColor: label.color, color: label.textColor }" } %a.gl-link.gl-label-link{ href: '#' }
%span.gl-label-text{ ":style" => "{ backgroundColor: label.color, color: label.textColor }" }
{{ scopedLabelScope(label) }}
%span.gl-label-text{ ":style" => "{ backgroundColor: label.textColor, color: label.Color }" }
{{ scopedValue(label) }}
%a.label.scoped-label.gl-link.gl-label-icon{ ":href" => "helpLink()" }
%i.fa.fa-question-circle
%span.gl-label{ "v-else" => true }
%a.gl-link.gl-label-link{ href: "#" }
%span.gl-label-text{ ":style" => "{ backgroundColor: label.color, color: label.textColor }" }
{{ label.title }} {{ label.title }}
%a.label.scoped-label{ ":href" => "helpLink()" }
%i.fa.fa-question-circle{ ":style" => "{ backgroundColor: label.color, color: label.textColor }" }
%a{ href: "#", "v-else" => true }
.badge.color-label.has-tooltip{ ":style" => "{ backgroundColor: label.color, color: label.textColor }" }
{{ label.title }}
- if can_admin_issue? - if can_admin_issue?
.selectbox .selectbox
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment