From 4f4e0a21f80019048aad6b7a679899c048cb3865 Mon Sep 17 00:00:00 2001 From: Romulus Urakagi Tsai Date: Wed, 7 Aug 2019 07:58:05 +0000 Subject: Add 'show archive' and 'hide empty lists' in filter feature. --- client/components/sidebar/sidebarArchives.js | 2 ++ client/components/sidebar/sidebarFilters.jade | 16 ++++++++++++++++ client/components/sidebar/sidebarFilters.js | 19 +++++++++++++++++++ client/components/swimlanes/swimlanes.jade | 3 ++- client/components/swimlanes/swimlanes.js | 18 ++++++++++++++++++ 5 files changed, 57 insertions(+), 1 deletion(-) (limited to 'client/components') diff --git a/client/components/sidebar/sidebarArchives.js b/client/components/sidebar/sidebarArchives.js index 53fc29b9..a4846561 100644 --- a/client/components/sidebar/sidebarArchives.js +++ b/client/components/sidebar/sidebarArchives.js @@ -1,3 +1,4 @@ +archivedRequested = false; const subManager = new SubsManager(); BlazeComponent.extendComponent({ @@ -12,6 +13,7 @@ BlazeComponent.extendComponent({ const currentBoardId = Session.get('currentBoard'); if (!currentBoardId) return; const handle = subManager.subscribe('board', currentBoardId, true); + archivedRequested = true; Tracker.nonreactive(() => { Tracker.autorun(() => { this.isArchiveReady.set(handle.ready()); diff --git a/client/components/sidebar/sidebarFilters.jade b/client/components/sidebar/sidebarFilters.jade index f11528b1..55ab213a 100644 --- a/client/components/sidebar/sidebarFilters.jade +++ b/client/components/sidebar/sidebarFilters.jade @@ -56,6 +56,22 @@ template(name="filterSidebar") if Filter.customFields.isSelected _id i.fa.fa-check hr + ul.sidebar-list + li(class="{{#if Filter.archive.isSelected _id}}active{{/if}}") + a.name.js-toggle-archive-filter + span.sidebar-list-item-description + | {{_ 'filter-show-archive'}} + if Filter.archive.isSelected _id + i.fa.fa-check + hr + ul.sidebar-list + li(class="{{#if Filter.hideEmpty.isSelected _id}}active{{/if}}") + a.name.js-toggle-hideEmpty-filter + span.sidebar-list-item-description + | {{_ 'filter-hide-empty'}} + if Filter.hideEmpty.isSelected _id + i.fa.fa-check + hr span {{_ 'advanced-filter-label'}} input.js-field-advanced-filter(type="text") span {{_ 'advanced-filter-description'}} diff --git a/client/components/sidebar/sidebarFilters.js b/client/components/sidebar/sidebarFilters.js index 88438a7a..3483d00c 100644 --- a/client/components/sidebar/sidebarFilters.js +++ b/client/components/sidebar/sidebarFilters.js @@ -1,3 +1,5 @@ +const subManager = new SubsManager(); + BlazeComponent.extendComponent({ events() { return [ @@ -12,6 +14,23 @@ BlazeComponent.extendComponent({ Filter.members.toggle(this.currentData()._id); Filter.resetExceptions(); }, + 'click .js-toggle-archive-filter'(evt) { + evt.preventDefault(); + Filter.archive.toggle(this.currentData()._id); + Filter.resetExceptions(); + const currentBoardId = Session.get('currentBoard'); + if (!currentBoardId) return; + subManager.subscribe( + 'board', + currentBoardId, + Filter.archive.isSelected(), + ); + }, + 'click .js-toggle-hideEmpty-filter'(evt) { + evt.preventDefault(); + Filter.hideEmpty.toggle(this.currentData()._id); + Filter.resetExceptions(); + }, 'click .js-toggle-custom-fields-filter'(evt) { evt.preventDefault(); Filter.customFields.toggle(this.currentData()._id); diff --git a/client/components/swimlanes/swimlanes.jade b/client/components/swimlanes/swimlanes.jade index 485b2ffc..3ad43777 100644 --- a/client/components/swimlanes/swimlanes.jade +++ b/client/components/swimlanes/swimlanes.jade @@ -33,7 +33,8 @@ template(name="listsGroup") +addListForm else each lists - +list(this) + if visible this + +list(this) if currentCardIsInThisList _id null +cardDetails(currentCard) if currentUser.isBoardMember diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js index 568c0bbe..e0857003 100644 --- a/client/components/swimlanes/swimlanes.js +++ b/client/components/swimlanes/swimlanes.js @@ -246,6 +246,24 @@ BlazeComponent.extendComponent({ currentCardIsInThisList(listId, swimlaneId) { return currentCardIsInThisList(listId, swimlaneId); }, + visible(list) { + if (list.archived) { + // Show archived list only when filter archive is on or archive is selected + if (!(Filter.archive.isSelected() || archivedRequested)) { + return false; + } + } + if (Filter.hideEmpty.isSelected()) { + const swimlaneId = this.parentComponent() + .parentComponent() + .data()._id; + const cards = list.cards(swimlaneId); + if (cards.count() === 0) { + return false; + } + } + return true; + }, onRendered() { const boardComponent = this.parentComponent(); const $listsDom = this.$('.js-lists'); -- cgit v1.2.3-1-g7c22 From af830812dbbf7d766a754d937308b11373c66e5a Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Mon, 19 Aug 2019 12:47:02 +0300 Subject: Wrap minicard text labels to multiple rows. Thanks to xet7 ! --- client/components/cards/minicard.styl | 1 + 1 file changed, 1 insertion(+) (limited to 'client/components') diff --git a/client/components/cards/minicard.styl b/client/components/cards/minicard.styl index 242367b4..f0bb0b39 100644 --- a/client/components/cards/minicard.styl +++ b/client/components/cards/minicard.styl @@ -81,6 +81,7 @@ .minicard-labels float: right display: flex + flex-wrap: wrap .minicard-label width: 11px -- cgit v1.2.3-1-g7c22 From 9d8a38f3240bbcf8734d0860db5a6ad1e19562a8 Mon Sep 17 00:00:00 2001 From: Justin Reynolds Date: Thu, 22 Aug 2019 16:05:41 -0500 Subject: Fixes #2638 importing trello --- client/components/import/import.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'client/components') diff --git a/client/components/import/import.js b/client/components/import/import.js index 62c7e525..6368885b 100644 --- a/client/components/import/import.js +++ b/client/components/import/import.js @@ -211,22 +211,20 @@ BlazeComponent.extendComponent({ this.parentComponent().nextStep(); }, - onMapMember(evt) { - const memberToMap = this.currentData(); - if (memberToMap.wekan) { - // todo xxx ask for confirmation? - this.unmapMember(memberToMap.id); - } else { - this.setSelectedMember(memberToMap.id); - Popup.open('importMapMembersAdd')(evt); - } - }, - events() { return [ { submit: this.onSubmit, - 'click .js-select-member': this.onMapMember, + 'click .js-select-member'(evt) { + const memberToMap = this.currentData(); + if (memberToMap.wekan) { + // todo xxx ask for confirmation? + this.unmapMember(memberToMap.id); + } else { + this.setSelectedMember(memberToMap.id); + Popup.open('importMapMembersAdd')(evt); + } + }, }, ]; }, -- cgit v1.2.3-1-g7c22 From 0dd3ff29f2b558bc912b330f178347035dcc46c7 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 23 Aug 2019 02:59:29 +0300 Subject: Limit card width to fixed size. Thanks to xet7 ! --- client/components/boards/boardColors.styl | 1 + client/components/cards/cardDetails.styl | 4 +++- client/components/cards/checklists.styl | 3 +++ client/components/cards/labels.styl | 3 ++- client/components/cards/minicard.styl | 11 ++++++++--- client/components/main/layouts.styl | 2 ++ 6 files changed, 19 insertions(+), 5 deletions(-) (limited to 'client/components') diff --git a/client/components/boards/boardColors.styl b/client/components/boards/boardColors.styl index efd4367e..3be9c0c3 100644 --- a/client/components/boards/boardColors.styl +++ b/client/components/boards/boardColors.styl @@ -241,6 +241,7 @@ setBoardColor(color) background-color #ffffff !important padding 15px !important border 1px solid #000000 !important + word-wrap: break-word // When card has comment, emphasis on minicard: // bigger red comment icon and number of comments, diff --git a/client/components/cards/cardDetails.styl b/client/components/cards/cardDetails.styl index 4bba2d4d..cd475072 100644 --- a/client/components/cards/cardDetails.styl +++ b/client/components/cards/cardDetails.styl @@ -99,7 +99,9 @@ &.card-details-item-end, &.card-details-item-customfield, &.card-details-item-name - max-width: 50% + display: block + word-wrap: break-word + max-width: 48% flex-grow: 1 .card-details-item-title diff --git a/client/components/cards/checklists.styl b/client/components/cards/checklists.styl index d48c1851..8ac37a15 100644 --- a/client/components/cards/checklists.styl +++ b/client/components/cards/checklists.styl @@ -128,6 +128,9 @@ textarea.js-add-checklist-item, textarea.js-edit-checklist-item & .viewer p margin-bottom: 2px + display: block + word-wrap: break-word + max-width: 420px .js-delete-checklist-item margin: 0 0 0.5em 1.33em diff --git a/client/components/cards/labels.styl b/client/components/cards/labels.styl index 3b481d93..9d7c7553 100644 --- a/client/components/cards/labels.styl +++ b/client/components/cards/labels.styl @@ -10,9 +10,10 @@ margin-right: 4px margin-bottom: 5px padding: 3px 8px - max-width: 100% + max-width: 210px min-width: 8px overflow: ellipsis + word-wrap: break-word height: 18px vertical-align: bottom diff --git a/client/components/cards/minicard.styl b/client/components/cards/minicard.styl index f0bb0b39..c4172572 100644 --- a/client/components/cards/minicard.styl +++ b/client/components/cards/minicard.styl @@ -93,8 +93,11 @@ .minicard-custom-field display:flex; .minicard-custom-field-item - max-width:50%; - flex-grow:1; + flex-grow: 1 + display: block + word-wrap: break-word + max-width: 100px + margin-right: 4px .handle width: 20px; height: 20px; @@ -112,7 +115,9 @@ p:last-child margin-bottom: 0 .viewer - display: inline-block + display: block + word-wrap: break-word + max-width: 230px .dates display: flex; flex-direction: row; diff --git a/client/components/main/layouts.styl b/client/components/main/layouts.styl index 0955a352..56c35284 100644 --- a/client/components/main/layouts.styl +++ b/client/components/main/layouts.styl @@ -378,6 +378,8 @@ a .viewer min-height: 18px + display: block + word-wrap: break-word ol list-style-type: decimal -- cgit v1.2.3-1-g7c22 From 9bbeb73db1cd0ce1caaaca8dfb14ea92131bbf9d Mon Sep 17 00:00:00 2001 From: Romulus Urakagi Tsai Date: Mon, 26 Aug 2019 10:10:57 +0000 Subject: Fix app hang when Meteor.user() is null and list spinner is loaded bug --- client/components/lists/listBody.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'client/components') diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 7d9e358b..a1a4c11a 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -701,12 +701,16 @@ BlazeComponent.extendComponent({ this.listId = this.parentComponent().data()._id; this.swimlaneId = ''; - const boardView = (Meteor.user().profile || {}).boardView; - if (boardView === 'board-view-swimlanes') - this.swimlaneId = this.parentComponent() - .parentComponent() - .parentComponent() - .data()._id; + let user = Meteor.user(); + if (user) { + const boardView = (Meteor.user().profile || {}).boardView; + if (boardView === 'board-view-swimlanes') { + this.swimlaneId = this.parentComponent() + .parentComponent() + .parentComponent() + .data()._id; + } + } }, onRendered() { -- cgit v1.2.3-1-g7c22 From 0cf9a7b552a8036158d5b158f875057b9aaf5fc0 Mon Sep 17 00:00:00 2001 From: justinr1234 Date: Mon, 26 Aug 2019 12:16:21 -0500 Subject: Fix last label undefined --- client/components/activities/activities.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components') diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js index 05149826..b082273a 100644 --- a/client/components/activities/activities.js +++ b/client/components/activities/activities.js @@ -85,7 +85,7 @@ BlazeComponent.extendComponent({ const lastLabel = Boards.findOne(Session.get('currentBoard')).getLabelById( lastLabelId, ); - if (lastLabel.name === undefined || lastLabel.name === '') { + if (lastLabel && (lastLabel.name === undefined || lastLabel.name === '')) { return lastLabel.color; } else { return lastLabel.name; -- cgit v1.2.3-1-g7c22 From a97360dcfba2bf1dd1be115dd91dd1dde49ded69 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Mon, 26 Aug 2019 23:24:13 +0300 Subject: Try to fix lint, and make board loading fix Sandstorm-only where user permissions work differently. Thanks to xet7 ! Related https://github.com/wekan/wekan/pull/2654 --- client/components/lists/listBody.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'client/components') diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index a1a4c11a..c8e41a0b 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -701,8 +701,23 @@ BlazeComponent.extendComponent({ this.listId = this.parentComponent().data()._id; this.swimlaneId = ''; - let user = Meteor.user(); - if (user) { + const isSandstorm = + Meteor.settings && + Meteor.settings.public && + Meteor.settings.public.sandstorm; + + if (isSandstorm) { + const user = Meteor.user(); + if (user) { + const boardView = (Meteor.user().profile || {}).boardView; + if (boardView === 'board-view-swimlanes') { + this.swimlaneId = this.parentComponent() + .parentComponent() + .parentComponent() + .data()._id; + } + } + } else { const boardView = (Meteor.user().profile || {}).boardView; if (boardView === 'board-view-swimlanes') { this.swimlaneId = this.parentComponent() -- cgit v1.2.3-1-g7c22 From b7c5ba3d1b97bc33c95618cefbd0416d78a4d4dc Mon Sep 17 00:00:00 2001 From: Steffen Date: Thu, 29 Aug 2019 13:53:40 +0200 Subject: add card color to calendar event (#2651) --- client/components/boards/boardBody.js | 1 + client/components/boards/boardBody.styl | 78 +++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) (limited to 'client/components') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 6cff5ab1..07cd306a 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -326,6 +326,7 @@ BlazeComponent.extendComponent({ slug: currentBoard.slug, cardId: card._id, }), + className: card.color ? `calendar-event-${card.color}` : null, }); }); callback(events); diff --git a/client/components/boards/boardBody.styl b/client/components/boards/boardBody.styl index dfaaa050..32207d82 100644 --- a/client/components/boards/boardBody.styl +++ b/client/components/boards/boardBody.styl @@ -53,3 +53,81 @@ position() padding: 0 0px 0px 0 overflow-x: hidden overflow-y: auto + +calendar-event-color(background, borderColor, color...) + background: background !important + border-color: borderColor + if color + color: color !important //overwrite text for better visibility + +.calendar-event-green + calendar-event-color(#3cb500, #2a8000, #ffffff) //White text for better visibility + +.calendar-event-yellow + calendar-event-color(#fad900, #c7ac00, #000) //Black text for better visibility + +.calendar-event-orange + calendar-event-color(#ff9f19, #cc7c14, #000) //Black text for better visibility + +.calendar-event-red + calendar-event-color(#eb4646, #b83737, #ffffff) //White text for better visibility + +.calendar-event-purple + calendar-event-color(#a632db, #7d26a6, #ffffff) //White text for better visibility + +.calendar-event-blue + calendar-event-color(#0079bf, #005a8a, #ffffff) //White text for better visibility + +.calendar-event-pink + calendar-event-color(#ff78cb, #cc62a3, #000) //Black text for better visibility + +.calendar-event-sky + calendar-event-color(#00c2e0, #0094ab, #ffffff) //White text for better visibility + +.calendar-event-black + calendar-event-color(#4d4d4d, #1a1a1a, #ffffff) //White text for better visibility + +.calendar-event-lime + calendar-event-color(#51e898, #3eb375, #000) //Black text for better visibility + +.calendar-event-silver + calendar-event-color(#c0c0c0, #8c8c8c, #000) //Black text for better visibility + +.calendar-event-peachpuff + calendar-event-color(#ffdab9, #ccaf95, #000) //Black text for better visibility + +.calendar-event-crimson + calendar-event-color(#dc143c, #a8112f, #ffffff) //White text for better visibility + +.calendar-event-plum + calendar-event-color(#dda0dd, #a87ba8, #000) //Black text for better visibility + +.calendar-event-darkgreen + calendar-event-color(#006400, #003000, #ffffff) //White text for better visibility + +.calendar-event-slateblue + calendar-event-color(#6a5acd, #4f4399, #ffffff) //White text for better visibility + +.calendar-event-magenta + calendar-event-color(#ff00ff, #cc00cc, #ffffff) //White text for better visibility + +.calendar-event-gold + calendar-event-color(#ffd700, #ccaa00, #000) //Black text for better visibility + +.calendar-event-navy + calendar-event-color(#000080, #000033, #ffffff) //White text for better visibility + +.calendar-event-gray + calendar-event-color(#808080, #333333, #ffffff) //White text for better visibility + +.calendar-event-saddlebrown + calendar-event-color(#8b4513, #572b0c, #ffffff) //White text for better visibility + +.calendar-event-paleturquoise + calendar-event-color(#afeeee, #8ababa, #000) //Black text for better visibility + +.calendar-event-mistyrose + calendar-event-color(#ffe4e1, #ccb8b6, #000) //Black text for better visibility + +.calendar-event-indigo + calendar-event-color(#4b0082, #2b004d, #ffffff) //White text for better visibility -- cgit v1.2.3-1-g7c22