Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
ff98a743
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,体验更适合开发者的 AI 搜索 >>
提交
ff98a743
编写于
1月 26, 2017
作者:
P
Phil Hughes
提交者:
Fatih Acet
2月 03, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added empty state
上级
d9894a2f
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
105 addition
and
9 deletion
+105
-9
app/assets/javascripts/boards/components/modal/empty_state.js.es6
...ts/javascripts/boards/components/modal/empty_state.js.es6
+65
-0
app/assets/javascripts/boards/components/modal/footer.js.es6
app/assets/javascripts/boards/components/modal/footer.js.es6
+2
-1
app/assets/javascripts/boards/components/modal/header.js.es6
app/assets/javascripts/boards/components/modal/header.js.es6
+3
-3
app/assets/javascripts/boards/components/modal/index.js.es6
app/assets/javascripts/boards/components/modal/index.js.es6
+19
-1
app/assets/javascripts/boards/components/modal/list.js.es6
app/assets/javascripts/boards/components/modal/list.js.es6
+1
-2
app/assets/javascripts/boards/components/modal/tabs.js.es6
app/assets/javascripts/boards/components/modal/tabs.js.es6
+1
-1
app/assets/stylesheets/pages/boards.scss
app/assets/stylesheets/pages/boards.scss
+12
-0
app/views/projects/boards/_show.html.haml
app/views/projects/boards/_show.html.haml
+2
-1
未找到文件。
app/assets/javascripts/boards/components/modal/empty_state.js.es6
0 → 100644
浏览文件 @
ff98a743
/* global Vue */
(() => {
const ModalStore = gl.issueBoards.ModalStore;
window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {};
gl.issueBoards.ModalEmptyState = Vue.extend({
data() {
return ModalStore.store;
},
props: [
'image', 'newIssuePath',
],
computed: {
contents() {
const obj = {
title: 'You haven\'t added any issues to your project yet',
content: `
An issue can be a bug, a todo or a feature request that needs to be
discussed in a project. Besides, issues are searchable and filterable.
`,
};
if (this.activeTab === 'selected') {
obj.title = 'You haven\'t selected any issues yet';
obj.content = `
Go back to <strong>All issues</strong> and select some issues
to add to your board.
`;
}
return obj;
}
},
template: `
<div class="empty-state">
<div class="row">
<div class="col-xs-12 col-sm-6 col-sm-push-6">
<div class="svg-content" v-html="image"></div>
</div>
<div class="col-xs-12 col-sm-6 col-sm-pull-6">
<div class="text-content">
<h4>{{ contents.title }}</h4>
<p v-html="contents.content"></p>
<a
:href="newIssuePath"
class="btn btn-success btn-inverted"
v-if="activeTab === 'all'">
Create issue
</a>
<button
type="button"
class="btn btn-default"
@click="activeTab = 'all'"
v-if="activeTab === 'selected'">
All issues
</button>
</div>
</div>
</div>
</div>
`,
});
})();
app/assets/javascripts/boards/components/modal/footer.js.es6
浏览文件 @
ff98a743
...
@@ -44,7 +44,8 @@
...
@@ -44,7 +44,8 @@
'lists-dropdown': gl.issueBoards.ModalFooterListsDropdown,
'lists-dropdown': gl.issueBoards.ModalFooterListsDropdown,
},
},
template: `
template: `
<footer class="form-actions add-issues-footer">
<footer
class="form-actions add-issues-footer">
<div class="pull-left">
<div class="pull-left">
<button
<button
class="btn btn-success"
class="btn btn-success"
...
...
app/assets/javascripts/boards/components/modal/header.js.es6
浏览文件 @
ff98a743
...
@@ -40,10 +40,10 @@
...
@@ -40,10 +40,10 @@
</button>
</button>
</h2>
</h2>
</header>
</header>
<modal-tabs v-if="!loading"></modal-tabs>
<modal-tabs v-if="!loading
&& issues.length > 0
"></modal-tabs>
<div
<div
class="add-issues-search
prepend-top-10
append-bottom-10"
class="add-issues-search append-bottom-10"
v-if="activeTab == 'all' && !loading">
v-if="activeTab == 'all' && !loading
&& issues.length > 0
">
<input
<input
placeholder="Search issues..."
placeholder="Search issues..."
class="form-control"
class="form-control"
...
...
app/assets/javascripts/boards/components/modal/index.js.es6
浏览文件 @
ff98a743
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
//= require ./header
//= require ./header
//= require ./list
//= require ./list
//= require ./footer
//= require ./footer
//= require ./empty_state
(() => {
(() => {
const ModalStore = gl.issueBoards.ModalStore;
const ModalStore = gl.issueBoards.ModalStore;
...
@@ -9,6 +10,9 @@
...
@@ -9,6 +10,9 @@
window.gl.issueBoards = window.gl.issueBoards || {};
window.gl.issueBoards = window.gl.issueBoards || {};
gl.issueBoards.IssuesModal = Vue.extend({
gl.issueBoards.IssuesModal = Vue.extend({
props: [
'blankStateImage', 'newIssuePath',
],
data() {
data() {
return ModalStore.store;
return ModalStore.store;
},
},
...
@@ -48,10 +52,20 @@
...
@@ -48,10 +52,20 @@
});
});
},
},
},
},
computed: {
showList() {
if (this.activeTab === 'selected') {
return this.selectedIssues.length > 0;
}
return this.issues.length > 0;
},
},
components: {
components: {
'modal-header': gl.issueBoards.IssuesModalHeader,
'modal-header': gl.issueBoards.IssuesModalHeader,
'modal-list': gl.issueBoards.ModalList,
'modal-list': gl.issueBoards.ModalList,
'modal-footer': gl.issueBoards.ModalFooter,
'modal-footer': gl.issueBoards.ModalFooter,
'empty-state': gl.issueBoards.ModalEmptyState,
},
},
template: `
template: `
<div
<div
...
@@ -59,7 +73,11 @@
...
@@ -59,7 +73,11 @@
v-if="showAddIssuesModal">
v-if="showAddIssuesModal">
<div class="add-issues-container">
<div class="add-issues-container">
<modal-header></modal-header>
<modal-header></modal-header>
<modal-list v-if="!loading"></modal-list>
<modal-list v-if="!loading && showList"></modal-list>
<empty-state
v-if="(!loading && issues.length === 0) || (activeTab === 'selected' && selectedIssues.length === 0)"
:image="blankStateImage"
:new-issue-path="newIssuePath"></empty-state>
<section
<section
class="add-issues-list text-center"
class="add-issues-list text-center"
v-if="loading">
v-if="loading">
...
...
app/assets/javascripts/boards/components/modal/list.js.es6
浏览文件 @
ff98a743
...
@@ -66,8 +66,7 @@
...
@@ -66,8 +66,7 @@
template: `
template: `
<div
<div
class="add-issues-list add-issues-list-columns"
class="add-issues-list add-issues-list-columns"
ref="list"
ref="list">
v-show="!loading">
<div
<div
v-for="issue in loopIssues"
v-for="issue in loopIssues"
v-if="showIssue(issue)"
v-if="showIssue(issue)"
...
...
app/assets/javascripts/boards/components/modal/tabs.js.es6
浏览文件 @
ff98a743
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
this.activeTab = 'all';
this.activeTab = 'all';
},
},
template: `
template: `
<div class="top-area prepend-top-10">
<div class="top-area prepend-top-10
append-bottom-10
">
<ul class="nav-links issues-state-filters">
<ul class="nav-links issues-state-filters">
<li :class="{ 'active': activeTab == 'all' }">
<li :class="{ 'active': activeTab == 'all' }">
<a
<a
...
...
app/assets/stylesheets/pages/boards.scss
浏览文件 @
ff98a743
...
@@ -378,6 +378,18 @@
...
@@ -378,6 +378,18 @@
background-color
:
$white-light
;
background-color
:
$white-light
;
border-radius
:
$border-radius-default
;
border-radius
:
$border-radius-default
;
box-shadow
:
0
2px
12px
rgba
(
$black
,
.5
);
box-shadow
:
0
2px
12px
rgba
(
$black
,
.5
);
.empty-state
{
display
:
flex
;
flex
:
1
;
margin-top
:
0
;
>
.row
{
width
:
100%
;
margin-top
:
auto
;
margin-bottom
:
auto
;
}
}
}
}
.add-issues-header
{
.add-issues-header
{
...
...
app/views/projects/boards/_show.html.haml
浏览文件 @
ff98a743
...
@@ -26,4 +26,5 @@
...
@@ -26,4 +26,5 @@
":issue-link-base"
=>
"issueLinkBase"
,
":issue-link-base"
=>
"issueLinkBase"
,
":key"
=>
"_uid"
}
":key"
=>
"_uid"
}
=
render
"projects/boards/components/sidebar"
=
render
"projects/boards/components/sidebar"
%board-add-issues-modal
%board-add-issues-modal
{
"blank-state-image"
=>
render
(
'shared/empty_states/icons/issues.svg'
),
"new-issue-path"
=>
new_namespace_project_issue_path
(
@project
.
namespace
,
@project
)
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录