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
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
Show 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 @@
...
@@ -7,15 +7,23 @@
//= require_tree ./components
//= require_tree ./components
$(function () {
$(function () {
window.service = new BoardService($('#board-app').data('endpoint'));
if (!window.gl) {
window.gl = {};
}
gl.boardService = new BoardService($('#board-app').data('endpoint'));
if (gl.IssueBoardsApp) {
gl.IssueBoardsApp.$destroy(true);
BoardsStore.reset();
}
new Vue({
gl.IssueBoardsApp =
new Vue({
el: '#board-app',
el: '#board-app',
data: {
data: {
state: BoardsStore.state
state: BoardsStore.state
},
},
ready: function () {
ready: function () {
s
ervice.all()
gl.boardS
ervice.all()
.then((resp) => {
.then((resp) => {
const boards = resp.json();
const boards = resp.json();
...
...
app/assets/javascripts/boards/components/board_blank_state.js.es6
View file @
0fa57599
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
},
},
clearBlankState: 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 {
...
@@ -12,7 +12,7 @@ class List {
if (this.type !== 'blank') {
if (this.type !== 'blank') {
this.loading = true;
this.loading = true;
s
ervice.getIssuesForList(this.id)
gl.boardS
ervice.getIssuesForList(this.id)
.then((resp) => {
.then((resp) => {
const data = resp.json();
const data = resp.json();
this.loading = false;
this.loading = false;
...
@@ -25,7 +25,7 @@ class List {
...
@@ -25,7 +25,7 @@ class List {
}
}
save () {
save () {
s
ervice.createList(this.label.id)
gl.boardS
ervice.createList(this.label.id)
.then((resp) => {
.then((resp) => {
const data = resp.json();
const data = resp.json();
...
@@ -36,11 +36,13 @@ class List {
...
@@ -36,11 +36,13 @@ class List {
}
}
destroy () {
destroy () {
service.destroyList(this.id);
if (this.type !== 'blank') {
gl.boardService.destroyList(this.id);
}
}
}
update () {
update () {
s
ervice.updateList(this);
gl.boardS
ervice.updateList(this);
}
}
canSearch () {
canSearch () {
...
@@ -52,7 +54,7 @@ class List {
...
@@ -52,7 +54,7 @@ class List {
issue.addLabel(this.label);
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) {
findIssue (id) {
...
...
app/assets/javascripts/boards/stores/boards_store.js.es6
View file @
0fa57599
...
@@ -9,6 +9,15 @@
...
@@ -9,6 +9,15 @@
label: []
label: []
}
}
},
},
reset: function () {
this.state.lists = [];
this.state.filters = {
author: {},
assignee: {},
milestone: {},
label: []
};
},
new: function (board, persist = true) {
new: function (board, persist = true) {
const doneList = this.getDoneList(),
const doneList = this.getDoneList(),
list = new List(board);
list = new List(board);
...
@@ -35,6 +44,8 @@
...
@@ -35,6 +44,8 @@
return addBlankState;
return addBlankState;
},
},
addBlankState: function () {
addBlankState: function () {
if ($.cookie('issue_board_welcome_hidden') === 'true') return;
const doneList = this.getDoneList(),
const doneList = this.getDoneList(),
addBlankState = this.shouldAddBlankState();
addBlankState = this.shouldAddBlankState();
...
@@ -49,24 +60,22 @@
...
@@ -49,24 +60,22 @@
},
},
removeBlankState: function () {
removeBlankState: function () {
this.removeList('blank');
this.removeList('blank');
$.cookie('issue_board_welcome_hidden', 'true', {
path: '/',
expires: 365 * 10
});
},
},
getDoneList: function () {
getDoneList: function () {
return this.findList('type', 'done');
return this.findList('type', 'done');
},
},
removeList: function (id) {
removeList: function (id) {
const list = this.findList('id', id);
const list = this.findList('id', id);
if (id !== 'blank') {
list.destroy();
list.destroy();
}
this.state.lists = _.reject(this.state.lists, (list) => {
this.state.lists = _.reject(this.state.lists, (list) => {
return list.id === id;
return list.id === id;
});
});
if (id !== 'blank') {
this.addBlankState();
}
},
},
moveList: function (oldIndex, newIndex) {
moveList: function (oldIndex, newIndex) {
const listFrom = this.findList('position', oldIndex),
const listFrom = this.findList('position', oldIndex),
...
...
app/views/projects/boards/components/_blank_state.html.haml
View file @
0fa57599
...
@@ -11,4 +11,4 @@
...
@@ -11,4 +11,4 @@
%button
.btn.btn-create.btn-inverted.btn-block
{
type:
"button"
,
"@click"
=>
"addDefaultLists"
}
%button
.btn.btn-create.btn-inverted.btn-block
{
type:
"button"
,
"@click"
=>
"addDefaultLists"
}
Add default lists
Add default lists
%button
.btn.btn-default.btn-block
{
type:
"button"
,
"@click"
=>
"clearBlankState"
}
%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 @@
...
@@ -4,13 +4,13 @@
%header
.board-inner-container.board-header
{
":class"
=>
"{ 'has-border': board.label }"
,
":style"
=>
"{ borderTopColor: board.label.color }"
}
%header
.board-inner-container.board-header
{
":class"
=>
"{ 'has-border': board.label }"
,
":style"
=>
"{ borderTopColor: board.label.color }"
}
%h3
.board-title
%h3
.board-title
{{ board.title }}
{{ board.title }}
%span
.pull-right
%span
.pull-right
{
"v-if"
=>
"board.type !== 'blank'"
}
{{ board.issues.length }}
{{ board.issues.length }}
%board-delete
{
"inline-template"
=>
true
,
"v-if"
=>
"!isPreset"
,
":board-id"
=>
"board.id"
}
%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"
}
%button
.board-delete.has-tooltip.pull-right
{
type:
"button"
,
title:
"Delete board"
,
"aria-label"
=>
"Delete board"
,
data:
{
placement:
"bottom"
},
"@click"
=>
"deleteBoard"
}
=
icon
(
"trash"
)
=
icon
(
"trash"
)
.board-inner-container.board-search-container
{
"v-if"
=>
"board.canSearch()"
}
.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"
)
=
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"
}
%button
.board-search-clear-btn
{
type:
"button"
,
role:
"button"
,
"aria-label"
=>
"Clear search"
,
"@click"
=>
"clearSearch"
,
"v-show"
=>
"query"
}
=
icon
(
"times"
,
class:
"board-search-clear"
)
=
icon
(
"times"
,
class:
"board-search-clear"
)
...
@@ -29,4 +29,5 @@
...
@@ -29,4 +29,5 @@
"v-show"
=>
"!loading"
,
"v-show"
=>
"!loading"
,
":data-board"
=>
"boardId"
}
":data-board"
=>
"boardId"
}
=
render
"projects/boards/components/card"
=
render
"projects/boards/components/card"
-
if
current_user
=
render
"projects/boards/components/blank_state"
=
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