Skip to content

Commit a632e6b

Browse files
refactor: add merge
1 parent 084596a commit a632e6b

File tree

52 files changed

+2098
-1727
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2098
-1727
lines changed

classic/src/view/mail/message/editor/HtmlEditor.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* conjoon
33
* extjs-app-webmail
4-
* Copyright (C) 2019-2021 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-webmail
4+
* Copyright (C) 2019-2022 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-webmail
55
*
66
* Permission is hereby granted, free of charge, to any person
77
* obtaining a copy of this software and associated documentation
@@ -107,12 +107,12 @@ Ext.define("conjoon.cn_mail.view.mail.message.editor.HtmlEditor", {
107107

108108
// Destroying the component during initialization cancels initialization.
109109
if (me.destroying || me.destroyed) {
110-
return me.callParent(arguments);
110+
return me.superclass.initFrameDoc.apply(me, arguments);
111111
}
112112

113113
me.editorHtmlTemplateTxt = await me.loadMarkup();
114114

115-
return me.callParent(arguments);
115+
return me.superclass.initFrameDoc.apply(me, arguments);
116116
},
117117

118118

classic/src/view/mail/message/grid/feature/PreviewTextLazyLoad.js

+34-6
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,16 @@ Ext.define("conjoon.cn_mail.view.mail.message.grid.feature.PreviewTextLazyLoad",
4646
"l8",
4747
"conjoon.cn_mail.data.mail.message.CompoundKey",
4848
"coon.core.data.pageMap.PageMapUtil",
49-
"coon.core.data.pageMap.RecordPosition"
49+
"coon.core.data.pageMap.RecordPosition",
50+
"coon.core.data.request.Configurator"
5051
],
5152

53+
statics: {
54+
required: {
55+
requestConfigurator: "coon.core.data.request.Configurator"
56+
}
57+
},
58+
5259
/**
5360
* @type {Object} pendingLazies
5461
* @private
@@ -59,6 +66,11 @@ Ext.define("conjoon.cn_mail.view.mail.message.grid.feature.PreviewTextLazyLoad",
5966
* @private
6067
*/
6168

69+
/**
70+
* @type {coon.core.data.request.Configurator} requestConfigurator
71+
* @private
72+
*/
73+
6274

6375
/**
6476
* Inits this plugin.
@@ -447,16 +459,32 @@ Ext.define("conjoon.cn_mail.view.mail.message.grid.feature.PreviewTextLazyLoad",
447459
store = grid.getStore(),
448460
proxy = store.getProxy();
449461

450-
Ext.Ajax.request({
462+
Ext.Ajax.request(me.requestConfigurator.configure(
463+
464+
me.getDefaultRequestCfg({
465+
url,
466+
idsToLoad,
467+
options: proxy.getDefaultParameters("ListMessageItem.options")
468+
})
469+
470+
471+
)).then(me.processLoadedPreviewText.bind(me));
472+
},
473+
474+
475+
/**
476+
* @private
477+
*/
478+
getDefaultRequestCfg ({url, idsToLoad, options}) {
479+
return {
451480
method: "get",
452481
url: url,
453-
headers: proxy.headers,
454482
params: {
455483
attributes: "previewText",
456-
options: proxy.getDefaultParameters("ListMessageItem.options"),
484+
options: options,
457485
filter: JSON.stringify([{"property": "id", "operator": "in", "value": idsToLoad}])
458486
}
459-
}).then(me.processLoadedPreviewText.bind(me));
487+
};
460488
}
461489

462-
});
490+
});

classic/src/view/mail/message/reader/MessageViewIframe.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* conjoon
33
* extjs-app-webmail
4-
* Copyright (C) 2019-2021 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-webmail
4+
* Copyright (C) 2019-2022 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-webmail
55
*
66
* Permission is hereby granted, free of charge, to any person
77
* obtaining a copy of this software and associated documentation
@@ -93,7 +93,7 @@ Ext.define("conjoon.cn_mail.view.mail.message.reader.MessageViewIframe", {
9393
me.publishState("imagesAllowed", me.imagesAllowed);
9494

9595
if (!value) {
96-
return me.callParent([value]);
96+
return me.superclass.setSrcDoc.apply(me, [value]);
9797
}
9898

9999
const
@@ -105,9 +105,12 @@ Ext.define("conjoon.cn_mail.view.mail.message.reader.MessageViewIframe", {
105105
),
106106
tpl = await coon.core.Template.load(tplPath);
107107

108-
value = tpl.render({theme: themeConfig ? themeConfig : {}, reader: {body: value, imagesAllowed: me.imagesAllowed}});
108+
value = tpl.render({
109+
theme: themeConfig ? themeConfig : {},
110+
reader: {body: value, imagesAllowed: me.imagesAllowed}
111+
});
109112

110-
return me.callParent([value]);
113+
return me.superclass.setSrcDoc.apply(me, [value]);
111114
},
112115

113116

docs/README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ and appearance of the email client:
4646
}
4747
],
4848
"controller": [
49+
{
50+
"xclass": "conjoon.cn_mail.app.plugin.MailtoProtocolHandlerPlugin"
51+
},
4952
{
5053
"xclass": "conjoon.cn_mail.app.plugin.NewMessagesNotificationPlugin",
5154
"args": [
@@ -105,8 +108,10 @@ for new messages. Plays notification sounds when new messages have been received
105108
desktop notifications are shown for new messages, too. The default interval
106109
for looking up new messages is set to 240000 ms. Additional resources for this plugin can be configured
107110
with the [static resources](#staticResources).
111+
- `conjoon.cn_mail.app.plugin.MailtoProtocolHandlerPlugin` - a plugin for registering **extjs-app-webmail**
112+
as a [protocol handler](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler/Web-based_protocol_handlers) for `mailto`-links.
108113

109114
#### Rest API
110115
- `service` - Endpoint configuration for this package. Used to create required URLs for outgoing
111116
HTTP-requests. Holds the key `rest-api-email.base` that must hold the base URL where the endpoints for
112-
email related operations as described in [rest-api-mail](https://github.com/conjoon/rest-api-description) can be found.
117+
email related operations as described in [rest-api-mail](https://github.com/conjoon/rest-api-description) can be found.

src/app/PackageController.js

+1
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,7 @@ Ext.define("conjoon.cn_mail.app.PackageController", {
901901

902902
conjoon.cn_mail.store.mail.folder.MailFolderTreeStore.getInstance().load();
903903

904+
904905
return {
905906
navigation: [{
906907
text: "Email",

src/data/mail/BaseProxy.js

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/**
2+
* conjoon
3+
* extjs-app-webmail
4+
* Copyright (C) 2022 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-webmail
5+
*
6+
* Permission is hereby granted, free of charge, to any person
7+
* obtaining a copy of this software and associated documentation
8+
* files (the "Software"), to deal in the Software without restriction,
9+
* including without limitation the rights to use, copy, modify, merge,
10+
* publish, distribute, sublicense, and/or sell copies of the Software,
11+
* and to permit persons to whom the Software is furnished to do so,
12+
* subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included
15+
* in all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
21+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
23+
* USE OR OTHER DEALINGS IN THE SOFTWARE.
24+
*/
25+
26+
/**
27+
*
28+
*/
29+
Ext.define("conjoon.cn_mail.data.mail.BaseProxy", {
30+
31+
extend: "Ext.data.proxy.Rest",
32+
33+
requires: [
34+
"conjoon.cn_mail.data.mail.message.proxy.UtilityMixin",
35+
"coon.core.data.request.Configurator"
36+
],
37+
38+
mixins: {
39+
utilityMixin: "conjoon.cn_mail.data.mail.message.proxy.UtilityMixin"
40+
},
41+
42+
inheritableStatics: {
43+
required: {
44+
requestConfigurator: "coon.core.data.request.Configurator"
45+
}
46+
},
47+
48+
49+
/**
50+
* The entity being used with this Proxy.
51+
* @cfg {string}
52+
*/
53+
entityName: null,
54+
55+
appendId: false,
56+
57+
/**
58+
* @type {coon.core.data.request.Configurator} requestConfigurator
59+
* @private
60+
*/
61+
62+
/**
63+
* @param request
64+
* @returns {*}
65+
*/
66+
sendRequest (request) {
67+
68+
const me = this;
69+
70+
request = me.requestConfigurator.configure(request);
71+
72+
return me.callParent([request]);
73+
}
74+
75+
});

src/data/mail/MailboxRunner.js

+35-12
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,16 @@ Ext.define("conjoon.cn_mail.data.mail.MailboxRunner", {
4343
"conjoon.cn_mail.store.mail.folder.MailFolderTreeStore",
4444
"conjoon.cn_mail.data.mail.folder.MailFolderTypes",
4545
"conjoon.cn_mail.model.mail.message.MessageItem",
46-
"conjoon.cn_mail.data.mail.service.MailboxService"
46+
"conjoon.cn_mail.data.mail.service.MailboxService",
47+
"coon.core.data.request.Configurator"
4748
],
4849

50+
statics: {
51+
required: {
52+
requestConfigurator: "coon.core.data.request.Configurator"
53+
}
54+
},
55+
4956
mixins: [
5057
"conjoon.cn_mail.data.mail.MailboxSubscriptionMixin"
5158
],
@@ -72,11 +79,15 @@ Ext.define("conjoon.cn_mail.data.mail.MailboxRunner", {
7279
* @var {conjoon.cn_mail.data.mail.service.MailFolderHelper} mailFolderHelper
7380
*/
7481

82+
/**
83+
* @var {coon.core.data.request.Configurator} requestConfigurator
84+
*/
7585

7686
/**
7787
* Constructor.
7888
*
79-
* @param {Object} mailFolderTreeStore
89+
* @param {Object} cfg
90+
* @param {coon.core.data.request.Configurator} cfg.requestConfigurator} cfg
8091
*
8192
* @see init
8293
*/
@@ -89,7 +100,6 @@ Ext.define("conjoon.cn_mail.data.mail.MailboxRunner", {
89100
mailFolderTreeStore = cfg.mailFolderTreeStore;
90101

91102
delete cfg.mailFolderTreeStore;
92-
93103
Object.assign(me, cfg);
94104

95105
if (mailFolderTreeStore) {
@@ -225,19 +235,32 @@ Ext.define("conjoon.cn_mail.data.mail.MailboxRunner", {
225235
}
226236
}));
227237

228-
const parameters = proxy.getDefaultParameters("ListMessageItem");
238+
const
239+
parameters = Object.assign(proxy.getDefaultParameters("ListMessageItem"), {
240+
filter: JSON.stringify(latestFilter)
241+
}),
242+
defaultCfg = me.getDefaultRequestCfg({
243+
url, parameters, latestFilter
244+
}),
245+
requestCfg = me.requestConfigurator.configure(defaultCfg);
246+
247+
Ext.Ajax.request(requestCfg)
248+
.then(me.onSubscriptionResponseAvailable.bind(me, mailFolder));
229249

230-
Ext.Ajax.request({
250+
},
251+
252+
253+
/**
254+
* @private
255+
*/
256+
getDefaultRequestCfg ({url, parameters}) {
257+
return {
231258
method: "get",
232-
// required by the custom Reader used by teh messageEntityProxy
259+
// required by the custom Reader used by the messageEntityProxy
233260
action: "read",
234261
url: url,
235-
headers: proxy.headers,
236-
params: Object.assign(parameters, {
237-
filter: JSON.stringify(latestFilter)
238-
})
239-
}).then(me.onSubscriptionResponseAvailable.bind(me, mailFolder));
240-
262+
params: parameters
263+
};
241264
},
242265

243266

src/data/mail/account/proxy/MailAccountProxy.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* conjoon
33
* extjs-app-webmail
4-
* Copyright (C) 2017-2021 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-webmail
4+
* Copyright (C) 2017-2022 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-webmail
55
*
66
* Permission is hereby granted, free of charge, to any person
77
* obtaining a copy of this software and associated documentation
@@ -37,7 +37,7 @@
3737
*/
3838
Ext.define("conjoon.cn_mail.data.mail.account.proxy.MailAccountProxy", {
3939

40-
extend: "Ext.data.proxy.Rest",
40+
extend: "conjoon.cn_mail.data.mail.BaseProxy",
4141

4242
requires: [
4343
"conjoon.cn_mail.data.mail.account.reader.MailAccountJsonReader"
@@ -51,7 +51,6 @@ Ext.define("conjoon.cn_mail.data.mail.account.proxy.MailAccountProxy", {
5151

5252
idParam: "id",
5353

54-
appendId: false,
5554

5655
/**
5756
* @private

src/data/mail/message/proxy/AttachmentProxy.js

+19
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ Ext.define("conjoon.cn_mail.data.mail.message.proxy.AttachmentProxy", {
3737
"conjoon.cn_mail.data.mail.message.proxy.UtilityMixin"
3838
],
3939

40+
statics: {
41+
required: {
42+
requestConfigurator: "coon.core.data.request.Configurator"
43+
}
44+
},
45+
4046
mixins: {
4147
utilityMixin: "conjoon.cn_mail.data.mail.message.proxy.UtilityMixin"
4248
},
@@ -160,6 +166,19 @@ Ext.define("conjoon.cn_mail.data.mail.message.proxy.AttachmentProxy", {
160166

161167
request.setUrl(url);
162168

169+
return me.callParent([request]);
170+
},
171+
172+
/**
173+
* @param request
174+
* @returns {*}
175+
*/
176+
sendRequest (request) {
177+
178+
const me = this;
179+
180+
request = me.requestConfigurator.configure(request);
181+
163182
return me.callParent([request]);
164183
}
165184

0 commit comments

Comments
 (0)