summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorNicoP-S <paetni1@gmail.com>2020-04-08 23:22:49 +0200
committerGitHub <noreply@github.com>2020-04-08 23:22:49 +0200
commit7c2554297617898187906baa646b5b89f6f37af6 (patch)
treeacd374922850b5ed7468c37908e0c14318f3bca0 /client
parent411b8d3f56ed2c77f0e46be92fd7d78c32fa0c9e (diff)
parent121686a928029609e46740d78e129d91fae432e5 (diff)
downloadwekan-7c2554297617898187906baa646b5b89f6f37af6.tar.gz
wekan-7c2554297617898187906baa646b5b89f6f37af6.tar.bz2
wekan-7c2554297617898187906baa646b5b89f6f37af6.zip
Merge pull request #5 from wekan/master
Update
Diffstat (limited to 'client')
-rw-r--r--client/components/cards/cardDetails.js49
-rw-r--r--client/components/cards/cardDetails.styl12
-rw-r--r--client/components/cards/subtasks.js15
-rw-r--r--client/components/notifications/notificationsDrawer.jade4
-rw-r--r--client/components/notifications/notificationsDrawer.js15
-rw-r--r--client/components/notifications/notificationsDrawer.styl13
-rw-r--r--client/components/sidebar/sidebarFilters.jade18
-rw-r--r--client/components/sidebar/sidebarFilters.js5
-rw-r--r--client/lib/filter.js10
9 files changed, 104 insertions, 37 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 8492393c..84ba21b1 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -40,31 +40,29 @@ BlazeComponent.extendComponent({
voteState() {
const card = this.currentData();
- const userId = Meteor.userId()
- let state
+ const userId = Meteor.userId();
+ let state;
if (card.vote) {
if (card.vote.positive) {
state = _.contains(card.vote.positive, userId);
- if (state === true) return true
+ if (state === true) return true;
}
if (card.vote.negative) {
state = _.contains(card.vote.negative, userId);
- if (state === true) return false
+ if (state === true) return false;
}
}
- return null
+ return null;
},
voteCountPositive() {
const card = this.currentData();
- if (card.vote && card.vote.positive)
- return card.vote.positive.length
- return null
+ if (card.vote && card.vote.positive) return card.vote.positive.length;
+ return null;
},
voteCountNegative() {
const card = this.currentData();
- if (card.vote && card.vote.negative)
- return card.vote.negative.length
- return null
+ if (card.vote && card.vote.negative) return card.vote.negative.length;
+ return null;
},
isWatching() {
const card = this.currentData();
@@ -408,17 +406,17 @@ BlazeComponent.extendComponent({
Meteor.call('toggleSystemMessages');
},
'click .js-vote'(e) {
- const forIt = $(e.target).hasClass('js-vote-positive')
- let newState = null
+ const forIt = $(e.target).hasClass('js-vote-positive');
+ let newState = null;
if (
this.voteState() == null ||
- this.voteState() == false && forIt ||
- this.voteState() == true && !forIt
+ (this.voteState() == false && forIt) ||
+ (this.voteState() == true && !forIt)
) {
- newState = forIt
+ newState = forIt;
}
- this.data().setVote(Meteor.userId(), newState)
- }
+ this.data().setVote(Meteor.userId(), newState);
+ },
},
];
},
@@ -613,7 +611,7 @@ Template.cardDetailsActionsPopup.events({
'click .js-set-card-color': Popup.open('setCardColor'),
'click .js-cancel-voting'(event) {
event.preventDefault();
- this.unsetVote()
+ this.unsetVote();
Popup.close();
},
'click .js-move-card-to-top'(event) {
@@ -649,7 +647,7 @@ Template.cardDetailsActionsPopup.events({
},
});
-Template.editCardTitleForm.onRendered(function () {
+Template.editCardTitleForm.onRendered(function() {
autosize(this.$('.js-edit-card-title'));
});
@@ -663,7 +661,7 @@ Template.editCardTitleForm.events({
},
});
-Template.editCardRequesterForm.onRendered(function () {
+Template.editCardRequesterForm.onRendered(function() {
autosize(this.$('.js-edit-card-requester'));
});
@@ -676,7 +674,7 @@ Template.editCardRequesterForm.events({
},
});
-Template.editCardAssignerForm.onRendered(function () {
+Template.editCardAssignerForm.onRendered(function() {
autosize(this.$('.js-edit-card-assigner'));
});
@@ -816,7 +814,7 @@ Template.copyChecklistToManyCardsPopup.events({
// copy subtasks
cursor = Cards.find({ parentId: oldId });
- cursor.forEach(function () {
+ cursor.forEach(function() {
'use strict';
const subtask = arguments[0];
subtask.parentId = _id;
@@ -965,7 +963,7 @@ BlazeComponent.extendComponent({
}
}
},
- 'click .js-delete': Popup.afterConfirm('cardDelete', function () {
+ 'click .js-delete': Popup.afterConfirm('cardDelete', function() {
Popup.close();
Cards.remove(this._id);
Utils.goBoardId(this.boardId);
@@ -1003,9 +1001,8 @@ BlazeComponent.extendComponent({
'submit .edit-vote-question'(evt) {
evt.preventDefault();
const voteQuestion = evt.target.vote.value;
- this.currentCard.setVoteQuestion(voteQuestion)
+ this.currentCard.setVoteQuestion(voteQuestion);
Popup.close();
-
},
},
];
diff --git a/client/components/cards/cardDetails.styl b/client/components/cards/cardDetails.styl
index 9bbbf075..6b3ca91c 100644
--- a/client/components/cards/cardDetails.styl
+++ b/client/components/cards/cardDetails.styl
@@ -100,11 +100,11 @@ avatar-radius = 50%
.ps-scrollbar-y-rail
pointer-event: all
- position: absolute;
+ position: absolute
.card-details-canvas
width: 470px
- padding-left: 20px;
+ padding-left: 20px
.card-details-header
margin: 0 -20px 5px
@@ -241,7 +241,7 @@ input[type="submit"].attachment-add-link-submit
.card-details-canvas
width: 100%
- padding-left: 0px;
+ padding-left: 0px
.card-details-header
.close-card-details
@@ -334,7 +334,7 @@ card-details-color(background, color...)
.voted
opacity: .7
.vote-title
- display: flex;
- justify-content: space-between;
+ display: flex
+ justify-content: space-between
.vote-result
- display: flex;
+ display: flex
diff --git a/client/components/cards/subtasks.js b/client/components/cards/subtasks.js
index cdc227fc..4cd15c11 100644
--- a/client/components/cards/subtasks.js
+++ b/client/components/cards/subtasks.js
@@ -22,11 +22,20 @@ BlazeComponent.extendComponent({
const listId = targetBoard.getDefaultSubtasksListId();
//Get the full swimlane data for the parent task.
- const parentSwimlane = Swimlanes.findOne({boardId: crtBoard._id, _id: card.swimlaneId});
+ const parentSwimlane = Swimlanes.findOne({
+ boardId: crtBoard._id,
+ _id: card.swimlaneId,
+ });
//find the swimlane of the same name in the target board.
- const targetSwimlane = Swimlanes.findOne({boardId: targetBoard._id, title: parentSwimlane.title});
+ const targetSwimlane = Swimlanes.findOne({
+ boardId: targetBoard._id,
+ title: parentSwimlane.title,
+ });
//If no swimlane with a matching title exists in the target board, fall back to the default swimlane.
- const swimlaneId = targetSwimlane === undefined ? targetBoard.getDefaultSwimline()._id : targetSwimlane._id;
+ const swimlaneId =
+ targetSwimlane === undefined
+ ? targetBoard.getDefaultSwimline()._id
+ : targetSwimlane._id;
if (title) {
const _id = Cards.insert({
diff --git a/client/components/notifications/notificationsDrawer.jade b/client/components/notifications/notificationsDrawer.jade
index 01117009..fee6aef6 100644
--- a/client/components/notifications/notificationsDrawer.jade
+++ b/client/components/notifications/notificationsDrawer.jade
@@ -14,3 +14,7 @@ template(name='notificationsDrawer')
+notification(activityData=activity index=dbIndex read=read)
if($gt unreadNotifications 0)
a.all-read {{_ 'mark-all-as-read'}}
+ if ($and ($.Session.get 'showReadNotifications') ($gt readNotifications 0))
+ a.remove-read
+ i.fa.fa-trash
+ | {{_ 'remove-all-read'}}
diff --git a/client/components/notifications/notificationsDrawer.js b/client/components/notifications/notificationsDrawer.js
index 98d4750d..76abeea7 100644
--- a/client/components/notifications/notificationsDrawer.js
+++ b/client/components/notifications/notificationsDrawer.js
@@ -16,6 +16,13 @@ Template.notificationsDrawer.helpers({
transformedProfile() {
return Users.findOne(Meteor.userId());
},
+ readNotifications() {
+ const readNotifications = _.filter(
+ Meteor.user().profile.notifications,
+ v => !!v.read,
+ );
+ return readNotifications.length;
+ },
});
Template.notificationsDrawer.events({
@@ -35,4 +42,12 @@ Template.notificationsDrawer.events({
'click .toggle-read'() {
Session.set('showReadNotifications', !Session.get('showReadNotifications'));
},
+ 'click .remove-read'() {
+ const user = Meteor.user();
+ for (const notification of user.profile.notifications) {
+ if (notification.read) {
+ user.removeNotification(notification.activity);
+ }
+ }
+ },
});
diff --git a/client/components/notifications/notificationsDrawer.styl b/client/components/notifications/notificationsDrawer.styl
index a26b5e4a..b64f13f4 100644
--- a/client/components/notifications/notificationsDrawer.styl
+++ b/client/components/notifications/notificationsDrawer.styl
@@ -45,12 +45,23 @@ section#notifications-drawer
line-height: 24px
opacity 1
- .all-read
+ .all-read,
+ .remove-read
color belize
background-color: #fafafa
margin 8px 16px 12px
display inline-block
+ .remove-read
+ float right
+
+ &:hover
+ color #eb4646 !important
+
+ i.fa
+ color inherit
+
+
ul.notifications
display: block
padding: 0px 16px
diff --git a/client/components/sidebar/sidebarFilters.jade b/client/components/sidebar/sidebarFilters.jade
index 7f31dada..6d899b70 100644
--- a/client/components/sidebar/sidebarFilters.jade
+++ b/client/components/sidebar/sidebarFilters.jade
@@ -46,6 +46,24 @@ template(name="filterSidebar")
i.fa.fa-check
hr
ul.sidebar-list
+ li(class="{{#if Filter.assignees.isSelected undefined}}active{{/if}}")
+ a.name.js-toggle-assignee-filter
+ span.sidebar-list-item-description
+ | {{_ 'filter-no-assignee'}}
+ if Filter.assignees.isSelected undefined
+ i.fa.fa-check
+ each currentBoard.activeMembers
+ with getUser userId
+ li(class="{{#if Filter.assignees.isSelected _id}}active{{/if}}")
+ a.name.js-toggle-assignee-filter
+ +userAvatar(userId=this._id)
+ span.sidebar-list-item-description
+ = profile.fullname
+ | (<span class="username">{{ username }}</span>)
+ if Filter.assignees.isSelected _id
+ i.fa.fa-check
+ hr
+ ul.sidebar-list
li(class="{{#if Filter.customFields.isSelected undefined}}active{{/if}}")
a.name.js-toggle-custom-fields-filter
span.sidebar-list-item-description
diff --git a/client/components/sidebar/sidebarFilters.js b/client/components/sidebar/sidebarFilters.js
index ee0176b9..0d402ab5 100644
--- a/client/components/sidebar/sidebarFilters.js
+++ b/client/components/sidebar/sidebarFilters.js
@@ -18,6 +18,11 @@ BlazeComponent.extendComponent({
Filter.members.toggle(this.currentData()._id);
Filter.resetExceptions();
},
+ 'click .js-toggle-assignee-filter'(evt) {
+ evt.preventDefault();
+ Filter.assignees.toggle(this.currentData()._id);
+ Filter.resetExceptions();
+ },
'click .js-toggle-archive-filter'(evt) {
evt.preventDefault();
Filter.archive.toggle(this.currentData()._id);
diff --git a/client/lib/filter.js b/client/lib/filter.js
index 592eb4ab..24ca320b 100644
--- a/client/lib/filter.js
+++ b/client/lib/filter.js
@@ -459,13 +459,21 @@ Filter = {
// before changing the schema.
labelIds: new SetFilter(),
members: new SetFilter(),
+ assignees: new SetFilter(),
archive: new SetFilter(),
hideEmpty: new SetFilter(),
customFields: new SetFilter('_id'),
advanced: new AdvancedFilter(),
lists: new AdvancedFilter(), // we need the ability to filter list by name as well
- _fields: ['labelIds', 'members', 'archive', 'hideEmpty', 'customFields'],
+ _fields: [
+ 'labelIds',
+ 'members',
+ 'assignees',
+ 'archive',
+ 'hideEmpty',
+ 'customFields',
+ ],
// We don't filter cards that have been added after the last filter change. To
// implement this we keep the id of these cards in this `_exceptions` fields