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
Boxiang Sun
gitlab-ce
Commits
49c920fb
Commit
49c920fb
authored
Mar 15, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue boards blank state template in JS file
Aim to eventually go to vue files
parent
9226ce9e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
62 deletions
+71
-62
app/assets/javascripts/boards/components/board.js
app/assets/javascripts/boards/components/board.js
+3
-2
app/assets/javascripts/boards/components/board_blank_state.js
...assets/javascripts/boards/components/board_blank_state.js
+67
-44
app/views/projects/boards/components/_blank_state.html.haml
app/views/projects/boards/components/_blank_state.html.haml
+0
-15
app/views/projects/boards/components/_board.html.haml
app/views/projects/boards/components/_board.html.haml
+1
-1
No files found.
app/assets/javascripts/boards/components/board.js
View file @
49c920fb
...
...
@@ -2,7 +2,8 @@
/* global Vue */
/* global Sortable */
require
(
'
./board_blank_state
'
);
import
boardBlankState
from
'
./board_blank_state
'
;
require
(
'
./board_delete
'
);
require
(
'
./board_list
'
);
...
...
@@ -17,7 +18,7 @@ require('./board_list');
components
:
{
'
board-list
'
:
gl
.
issueBoards
.
BoardList
,
'
board-delete
'
:
gl
.
issueBoards
.
BoardDelete
,
'
board-blank-state
'
:
gl
.
issueBoards
.
BoardBlankState
boardBlankState
,
},
props
:
{
list
:
Object
,
...
...
app/assets/javascripts/boards/components/board_blank_state.js
View file @
49c920fb
/* eslint-disable space-before-function-paren, comma-dangle */
/* global Vue */
/* global ListLabel */
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
(()
=>
{
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
export
default
{
template
:
`
<div class="board-blank-state">
<p>
Add the following default lists to your Issue Board with one click:
</p>
<ul class="board-blank-state-list">
<li v-for="label in predefinedLabels">
<span
class="label-color"
:style="{ backgroundColor: label.color }">
</span>
{{ label.title }}
</li>
</ul>
<p>
Starting out with the default set of lists will get you right on the way to making the most of your board.
</p>
<button
class="btn btn-create btn-inverted btn-block"
type="button"
@click.stop="addDefaultLists">
Add default lists
</button>
<button
class="btn btn-default btn-block"
type="button"
@click.stop="clearBlankState">
Nevermind, I'll use my own
</button>
</div>
`
,
data
()
{
return
{
predefinedLabels
:
[
new
ListLabel
({
title
:
'
To Do
'
,
color
:
'
#F0AD4E
'
}),
new
ListLabel
({
title
:
'
Doing
'
,
color
:
'
#5CB85C
'
}),
],
};
},
methods
:
{
addDefaultLists
()
{
this
.
clearBlankState
();
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
gl
.
issueBoards
.
BoardBlankState
=
Vue
.
extend
({
data
()
{
return
{
predefinedLabels
:
[
new
ListLabel
({
title
:
'
To Do
'
,
color
:
'
#F0AD4E
'
}),
new
ListLabel
({
title
:
'
Doing
'
,
color
:
'
#5CB85C
'
})
]
};
},
methods
:
{
addDefaultLists
()
{
this
.
clearBlankState
();
this
.
predefinedLabels
.
forEach
((
label
,
i
)
=>
{
Store
.
addList
({
this
.
predefinedLabels
.
forEach
((
label
,
i
)
=>
{
Store
.
addList
({
title
:
label
.
title
,
position
:
i
,
list_type
:
'
label
'
,
label
:
{
title
:
label
.
title
,
position
:
i
,
list_type
:
'
label
'
,
label
:
{
title
:
label
.
title
,
color
:
label
.
color
}
});
color
:
label
.
color
,
},
});
});
Store
.
state
.
lists
=
_
.
sortBy
(
Store
.
state
.
lists
,
'
position
'
);
Store
.
state
.
lists
=
_
.
sortBy
(
Store
.
state
.
lists
,
'
position
'
);
// Save the labels
gl
.
boardService
.
generateDefaultLists
()
.
then
((
resp
)
=>
{
resp
.
json
().
forEach
((
listObj
)
=>
{
const
list
=
Store
.
findList
(
'
title
'
,
listObj
.
title
);
// Save the labels
gl
.
boardService
.
generateDefaultLists
()
.
then
((
resp
)
=>
{
resp
.
json
().
forEach
((
listObj
)
=>
{
const
list
=
Store
.
findList
(
'
title
'
,
listObj
.
title
);
list
.
id
=
listObj
.
id
;
list
.
label
.
id
=
listObj
.
label
.
id
;
list
.
getIssues
();
});
list
.
id
=
listObj
.
id
;
list
.
label
.
id
=
listObj
.
label
.
id
;
list
.
getIssues
();
});
},
clearBlankState
:
Store
.
removeBlankState
.
bind
(
Store
)
}
}
);
}
)()
;
});
},
clearBlankState
:
Store
.
removeBlankState
.
bind
(
Store
),
}
,
};
app/views/projects/boards/components/_blank_state.html.haml
deleted
100644 → 0
View file @
9226ce9e
%board-blank-state
{
"inline-template"
=>
true
,
"v-if"
=>
'list.id == "blank"'
}
.board-blank-state
%p
Add the following default lists to your Issue Board with one click:
%ul
.board-blank-state-list
%li
{
"v-for"
=>
"label in predefinedLabels"
}
%span
.label-color
{
":style"
=>
"{ backgroundColor: label.color } "
}
{{ label.title }}
%p
Starting out with the default set of lists will get you right on the way to making the most of your board.
%button
.btn.btn-create.btn-inverted.btn-block
{
type:
"button"
,
"@click.stop"
=>
"addDefaultLists"
}
Add default lists
%button
.btn.btn-default.btn-block
{
type:
"button"
,
"@click.stop"
=>
"clearBlankState"
}
Nevermind, I'll use my own
app/views/projects/boards/components/_board.html.haml
View file @
49c920fb
...
...
@@ -32,4 +32,4 @@
":root-path"
=>
"rootPath"
,
"ref"
=>
"board-list"
}
-
if
can?
(
current_user
,
:admin_list
,
@project
)
=
render
"projects/boards/components/blank_state"
%board-blank-state
{
"v-if"
=>
'list.id == "blank"'
}
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