BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
dc73405d
Commit
dc73405d
authored
Aug 16, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Uses dataset rather than jQuery to get attribute values
parent
1de23708
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
40 deletions
+45
-40
boards_bundle.js.es6
app/assets/javascripts/boards/boards_bundle.js.es6
+10
-14
board.js.es6
app/assets/javascripts/boards/components/board.js.es6
+6
-4
board_blank_state.js.es6
...ts/javascripts/boards/components/board_blank_state.js.es6
+6
-4
board_card.js.es6
app/assets/javascripts/boards/components/board_card.js.es6
+8
-6
board_list.js.es6
app/assets/javascripts/boards/components/board_list.js.es6
+9
-8
new_list_dropdown.js.es6
...ts/javascripts/boards/components/new_list_dropdown.js.es6
+6
-4
No files found.
app/assets/javascripts/boards/boards_bundle.js.es6
View file @
dc73405d
...
...
@@ -9,7 +9,8 @@
//= require ./components/new_list_dropdown
$(() => {
const $boardApp = $('#board-app');
const $boardApp = document.getElementById('board-app'),
Store = gl.issueBoards.BoardsStore;
window.gl = window.gl || {};
...
...
@@ -18,16 +19,16 @@ $(() => {
}
gl.IssueBoardsApp = new Vue({
el: $boardApp
.get(0)
,
el: $boardApp,
components: {
'board': gl.issueBoards.Board
},
data: {
state:
gl.issueBoards.Boards
Store.state,
state: Store.state,
loading: true,
endpoint: $boardApp.data
('endpoint')
,
disabled: $boardApp.data
('disabled')
,
issueLinkBase: $boardApp.data
('issue-link-base')
endpoint: $boardApp.data
set.endpoint
,
disabled: $boardApp.data
set.disabled === 'true'
,
issueLinkBase: $boardApp.data
set.issueLinkBase
},
init () {
gl.issueBoards.BoardsStore.create();
...
...
@@ -35,21 +36,16 @@ $(() => {
created () {
this.loading = true;
gl.boardService = new BoardService(this.endpoint);
$boardApp
.removeAttr('data-endpoint')
.removeAttr('data-disabled')
.removeAttr('data-issue-link-base');
},
ready () {
gl.issueBoards.Boards
Store.disabled = this.disabled;
Store.disabled = this.disabled;
gl.boardService.all()
.then((resp) => {
const boards = resp.json();
for (let i = 0, boardsLength = boards.length; i < boardsLength; i++) {
const board = boards[i],
list =
gl.issueBoards.Boards
Store.addList(board);
list = Store.addList(board);
if (list.type === 'done') {
list.position = Infinity;
...
...
@@ -58,7 +54,7 @@ $(() => {
}
}
gl.issueBoards.Boards
Store.addBlankState();
Store.addBlankState();
this.loading = false;
});
}
...
...
app/assets/javascripts/boards/components/board.js.es6
View file @
dc73405d
...
...
@@ -3,6 +3,8 @@
//= require ./board_list
(() => {
const Store = gl.issueBoards.BoardsStore;
window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {};
...
...
@@ -20,7 +22,7 @@
data () {
return {
query: '',
filters:
gl.issueBoards.Boards
Store.state.filters
filters: Store.state.filters
};
},
watch: {
...
...
@@ -75,8 +77,8 @@
$board.$destroy(true);
this.$nextTick(() => {
gl.issueBoards.Boards
Store.state.lists.splice(e.newIndex, 0, list);
gl.issueBoards.Boards
Store.moveList(list, order);
Store.state.lists.splice(e.newIndex, 0, list);
Store.moveList(list, order);
});
}
}
...
...
@@ -89,7 +91,7 @@
this.sortable = Sortable.create(this.$el.parentNode, options);
},
beforeDestroy () {
gl.issueBoards.Boards
Store.state.lists.$remove(this.list);
Store.state.lists.$remove(this.list);
}
});
})();
app/assets/javascripts/boards/components/board_blank_state.js.es6
View file @
dc73405d
(() => {
const Store = gl.issueBoards.BoardsStore;
window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {};
...
...
@@ -15,12 +17,12 @@
},
methods: {
addDefaultLists () {
gl.issueBoards.Boards
Store.removeBlankState();
Store.removeBlankState();
for (let i = 0, labelsLength = this.predefinedLabels.length; i < labelsLength; i++) {
const label = this.predefinedLabels[i];
gl.issueBoards.Boards
Store.addList({
Store.addList({
title: label.title,
position: i,
list_type: 'label',
...
...
@@ -39,7 +41,7 @@
for (let i = 0, dataLength = data.length; i < dataLength; i++) {
const listObj = data[i],
list =
gl.issueBoards.Boards
Store.findList('title', listObj.title);
list = Store.findList('title', listObj.title);
list.id = listObj.id;
list.label.id = listObj.label.id;
...
...
@@ -48,7 +50,7 @@
});
},
clearBlankState () {
gl.issueBoards.Boards
Store.removeBlankState();
Store.removeBlankState();
}
}
});
...
...
app/assets/javascripts/boards/components/board_card.js.es6
View file @
dc73405d
(() => {
const Store = gl.issueBoards.BoardsStore;
window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {};
...
...
@@ -13,19 +15,19 @@
methods: {
filterByLabel (label, e) {
let labelToggleText = label.title;
const labelIndex =
gl.issueBoards.Boards
Store.state.filters['label_name'].indexOf(label.title);
const labelIndex = Store.state.filters['label_name'].indexOf(label.title);
$(e.target).tooltip('hide');
if (labelIndex === -1) {
gl.issueBoards.Boards
Store.state.filters['label_name'].push(label.title);
Store.state.filters['label_name'].push(label.title);
$('.labels-filter').prepend(`<input type="hidden" name="label_name[]" value="${label.title}" />`);
} else {
gl.issueBoards.Boards
Store.state.filters['label_name'].splice(labelIndex, 1);
labelToggleText =
gl.issueBoards.Boards
Store.state.filters['label_name'][0];
Store.state.filters['label_name'].splice(labelIndex, 1);
labelToggleText = Store.state.filters['label_name'][0];
$(`.labels-filter input[name="label_name[]"][value="${label.title}"]`).remove();
}
const selectedLabels =
gl.issueBoards.Boards
Store.state.filters['label_name'];
const selectedLabels = Store.state.filters['label_name'];
if (selectedLabels.length === 0) {
labelToggleText = 'Label';
} else if (selectedLabels.length > 1) {
...
...
@@ -34,7 +36,7 @@
$('.labels-filter .dropdown-toggle-text').text(labelToggleText);
gl.issueBoards.Boards
Store.updateFiltersUrl();
Store.updateFiltersUrl();
}
}
});
...
...
app/assets/javascripts/boards/components/board_list.js.es6
View file @
dc73405d
//= require ./board_card
(() => {
const Store = gl.issueBoards.BoardsStore;
window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {};
...
...
@@ -18,7 +20,7 @@
data () {
return {
scrollOffset: 250,
filters:
gl.issueBoards.Boards
Store.state.filters
filters: Store.state.filters
};
},
watch: {
...
...
@@ -59,20 +61,19 @@
onStart: (e) => {
const card = this.$refs.issue[e.oldIndex];
gl.issueBoards.Boards
Store.moving.issue = card.issue;
gl.issueBoards.Boards
Store.moving.list = card.list;
Store.moving.issue = card.issue;
Store.moving.list = card.list;
},
onAdd: (e) => {
const card = e.item,
fromList = gl.issueBoards.BoardsStore.moving.list,
issue = gl.issueBoards.BoardsStore.moving.issue;
const fromList = Store.moving.list,
issue = Store.moving.issue;
gl.issueBoards.BoardsStore.moveIssueToList(fromList, this.list, issue);
},
onRemove (e) {
const card = e.item,
list =
gl.issueBoards.Boards
Store.moving.list,
issue =
gl.issueBoards.Boards
Store.moving.issue;
list = Store.moving.list,
issue = Store.moving.issue;
// Remove the new dom element & let vue add the element
card.parentNode.removeChild(card);
...
...
app/assets/javascripts/boards/components/new_list_dropdown.js.es6
View file @
dc73405d
$(() => {
const Store = gl.issueBoards.BoardsStore;
$('.js-new-board-list').each(function () {
const $this = $(this);
...
...
@@ -13,7 +15,7 @@ $(() => {
});
},
renderRow (label) {
const active =
gl.issueBoards.Boards
Store.findList('title', label.title),
const active = Store.findList('title', label.title),
$li = $('<li />',),
$a = $('<a />', {
class: (active ? `is-active js-board-list-${active.id}` : ''),
...
...
@@ -35,10 +37,10 @@ $(() => {
clicked (label, $el, e) {
e.preventDefault();
if (!
gl.issueBoards.Boards
Store.findList('title', label.title)) {
gl.issueBoards.Boards
Store.new({
if (!Store.findList('title', label.title)) {
Store.new({
title: label.title,
position:
gl.issueBoards.Boards
Store.state.lists.length - 2,
position: Store.state.lists.length - 2,
list_type: 'label',
label: {
id: label.id,
...
...
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