summaryrefslogtreecommitdiffstats
path: root/views/log/main.qml
diff options
context:
space:
mode:
authorRémi Nicole <nicole@kolabsystems.com>2018-02-26 18:19:43 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-02-26 18:20:13 +0100
commit331f75d4da056ddb235be45a3784d2c19e545211 (patch)
tree64adc5432725e6d484012acfcea64b95b5d1711f /views/log/main.qml
parent2dc4d380f8c0cc90aa0dec67a826703c3ceb34af (diff)
downloadkube-331f75d4da056ddb235be45a3784d2c19e545211.tar.gz
kube-331f75d4da056ddb235be45a3784d2c19e545211.zip
Improvements of the log view
Summary: - Add a test view for the log view - Allow passing the `entities` part of Sink messages - That allowed getting information about which mail could not be sent in sink transmission errors Reviewers: cmollekopf Reviewed By: cmollekopf Differential Revision: https://phabricator.kde.org/D10861
Diffstat (limited to 'views/log/main.qml')
-rw-r--r--views/log/main.qml153
1 files changed, 153 insertions, 0 deletions
diff --git a/views/log/main.qml b/views/log/main.qml
new file mode 100644
index 00000000..f4f20582
--- /dev/null
+++ b/views/log/main.qml
@@ -0,0 +1,153 @@
1/*
2 * Copyright (C) 2018 Christian Mollekopf, <mollekopf@kolabsys.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19import QtQuick 2.7
20import QtQuick.Controls 2.0
21import QtQuick.Window 2.0
22
23import org.kube.framework 1.0 as Kube
24import org.kube.test 1.0
25import "qml"
26
27ApplicationWindow {
28 id: app
29 height: Screen.desktopAvailableHeight * 0.8
30 width: Screen.desktopAvailableWidth * 0.8
31
32 Component.onCompleted: {
33 var initialState = {
34 accounts: [{
35 id: "account1",
36 name: "Test Account"
37 }],
38 identities: [{
39 account: "account1",
40 name: "Test Identity",
41 address: "identity@example.org"
42 }],
43 resources: [{
44 id: "resource1",
45 account: "account1",
46 type: "dummy"
47 },
48 {
49 id: "resource2",
50 account: "account1",
51 type: "mailtransport"
52 }],
53 folders: [{
54 id: "folder1",
55 resource: "resource1",
56 name: "Folder 1",
57 specialpurpose: ["drafts"],
58 mails: [{
59 resource: "resource1",
60 messageId: "<msg1@test.com>",
61 date: "2017-07-24T15:46:29",
62 subject: "subject1",
63 body: "body",
64 to: ["to@example.org"],
65 cc: ["cc@example.org"],
66 bcc: ["bcc@example.org"],
67 draft: true
68 },
69 {
70 resource: "resource1",
71 messageId: "<msg2@test.com>",
72 date: "2017-07-23T15:46:29",
73 subject: "LooooooooooooooooooooooooooooooooooooooooooooooooooooooooonggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggEnd",
74 body: "LooooooooooooooooooooooooooooooooooooooooooooooooooooooooonggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggEnd\nbody\nbody\n\n\nbody\n\n\nbody\n\n\nbody\n\n\nbody\nbody\n\n\nbody\n\n\nbody\n\n\nbody\n\n\nbody\n\n\n\n\n\n\n\n\nbody\nbody\n\n\nbody\n\n\nbody\n\n\nbody\n\n\nbody\n\n\nbody",
75 to: ["toLoooooooooooooooooooooooooooooooooooooooooooooooooong@example.org"],
76 cc: ["ccLoooooooooooooooooooooooooooooooooooooooooooooooooong@example.org"],
77 bcc: ["bccLoooooooooooooooooooooooooooooooooooooooooooooooooong@example.org"],
78 draft: true
79 }
80 ]
81 }],
82 }
83 TestStore.setup(initialState)
84 Kube.Fabric.postMessage(
85 Kube.Messages.notification,
86 {
87 "type": Kube.Notifications.error,
88 "subtype": Kube.Notifications.loginError,
89 message: "merge1",
90 resource: "resource1",
91 entities: []
92 }
93 );
94 Kube.Fabric.postMessage(
95 Kube.Messages.notification,
96 {
97 "type": Kube.Notifications.error,
98 "subtype": Kube.Notifications.hostNotFoundError,
99 message: "merge1",
100 resource: "resource1",
101 entities: []
102 }
103 )
104 Kube.Fabric.postMessage(
105 Kube.Messages.notification,
106 {
107 "type": Kube.Notifications.error,
108 "subtype": Kube.Notifications.connectionError,
109 message: "merge1",
110 resource: "resource1",
111 entities: []
112 }
113 )
114 var mail = TestStore.load("mail", {messageId: "msg1@test.com"})
115 var mail_uid = TestStore.read(mail).uid
116 Kube.Fabric.postMessage(
117 Kube.Messages.notification,
118 {
119 "type": Kube.Notifications.error,
120 "subtype": Kube.Notifications.transmissionError,
121 message: "merge1",
122 resource: "resource1",
123 entities: [mail_uid]
124 }
125 )
126 var mail2 = TestStore.load("mail", {messageId: "msg2@test.com"})
127 var mail2_uid = TestStore.read(mail2).uid
128 Kube.Fabric.postMessage(
129 Kube.Messages.notification,
130 {
131 "type": Kube.Notifications.error,
132 "subtype": Kube.Notifications.transmissionError,
133 message: "merge1",
134 resource: "resource1",
135 entities: [mail2_uid]
136 }
137 )
138 Kube.Fabric.postMessage(
139 Kube.Messages.notification,
140 {
141 "type": Kube.Notifications.error,
142 "subtype": "customSubType",
143 message: "merge1",
144 resource: "resource1",
145 entities: []
146 }
147 )
148 }
149
150 View {
151 anchors.fill: parent
152 }
153}