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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
0fa57599
Commit
0fa57599
authored
Aug 05, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hides the welcome board forever after it being hidden by the user
parent
0b351d55
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
22 deletions
+42
-22
app/assets/javascripts/boards/boards_bundle.js.es6
app/assets/javascripts/boards/boards_bundle.js.es6
+11
-3
app/assets/javascripts/boards/components/board_blank_state.js.es6
...ts/javascripts/boards/components/board_blank_state.js.es6
+2
-2
app/assets/javascripts/boards/models/list.js.es6
app/assets/javascripts/boards/models/list.js.es6
+7
-5
app/assets/javascripts/boards/stores/boards_store.js.es6
app/assets/javascripts/boards/stores/boards_store.js.es6
+17
-8
app/views/projects/boards/components/_blank_state.html.haml
app/views/projects/boards/components/_blank_state.html.haml
+1
-1
app/views/projects/boards/components/_board.html.haml
app/views/projects/boards/components/_board.html.haml
+4
-3
No files found.
app/assets/javascripts/boards/boards_bundle.js.es6
View file @
0fa57599
...
...
@@ -7,15 +7,23 @@
//= require_tree ./components
$(function () {
window.service = new BoardService($('#board-app').data('endpoint'));
if (!window.gl) {
window.gl = {};
}
gl.boardService = new BoardService($('#board-app').data('endpoint'));
new Vue({
if (gl.IssueBoardsApp) {
gl.IssueBoardsApp.$destroy(true);
BoardsStore.reset();
}
gl.IssueBoardsApp = new Vue({
el: '#board-app',
data: {
state: BoardsStore.state
},
ready: function () {
s
ervice.all()
gl.boardS
ervice.all()
.then((resp) => {
const boards = resp.json();
...
...
app/assets/javascripts/boards/components/board_blank_state.js.es6
View file @
0fa57599
...
...
@@ -2,10 +2,10 @@
const BoardBlankState = Vue.extend({
methods: {
addDefaultLists: function () {
},
clearBlankState: function () {
BoardsStore.remove
List('blank'
);
BoardsStore.remove
BlankState(
);
}
}
});
...
...
app/assets/javascripts/boards/models/list.js.es6
View file @
0fa57599
...
...
@@ -12,7 +12,7 @@ class List {
if (this.type !== 'blank') {
this.loading = true;
s
ervice.getIssuesForList(this.id)
gl.boardS
ervice.getIssuesForList(this.id)
.then((resp) => {
const data = resp.json();
this.loading = false;
...
...
@@ -25,7 +25,7 @@ class List {
}
save () {
s
ervice.createList(this.label.id)
gl.boardS
ervice.createList(this.label.id)
.then((resp) => {
const data = resp.json();
...
...
@@ -36,11 +36,13 @@ class List {
}
destroy () {
service.destroyList(this.id);
if (this.type !== 'blank') {
gl.boardService.destroyList(this.id);
}
}
update () {
s
ervice.updateList(this);
gl.boardS
ervice.updateList(this);
}
canSearch () {
...
...
@@ -52,7 +54,7 @@ class List {
issue.addLabel(this.label);
s
ervice.moveIssue(issue.id, listFrom.id, this.id);
gl.boardS
ervice.moveIssue(issue.id, listFrom.id, this.id);
}
findIssue (id) {
...
...
app/assets/javascripts/boards/stores/boards_store.js.es6
View file @
0fa57599
...
...
@@ -9,6 +9,15 @@
label: []
}
},
reset: function () {
this.state.lists = [];
this.state.filters = {
author: {},
assignee: {},
milestone: {},
label: []
};
},
new: function (board, persist = true) {
const doneList = this.getDoneList(),
list = new List(board);
...
...
@@ -35,6 +44,8 @@
return addBlankState;
},
addBlankState: function () {
if ($.cookie('issue_board_welcome_hidden') === 'true') return;
const doneList = this.getDoneList(),
addBlankState = this.shouldAddBlankState();
...
...
@@ -49,24 +60,22 @@
},
removeBlankState: function () {
this.removeList('blank');
$.cookie('issue_board_welcome_hidden', 'true', {
path: '/',
expires: 365 * 10
});
},
getDoneList: function () {
return this.findList('type', 'done');
},
removeList: function (id) {
const list = this.findList('id', id);
if (id !== 'blank') {
list.destroy();
}
list.destroy();
this.state.lists = _.reject(this.state.lists, (list) => {
return list.id === id;
});
if (id !== 'blank') {
this.addBlankState();
}
},
moveList: function (oldIndex, newIndex) {
const listFrom = this.findList('position', oldIndex),
...
...
app/views/projects/boards/components/_blank_state.html.haml
View file @
0fa57599
...
...
@@ -11,4 +11,4 @@
%button
.btn.btn-create.btn-inverted.btn-block
{
type:
"button"
,
"@click"
=>
"addDefaultLists"
}
Add default lists
%button
.btn.btn-default.btn-block
{
type:
"button"
,
"@click"
=>
"clearBlankState"
}
Nevermind,
i
'll use my own
Nevermind,
I
'll use my own
app/views/projects/boards/components/_board.html.haml
View file @
0fa57599
...
...
@@ -4,13 +4,13 @@
%header
.board-inner-container.board-header
{
":class"
=>
"{ 'has-border': board.label }"
,
":style"
=>
"{ borderTopColor: board.label.color }"
}
%h3
.board-title
{{ board.title }}
%span
.pull-right
%span
.pull-right
{
"v-if"
=>
"board.type !== 'blank'"
}
{{ board.issues.length }}
%board-delete
{
"inline-template"
=>
true
,
"v-if"
=>
"!isPreset"
,
":board-id"
=>
"board.id"
}
%button
.board-delete.has-tooltip.pull-right
{
type:
"button"
,
title:
"Delete board"
,
"aria-label"
=>
"Delete board"
,
data:
{
placement:
"bottom"
},
"@click"
=>
"deleteBoard"
}
=
icon
(
"trash"
)
.board-inner-container.board-search-container
{
"v-if"
=>
"board.canSearch()"
}
%input
.form-control
{
type:
"text"
,
placeholder:
"Search issues"
,
"v-model"
=>
"query"
}
%input
.form-control
{
type:
"text"
,
placeholder:
"Search issues"
,
"v-model"
=>
"query"
,
"debounce"
=>
"250"
}
=
icon
(
"search"
,
class:
"board-search-icon"
,
"v-show"
=>
"!query"
)
%button
.board-search-clear-btn
{
type:
"button"
,
role:
"button"
,
"aria-label"
=>
"Clear search"
,
"@click"
=>
"clearSearch"
,
"v-show"
=>
"query"
}
=
icon
(
"times"
,
class:
"board-search-clear"
)
...
...
@@ -29,4 +29,5 @@
"v-show"
=>
"!loading"
,
":data-board"
=>
"boardId"
}
=
render
"projects/boards/components/card"
=
render
"projects/boards/components/blank_state"
-
if
current_user
=
render
"projects/boards/components/blank_state"
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