Commit d59af51d authored by Simon Knox's avatar Simon Knox Committed by Oswaldo Ferreira

fix up padding and UI tweaks. Add Any Label option to dropdown

parent 05059efb
...@@ -18,14 +18,6 @@ export default { ...@@ -18,14 +18,6 @@ export default {
type: Array, type: Array,
required: false, required: false,
}, },
defaultText: {
type: String,
required: true,
},
title: {
type: String,
required: true,
},
canEdit: { canEdit: {
type: Boolean, type: Boolean,
required: false, required: false,
...@@ -47,6 +39,18 @@ export default { ...@@ -47,6 +39,18 @@ export default {
mounted() { mounted() {
new LabelsSelect(); new LabelsSelect();
}, },
methods: {
labelStyle(label) {
let style;
if (label.textColor) {
style += `color: ${label.textColor};`
}
if (label.color) {
style += `background-color: ${label.color};`
}
return style;
},
},
}; };
</script> </script>
...@@ -70,17 +74,14 @@ export default { ...@@ -70,17 +74,14 @@ export default {
Any label Any label
</span> </span>
<a <a
v-else
href="#" href="#"
v-for="label in board.labels" v-for="label in board.labels"
:key="label.id" :key="label.id"
> >
<span <span
class="label color-label has-tooltip" class="label color-label"
:style="` :style="labelStyle(label)"
background-color: ${label.color};
color: ${label.textColor};
`"
title=""
> >
{{ label.title }} {{ label.title }}
</span> </span>
...@@ -100,8 +101,9 @@ export default { ...@@ -100,8 +101,9 @@ export default {
<div class="dropdown"> <div class="dropdown">
<button <button
v-bind:data-labels="labelsPath" v-bind:data-labels="labelsPath"
class="dropdown-menu-toggle wide js-label-select js-multiselect js-board-config-modal" class="dropdown-menu-toggle wide js-label-select js-multiselect js-extra-options js-board-config-modal"
data-field-name="label_id[]" data-field-name="label_id[]"
:data-show-any="true"
data-toggle="dropdown" data-toggle="dropdown"
type="button" type="button"
> >
......
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
return this.board.milestone ? this.board.milestone.id : ''; return this.board.milestone ? this.board.milestone.id : '';
}, },
milestoneTitleClass() { milestoneTitleClass() {
return this.milestoneTitle === 'ANY_MILESTONE' ? 'text-secondary': 'bold'; return this.milestoneTitle === ANY_MILESTONE ? 'text-secondary': 'bold';
}, },
selected() { selected() {
return this.board.milestone ? this.board.milestone.name : ''; return this.board.milestone ? this.board.milestone.name : '';
...@@ -72,10 +72,11 @@ export default { ...@@ -72,10 +72,11 @@ export default {
Edit Edit
</a> </a>
</div> </div>
<div class="value"> <div
<span :class="milestoneTitleClass"> class="value"
{{ milestoneTitle }} :class="milestoneTitleClass"
</span> >
{{ milestoneTitle }}
</div> </div>
<div <div
class="selectbox" class="selectbox"
......
...@@ -391,15 +391,16 @@ import DropdownUtils from './filtered_search/dropdown_utils'; ...@@ -391,15 +391,16 @@ import DropdownUtils from './filtered_search/dropdown_utils';
.catch(fadeOutLoader); .catch(fadeOutLoader);
} }
else if ($dropdown.hasClass('js-board-config-modal')) { else if ($dropdown.hasClass('js-board-config-modal')) {
if ($el.hasClass('is-active')) { if (label.isAny) {
gl.issueBoards.BoardsStore.boardConfig.labels = [];
} else if ($el.hasClass('is-active')) {
gl.issueBoards.BoardsStore.boardConfig.labels.push(new ListLabel({ gl.issueBoards.BoardsStore.boardConfig.labels.push(new ListLabel({
id: label.id, id: label.id,
title: label.title, title: label.title,
color: label.color[0], color: label.color[0],
textColor: '#fff' textColor: label.text_color || '#fff',
})); }));
} } else {
else {
let labels = gl.issueBoards.BoardsStore.boardConfig.labels; let labels = gl.issueBoards.BoardsStore.boardConfig.labels;
labels = labels.filter(function (selectedLabel) { labels = labels.filter(function (selectedLabel) {
return selectedLabel.id !== label.id; return selectedLabel.id !== label.id;
......
...@@ -49,3 +49,7 @@ body.modal-open { ...@@ -49,3 +49,7 @@ body.modal-open {
} }
} }
} }
.modal-body {
background-color: $modal-body-bg;
}
...@@ -164,3 +164,36 @@ $pre-border-color: $border-color; ...@@ -164,3 +164,36 @@ $pre-border-color: $border-color;
$table-bg-accent: $gray-light; $table-bg-accent: $gray-light;
$zindex-popover: 900; $zindex-popover: 900;
//== Modals
//
//##
//** Padding applied to the modal body
$modal-inner-padding: $gl-padding;
//** Padding applied to the modal title
$modal-title-padding: $gl-padding;
//** Modal title line-height
// $modal-title-line-height: $line-height-base
//** Background color of modal content area
$modal-content-bg: $gray-light;
$modal-body-bg: $white-light;
//** Modal content border color
// $modal-content-border-color: rgba(0,0,0,.2)
//** Modal content border color **for IE8**
// $modal-content-fallback-border-color: #999
//** Modal backdrop background color
// $modal-backdrop-bg: #000
//** Modal backdrop opacity
// $modal-backdrop-opacity: .5
//** Modal header border color
// $modal-header-border-color: #e5e5e5
//** Modal footer border color
// $modal-footer-border-color: $modal-header-border-color
// $modal-lg: 900px
// $modal-md: 600px
// $modal-sm: 300px
\ No newline at end of file
...@@ -307,6 +307,12 @@ h6 { ...@@ -307,6 +307,12 @@ h6 {
.edit-link { .edit-link {
color: $gl-text-color; color: $gl-text-color;
&:focus,
&:hover {
color: $gl-text-color;
text-decoration: none;
}
} }
.light-header { .light-header {
......
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