From 18e936fd28192538cc39d0413d7a85a69b65c6cb Mon Sep 17 00:00:00 2001 From: pravdomil Date: Tue, 19 Jun 2018 14:12:17 +0200 Subject: less margin-bottom after minicard --- client/components/cards/minicard.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components/cards') diff --git a/client/components/cards/minicard.styl b/client/components/cards/minicard.styl index 38f829d0..335182a3 100644 --- a/client/components/cards/minicard.styl +++ b/client/components/cards/minicard.styl @@ -5,7 +5,7 @@ position: relative display: flex align-items: center - margin-bottom: 9px + margin-bottom: 2px &.placeholder background: darken(white, 20%) -- cgit v1.2.3-1-g7c22 From 6a587299b80a49fce0789628ff65885b5ed2c837 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 26 Jun 2018 01:02:19 +0300 Subject: - Add more card inner shadow. Thanks to pravdomil and xet7 ! Related #1690 --- client/components/cards/minicard.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components/cards') diff --git a/client/components/cards/minicard.styl b/client/components/cards/minicard.styl index 335182a3..391a6316 100644 --- a/client/components/cards/minicard.styl +++ b/client/components/cards/minicard.styl @@ -37,7 +37,7 @@ flex-wrap: wrap background-color: #fff min-height: 20px - box-shadow: 0 1px 2px rgba(0,0,0,.15) + box-shadow: 0 0px 16px rgba(0,0,0,0.15) inset border-radius: 2px color: #4d4d4d overflow: hidden -- cgit v1.2.3-1-g7c22 From 19d239f4cf90686db9c775bb0c3899b65760b06c Mon Sep 17 00:00:00 2001 From: Nicu Tofan Date: Wed, 27 Jun 2018 16:25:57 +0300 Subject: Prevent errors due to missing date fields --- client/components/cards/cardDate.js | 57 +++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 21 deletions(-) (limited to 'client/components/cards') diff --git a/client/components/cards/cardDate.js b/client/components/cards/cardDate.js index c3e0524d..02ea09ae 100644 --- a/client/components/cards/cardDate.js +++ b/client/components/cards/cardDate.js @@ -218,10 +218,13 @@ class CardReceivedDate extends CardDate { } classes() { - let classes = 'received-date' + ' '; - if (this.date.get().isBefore(this.now.get(), 'minute') && - this.now.get().isBefore(this.data().dueAt)) { - classes += 'current'; + let classes = 'received-date '; + const dueAt = this.data().dueAt; + if (dueAt) { + if (this.date.get().isBefore(this.now.get(), 'minute') && + this.now.get().isBefore(dueAt)) { + classes += 'current'; + } } return classes; } @@ -249,9 +252,12 @@ class CardStartDate extends CardDate { classes() { let classes = 'start-date' + ' '; - if (this.date.get().isBefore(this.now.get(), 'minute') && - this.now.get().isBefore(this.data().dueAt)) { - classes += 'current'; + const dueAt = this.data().dueAt; + if (dueAt) { + if (this.date.get().isBefore(this.now.get(), 'minute') && + this.now.get().isBefore(dueAt)) { + classes += 'current'; + } } return classes; } @@ -279,18 +285,23 @@ class CardDueDate extends CardDate { classes() { let classes = 'due-date' + ' '; + // 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))) + const endAt = this.data().endAt; + const theDate = this.date.get(); + const now = this.now.get(); + + if ((endAt !== 0) && + (endAt !== null) && + (endAt !== '') && + (endAt !== undefined) && + (theDate.isBefore(endAt))) classes += 'current'; - else if (this.now.get().diff(this.date.get(), 'days') >= 2) + else if (now.diff(theDate, 'days') >= 2) classes += 'long-overdue'; - else if (this.now.get().diff(this.date.get(), 'minute') >= 0) + else if (now.diff(theDate, 'minute') >= 0) classes += 'due'; - else if (this.now.get().diff(this.date.get(), 'days') >= -1) + else if (now.diff(theDate, 'days') >= -1) classes += 'almost-due'; return classes; } @@ -318,12 +329,16 @@ class CardEndDate extends CardDate { classes() { 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) - classes += 'due'; - else if (this.data.dueAt.diff(this.date.get(), 'days') <= 0) - classes += 'current'; + const dueAt = this.data.dueAt; + if (dueAt) { + const diff = dueAt.diff(this.date.get(), 'days'); + if (diff >= 2) + classes += 'long-overdue'; + else if (diff > 0) + classes += 'due'; + else if (diff <= 0) + classes += 'current'; + } return classes; } -- cgit v1.2.3-1-g7c22