@@ -52,47 +52,48 @@ export default {
default: null
}
},
+ data() {
+ return {
+ dueTime: null,
+ dueIcon: null
+ }
+ },
computed: {
+ checkListCount() {
+ return (this.card.description.match(/\[\s*\x*\]/g) || []).length
+ },
+ checkListCheckedCount() {
+ return (this.card.description.match(/\[\s*x\s*\]/g) || []).length
+ },
compactMode() {
return false
},
- dueIcon() {
- let timeInHours = Math.round((Date.parse(this.card.duedate) - Date.now()) / 1000 / 60 / 60 / 24)
-
- if (timeInHours === 1) {
- return 'icon-calendar-dark due icon next'
- }
- if (timeInHours === 0) {
- return 'icon-calendar-dark due icon now'
- }
- if (timeInHours < 0) {
- return 'icon-calendar-dark due icon overdue'
- }
- },
- dueTimeDiff() {
- let unit = 'Minutes'
- let timeInMin = (Date.parse(this.card.duedate) - Date.now()) / 60000
-
- if (timeInMin > 59) {
- timeInMin /= 60
- unit = 'Hours'
- }
-
- if (timeInMin > 23) {
- timeInMin /= 24
- unit = 'Days'
- }
-
- if (timeInMin > 355) {
- timeInMin /= 355
- unit = 'Years'
- }
-
- return Math.round(timeInMin) + ' ' + unit
- },
card() {
return this.$store.getters.cardById(this.id)
}
+ },
+ created() {
+ this.updateDueTime()
+ setInterval(this.updateDueTime, 10000)
+ },
+ destroyed() {
+ clearInterval(this.updateDueTime)
+ },
+ methods: {
+ updateDueTime() {
+ this.dueTime = OC.Util.relativeModifiedDate(this.card.duedate)
+
+ let timeInHours = Math.round((Date.parse(this.card.duedate) - Date.now()) / 1000 / 60 / 60 / 24)
+ if (timeInHours >= 1) {
+ this.dueIcon = 'icon-calendar-dark due icon next'
+ }
+ if (timeInHours === 0) {
+ this.dueIcon = 'icon-calendar-dark due icon now'
+ }
+ if (timeInHours < 0) {
+ this.dueIcon = 'icon-calendar-dark due icon overdue'
+ }
+ }
}
}
diff --git a/templates/part.board.sidebarView.php b/templates/part.board.sidebarView.php
index ea92e9aed..232a77156 100644
--- a/templates/part.board.sidebarView.php
+++ b/templates/part.board.sidebarView.php
@@ -90,7 +90,6 @@
t('Sharing has been disabled for your account.')); ?>
-
Collections
diff --git a/tests/unit/Activity/ActivityManagerTest.php b/tests/unit/Activity/ActivityManagerTest.php
index 8bcf3884e..7d6b515ea 100644
--- a/tests/unit/Activity/ActivityManagerTest.php
+++ b/tests/unit/Activity/ActivityManagerTest.php
@@ -295,7 +295,11 @@ class ActivityManagerTest extends TestCase {
$this->assertEquals([
'stack' => $stack,
'board' => $board,
- 'card' => $card
+ 'card' => [
+ 'id' => $card->getId(),
+ 'title' => $card->getTitle(),
+ 'archived' => $card->getArchived()
+ ]
], $this->invokePrivate($this->activityManager, 'findDetailsForCard', [555]));
}
@@ -329,7 +333,11 @@ class ActivityManagerTest extends TestCase {
$this->assertEquals([
'stack' => $stack,
'board' => $board,
- 'card' => $card,
+ 'card' => [
+ 'id' => $card->getId(),
+ 'title' => $card->getTitle(),
+ 'archived' => $card->getArchived()
+ ],
'attachment' => $attachment
], $this->invokePrivate($this->activityManager, 'findDetailsForAttachment', [777]));
}
diff --git a/tests/unit/Activity/FilterTest.php b/tests/unit/Activity/FilterTest.php
index d3e6b82c5..d58ad34b9 100644
--- a/tests/unit/Activity/FilterTest.php
+++ b/tests/unit/Activity/FilterTest.php
@@ -71,7 +71,7 @@ class FilterTest extends TestCase {
public function testFilterTypes() {
$data = ['deck_board', 'deck_card'];
- $this->assertEquals($data, $this->filter->filterTypes($data));
+ $this->assertEquals(array_merge($data, ['deck_comment']), $this->filter->filterTypes($data));
}
public function testAllowedApps() {
diff --git a/tests/unit/Db/BoardMapperTest.php b/tests/unit/Db/BoardMapperTest.php
index f11eb0363..896f5bb5f 100644
--- a/tests/unit/Db/BoardMapperTest.php
+++ b/tests/unit/Db/BoardMapperTest.php
@@ -158,10 +158,7 @@ class BoardMapperTest extends MapperTestUtility {
public function testFindWithAcl() {
$actual = $this->boardMapper->find($this->boards[0]->getId(), false, true);
- $expected = [
- $this->acls[1]->getId() => $this->acls[1],
- $this->acls[2]->getId() => $this->acls[2]
- ];
+ $expected = [$this->acls[1], $this->acls[2]];
$this->assertEquals($expected, $actual->getAcl());
}
diff --git a/tests/unit/Db/BoardTest.php b/tests/unit/Db/BoardTest.php
index 2f06a4172..5053c761d 100644
--- a/tests/unit/Db/BoardTest.php
+++ b/tests/unit/Db/BoardTest.php
@@ -57,7 +57,7 @@ class BoardTest extends TestCase {
$acl->setId(1);
$board = $this->createBoard();
$board->setAcl(array($acl));
- $result = $board->getAcl()[1];
+ $result = $board->getAcl()[0];
$this->assertEquals($acl, $result);
}
public function testSetShared() {
diff --git a/tests/unit/Db/GroupTest.php b/tests/unit/Db/GroupTest.php
index cb98d6f0f..8f0678c62 100644
--- a/tests/unit/Db/GroupTest.php
+++ b/tests/unit/Db/GroupTest.php
@@ -33,10 +33,13 @@ class GroupTest extends \Test\TestCase {
$group->expects($this->any())
->method('getGID')
->willReturn('mygroup');
+ $group->expects($this->any())
+ ->method('getDisplayName')
+ ->willReturn('My Group');
$groupRelationalObject = new Group($group);
$expected = [
'uid' => 'mygroup',
- 'displayname' => 'mygroup'
+ 'displayname' => 'My Group'
];
$this->assertEquals($expected, $groupRelationalObject->getObjectSerialization());
}
@@ -47,12 +50,19 @@ class GroupTest extends \Test\TestCase {
$group->expects($this->any())
->method('getGID')
->willReturn('mygroup');
+ $group->expects($this->any())
+ ->method('getDisplayName')
+ ->willReturn('My Group');
$groupRelationalObject = new Group($group);
$expected = [
'uid' => 'mygroup',
- 'displayname' => 'mygroup',
+ 'displayname' => 'My Group',
'primaryKey' => 'mygroup'
];
- $this->assertEquals($expected, $groupRelationalObject->jsonSerialize());
+
+ $actual = $groupRelationalObject->jsonSerialize();
+ asort($expected);
+ asort($actual);
+ $this->assertEquals($expected, $actual);
}
-}
\ No newline at end of file
+}
diff --git a/tests/unit/Service/CardServiceTest.php b/tests/unit/Service/CardServiceTest.php
index ab73ebcd6..b2e2db7ad 100644
--- a/tests/unit/Service/CardServiceTest.php
+++ b/tests/unit/Service/CardServiceTest.php
@@ -197,7 +197,7 @@ class CardServiceTest extends TestCase {
$this->cardMapper->expects($this->once())->method('find')->willReturn($card);
$this->cardMapper->expects($this->never())->method('update');
$this->expectException(StatusException::class);
- $this->cardService->update(123, 'newtitle', 234, 'text', 999, 'foo', 'admin', '2017-01-01 00:00:00', null);
+ $this->cardService->update(123, 'newtitle', 234, 'text', 999, 'foo', 'admin', '2017-01-01 00:00:00', null, true);
}
public function testRename() {