diff --git a/classic/overrides/coon/user/view/authentication/AuthForm.js b/classic/overrides/coon.user.view.authentication.AuthForm.js similarity index 97% rename from classic/overrides/coon/user/view/authentication/AuthForm.js rename to classic/overrides/coon.user.view.authentication.AuthForm.js index 2c4fddb..1592836 100644 --- a/classic/overrides/coon/user/view/authentication/AuthForm.js +++ b/classic/overrides/coon.user.view.authentication.AuthForm.js @@ -1,7 +1,7 @@ /** * conjoon * extjs-app-imapuser - * Copyright (C) 2017-2021 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-imapuser + * Copyright (C) 2017-2022 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-imapuser * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/classic/overrides/coon/user/view/authentication/AuthWindow.js b/classic/overrides/coon.user.view.authentication.AuthWindow.js similarity index 100% rename from classic/overrides/coon/user/view/authentication/AuthWindow.js rename to classic/overrides/coon.user.view.authentication.AuthWindow.js diff --git a/overrides/conjoon.cn_mail.data.mail.HeaderMixin.js b/overrides/conjoon.cn_mail.data.mail.HeaderMixin.js new file mode 100644 index 0000000..d3e9d42 --- /dev/null +++ b/overrides/conjoon.cn_mail.data.mail.HeaderMixin.js @@ -0,0 +1,57 @@ +/** + * conjoon + * extjs-app-imapuser + * Copyright (C) 2022 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-imapuser + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * + * + */ +Ext.define("conjoon.cn_imapuser.overrides.conjoon.cn_mail.data.mail.HeaderMixin", { + + override: "conjoon.cn_mail.data.mail.HeaderMixin", + + getAdditionalHeaders (url, cfg) { + return {}; + }, + + + getConnectionHeaders (url) { + return {}; + }, + + getAuthHeaders (url, type) { + return {}; + }, + + + /** + * @param url + * @returns {conjoon.cn_mail.model.mail.folder.MailFolder|null} + * @private + */ + getAccountForUrl (url) { + throw new Error("Runtime Exception: getAccoutnUrl should not be called from extern."); + } + +}); diff --git a/overrides/conjoon/cn_mail/data/mail/account/proxy/MailAccountProxy.js b/overrides/conjoon.cn_mail.data.mail.account.proxy.MailAccountProxy.js similarity index 100% rename from overrides/conjoon/cn_mail/data/mail/account/proxy/MailAccountProxy.js rename to overrides/conjoon.cn_mail.data.mail.account.proxy.MailAccountProxy.js diff --git a/overrides/conjoon.dev.cn_mailsim.data.HeaderMixin.js b/overrides/conjoon.dev.cn_mailsim.data.HeaderMixin.js new file mode 100644 index 0000000..74ff3a6 --- /dev/null +++ b/overrides/conjoon.dev.cn_mailsim.data.HeaderMixin.js @@ -0,0 +1,41 @@ +/** + * conjoon + * extjs-app-imapuser + * Copyright (C) 2022 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-imapuser + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @inheritdoc + */ +Ext.define("conjoon.cn_imapuser.overrides.conjoon.dev.cn_mailsim.data.HeaderMixin", { + + override: "conjoon.dev.cn_mailsim.data.HeaderMixin", + + checkHeader: function (xhr) { + return true; + }, + + + matchAccountInfoForCurrentRequest (mailAccountId) { + return true; + } +}); diff --git a/package-lock.json b/package-lock.json index 88da032..4361667 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@commitlint/config-conventional": "^13.2.0", "@conjoon/extjs-app-webmail": "^0.3", "@conjoon/extjs-dev-imapusersim": "^1.0.4", + "@conjoon/extjs-dev-webmailsim": "^0.1.4", "@conjoon/extjs-theme-material": "^0.2.3", "@coon-js/bundleme": "^0.3.1", "@coon-js/extjs-app-user": "^0.1.7", @@ -927,6 +928,16 @@ "integrity": "sha512-51SjWCE02v/JGcMNNSHbAkp/C6ht8xL8q2hfHFUOV673z7Z/vSmvr2Jn765YxhhKfSeHh30YTHc6FDqPEJkIFw==", "dev": true }, + "node_modules/@conjoon/extjs-dev-webmailsim": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@conjoon/extjs-dev-webmailsim/-/extjs-dev-webmailsim-0.1.4.tgz", + "integrity": "sha512-niK6BO8emavK1usgRX8p4jsbKmuKkHVMlycLCkbuiIRSdJGDk1FPhG9jouC2zmmeRBe7cy9ssIfEWca8xnygZQ==", + "dev": true, + "dependencies": { + "@coon-js/extjs-lib-core": "^0.8.1", + "@l8js/l8": "^0.7.2" + } + }, "node_modules/@conjoon/extjs-theme-material": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@conjoon/extjs-theme-material/-/extjs-theme-material-0.2.3.tgz", @@ -9460,6 +9471,16 @@ "integrity": "sha512-51SjWCE02v/JGcMNNSHbAkp/C6ht8xL8q2hfHFUOV673z7Z/vSmvr2Jn765YxhhKfSeHh30YTHc6FDqPEJkIFw==", "dev": true }, + "@conjoon/extjs-dev-webmailsim": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@conjoon/extjs-dev-webmailsim/-/extjs-dev-webmailsim-0.1.4.tgz", + "integrity": "sha512-niK6BO8emavK1usgRX8p4jsbKmuKkHVMlycLCkbuiIRSdJGDk1FPhG9jouC2zmmeRBe7cy9ssIfEWca8xnygZQ==", + "dev": true, + "requires": { + "@coon-js/extjs-lib-core": "^0.8.1", + "@l8js/l8": "^0.7.2" + } + }, "@conjoon/extjs-theme-material": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@conjoon/extjs-theme-material/-/extjs-theme-material-0.2.3.tgz", diff --git a/package.json b/package.json index 86c7a68..e7ce89c 100644 --- a/package.json +++ b/package.json @@ -95,6 +95,7 @@ "@commitlint/config-conventional": "^13.2.0", "@conjoon/extjs-app-webmail": "^0.3", "@conjoon/extjs-dev-imapusersim": "^1.0.4", + "@conjoon/extjs-dev-webmailsim": "^0.1.4", "@conjoon/extjs-theme-material": "^0.2.3", "@coon-js/bundleme": "^0.3.1", "@coon-js/extjs-app-user": "^0.1.7", diff --git a/tests/groups.config.js b/tests/groups.config.js index 238bd82..b104cfd 100644 --- a/tests/groups.config.js +++ b/tests/groups.config.js @@ -25,35 +25,12 @@ export default [{ group: "overrides", - items: [{ - group: "coon", - items: [{ - group: "user", - items: [{ - group: "view", - items: [{ - group: "authentication", - items: [ - "overrides/coon/user/view/authentication/AuthFormTest.js" - ] - }] - }] - }] - },{ - group: "conjoon", - items: [{ - group: "cn_mail", - items: [{ - group: "data", - items: [{ - group: "mail", - items: [ - "overrides/conjoon/cn_mail/data/mail/account/proxy/MailAccountProxyTest.js" - ] - }] - }] - }] - }] + items: [ + "overrides/coon.user.view.authentication.AuthFormTest.js", + "overrides/conjoon.cn_mail.data.mail.account.proxy.MailAccountProxyTest.js", + "overrides/conjoon.dev.cn_mailsim.data.HeaderMixinTest.js", + "overrides/conjoon.cn_mail.data.mail.HeaderMixinTest.js" + ] }, { group: "universal", items: [{ diff --git a/tests/overrides/conjoon.cn_mail.data.mail.HeaderMixinTest.js b/tests/overrides/conjoon.cn_mail.data.mail.HeaderMixinTest.js new file mode 100644 index 0000000..8380968 --- /dev/null +++ b/tests/overrides/conjoon.cn_mail.data.mail.HeaderMixinTest.js @@ -0,0 +1,49 @@ +/** + * conjoon + * extjs-app-imapuser + * Copyright (C) 2022 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-imapuser + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +StartTest(t => { + + + t.requireOk( + "conjoon.cn_mail.data.mail.HeaderMixin", + "conjoon.cn_imapuser.overrides.conjoon.cn_mail.data.mail.HeaderMixin", () => { + + const makeMixin = () => Ext.create("conjoon.cn_mail.data.mail.HeaderMixin"); + + t.it("getAdditionalHeaders()", t => { + t.expect(makeMixin().getAdditionalHeaders()).toEqual({}); + }); + + t.it("getConnectionHeaders()", t => { + t.expect(makeMixin().getConnectionHeaders()).toEqual({}); + }); + + t.it("getAuthHeaders()", t => { + t.expect(makeMixin().getAuthHeaders()).toEqual({}); + }); + + }); + +}); diff --git a/tests/overrides/conjoon/cn_mail/data/mail/account/proxy/MailAccountProxyTest.js b/tests/overrides/conjoon.cn_mail.data.mail.account.proxy.MailAccountProxyTest.js similarity index 100% rename from tests/overrides/conjoon/cn_mail/data/mail/account/proxy/MailAccountProxyTest.js rename to tests/overrides/conjoon.cn_mail.data.mail.account.proxy.MailAccountProxyTest.js diff --git a/tests/overrides/conjoon.dev.cn_mailsim.data.HeaderMixinTest.js b/tests/overrides/conjoon.dev.cn_mailsim.data.HeaderMixinTest.js new file mode 100644 index 0000000..30122c1 --- /dev/null +++ b/tests/overrides/conjoon.dev.cn_mailsim.data.HeaderMixinTest.js @@ -0,0 +1,46 @@ +/** + * conjoon + * extjs-app-imapuser + * Copyright (C) 2022 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-imapuser + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +StartTest(t => { + + + t.requireOk( + "conjoon.cn_imapuser.overrides.conjoon.dev.cn_mailsim.data.HeaderMixin", + "conjoon.dev.cn_mailsim.data.HeaderMixin", () => { + + const makeMixin = () => Ext.create("conjoon.dev.cn_mailsim.data.HeaderMixin"); + + t.it("checkHeader()", t => { + t.expect(makeMixin().checkHeader()).toBe(true); + }); + + + t.it("matchAccountInfoForCurrentRequest()", t => { + t.expect(makeMixin().matchAccountInfoForCurrentRequest()).toBe(true); + }); + + }); + +}); diff --git a/tests/overrides/coon/user/view/authentication/AuthFormTest.js b/tests/overrides/coon.user.view.authentication.AuthFormTest.js similarity index 99% rename from tests/overrides/coon/user/view/authentication/AuthFormTest.js rename to tests/overrides/coon.user.view.authentication.AuthFormTest.js index 853d286..c9459ee 100644 --- a/tests/overrides/coon/user/view/authentication/AuthFormTest.js +++ b/tests/overrides/coon.user.view.authentication.AuthFormTest.js @@ -49,4 +49,4 @@ StartTest(t => { }); -}); \ No newline at end of file +}); diff --git a/tests/tests.config.js b/tests/tests.config.js index 377ab7c..23eee6b 100644 --- a/tests/tests.config.js +++ b/tests/tests.config.js @@ -32,11 +32,18 @@ export default { timeout: 750, + loaderPath: { "conjoon.cn_imapuser": "../src", - "conjoon.cn_imapuser.overrides.conjoon": "../overrides/conjoon", + "conjoon.cn_imapuser.overrides.coon.user.view.authentication.AuthForm": "../classic/overrides/coon.user.view.authentication.AuthForm.js", + "conjoon.cn_imapuser.overrides.conjoon.cn_mail.data.mail.account.proxy.MailAccountProxy": "../overrides/conjoon.cn_mail.data.mail.account.proxy.MailAccountProxy.js", + "conjoon.cn_imapuser.overrides.conjoon.dev.cn_mailsim.data.HeaderMixin": "../overrides/conjoon.dev.cn_mailsim.data.HeaderMixin.js", + "conjoon.cn_imapuser.overrides.conjoon.cn_mail.data.mail.HeaderMixin": "../overrides/conjoon.cn_mail.data.mail.HeaderMixin.js", + + "conjoon.cn_mail.data.mail.HeaderMixin": "../../node_modules/@conjoon/extjs-app-webmail/src/data/mail/HeaderMixin.js", + "conjoon.dev.cn_mailsim.data.HeaderMixin": "../../node_modules/@conjoon/extjs-dev-webmailsim/src/data/HeaderMixin.js", "coon.user.view.authentication.AuthWindow": "../../node_modules/@coon-js/extjs-app-user/src/view/authentication/AuthWindow.js",