diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/components/boards/boardBody.js | 2 | ||||
-rw-r--r-- | client/components/cards/cardDate.js | 20 | ||||
-rw-r--r-- | client/components/cards/minicard.jade | 5 | ||||
-rw-r--r-- | client/components/sidebar/sidebarCustomFields.jade | 4 | ||||
-rw-r--r-- | client/lib/filter.js | 28 |
5 files changed, 41 insertions, 18 deletions
diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 456bf9b3..dfe7b8d2 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -88,11 +88,13 @@ BlazeComponent.extendComponent({ isViewSwimlanes() { const currentUser = Meteor.user(); + if (!currentUser) return false; return (currentUser.profile.boardView === 'board-view-swimlanes'); }, isViewLists() { const currentUser = Meteor.user(); + if (!currentUser) return true; return (currentUser.profile.boardView === 'board-view-lists'); }, diff --git a/client/components/cards/cardDate.js b/client/components/cards/cardDate.js index e95c3a23..c3e0524d 100644 --- a/client/components/cards/cardDate.js +++ b/client/components/cards/cardDate.js @@ -279,14 +279,18 @@ class CardDueDate extends CardDate { classes() { let classes = 'due-date' + ' '; - if ((this.now.get().diff(this.date.get(), 'days') >= 2) && + // if endAt exists & is < dueAt, dueAt doesn't need to be flagged + if ((this.data().endAt !== 0) && + (this.data().endAt !== null) && + (this.data().endAt !== '') && + (this.data().endAt !== undefined) && (this.date.get().isBefore(this.data().endAt))) + classes += 'current'; + else if (this.now.get().diff(this.date.get(), 'days') >= 2) classes += 'long-overdue'; - else if ((this.now.get().diff(this.date.get(), 'minute') >= 0) && - (this.date.get().isBefore(this.data().endAt))) + else if (this.now.get().diff(this.date.get(), 'minute') >= 0) classes += 'due'; - else if ((this.now.get().diff(this.date.get(), 'days') >= -1) && - (this.date.get().isBefore(this.data().endAt))) + else if (this.now.get().diff(this.date.get(), 'days') >= -1) classes += 'almost-due'; return classes; } @@ -316,10 +320,10 @@ class CardEndDate extends CardDate { let classes = 'end-date' + ' '; if (this.data.dueAt.diff(this.date.get(), 'days') >= 2) classes += 'long-overdue'; - else if (this.data.dueAt.diff(this.date.get(), 'days') >= 0) + else if (this.data.dueAt.diff(this.date.get(), 'days') > 0) classes += 'due'; - else if (this.data.dueAt.diff(this.date.get(), 'days') >= -2) - classes += 'almost-due'; + else if (this.data.dueAt.diff(this.date.get(), 'days') <= 0) + classes += 'current'; return classes; } diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade index b44021a6..2a8e95ab 100644 --- a/client/components/cards/minicard.jade +++ b/client/components/cards/minicard.jade @@ -15,7 +15,7 @@ template(name="minicard") unless dueAt unless endAt .date - +miniCardReceivedDate + +minicardReceivedDate if startAt .date +minicardStartDate @@ -37,7 +37,8 @@ template(name="minicard") .minicard-custom-field-item = definition.name .minicard-custom-field-item - = value + +viewer + = trueValue if members .minicard-members.js-minicard-members diff --git a/client/components/sidebar/sidebarCustomFields.jade b/client/components/sidebar/sidebarCustomFields.jade index def083e9..fd31e5ac 100644 --- a/client/components/sidebar/sidebarCustomFields.jade +++ b/client/components/sidebar/sidebarCustomFields.jade @@ -37,7 +37,7 @@ template(name="createCustomFieldPopup") each dropdownItems.get input.js-dropdown-item(type="text" value=name placeholder="") input.js-dropdown-item.last(type="text" value="" placeholder="{{_ 'custom-field-dropdown-options-placeholder'}}") - a.flex.js-field-show-on-card + a.flex.js-field-show-on-card(class="{{#if showOnCard}}is-checked{{/if}}") .materialCheckBox(class="{{#if showOnCard}}is-checked{{/if}}") span {{_ 'show-field-on-card'}} @@ -49,4 +49,4 @@ template(name="createCustomFieldPopup") template(name="deleteCustomFieldPopup") p {{_ "custom-field-delete-pop"}} - button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
\ No newline at end of file + button.js-confirm.negate.full(type="submit") {{_ 'delete'}} diff --git a/client/lib/filter.js b/client/lib/filter.js index fa139cfe..e3658e1e 100644 --- a/client/lib/filter.js +++ b/client/lib/filter.js @@ -145,6 +145,22 @@ class AdvancedFilter { return found._id; } + _fieldValueToId(field, value) + { + const found = CustomFields.findOne({ 'name': field }); + if (found.settings.dropdownItems && found.settings.dropdownItems.length > 0) + { + for (let i = 0; i < found.settings.dropdownItems.length; i++) + { + if (found.settings.dropdownItems[i].name === value) + { + return found.settings.dropdownItems[i]._id; + } + } + } + return value; + } + _arrayToSelector(commands) { try { //let changed = false; @@ -208,7 +224,7 @@ class AdvancedFilter { { const field = commands[i - 1].cmd; const str = commands[i + 1].cmd; - commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': str }; + commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': {$in: [this._fieldValueToId(field, str), parseInt(str, 10)]} }; commands.splice(i - 1, 1); commands.splice(i, 1); //changed = true; @@ -220,7 +236,7 @@ class AdvancedFilter { { const field = commands[i - 1].cmd; const str = commands[i + 1].cmd; - commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $not: str } }; + commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $not: {$in: [this._fieldValueToId(field, str), parseInt(str, 10)]} } }; commands.splice(i - 1, 1); commands.splice(i, 1); //changed = true; @@ -234,7 +250,7 @@ class AdvancedFilter { { const field = commands[i - 1].cmd; const str = commands[i + 1].cmd; - commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $gt: str } }; + commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $gt: parseInt(str, 10) } }; commands.splice(i - 1, 1); commands.splice(i, 1); //changed = true; @@ -249,7 +265,7 @@ class AdvancedFilter { { const field = commands[i - 1].cmd; const str = commands[i + 1].cmd; - commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $gte: str } }; + commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $gte: parseInt(str, 10) } }; commands.splice(i - 1, 1); commands.splice(i, 1); //changed = true; @@ -263,7 +279,7 @@ class AdvancedFilter { { const field = commands[i - 1].cmd; const str = commands[i + 1].cmd; - commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $lt: str } }; + commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $lt: parseInt(str, 10) } }; commands.splice(i - 1, 1); commands.splice(i, 1); //changed = true; @@ -278,7 +294,7 @@ class AdvancedFilter { { const field = commands[i - 1].cmd; const str = commands[i + 1].cmd; - commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $lte: str } }; + commands[i] = { 'customFields._id': this._fieldNameToId(field), 'customFields.value': { $lte: parseInt(str, 10) } }; commands.splice(i - 1, 1); commands.splice(i, 1); //changed = true; |