Commit 8780b2cf authored by Phil Hughes's avatar Phil Hughes Committed by Douglas Barbosa Alexandre

Styling updates

Fixes issue with dropdown toggle not changing
parent 5cf67cc1
/* global Vue */ /* global Vue */
/* eslint-disable */ /* eslint-disable */
//= require ./milestone_select const boardMilestoneSelect = require('./milestone_select');
(() => { (() => {
window.gl = window.gl || {}; window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {}; window.gl.issueBoards = window.gl.issueBoards || {};
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
board: { board: {
id: false, id: false,
name: '', name: '',
milestone: {},
milestone_id: '',
}, },
currentBoard: Store.state.currentBoard, currentBoard: Store.state.currentBoard,
currentPage: Store.state.currentPage, currentPage: Store.state.currentPage,
...@@ -27,7 +29,7 @@ ...@@ -27,7 +29,7 @@
}; };
}, },
components: { components: {
'board-milestone-select': gl.issueBoards.BoardMilestoneSelect, boardMilestoneSelect,
}, },
mounted() { mounted() {
if (this.currentBoard && Object.keys(this.currentBoard).length && this.currentPage !== 'new') { if (this.currentBoard && Object.keys(this.currentBoard).length && this.currentPage !== 'new') {
...@@ -43,11 +45,7 @@ ...@@ -43,11 +45,7 @@
return 'Save'; return 'Save';
}, },
milestoneToggleText() { milestoneToggleText() {
if (this.board.milestone_id) { return this.board.milestone.title || 'Milestone';
return this.board.milestone.title;
}
return 'Milestone';
}, },
submitDisabled() { submitDisabled() {
if (this.currentPage !== 'milestone') { if (this.currentPage !== 'milestone') {
......
...@@ -91,6 +91,7 @@ require('./board_new_form'); ...@@ -91,6 +91,7 @@ require('./board_new_form');
}, },
created() { created() {
const $milestoneDropdown = $('.dropdown-menu-milestone'); const $milestoneDropdown = $('.dropdown-menu-milestone');
console.log(this.currentBoard);
this.state.currentBoard = this.currentBoard; this.state.currentBoard = this.currentBoard;
......
/* global Vue */ /* global Vue */
(() => { module.exports = Vue.extend({
gl.issueBoards.BoardMilestoneSelect = Vue.extend({ props: {
props: { board: {
board: { type: Object,
type: Object, required: true,
required: true,
},
milestonePath: {
type: String,
required: true,
},
selectMilestone: {
type: Function,
required: true,
},
}, },
data() { milestonePath: {
return { type: String,
loading: false, required: true,
milestones: [],
};
}, },
mounted() { selectMilestone: {
this.loading = true; type: Function,
this.$http.get(this.milestonePath) required: true,
.then((res) => {
this.milestones = res.json();
this.loading = false;
});
}, },
template: ` },
<div> data() {
<div class="text-center"> return {
<i loading: false,
v-if="loading" milestones: [],
class="fa fa-spinner fa-spin"></i> };
</div> },
<ul v-if="!loading"> mounted() {
<li v-for="milestone in milestones"> this.loading = true;
<a this.$http.get(this.milestonePath)
href="#" .then((res) => {
@click.prevent.stop="selectMilestone(milestone)"> this.milestones = res.json();
<i this.loading = false;
class="fa fa-check" });
v-if="board.milestone_id === milestone.id"></i> },
{{ milestone.title }} template: `
</a> <div>
</li> <div class="text-center">
</ul> <i
v-if="loading"
class="fa fa-spinner fa-spin"></i>
</div> </div>
`, <ul
}); class="board-milestone-list"
})(); v-if="!loading">
<li v-for="milestone in milestones">
<a
href="#"
@click.prevent.stop="selectMilestone(milestone)">
<i
class="fa fa-check"
v-if="board.milestone_id === milestone.id"></i>
{{ milestone.title }}
</a>
</li>
</ul>
</div>
`,
});
...@@ -554,3 +554,25 @@ ...@@ -554,3 +554,25 @@
margin-right: 10px; margin-right: 10px;
border-right: 1px solid $white-dark; border-right: 1px solid $white-dark;
} }
.board-milestone-list {
> li {
padding-left: 0;
padding-right: 0;
}
a {
padding-left: 25px;
}
.fa-check {
margin-left: -18px;
}
}
.board-inner-milestone-dropdown {
.dropdown-menu {
top: 60px;
min-width: 100%;
}
}
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
%input.form-control{ type: "text", %input.form-control{ type: "text",
id: "board-new-name", id: "board-new-name",
"v-model" => "board.name" } "v-model" => "board.name" }
.dropdown{ ":class" => "{ open: milestoneDropdownOpen }", .dropdown.board-inner-milestone-dropdown{ ":class" => "{ open: milestoneDropdownOpen }",
"v-if" => "currentPage === 'new'" } "v-if" => "currentPage === 'new'" }
%label.label-light{ for: "board-milestone" } %label.label-light{ for: "board-milestone" }
Board milestone Board milestone
......
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