@@ -57,6 +54,7 @@
import Actions from '@nextcloud/vue/dist/Components/Actions'
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
import Moment from './Moment'
+import importantSvg from '../../img/important.svg'
import Avatar from './Avatar'
import {calculateAccountColor} from '../util/AccountColor'
@@ -79,6 +77,11 @@ export default {
required: true,
},
},
+ data() {
+ return {
+ importantSvg
+ }
+ },
computed: {
accountColor() {
return calculateAccountColor(this.$store.getters.getAccount(this.data.accountId).emailAddress)
@@ -175,7 +178,16 @@ export default {
}
.app-content-list-item-star.icon-important {
- left: 5px;
+ left: 7px;
+ top: 13px;
+ opacity: 1;
+ &:hover {
+ opacity: 0.5;
+ }
+ ::v-deep path {
+ fill: #FFCC00;
+ stroke: var( --color-main-background);
+ }
}
.app-content-list-item.unseen {
font-weight: bold;
diff --git a/tests/Unit/Service/Classification/ClassifierTest.php b/tests/Unit/Service/Classification/ClassifierTest.php
new file mode 100644
index 0000000000..6862a1282c
--- /dev/null
+++ b/tests/Unit/Service/Classification/ClassifierTest.php
@@ -0,0 +1,68 @@
+
+ *
+ * @author 2020 Christoph Wurst
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+namespace OCA\Mail\Tests\Unit\Service\Classification;
+
+use ChristophWurst\Nextcloud\Testing\TestCase;
+use OCA\Mail\Db\Message;
+use OCA\Mail\Service\Classification\AClassifier;
+
+class ClassifierTest extends TestCase {
+
+ public function testShortcut(): void {
+ $c1 = $this->createMock(AClassifier::class);
+ $c1->method('isImportant')->willReturn(true);
+ $c2 = $this->createMock(AClassifier::class);
+ $c2->expects($this->never())
+ ->method('isImportant');
+ $message = $this->createMock(Message::class);
+
+ $result = $c1->or($c2)->isImportant($message);
+
+ $this->assertTrue($result);
+ }
+
+ public function testOr(): void {
+ $c1 = $this->createMock(AClassifier::class);
+ $c2 = $this->createMock(AClassifier::class);
+ $c2->method('isImportant')->willReturn(true);
+ $message = $this->createMock(Message::class);
+
+ $result = $c1->or($c2)->isImportant($message);
+
+ $this->assertTrue($result);
+ }
+
+ public function testNone(): void {
+ $c1 = $this->createMock(AClassifier::class);
+ $c2 = $this->createMock(AClassifier::class);
+ $message = $this->createMock(Message::class);
+
+ $result = $c1->or($c2)->isImportant($message);
+
+ $this->assertFalse($result);
+ }
+
+}
diff --git a/webpack.common.js b/webpack.common.js
index 42a0777c04..010f19b084 100644
--- a/webpack.common.js
+++ b/webpack.common.js
@@ -62,7 +62,7 @@ module.exports = {
test: /\.(svg)$/i,
use: [
{
- loader: 'url-loader'
+ loader: 'svg-inline-loader'
}
],
exclude: path.join(__dirname, 'node_modules', '@ckeditor')