diff --git a/CHANGELOG.md b/CHANGELOG.md index d9fa04d78..5a8e3f2cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +# Upcoming Wekan release + +This release fixes the following bugs: + +- [Fix Switch List/swimlane view only working with admin privileges](https://github.com/wekan/wekan/issues/1567); +- [Fix Wekan logo positioning](https://github.com/wekan/wekan/issues/1378); +- [Fix checklists items migration error "title is required"](https://github.com/wekan/wekan/issues/1576); +- [Removed paxctl alpine fix #1303 , because it did not work anymore, so Docker container + did not build correctly](https://github.com/wekan/wekan/commit/ce659632174ba25ca9b5e85b053fde02fd9c3928). + +Thanks to GitHub users andresmanelli, iwkse and xet for their contributions. + # v0.84 2018-04-16 Wekan release This release adds the following new features: diff --git a/Dockerfile b/Dockerfile index 38a81cef6..c794f6dce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,9 @@ ARG ARCHITECTURE ARG SRC_PATH # Set the environment variables (defaults where required) -# paxctl fix for alpine linux: https://github.com/wekan/wekan/issues/1303 -ENV BUILD_DEPS="apt-utils gnupg gosu wget curl bzip2 build-essential python git ca-certificates gcc-7 paxctl" +# DOES NOT WORK: paxctl fix for alpine linux: https://github.com/wekan/wekan/issues/1303 +# ENV BUILD_DEPS="paxctl" +ENV BUILD_DEPS="apt-utils gnupg gosu wget curl bzip2 build-essential python git ca-certificates gcc-7" ENV NODE_VERSION ${NODE_VERSION:-v8.11.1} ENV METEOR_RELEASE ${METEOR_RELEASE:-1.6.0.1} ENV USE_EDGE ${USE_EDGE:-false} @@ -34,43 +35,9 @@ RUN \ apt-get update -y && apt-get install -y --no-install-recommends ${BUILD_DEPS} && \ \ # Download nodejs - wget https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-${ARCHITECTURE}.tar.gz && \ - wget https://nodejs.org/dist/${NODE_VERSION}/SHASUMS256.txt.asc && \ - \ - # Verify nodejs authenticity - grep ${NODE_VERSION}-${ARCHITECTURE}.tar.gz SHASUMS256.txt.asc | shasum -a 256 -c - && \ - export GNUPGHOME="$(mktemp -d)" && \ - \ - # Try other key servers if ha.pool.sks-keyservers.net is unreachable - # Code from https://github.com/chorrell/docker-node/commit/2b673e17547c34f17f24553db02beefbac98d23c - # gpg keys listed at https://github.com/nodejs/node#release-team - # and keys listed here from previous version of this Dockerfile - for key in \ - 9554F04D7259F04124DE6B476D5A82AC7E37093B \ - 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ - FD3A5288F042B6850C66B31F09FE44734EB7990E \ - 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ - DD8F2338BAE7501E3DD5AC78C273792F7D83545D \ - C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ - B9AE9905FFD7803F25714661B63B535A4C206CA9 \ - ; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \ - gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ - gpg --keyserver keyserver.pgp.com --recv-keys "$key" ; \ - done && \ - gpg --verify SHASUMS256.txt.asc && \ - # Ignore socket files then delete files then delete directories - find "$GNUPGHOME" -type f | xargs rm -f && \ - find "$GNUPGHOME" -type d | xargs rm -fR && \ - rm -f SHASUMS256.txt.asc && \ - \ - # Install Node - tar xvzf node-${NODE_VERSION}-${ARCHITECTURE}.tar.gz && \ - rm node-${NODE_VERSION}-${ARCHITECTURE}.tar.gz && \ - mv node-${NODE_VERSION}-${ARCHITECTURE} /opt/nodejs && \ - \ - # Remove original node, use Fibers 100% CPU usage issue patched node - rm /opt/nodejs/bin/node && \ + #wget https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-${ARCHITECTURE}.tar.gz && \ + #wget https://nodejs.org/dist/${NODE_VERSION}/SHASUMS256.txt.asc && \ + #--------------------------------------------------------------------------------------------- # Node Fibers 100% CPU usage issue: # https://github.com/wekan/wekan-mongodb/issues/2#issuecomment-381453161 # https://github.com/meteor/meteor/issues/9796#issuecomment-381676326 @@ -81,21 +48,45 @@ RUN \ # Download node version 8.11.1 that has fix included, node binary copied from Sandstorm # Description at https://releases.wekan.team/node.txt # SHA256SUM: 18c99d5e79e2fe91e75157a31be30e5420787213684d4048eb91e602e092725d - echo "18c99d5e79e2fe91e75157a31be30e5420787213684d4048eb91e602e092725d node" >> node-SHASUMS256.txt.asc && \ - wget https://releases.wekan.team/node && \ - # Verify Fibers patched node authenticity - echo "Fibers patched node authenticity:" && \ - grep node node-SHASUMS256.txt.asc | shasum -a 256 -c - && \ - rm -f node-SHASUMS256.txt.asc && \ - chmod +x node && \ - mv node /opt/nodejs/bin/ && \ + wget https://releases.wekan.team/node-${NODE_VERSION}-${ARCHITECTURE}.tar.gz && \ + echo "c85ed210a360c50d55baaf7b49419236e5241515ed21410d716f4c1f5deedb12 node-v8.11.1-linux-x64.tar.gz" >> SHASUMS256.txt.asc && \ \ - # Create symlinks + # Verify nodejs authenticity + grep ${NODE_VERSION}-${ARCHITECTURE}.tar.gz SHASUMS256.txt.asc | shasum -a 256 -c - && \ + #export GNUPGHOME="$(mktemp -d)" && \ + #\ + # Try other key servers if ha.pool.sks-keyservers.net is unreachable + # Code from https://github.com/chorrell/docker-node/commit/2b673e17547c34f17f24553db02beefbac98d23c + # gpg keys listed at https://github.com/nodejs/node#release-team + # and keys listed here from previous version of this Dockerfile + #for key in \ + #9554F04D7259F04124DE6B476D5A82AC7E37093B \ + #94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ + #FD3A5288F042B6850C66B31F09FE44734EB7990E \ + #71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ + #DD8F2338BAE7501E3DD5AC78C273792F7D83545D \ + #C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ + #B9AE9905FFD7803F25714661B63B535A4C206CA9 \ + #; do \ + #gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \ + #gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ + #gpg --keyserver keyserver.pgp.com --recv-keys "$key" ; \ + #done && \ + #gpg --verify SHASUMS256.txt.asc && \ + # Ignore socket files then delete files then delete directories + #find "$GNUPGHOME" -type f | xargs rm -f && \ + #find "$GNUPGHOME" -type d | xargs rm -fR && \ + rm -f SHASUMS256.txt.asc && \ + \ + # Install Node + tar xvzf node-${NODE_VERSION}-${ARCHITECTURE}.tar.gz && \ + rm node-${NODE_VERSION}-${ARCHITECTURE}.tar.gz && \ + mv node-${NODE_VERSION}-${ARCHITECTURE} /opt/nodejs && \ ln -s /opt/nodejs/bin/node /usr/bin/node && \ ln -s /opt/nodejs/bin/npm /usr/bin/npm && \ \ - # paxctl fix for alpine linux: https://github.com/wekan/wekan/issues/1303 - paxctl -mC `which node` && \ + #DOES NOT WORK: paxctl fix for alpine linux: https://github.com/wekan/wekan/issues/1303 + #paxctl -mC `which node` && \ \ # Install Node dependencies npm install -g npm@${NPM_VERSION} && \ diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index aa7b6a75f..456bf9b30 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -87,15 +87,13 @@ BlazeComponent.extendComponent({ }, isViewSwimlanes() { - const currentBoardId = Session.get('currentBoard'); - const board = Boards.findOne(currentBoardId); - return (board.view === 'board-view-swimlanes'); + const currentUser = Meteor.user(); + return (currentUser.profile.boardView === 'board-view-swimlanes'); }, isViewLists() { - const currentBoardId = Session.get('currentBoard'); - const board = Boards.findOne(currentBoardId); - return (board.view === 'board-view-lists'); + const currentUser = Meteor.user(); + return (currentUser.profile.boardView === 'board-view-lists'); }, openNewListForm() { diff --git a/client/components/boards/boardHeader.jade b/client/components/boards/boardHeader.jade index ce444c270..fe0771cb6 100644 --- a/client/components/boards/boardHeader.jade +++ b/client/components/boards/boardHeader.jade @@ -95,7 +95,7 @@ template(name="boardHeaderBar") a.board-header-btn.js-toggle-board-view( title="{{_ 'board-view'}}") i.fa.fa-th-large - span {{_ currentBoard.view}} + span {{_ currentUser.profile.boardView}} if canModifyBoard a.board-header-btn.js-multiselection-activate( diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js index 64cb0a54c..2b5878310 100644 --- a/client/components/boards/boardHeader.js +++ b/client/components/boards/boardHeader.js @@ -77,19 +77,11 @@ BlazeComponent.extendComponent({ Modal.open('archivedBoards'); }, 'click .js-toggle-board-view'() { - const currentBoard = Boards.findOne(Session.get('currentBoard')); - if (currentBoard.view === 'board-view-swimlanes') { - Boards.update(currentBoard._id, { - $set: { - view: 'board-view-lists', - }, - }); - } else if (currentBoard.view === 'board-view-lists') { - Boards.update(currentBoard._id, { - $set: { - view: 'board-view-swimlanes', - }, - }); + const currentUser = Meteor.user(); + if (currentUser.profile.boardView === 'board-view-swimlanes') { + currentUser.setBoardView('board-view-lists'); + } else if (currentUser.profile.boardView === 'board-view-lists') { + currentUser.setBoardView('board-view-swimlanes'); } }, 'click .js-open-filter-view'() { diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 6cc943716..52f34fabc 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -37,11 +37,11 @@ BlazeComponent.extendComponent({ const labelIds = formComponent.labels.get(); const boardId = this.data().board()._id; - const board = Boards.findOne(boardId); let swimlaneId = ''; - if (board.view === 'board-view-swimlanes') + const boardView = Meteor.user().profile.boardView; + if (boardView === 'board-view-swimlanes') swimlaneId = this.parentComponent().parentComponent().data()._id; - else + else if (boardView === 'board-view-lists') swimlaneId = Swimlanes.findOne({boardId})._id; if (title) { @@ -106,8 +106,8 @@ BlazeComponent.extendComponent({ }, idOrNull(swimlaneId) { - const board = Boards.findOne(Session.get('currentBoard')); - if (board.view === 'board-view-swimlanes') + const currentUser = Meteor.user(); + if (currentUser.profile.boardView === 'board-view-swimlanes') return swimlaneId; return undefined; }, diff --git a/client/components/main/header.styl b/client/components/main/header.styl index 7993ce6ab..f9455f8e6 100644 --- a/client/components/main/header.styl +++ b/client/components/main/header.styl @@ -29,13 +29,12 @@ font-size: 0.9em margin-right: 10px - .wekan-logo - display: block - margin: 3px auto 0 + margin: 3px auto auto width: 97px opacity: 0.6 transition: opacity 0.15s + float: right &:hover opacity: 0.9 diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js index f37e1e9ce..7965c2bc6 100644 --- a/client/components/swimlanes/swimlanes.js +++ b/client/components/swimlanes/swimlanes.js @@ -2,11 +2,10 @@ const { calculateIndex } = Utils; function currentCardIsInThisList(listId, swimlaneId) { const currentCard = Cards.findOne(Session.get('currentCard')); - const currentBoardId = Session.get('currentBoard'); - const board = Boards.findOne(currentBoardId); - if (board.view === 'board-view-lists') + const currentUser = Meteor.user(); + if (currentUser.profile.boardView === 'board-view-lists') return currentCard && currentCard.listId === listId; - else if (board.view === 'board-view-swimlanes') + else if (currentUser.profile.boardView === 'board-view-swimlanes') return currentCard && currentCard.listId === listId && currentCard.swimlaneId === swimlaneId; else return false; diff --git a/models/boards.js b/models/boards.js index 436a99f54..3e05b4994 100644 --- a/models/boards.js +++ b/models/boards.js @@ -31,14 +31,6 @@ Boards.attachSchema(new SimpleSchema({ } }, }, - view: { - type: String, - autoValue() { // eslint-disable-line consistent-return - if (this.isInsert) { - return 'board-view-lists'; - } - }, - }, createdAt: { type: Date, autoValue() { // eslint-disable-line consistent-return diff --git a/models/users.js b/models/users.js index da8ca77c5..41179875f 100644 --- a/models/users.js +++ b/models/users.js @@ -43,7 +43,9 @@ Users.attachSchema(new SimpleSchema({ optional: true, autoValue() { // eslint-disable-line consistent-return if (this.isInsert && !this.isSet) { - return {}; + return { + boardView: 'board-view-lists', + }; } }, }, @@ -95,6 +97,10 @@ Users.attachSchema(new SimpleSchema({ type: String, optional: true, }, + 'profile.boardView': { + type: String, + optional: true, + }, services: { type: Object, optional: true, @@ -329,6 +335,14 @@ Users.mutations({ setShowCardsCountAt(limit) { return {$set: {'profile.showCardsCountAt': limit}}; }, + + setBoardView(view) { + return { + $set : { + 'profile.boardView': view, + }, + }; + }, }); Meteor.methods({ diff --git a/server/authentication.js b/server/authentication.js index efe950154..8059f1760 100644 --- a/server/authentication.js +++ b/server/authentication.js @@ -1,10 +1,11 @@ +import Fiber from 'fibers'; + Meteor.startup(() => { // Node Fibers 100% CPU usage issue // https://github.com/wekan/wekan-mongodb/issues/2#issuecomment-381453161 // https://github.com/meteor/meteor/issues/9796#issuecomment-381676326 // https://github.com/sandstorm-io/sandstorm/blob/0f1fec013fe7208ed0fd97eb88b31b77e3c61f42/shell/server/00-startup.js#L99-L129 - import Fiber from "fibers"; Fiber.poolSize = 1e9; Accounts.validateLoginAttempt(function (options) { diff --git a/server/migrations.js b/server/migrations.js index a1bdd4873..684a8bbe6 100644 --- a/server/migrations.js +++ b/server/migrations.js @@ -140,7 +140,7 @@ Migrations.add('add-sort-checklists', () => { noValidate ); } - checklist.items.forEach(function(item, index) { + checklist.items.find().forEach((item, index) => { if (!item.hasOwnProperty('sort')) { Checklists.direct.update( { _id: checklist._id, 'items._id': item._id }, @@ -208,3 +208,14 @@ Migrations.add('add-checklist-items', () => { ); }); }); + +Migrations.add('add-profile-view', () => { + Users.find().forEach((user) => { + // Set default view + Users.direct.update( + { _id: user._id }, + { $set: { 'profile.boardView': 'board-view-lists' } }, + noValidate + ); + }); +}); diff --git a/snapcraft.yaml b/snapcraft.yaml index abcd1cc6e..1c9048786 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -118,8 +118,9 @@ parts: rm -f node-SHASUMS256.txt.asc chmod +x node mv node `which node` - echo "Applying paxctl fix for alpine linux: https://github.com/wekan/wekan/issues/1303" - paxctl -mC `which node` + # DOES NOT WORK: paxctl fix. + #echo "Applying paxctl fix for alpine linux: https://github.com/wekan/wekan/issues/1303" + #paxctl -mC `which node` echo "Installing meteor" curl https://install.meteor.com/ -o install_meteor.sh sed -i "s|RELEASE=.*|RELEASE=\"1.6.0.1\"|g" install_meteor.sh