From 0711149e413af63961a8306824c5981c6ce647ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 17 Dec 2018 02:16:57 +0000 Subject: [PATCH 1/9] Update css-loader requirement from ^1.0.1 to ^2.0.1 Updates the requirements on [css-loader](https://github.com/webpack-contrib/css-loader) to permit the latest version. - [Release notes](https://github.com/webpack-contrib/css-loader/releases) - [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/css-loader/commits/v2.0.1) Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 42d07c383..9530f0a03 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "babel-eslint": "^10.0.1", "babel-jest": "^23.6.0", "babel-loader": "^8.0.4", - "css-loader": "^1.0.1", + "css-loader": "^2.0.1", "eslint": "^4.19.1", "eslint-config-standard": "^11.0.0", "eslint-friendly-formatter": "^4.0.1", From 465a09f129e66e85618650e49fcbf935e448f45d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 18 Dec 2018 19:40:47 +0000 Subject: [PATCH 2/9] Update raw-loader requirement from ^0.5.1 to ^1.0.0 Updates the requirements on [raw-loader](https://github.com/webpack-contrib/raw-loader) to permit the latest version. - [Release notes](https://github.com/webpack-contrib/raw-loader/releases) - [Changelog](https://github.com/webpack-contrib/raw-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/raw-loader/commits/v1.0.0) Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4806d8fe2..2e586ff04 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "mini-css-extract-plugin": "^0.5.0", "node-sass": "^4.10.0", "prettier-eslint": "^8.8.2", - "raw-loader": "^0.5.1", + "raw-loader": "^1.0.0", "sass-loader": "^7.1.0", "stylelint": "^8.4.0", "stylelint-config-recommended-scss": "^3.2.0", From 1b0ea7331818b4fdca6fd9d4173b639a835814fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 21 Dec 2018 02:19:01 +0000 Subject: [PATCH 3/9] Update file-loader requirement from ^2.0.0 to ^3.0.1 Updates the requirements on [file-loader](https://github.com/webpack-contrib/file-loader) to permit the latest version. - [Release notes](https://github.com/webpack-contrib/file-loader/releases) - [Changelog](https://github.com/webpack-contrib/file-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/file-loader/commits/v3.0.1) Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4806d8fe2..e0f2667f6 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "eslint-plugin-standard": "^3.1.0", "eslint-plugin-vue": "^4.5.0", "extract-text-webpack-plugin": "^3.0.2", - "file-loader": "^2.0.0", + "file-loader": "^3.0.1", "jest": "^23.6.0", "jest-serializer-vue": "^2.0.2", "mini-css-extract-plugin": "^0.5.0", From 24af938058cb5440beae8ab5523af989a88eea12 Mon Sep 17 00:00:00 2001 From: Vadim Nicolai Date: Sat, 22 Dec 2018 23:17:27 +0200 Subject: [PATCH 4/9] Added current user avatar. --- src/components/board/BoardSidebar.vue | 30 +++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/components/board/BoardSidebar.vue b/src/components/board/BoardSidebar.vue index 771e67da8..f485105eb 100644 --- a/src/components/board/BoardSidebar.vue +++ b/src/components/board/BoardSidebar.vue @@ -35,18 +35,30 @@ -
-
    +
    +
    +
      +
    • + + + {{ board.owner.displayname }} + +
    • +
    +
+ + diff --git a/src/components/cards/CardBadges.vue b/src/components/cards/CardBadges.vue new file mode 100644 index 000000000..4fb829e59 --- /dev/null +++ b/src/components/cards/CardBadges.vue @@ -0,0 +1,71 @@ + + + + + + diff --git a/src/components/cards/CardItem.vue b/src/components/cards/CardItem.vue new file mode 100644 index 000000000..cbc3cef0d --- /dev/null +++ b/src/components/cards/CardItem.vue @@ -0,0 +1,131 @@ + + + + + + + diff --git a/src/components/cards/LabelTag.vue b/src/components/cards/LabelTag.vue new file mode 100644 index 000000000..1db9fb66c --- /dev/null +++ b/src/components/cards/LabelTag.vue @@ -0,0 +1,40 @@ + + + + + + diff --git a/src/mixins/color.js b/src/mixins/color.js new file mode 100644 index 000000000..7f2397ebd --- /dev/null +++ b/src/mixins/color.js @@ -0,0 +1,85 @@ +/* + * @copyright Copyright (c) 2018 Julius Härtl + * + * @author Julius Härtl + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +export default { + methods: { + hexToRgb(hex) { + let result = /^#?([A-Fa-f\d]{2})([A-Fa-f\d]{2})([A-Fa-f\d]{2})$/i.exec(hex) + return result + ? { + r: parseInt(result[1], 16), + g: parseInt(result[2], 16), + b: parseInt(result[3], 16) + } : null + }, + rgb2hls(rgb) { + // RGB2HLS by Garry Tan + // http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c + const r = rgb.r / 255 + const g = rgb.g / 255 + const b = rgb.b / 255 + let max = Math.max(r, g, b) + let min = Math.min(r, g, b) + let h + let s + let l = (max + min) / 2 + + if (max === min) { + h = s = 0 // achromatic + } else { + const d = max - min + s = l > 0.5 ? d / (2 - max - min) : d / (max + min) + switch (max) { + case r: + h = (g - b) / d + (g < b ? 6 : 0) + break + case g: + h = (b - r) / d + 2 + break + case b: + h = (r - g) / d + 4 + break + } + h /= 6 + } + return { + h, l, s + } + }, + textColor(hex) { + + let rgb = this.hexToRgb(hex) + if (rgb === null) { + return '#000000' + } + const { l } = this.rgb2hls(rgb) + + if (l < 0.5) { + return '#ffffff' + } else { + return '#000000' + } + + } + + } +} diff --git a/src/services/StackApi.js b/src/services/StackApi.js new file mode 100644 index 000000000..5b2785117 --- /dev/null +++ b/src/services/StackApi.js @@ -0,0 +1,109 @@ +/* + * @copyright Copyright (c) 2018 Michael Weimann + * + * @author Michael Weimann + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +import axios from 'nextcloud-axios' + +/** + * This class handles all the api communication with the Deck backend. + */ +export class BoardApi { + + url(url) { + url = `/apps/deck${url}` + return OC.generateUrl(url) + } + + /** + * Updates a board. + * + * @param {Board} board + * @return Promise + */ + updateBoard(board) { + return axios.put(this.url(`/boards/${board.id}`), board) + .then( + (response) => { + return Promise.resolve(response.data) + }, + (err) => { + return Promise.reject(err) + } + ) + .catch((err) => { + return Promise.reject(err) + }) + } + + /** + * Creates a new board. + * + * @param {{String title, String color, String hashedColor}} boardData The board data to send. + * hashedColor is the color in hex format, e.g. "#ff0000" + * color is the same color without the "#" + * @return Promise + */ + createBoard(boardData) { + return axios.post(this.url('/boards'), boardData) + .then( + (response) => { + return Promise.resolve(response.data) + }, + (err) => { + return Promise.reject(err) + } + ) + .catch((err) => { + return Promise.reject(err) + }) + } + + loadBoards() { + return axios.get(this.url('/boards')) + .then( + (response) => { + return Promise.resolve(response.data) + }, + (err) => { + return Promise.reject(err) + } + ) + .catch((err) => { + return Promise.reject(err) + }) + } + + loadById(id) { + return axios.get(this.url(`/boards/${id}`)) + .then( + (response) => { + return Promise.resolve(response.data) + }, + (err) => { + return Promise.reject(err) + } + ) + .catch((err) => { + return Promise.reject(err) + }) + } + +} From acd85eb0975b37c0b26c927e28e524f04e98d340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sun, 23 Dec 2018 21:57:43 +0100 Subject: [PATCH 6/9] Rework routing to make sidebar dependent on child routes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/App.vue | 18 +++++++++----- src/components/Controls.vue | 16 ++++++++++++ src/components/board/Board.vue | 3 +-- src/components/board/BoardSidebar.vue | 16 ++++++------ src/router.js | 35 +++++++++++++++++++++++---- 5 files changed, 66 insertions(+), 22 deletions(-) diff --git a/src/App.vue b/src/App.vue index c62fa66d3..922357dea 100644 --- a/src/App.vue +++ b/src/App.vue @@ -22,14 +22,12 @@ @@ -71,9 +69,17 @@ export default { computed: { ...mapState({ navShown: state => state.navShown, - sidebarShown: state => state.sidebarShown, + sidebarShownState: state => state.sidebarShown, currentBoard: state => state.currentBoard - }) + }), + // TODO: properly handle sidebar showing for route subview and board sidebar + sidebarRouterView() { + console.log(this.$route) + return this.$route.name === 'card' || this.$route.name === 'board.details' + }, + sidebarShown() { + return this.sidebarRouterView || this.sidebarShownState + } }, provide: function() { return { diff --git a/src/components/Controls.vue b/src/components/Controls.vue index 443ac0ea6..a5f0c37b7 100644 --- a/src/components/Controls.vue +++ b/src/components/Controls.vue @@ -35,6 +35,9 @@ {{ board.title }} +
+ +
@@ -52,6 +55,9 @@ export default { methods: { toggleNav() { this.$store.dispatch('toggleNav') + }, + toggleSidebar: function() { + this.$store.dispatch('toggleSidebar') } } } @@ -67,4 +73,14 @@ export default { position: static; } + .board-actions { + flex-grow: 1; + order: 100; + display: flex; + justify-content: flex-end; + } + button.icon-settings { + width: 44px; + } + diff --git a/src/components/board/Board.vue b/src/components/board/Board.vue index 02bdaa39e..55e1161a8 100644 --- a/src/components/board/Board.vue +++ b/src/components/board/Board.vue @@ -24,7 +24,6 @@
- board {{ board.title }}
@@ -104,7 +103,7 @@ export default { board: state => state.currentBoard }), orderedCards() { - //return (stack) => _.orderBy(this.stacks[stack].cards, 'order') + // return (stack) => _.orderBy(this.stacks[stack].cards, 'order') } }, diff --git a/src/components/board/BoardSidebar.vue b/src/components/board/BoardSidebar.vue index f485105eb..4bb4ff9cf 100644 --- a/src/components/board/BoardSidebar.vue +++ b/src/components/board/BoardSidebar.vue @@ -23,9 +23,6 @@