Skip to content

Commit b346921

Browse files
Merge branch 'dev'
# Conflicts: # package-lock.json
2 parents b4806d6 + d39ddb6 commit b346921

File tree

119 files changed

+22990
-17721
lines changed

Some content is hidden

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

119 files changed

+22990
-17721
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/docs
21
/build
3-
/tests/tests.config.js
42
/tests/index.html
53
/.idea
64
/node_modules/

README.md

+27-24
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# @conjoon/extjs-app-webmail ![MIT](https://img.shields.io/npm/l/@conjoon/extjs-app-webmail) [![npm version](https://badge.fury.io/js/@conjoon%2Fextjs-app-webmail.svg)](https://badge.fury.io/js/@conjoon%2Fextjs-app-webmail)
22

3-
4-
This Sencha ExtJS NPM package is built with the [coon.js-library](https://github.com/coon.js) and provides a webmail client
5-
implementation for the [conjoon](https://github.com/conjoon/conjoon) application.
6-
3+
JavaScript email client module for [conjoon](https://conjoon.org), powered by [Sencha Ext JS](https://sencha.com) and [coon.js](https://github.com/coon-js).
74
## Installation
85
```bash
9-
$ npm install --save-dev @conjoon/extjs-app-webmail
6+
$ npm i @conjoon/extjs-app-webmail
107
```
118
If you want to develop with this package, run the `build:dev`-script afterwards:
129
```bash
@@ -18,10 +15,8 @@ Testing environment will then be available via
1815
npm test
1916
```
2017

21-
For using the package as an external dependency in an application, use
22-
```bash
23-
$ npm install --save-prod @conjoon/extjs-app-webmail
24-
```
18+
For using the package as an external dependency in an application:
19+
<br>
2520
In your `app.json`, add this package as a requirement, and make sure your ExtJS `workspace.json`
2621
is properly configured to look up local repositories in the `node_modules`-directory.
2722

@@ -35,23 +30,31 @@ Example (`workspace.json`) :
3530
}
3631
```
3732

38-
## Usage
39-
When using this package without a backend implementation, make sure your app uses the [extjs-dev-webmailsim](https://github.com/conjoon/extjs-dev-webmailsim) package of the [conjoon](https://github.com/conjoon) project.
40-
41-
### Required Services
42-
This package requires a service that complies with the REST API described in `rest-imap` which can be found
43-
in the [REST API description](https://github.com/conjoon/rest-api-description) of the **conjoon**-project.
44-
45-
The url of this service can be configured in the configuration file for this package.
33+
Update the `app.json` of the application by specifying this package in the `uses`-property in
34+
either the `development` and/or `prodution` section:
4635

36+
*Example:*
4737
```json
4838
{
49-
"service": {
50-
"rest-imap": {
51-
"base" : "https://localhost/rest-imap/api/v1"
52-
}
39+
"development": {
40+
"uses": [
41+
"extjs-dev-imapusersim",
42+
"extjs-app-imapuser",
43+
"extjs-app-webmail",
44+
"extjs-dev-webmailsim"
45+
]
46+
},
47+
"production": {
48+
"uses": [
49+
"extjs-app-imapuser",
50+
"extjs-app-webmail"
51+
]
5352
}
54-
}
53+
}
5554
```
56-
Please refer to the documentation of [extjs-lib-core](https://github.com/coon-js/extjs-lib-core) on how to
57-
create package-specific configurations.
55+
56+
## Configuration and Usage
57+
For more information on how to configure and use the package, refer to the [documentation](./docs/README.md).
58+
59+
## Tests
60+
Tests are written with [Siesta](https://bryntum.com/siesta). Documentation can be found [here](./tests/README.md).

classic/src/view/mail/folder/MailFolderTreeColumn.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,15 @@ Ext.define("conjoon.cn_mail.view.mail.folder.MailFolderTreeColumn", {
5555
"<div class=\"{parent.childCls} {parent.elbowCls}-img ",
5656
"{parent.elbowCls}-<tpl if=\".\">line<tpl else>empty</tpl>\" role=\"presentation\"></div>",
5757
"</tpl>",
58-
5958
"<tpl if=\"glyph\">",
6059
"<span class=\"{baseIconCls}\" ",
6160
"<tpl if=\"glyphFontFamily\">",
6261
"style=\"font-family:{glyphFontFamily}\"",
6362
"</tpl>",
6463
">{glyph}</span>",
6564
"<tpl else>",
65+
66+
"<tpl if=\"iconCls\">",
6667
"<tpl if=\"icon\">",
6768
"<img src=\"{blankUrl}\"",
6869
"<tpl else>",
@@ -71,20 +72,19 @@ Ext.define("conjoon.cn_mail.view.mail.folder.MailFolderTreeColumn", {
7172
" role=\"presentation\" class=\"{childCls} {baseIconCls} {customIconCls} ",
7273
"{baseIconCls}-<tpl if=\"leaf\">leaf<tpl else><tpl if=\"expanded\">parent-expanded<tpl else>parent</tpl></tpl> {iconCls}\" ",
7374
"<tpl if=\"icon\">style=\"background-image:url({icon})\"/>" +
74-
"<tpl else>" +
75-
"></div>" +
75+
"<tpl else>" +
76+
"></div>" +
77+
"</tpl>",
7678
"</tpl>",
7779
"</tpl>",
7880
"<tpl if=\"href\">",
7981
"<a href=\"{href}\" role=\"link\" target=\"{hrefTarget}\" class=\"{textCls} {childCls}\">{value}</a>",
8082
"<tpl else>",
8183
"<span class=\"{textCls} {childCls}\">{value}</span>",
8284
"</tpl>",
83-
8485
"<div class=\"{childCls} {elbowCls}-img {elbowCls}",
8586
"<tpl if=\"isLast\">-end</tpl>" +
8687
"<tpl if=\"expandable\">-plus {expanderCls}</tpl>\" role=\"presentation\"></div>"
87-
8888
],
8989

9090

@@ -104,19 +104,18 @@ Ext.define("conjoon.cn_mail.view.mail.folder.MailFolderTreeColumn", {
104104

105105
// do not set record data via set() as it seems to trigger
106106
// immediate update which calls this method in return (?)
107-
if (ret.lines.length === 1) {
108-
record.data.iconCls = me.getIconClsForMailFolderType(type);
107+
if (ret.lines.length <= 1) {
108+
// we could also assign a type-property to ret, but a blank space will do
109+
// to properly render ACCOUNT nodes with the given template
110+
record.data.iconCls = ret.lines.length === 0 ? " " : me.getIconClsForMailFolderType(type);
109111
} else {
110112
record.data.iconCls = "";
111113
}
112114

113115
if (ret.lines && ret.lines.length < 2) {
114116
ret.lines = [];
115-
} else {
116-
ret.lines.pop();
117117
}
118118

119-
120119
return ret;
121120
},
122121

@@ -157,4 +156,4 @@ Ext.define("conjoon.cn_mail.view.mail.folder.MailFolderTreeColumn", {
157156
return iconCls;
158157
}
159158

160-
});
159+
});

classic/src/view/mail/message/AbstractAttachmentList.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Ext.define("conjoon.cn_mail.view.mail.message.AbstractAttachmentList", {
161161
return "fa-file-pdf";
162162

163163
case "text/plain":
164-
return "fa-file-alt";
164+
return "fa-file-alt";
165165

166166
case "text/html":
167167
case "application/json":
@@ -170,12 +170,13 @@ Ext.define("conjoon.cn_mail.view.mail.message.AbstractAttachmentList", {
170170
case "application/gzip":
171171
case "application/zip":
172172
case "application/x-rar-compressed":
173+
case "application/x-zip-compressed":
173174
return "fa-file-archive";
174175

175176
}
176177

177-
return "fa-file-o";
178+
return "fa-file";
178179
}
179180

180181

181-
});
182+
});

classic/src/view/mail/message/MessageGrid.js

+18-10
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
@@ -35,6 +35,8 @@ Ext.define("conjoon.cn_mail.view.mail.message.MessageGrid", {
3535
extend: "Ext.grid.Panel",
3636

3737
requires: [
38+
// @see conjoon/extjs-app-webmail#178
39+
"Ext.grid.column.Date",
3840
"coon.comp.grid.feature.RowBodySwitch",
3941
"conjoon.cn_mail.view.mail.message.grid.feature.Livegrid",
4042
"conjoon.cn_mail.view.mail.message.grid.feature.PreviewTextLazyLoad",
@@ -45,6 +47,12 @@ Ext.define("conjoon.cn_mail.view.mail.message.MessageGrid", {
4547

4648
alias: "widget.cn_mail-mailmessagegrid",
4749

50+
/**
51+
* Gets fired with initComponent to signal that the component is about to get initialized.
52+
* @event cn_init
53+
* @param {conjoon.cn_mail.view.mail.message.MessageGrid} this
54+
*/
55+
4856
/**
4957
* Gets fired when the conjoon.cn_mail.store.mail.message.MessageItemStore
5058
* beforeload-event fires. This relay is needed due to the late binding behavior
@@ -98,9 +106,6 @@ Ext.define("conjoon.cn_mail.view.mail.message.MessageGrid", {
98106
features: [{
99107
ftype: "cn_mail-mailmessagegridfeature-livegrid",
100108
id: "cn_mail-mailMessageFeature-livegrid"
101-
}, {
102-
ftype: "cn_webmailplug-previewtextlazyload",
103-
id: "cn_webmailplug-previewtextlazyload"
104109
}, {
105110
ftype: "cn_comp-gridfeature-rowbodyswitch",
106111
variableRowHeight: false,
@@ -126,9 +131,11 @@ Ext.define("conjoon.cn_mail.view.mail.message.MessageGrid", {
126131

127132
return {
128133
rowBody:
129-
"<div class=\"head" + (!record.get("seen") ? " unread" : "")+"\">" +
130-
"<div class=\"subject"+ (!record.get("seen") ? " unread" : "")+"\">" +
131-
(record.get("answered") ? "<span class=\"fa fa-mail-reply\"></span>" : "")+
134+
"<div class=\"head" + (!record.get("seen") ? " unread" : "") +
135+
(record.get("recent") ? " recent" : "")+"\">" +
136+
"<div class=\"subject"+ (!record.get("seen") ? " seen" : "") +
137+
(record.get("recent") ? " recent" : "")+"\">" +
138+
(record.get("answered") ? "<span class=\"fa fa-reply\"></span>" : "")+
132139
(record.get("flagged") ? "<span class=\"fa fa-flag\"></span>" : "")+
133140
(record.get("draft") ? "<span class=\"draft\">[Draft]</span>" : "") +
134141

@@ -175,9 +182,8 @@ Ext.define("conjoon.cn_mail.view.mail.message.MessageGrid", {
175182
viewConfig: {
176183
markDirty: false,
177184
getRowClass: function (record, rowIndex, rowParams, store){
178-
let cls = record.get("seen")
179-
? ""
180-
: "boldFont";
185+
let cls = record.get("recent") ? "recent" : "";
186+
cls += record.get("seen") ? "" : " boldFont";
181187

182188
if (record.get("cn_deleted")) {
183189
cls += " cn-deleted";
@@ -286,6 +292,8 @@ Ext.define("conjoon.cn_mail.view.mail.message.MessageGrid", {
286292

287293
const me = this;
288294

295+
me.fireEvent("cn_init", me);
296+
289297
// apply Renderer to draftDisplayAddress columns
290298
for (let i = 0, len = me.columns.length; i < len; i++) {
291299
if (me.columns[i].dataIndex === "draftDisplayAddress") {

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

+27
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ Ext.define("conjoon.cn_mail.view.mail.message.editor.HtmlEditor", {
6868
}
6969
});
7070

71+
let overflowHandler = tbar.getLayout().overflowHandler;
72+
73+
overflowHandler.addComponentToMenu = me.createOverflowHandlerInterceptor(overflowHandler.addComponentToMenu);
74+
7175
return tbar;
7276
},
7377

@@ -149,6 +153,29 @@ Ext.define("conjoon.cn_mail.view.mail.message.editor.HtmlEditor", {
149153
"<style type=\"text/css\">",
150154
"</style></head><body></body></html>"
151155
].join("");
156+
},
157+
158+
159+
/**
160+
* Used to hide the Attachment-Button in the menu that gets rendered with the overflow-handler
161+
* of this editor's toolbar.
162+
* Creates an interceptor for the passed func that will not call the
163+
* passed func if teh component passed to it is of the type
164+
* coon.comp.form.field.FileButton.
165+
*
166+
* @private
167+
*
168+
* returns function
169+
*/
170+
createOverflowHandlerInterceptor (func) {
171+
"use strict";
172+
173+
return Ext.Function.createInterceptor(func, function (menu, component) {
174+
if (component instanceof coon.comp.form.field.FileButton) {
175+
return false;
176+
}
177+
});
152178
}
153179

180+
154181
});

0 commit comments

Comments
 (0)