Skip to content

Commit d39ddb6

Browse files
build: update dependencies and related scripts and docs
1 parent 62ba3e9 commit d39ddb6

File tree

12 files changed

+276
-268
lines changed

12 files changed

+276
-268
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/docs
21
/build
32
/tests/index.html
43
/.idea

README.md

Lines changed: 27 additions & 35 deletions
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,34 +30,31 @@ Example (`workspace.json`) :
3530
}
3631
```
3732

38-
## Configuration options
39-
40-
### Package related resources
41-
- `resources.images.notifications.newEmail` - an icon to show with the desktop notifications for new email messages
42-
- `resources.sounds.notifications.newEmail` - a notification sound to play for new email messages
43-
- `templates.html.editor` - an html-template to use with the message editor
44-
- `templates.html.reader` - an html-template to use with the message reader
45-
46-
### Rest API
47-
- `service.rest-api-email.base` - the base url to the [service](#required_services) providing endpoints for the [rest-api-email](https://github.com/conjoon/rest-api-description)-API
48-
49-
## Usage
50-
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.
51-
52-
### Required Services <a name="required_services"></a>
53-
This package requires a service that complies with the REST API described in `rest-api-email` which can be found
54-
in the [REST API description](https://github.com/conjoon/rest-api-description) of the **conjoon**-project.
55-
56-
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:
5735

36+
*Example:*
5837
```json
5938
{
60-
"service": {
61-
"rest-api-email": {
62-
"base" : "https://localhost/rest-api-email/api/v1"
63-
}
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+
]
6452
}
65-
}
53+
}
6654
```
67-
Please refer to the documentation of [extjs-lib-core](https://github.com/coon-js/extjs-lib-core) on how to
68-
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).

docs/README.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# @conjoon/extjs-app-webmail Documentation
2+
3+
**extjs-app-webmail** is a **coon.js** package and is tagged as such in the
4+
`package.json`:
5+
6+
```json
7+
{
8+
"coon-js": {
9+
"package": {
10+
"autoLoad": {
11+
"registerController": true
12+
},
13+
"config" : "${package.resourcePath}/extjs-app-webmail.conf.json"
14+
}
15+
}
16+
}
17+
```
18+
19+
By default, this package's configuration can be found in this package's `resources` folder
20+
in a file named `extjs-app-webmail.conf.json`.
21+
22+
### Required Services
23+
This package requires a service that complies with the REST API described in `rest-api-email` which can be found
24+
in the [REST API description](https://github.com/conjoon/rest-api-description) of the **conjoon**-project.
25+
26+
#### Mocking required Services
27+
When using this package without a backend implementation, your app can use the
28+
[extjs-dev-webmailsim](https://github.com/conjoon/extjs-dev-webmailsim) package of
29+
the [conjoon-project](https://github.com/conjoon).
30+
31+
32+
## What goes into a `extjs-app-webmail` configuration?
33+
34+
The configuration file for this package is built from various key/value-pairs, configuring the behavior
35+
and appearance of the email client:
36+
37+
```json
38+
{
39+
"title": "Email",
40+
"plugins": {
41+
"components": [
42+
{
43+
"cmp": "cn_mail-mailmessagegrid",
44+
"fclass": "conjoon.cn_mail.view.mail.message.grid.feature.PreviewTextLazyLoad",
45+
"event": "cn_init"
46+
}
47+
],
48+
"controller": [
49+
{
50+
"xclass": "conjoon.cn_mail.app.plugin.NewMessagesNotificationPlugin",
51+
"args": [
52+
{
53+
"interval": 240000
54+
}
55+
]
56+
}
57+
]
58+
},
59+
"resources": {
60+
"images": {
61+
"notifications": {
62+
"newEmail": "resources/images/notification/newmail.png"
63+
}
64+
},
65+
"sounds": {
66+
"notifications": {
67+
"newEmail": "resources/sounds/notification/newmail.wav"
68+
}
69+
},
70+
"templates": {
71+
"html": {
72+
"editor": "resources/templates/html/editor.html.tpl",
73+
"reader": "resources/templates/html/reader.html.tpl"
74+
}
75+
}
76+
},
77+
"service": {
78+
"rest-api-email": {
79+
"base": "https://ddev-ms-email.ddev.site/rest-api-email/api/v0/"
80+
}
81+
}
82+
}
83+
```
84+
85+
#### Static resources<a name="staticResources"></a>
86+
The configuration allows for static resources to be configured, making it possible to change the
87+
appearance of the email client. The dot-notation for the configuration options is as follows:
88+
89+
- `title` - The title of the package. This is used for assembling navigation entries, or changing the
90+
`document.title` of the browser instance the application runs in. This package notifies interested
91+
observers with this title whenever view of the package gets activated and gains the focus.
92+
- `resources.images.notifications.newEmail` - an icon to show with the desktop notification when new email messages are coming in.
93+
- `resources.sounds.notifications.newEmail` - a notification sound to play when new email messages are coming in.
94+
- `templates.html.editor` - an html-template to use with the message editor.
95+
- `templates.html.reader` - an html-template to use with the message reader.
96+
97+
#### Plugins
98+
There are several plugins preconfigured for **extjs-app-webmail**. Please consult the documentation
99+
of the plugins for providing constructor arguments.
100+
- `conjoon.cn_mail.view.mail.message.grid.feature.PreviewTextLazyLoad` - a plugin for lazy loading
101+
email message preview texts in the grid, making sure that envelope information of available messages
102+
are loaded and rendered first.
103+
- `conjoon.cn_mail.app.plugin.NewMessagesNotificationPlugin` - a plugin for automatically querying mailboxes
104+
for new messages. Plays notification sounds when new messages have been received. If allowed by the user,
105+
desktop notifications are shown for new messages, too. The default interval
106+
for looking up new messages is set to 240000 ms. Additional resources for this plugin can be configured
107+
with the [static resources](#staticResources).
108+
109+
#### Rest API
110+
- `service` - Endpoint configuration for this package. Used to create required URLs for outgoing
111+
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.

0 commit comments

Comments
 (0)