Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
0fa57599
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0fa57599
编写于
8月 05, 2016
作者:
P
Phil Hughes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Hides the welcome board forever after it being hidden by the user
上级
0b351d55
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
42 addition
and
22 deletion
+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
未找到文件。
app/assets/javascripts/boards/boards_bundle.js.es6
浏览文件 @
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'));
new Vue({
if (gl.IssueBoardsApp) {
gl.IssueBoardsApp.$destroy(true);
BoardsStore.reset();
}
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
浏览文件 @
0fa57599
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
const BoardBlankState = Vue.extend({
const BoardBlankState = Vue.extend({
methods: {
methods: {
addDefaultLists: function () {
addDefaultLists: function () {
},
},
clearBlankState: function () {
clearBlankState: function () {
BoardsStore.remove
List('blank'
);
BoardsStore.remove
BlankState(
);
}
}
}
}
});
});
...
...
app/assets/javascripts/boards/models/list.js.es6
浏览文件 @
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
浏览文件 @
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);
list.destroy();
if (id !== 'blank') {
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
浏览文件 @
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
浏览文件 @
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"
=
render
"projects/boards/components/blank_state"
-
if
current_user
=
render
"projects/boards/components/blank_state"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录