mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-16 18:13:06 +00:00
Compare commits
245
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6f00345d0 | ||
|
|
5f47450643 | ||
|
|
9da61ddba7 | ||
|
|
60b41e61f7 | ||
|
|
a4d12127ea | ||
|
|
18b5f812bf | ||
|
|
a277a00a96 | ||
|
|
f372f4925d | ||
|
|
a95883db10 | ||
|
|
8f750c75f6 | ||
|
|
005c1cf54d | ||
|
|
90f0aafb97 | ||
|
|
91f4a22ecc | ||
|
|
3973303e41 | ||
|
|
5a26bdbb0d | ||
|
|
88fb63df92 | ||
|
|
208c37c9f0 | ||
|
|
a9a94c80a1 | ||
|
|
32aa387b61 | ||
|
|
05a523c24b | ||
|
|
31db995a92 | ||
|
|
50a13f8cd1 | ||
|
|
ba654fd177 | ||
|
|
5e93bdad69 | ||
|
|
415dd4afd0 | ||
|
|
66de20dd21 | ||
|
|
c5feae5de3 | ||
|
|
83fcd5d37e | ||
|
|
d3da5e7033 | ||
|
|
fc5e3ed682 | ||
|
|
7a0f17b078 | ||
|
|
508548fe8b | ||
|
|
6b3b601f7d | ||
|
|
3e2c5d4a45 | ||
|
|
9997e5a9cf | ||
|
|
ac45c2dc9c | ||
|
|
7b11fc24ac | ||
|
|
ae11297a90 | ||
|
|
15bdeffeee | ||
|
|
ba41f49cd7 | ||
|
|
eeb8ca0bbc | ||
|
|
20d7d65a0b | ||
|
|
206a0e99cc | ||
|
|
036243ad35 | ||
|
|
21205e3d45 | ||
|
|
87184c5611 | ||
|
|
04de7e2791 | ||
|
|
f413e44365 | ||
|
|
a083c88a89 | ||
|
|
14c4af1304 | ||
|
|
85c920ab7c | ||
|
|
2f36777598 | ||
|
|
f138efbda5 | ||
|
|
ddc32328d8 | ||
|
|
32e64339ee | ||
|
|
cdf75c6be5 | ||
|
|
4d49c9176f | ||
|
|
64f5b293d7 | ||
|
|
792bb3c41a | ||
|
|
274128ad86 | ||
|
|
d54eb57573 | ||
|
|
d629c7688c | ||
|
|
834aa44e39 | ||
|
|
47c229d907 | ||
|
|
0fed22e686 | ||
|
|
6947861ec9 | ||
|
|
bc2825f269 | ||
|
|
58de71dbdf | ||
|
|
38fb5ea519 | ||
|
|
0fd5646e4c | ||
|
|
46b91f86d1 | ||
|
|
a86dc712ba | ||
|
|
f0490f32b4 | ||
|
|
1ed56460cc | ||
|
|
d5bdadde0d | ||
|
|
2e3b081bc4 | ||
|
|
19835732a5 | ||
|
|
5be12c1b7d | ||
|
|
2449da995b | ||
|
|
8a6002ab4c | ||
|
|
619112c0ba | ||
|
|
0767bb6b20 | ||
|
|
fdaa7bd00e | ||
|
|
cd8e53c2ff | ||
|
|
f906b056c3 | ||
|
|
a80398cfe3 | ||
|
|
0a1675811a | ||
|
|
855469c076 | ||
|
|
92f2ffd878 | ||
|
|
0b70ba6a6a | ||
|
|
d669f5eb69 | ||
|
|
33fc2373ae | ||
|
|
1214c2ebab | ||
|
|
72926b220f | ||
|
|
59d9b66908 | ||
|
|
a2ee6adf95 | ||
|
|
ae518659c5 | ||
|
|
e0d13c444f | ||
|
|
e09b6304c9 | ||
|
|
ac49b264aa | ||
|
|
4b647b374e | ||
|
|
939e90f12f | ||
|
|
0c457d6988 | ||
|
|
9888223bec | ||
|
|
0878d9f3ab | ||
|
|
4bc50330cf | ||
|
|
ac16369659 | ||
|
|
8c28daf2cd | ||
|
|
e944b92fc7 | ||
|
|
025ecd5647 | ||
|
|
335dd870ad | ||
|
|
45c8e9fed8 | ||
|
|
6998ffd96c | ||
|
|
160badbbad | ||
|
|
3ff26a8e19 | ||
|
|
a02f904d03 | ||
|
|
b4b041260b | ||
|
|
500c7daea2 | ||
|
|
07b0e98b20 | ||
|
|
08766eee23 | ||
|
|
3d4897b4bb | ||
|
|
52be6534ae | ||
|
|
2f3c6fb4d2 | ||
|
|
42fc4932b6 | ||
|
|
f5cc25bb64 | ||
|
|
792937d561 | ||
|
|
3952c0f6e9 | ||
|
|
6aa04a519a | ||
|
|
b52888144e | ||
|
|
689eb42f72 | ||
|
|
61a81b3948 | ||
|
|
da87aba713 | ||
|
|
26841a782d | ||
|
|
3b3adbb8ba | ||
|
|
80b3445c9c | ||
|
|
ae98b41458 | ||
|
|
7fa519d15c | ||
|
|
2e975dbc29 | ||
|
|
fed2462586 | ||
|
|
4c0b29a4ae | ||
|
|
079f36a8a9 | ||
|
|
eeacea784c | ||
|
|
f891c11e78 | ||
|
|
945dac6c49 | ||
|
|
fba0614b60 | ||
|
|
53a614bfbf | ||
|
|
9870964c0e | ||
|
|
4f3d1deff0 | ||
|
|
d9fca83e04 | ||
|
|
4bd0f04913 | ||
|
|
7cbefb1355 | ||
|
|
87c1921034 | ||
|
|
f0ee0a2ee2 | ||
|
|
232375bf82 | ||
|
|
2307b49d44 | ||
|
|
985595467c | ||
|
|
d1d147e696 | ||
|
|
73967518d8 | ||
|
|
568ae1f32d | ||
|
|
16b8f9a5d7 | ||
|
|
3a7fe45ca4 | ||
|
|
0d1354ebbc | ||
|
|
d7bc86239f | ||
|
|
3524b76793 | ||
|
|
40fe3ce361 | ||
|
|
ff2c566c90 | ||
|
|
ba580ad11d | ||
|
|
a3ebebd926 | ||
|
|
92a3f9f677 | ||
|
|
ca6de58598 | ||
|
|
01a73d34c2 | ||
|
|
4ae3907d2a | ||
|
|
ab4a548ead | ||
|
|
70948c3533 | ||
|
|
182efb15b8 | ||
|
|
3cc37bf86e | ||
|
|
137e816661 | ||
|
|
e73e518bfb | ||
|
|
2624d1bc0d | ||
|
|
480482d575 | ||
|
|
b0a168aa39 | ||
|
|
255a0f3260 | ||
|
|
ff73456379 | ||
|
|
391a19e94b | ||
|
|
ddba8268b7 | ||
|
|
5a85c6ab57 | ||
|
|
7fefa2f631 | ||
|
|
c778104b37 | ||
|
|
404589e302 | ||
|
|
43c5fc7d63 | ||
|
|
d6fc36a8d6 | ||
|
|
743e6cb105 | ||
|
|
f79a34d7aa | ||
|
|
fe13a34077 | ||
|
|
d57a1d6093 | ||
|
|
fc8c81deb3 | ||
|
|
9251b401ed | ||
|
|
517ebd3a96 | ||
|
|
2f04b7ad95 | ||
|
|
562bc3d86c | ||
|
|
25df65ed60 | ||
|
|
7b166346b9 | ||
|
|
a5d384890b | ||
|
|
90aa47e179 | ||
|
|
9eb9db6c8b | ||
|
|
433f58061e | ||
|
|
f9693a1447 | ||
|
|
1947e7944a | ||
|
|
5bf025bfcb | ||
|
|
892389f5ae | ||
|
|
c20da3b93e | ||
|
|
697e0459e8 | ||
|
|
0b6c9051f0 | ||
|
|
081c2ce12a | ||
|
|
abe99746f2 | ||
|
|
78aab47094 | ||
|
|
de4ea368b8 | ||
|
|
f26ce86aab | ||
|
|
0dc4b21920 | ||
|
|
c48e4be7c2 | ||
|
|
2592486e62 | ||
|
|
c7dc6ccfb2 | ||
|
|
3f29074cf6 | ||
|
|
4585f2681f | ||
|
|
8cfdc6f561 | ||
|
|
145ceccdfd | ||
|
|
f1a1fc39a6 | ||
|
|
bea14aa9ca | ||
|
|
308b086442 | ||
|
|
b5eef694df | ||
|
|
922927ab03 | ||
|
|
a81dcb9796 | ||
|
|
960bbe0bad | ||
|
|
ad886f608c | ||
|
|
69cae2f4d4 | ||
|
|
9230352f77 | ||
|
|
8b8828328c | ||
|
|
0c13842372 | ||
|
|
dbf7616f8a | ||
|
|
ba4d0b51a2 | ||
|
|
d3220c245e | ||
|
|
a7ddf32ec4 | ||
|
|
38b68a8fc1 | ||
|
|
33d4001278 | ||
|
|
aebf1238d0 |
@@ -16,3 +16,4 @@ src/environments/
|
||||
/demo-shell-ng2/ng2-components/
|
||||
.happypack/
|
||||
.happypack/
|
||||
.history
|
||||
Vendored
+11
-1
@@ -9,5 +9,15 @@
|
||||
"**/.happypack": true
|
||||
},
|
||||
"editor.renderIndentGuides": true,
|
||||
"tslint.configFile": "ng2-components/tslint.json"
|
||||
"tslint.configFile": "ng2-components/tslint.json",
|
||||
"markdownlint.config": {
|
||||
"MD032": false,
|
||||
"MD004": false,
|
||||
"MD024": false,
|
||||
"MD009": false,
|
||||
"MD013": false,
|
||||
"MD036": false,
|
||||
"MD033" : false,
|
||||
"MD031" : false
|
||||
}
|
||||
}
|
||||
|
||||
+24
-24
@@ -4,7 +4,7 @@ The web client that we are building with the application development framework w
|
||||
So we need to tell the Alfresco server that any request that comes in from this custom web client should be allowed access
|
||||
to the Content Repository. This is done by enabling CORS.
|
||||
|
||||
If you are experiencing this kind of problem you can follow **one of the following**:
|
||||
If you are experiencing this kind of problem, see **one of the following**:
|
||||
|
||||
1. [Configure Webpack Proxy](#configure-webpack-proxy)
|
||||
2. [Configure angular-cli Proxy](#configure-angular-cli-proxy)
|
||||
@@ -13,13 +13,13 @@ If you are experiencing this kind of problem you can follow **one of the follow
|
||||
|
||||
# Configure Webpack Proxy
|
||||
|
||||
If you are using a project created with the [Yeoman Generator](https://github.com/Alfresco/generator-ng2-alfresco-app) or the demo shell >=1.6.0 you have already out of the box in your `config/webpack.common.js` the following configuration.
|
||||
Say we have an app running on http://localhost:3000/ and we want all calls redirect with the following strategy:
|
||||
If you are using a project created with the [Yeoman Generator](https://github.com/Alfresco/generator-ng2-alfresco-app) or the demo shell >=1.6.0, you have already out of the box in your `config/webpack.common.js` the following configuration.
|
||||
Say we have an app running on http://localhost:3000/ and we want to redirect all calls with the following strategy:
|
||||
|
||||
* Content service http://localhost:8080/ redirect to -> http://localhost:3000/ecm/
|
||||
* Process service http://localhost:9999/ redirect to -> http://localhost:3000/bpm/
|
||||
* Content Service http://localhost:8080/ redirect to -> http://localhost:3000/ecm/
|
||||
* Process Service http://localhost:9999/ redirect to -> http://localhost:3000/bpm/
|
||||
|
||||
Open the file `config/webpack.common.js` find the `devServer` section and add the content:
|
||||
Open the `config/webpack.common.js` file, find the `devServer` section and add the content:
|
||||
|
||||
```javascript
|
||||
devServer: {
|
||||
@@ -55,18 +55,18 @@ devServer: {
|
||||
```
|
||||
|
||||
Notes:
|
||||
- With differents configuration of webpack the `devServer` properties could be in other webpack files. Search in your configuration
|
||||
- With different configuration of webpack the `devServer` properties could be in other webpack files. Search in your configuration files
|
||||
|
||||
- If you are runnign the App, content service or process service on different ports change the ports accordingly your local configuration.
|
||||
- If you are running the App, Content Service or Process Service on different ports change the ports accordingly in your local configuration.
|
||||
For further details about how to configure a webpack proxy please refer to the [official documentation](https://webpack.js.org/configuration/dev-server/#devserver-proxy).
|
||||
|
||||
# Configure angular-cli Proxy
|
||||
Say we have a app running on http://localhost:3000/ and we want redirect all the calls with the following strategy:
|
||||
Say we have an app running on http://localhost:3000/ and we want to redirect all the calls with the following strategy:
|
||||
|
||||
* Content service http://localhost:8080/ redirect to -> http://localhost:3000/ecm/
|
||||
* Process service http://localhost:9999/ redirect to -> http://localhost:3000/bpm/
|
||||
* Content Service http://localhost:8080/ redirect to -> http://localhost:3000/ecm/
|
||||
* Process Service http://localhost:9999/ redirect to -> http://localhost:3000/bpm/
|
||||
|
||||
Create a file next to projects `package.json` call it `proxy.conf.json` with the content:
|
||||
Create a file next to project's `package.json`, call it `proxy.conf.json` and add the following content:
|
||||
|
||||
```javascript
|
||||
{
|
||||
@@ -93,7 +93,7 @@ Create a file next to projects `package.json` call it `proxy.conf.json` with the
|
||||
}
|
||||
```
|
||||
|
||||
Note if you are running the App, content service or process service on different ports change the ports accordingly your local configuration.
|
||||
Note if you are running the App, Content Service or Process Service on different ports change the ports accordingly in your local configuration.
|
||||
For further details about how to configure a webpack proxy please refer to the [official documentation](https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/proxy.md).
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ For further details about how to configure a webpack proxy please refer to the [
|
||||
Most Linux distributions will come with nginx available to install via your
|
||||
package manager and on Mac OS you can use [Homebrew](http://brew.sh/).
|
||||
|
||||
If you want to install manually however you can follow the instructions on the
|
||||
If you want to install manually however, you can follow the instructions on the
|
||||
[download page](http://nginx.org/en/download.html). See also the specific information for
|
||||
[windows users](http://nginx.org/en/docs/windows.html).
|
||||
|
||||
@@ -122,24 +122,24 @@ This will host Activiti, Alfresco and the app dev framework under the same origi
|
||||
* ECM : http://localhost:8888/alfresco/
|
||||
* BPM : http://localhost:8888/activiti/
|
||||
|
||||
To make everything work, you have to change the address of the ECM and BPM. In the demo app you can do that clicking on the top right settings menu and change the bottom left options: *ECM host* and *BPM host*.
|
||||
To make everything work, you should change the address of the ECM and BPM. In the demo app you can do that by clicking on the top right settings menu and change the bottom left options: *ECM host* and *BPM host*.
|
||||
|
||||
This configuration assumes few things:
|
||||
This configuration assumes a few things:
|
||||
|
||||
* Port mapping:
|
||||
* nginx entry point: 0.0.0.0:8888
|
||||
* Demo Shell: locathost:3000
|
||||
* Alfresco: locathost:8080
|
||||
* Activiti: locathost:9999
|
||||
* Demo Shell: localhost:3000
|
||||
* Alfresco: localhost:8080
|
||||
* Activiti: localhost:9999
|
||||
|
||||
All those values can be modified at their respective `location` directive on the [nginx.conf](/nginx.conf) file.
|
||||
|
||||
If you want to know more on how to install and configure nginx to work with the Application Development Framework can be found [here](https://community.alfresco.com/community/application-development-framework/blog/2016/09/28/adf-development-set-up-with-nginx-proxy)
|
||||
If you want to know more on how to install and configure nginx to work with the Application Development Framework, information can be found [here](https://community.alfresco.com/community/application-development-framework/blog/2016/09/28/adf-development-set-up-with-nginx-proxy)
|
||||
|
||||
|
||||
# Enable CORS in CS and PS
|
||||
|
||||
If you want completely enable CORS call on your Content service and Process service, plese refer to the following alfresco documents:
|
||||
If you want to completely enable CORS calls on your Content Service and Process Service, please refer to the following Alfresco documents:
|
||||
|
||||
* [Enable Cross Origin Resource Sharing (CORS) in Alfresco Process Services](http://docs.alfresco.com/process-services1.6/topics/enabling-cors.html)
|
||||
|
||||
@@ -148,12 +148,12 @@ If you want completely enable CORS call on your Content service and Process serv
|
||||
This is the easiest way, add the [enablecors](https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/enablecors/1.0/enablecors-1.0.jar)
|
||||
platform module JAR to the *$ALF_INSTALL_DIR/modules/platform* directory and restart the server.
|
||||
|
||||
Note. by default the CORS filter that is enabled will allow any origin.
|
||||
Note. by default, the CORS filter that is enabled will allow any origin.
|
||||
|
||||
##Or - Manually update the web.xml file
|
||||
Or - Manually update the web.xml file
|
||||
|
||||
Modify *$ALF_INSTALL_DIR/tomcat/webapps/alfresco/WEB-INF/web.xml* and uncomment the following section and update
|
||||
`cors.allowOrigin` to `http://localhost:3000`:
|
||||
`cors.allowOrigin` to `http://localhost:3000` :
|
||||
|
||||
```
|
||||
<filter>
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
# Browser Support
|
||||
Browser support and polyfills guide.
|
||||
|
||||
Browser compatibility and support depends on targeted browsers and 3rd party libraries. ADF framework is based on the following libraries and components:
|
||||
Browser compatibility and support depends on targeted browsers and 3rd party libraries. ADF is based on the following libraries and components:
|
||||
|
||||
- Angular 2 (all ADF components)
|
||||
- Material Design Lite (all ADF components)
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
# Contributing to ADF
|
||||
|
||||
- [Library Contents](#submitting-a-pull-request-pr)
|
||||
- [Code style](#code-style)
|
||||
- [Test guide](#test-guide)
|
||||
|
||||
## Submitting a Pull Request (PR)
|
||||
|
||||
Before you submit please follow the steps below:
|
||||
|
||||
* Search in [GitHub PR](https://github.com/Alfresco/alfresco-ng2-components/pulls) for an open or closed PR
|
||||
that could solve or already solves your issue.
|
||||
* Search in the [GitHub release history](https://github.com/Alfresco/alfresco-ng2-components/releases) if your
|
||||
issue has already been solved in a new version of ADF.
|
||||
* Fork our repository - [if you don't know how to do it read this GitHub document](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)
|
||||
* Make your changes in a new git branch starting from development and following the [naming convention](https://github.com/Alfresco/alfresco-ng2-components/wiki/Branching-Strategy)
|
||||
|
||||
```shell
|
||||
git checkout -b dev-{developerName}-{GitIssuedId/JiraIssueId} development
|
||||
```
|
||||
|
||||
* Create your PR **including appropriate test cases** following the [code contribution acceptance criteria](https://github.com/Alfresco/alfresco-ng2-components/wiki/Code-contribution-acceptance-criteria)
|
||||
* Run the tests and make sure they are green. Please don't comment out or exclude the already existing tests
|
||||
* Commit your change using the [commit format message good practice](https://github.com/Alfresco/alfresco-ng2-components/wiki/Commit-format)
|
||||
* Push your branch to GitHub:
|
||||
|
||||
```shell
|
||||
git push origin dev-{developerName}-{GitIssuedId/JiraIssueId}
|
||||
```
|
||||
|
||||
* In GitHub, send a pull request to `development`.
|
||||
* If we suggest changes then:
|
||||
* Make the required updates.
|
||||
* Re-run the tests.
|
||||
* Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
|
||||
|
||||
```shell
|
||||
git fetch development
|
||||
git checkout dev-my-branch
|
||||
git rebase development -i
|
||||
git push -f
|
||||
```
|
||||
Note: If you need more information about how to sync your fork, see [here](https://help.github.com/articles/syncing-a-fork/)
|
||||
|
||||
## Code style
|
||||
|
||||
The code style in the ADF code follows the [Angular style guide](https://angular.io/guide/styleguide) plus some internal rules.
|
||||
You don’t have to worry too much about those rules because they are automatically checked by tslint/codelyzer/adf-rules.
|
||||
If your code is not compliant to one of these rules you will receive an error when you build the project with some help on how to fix it.
|
||||
The ADF-Rules :
|
||||
* File name component/directive cannot start with Alfresco/Activiti/adf - this rule is to help developers find files easily
|
||||
* Class names cannot start with Alfresco/Activiti/adf for the same reason as above
|
||||
* scss is mandatory. All the classes need to have the adf- prefix
|
||||
|
||||
## Test guide
|
||||
In ADF we are encouraging the use of behavior-driven development (BDD)
|
||||
|
||||
### General guidelines
|
||||
|
||||
* Class selector in all the tests is not suggested. Use of the element ID is preferred
|
||||
* Any test case should test only one behavior
|
||||
* Use of the Angular [testBed](https://angular.io/guide/testing#testbed) is highly recommended
|
||||
|
||||
### File name
|
||||
|
||||
* The file name specification as to be the same of the component/service/pipe it test plus the .spec. suffix
|
||||
* The specification file has to be in the same folder of the component/service/pipe it test
|
||||
|
||||
### Describer Name
|
||||
|
||||
* The Main describer of the test should be the name of the class under test
|
||||
* The sub describe is used for grouping related behavior test. Do not over use it
|
||||
|
||||
### Test Name
|
||||
|
||||
Any test should follow the naming convetion:
|
||||
|
||||
[Should] [ ***Expected Behavior** ] [when/after/before] [ ***State Under Test*** ].
|
||||
+2
-2
@@ -18,7 +18,7 @@ However, there are use-cases that Share does not fit very well, such as:
|
||||
This is where this application development framework comes into play, it can be used to create exactly the user interface
|
||||
(i.e. web client) that the requirements demand.
|
||||
|
||||
The framework consists of a number of components that can be combined together to form a customized content management application.
|
||||
The framework consists of several components that can be combined to form a customized content management application.
|
||||
Here is a list of some of the available web components:
|
||||
|
||||
- [Core library](ng2-components/ng2-alfresco-core/README.md)
|
||||
@@ -36,6 +36,6 @@ An architecture overview looks like this:
|
||||
<img title="alfresco-ng2-components-architecture" alt='alfresco' src='assets/alfresco-app-dev-framework-architecture.png'></img>
|
||||
</p>
|
||||
|
||||
Here we can also see that there is an Alfresco JavaScript framework in use that wraps the Alfresco REST API. To make things easier for the client developer.
|
||||
Here we can also see that there is an Alfresco JavaScript framework in use that wraps the Alfresco REST API, to make things easier for the client developer.
|
||||
|
||||
|
||||
|
||||
@@ -85,6 +85,6 @@ All components are supported in the following browsers:
|
||||
|Edge |13, 14 |
|
||||
|Internet Explorer |11 |
|
||||
|
||||
* Due to a [known Firefox issue] (https://bugzilla.mozilla.org/show_bug.cgi?id=1188880),the Alfresco Upload Component does not currently support folder upload functionality on Firefox
|
||||
* Due to a [Firefox known issue](https://bugzilla.mozilla.org/show_bug.cgi?id=1188880), the Alfresco Upload Component does not currently support folder upload functionality on Firefox.
|
||||
|
||||
Please refer to [Browser Support](BROWSER-SUPPORT.md) article for more details.
|
||||
Please refer to the [Browser Support](BROWSER-SUPPORT.md) article for more details.
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const Lint = require("tslint");
|
||||
const sprintf_js_1 = require("sprintf-js");
|
||||
const walkerFactory_1 = require("codelyzer/walkerFactory/walkerFactory");
|
||||
const walkerFn_1 = require("codelyzer/walkerFactory/walkerFn");
|
||||
const function_1 = require("codelyzer/util/function");
|
||||
class Rule extends Lint.Rules.AbstractRule {
|
||||
static invalidName(className) {
|
||||
var whiteList = ['ActivitiContentComponent', 'ActivitiForm'];
|
||||
var classNameReg = /^(alfresco|activiti|adf|activity)/ig;
|
||||
var classNameMatch = classNameReg.exec(className);
|
||||
var isWhiteListName = whiteList.find((currentWhiteListName) => {
|
||||
return currentWhiteListName === className;
|
||||
});
|
||||
if (classNameMatch && !isWhiteListName) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
apply(sourceFile) {
|
||||
return this.applyWithWalker(Rule.walkerBuilder(sourceFile, this.getOptions()));
|
||||
}
|
||||
}
|
||||
Rule.metadata = {
|
||||
ruleName: 'adf-class-name',
|
||||
type: 'maintainability',
|
||||
description: `Enforce consistent name avoid prefix`,
|
||||
descriptionDetails: `See more at https://angular.io/styleguide#style-05-13.`,
|
||||
rationale: `Consistent conventions make it easy to quickly identify class when you search with autocomplete.`,
|
||||
options: null,
|
||||
optionsDescription: "Not configurable.",
|
||||
typescriptOnly: true,
|
||||
};
|
||||
Rule.FAILURE_STRING = 'The name of the class should not start with ADF Alfresco or Activiti prefix ';
|
||||
Rule.walkerBuilder = walkerFn_1.all(walkerFn_1.validateComponent((meta, suffixList) => function_1.Maybe.lift(meta.controller)
|
||||
.fmap(controller => controller.name)
|
||||
.fmap(name => {
|
||||
const className = name.text;
|
||||
if (Rule.invalidName(className)) {
|
||||
return [new walkerFactory_1.Failure(name, sprintf_js_1.sprintf(Rule.FAILURE_STRING + className, className, suffixList))];
|
||||
}
|
||||
})));
|
||||
exports.Rule = Rule;
|
||||
@@ -0,0 +1,61 @@
|
||||
import * as Lint from 'tslint';
|
||||
import * as ts from 'typescript';
|
||||
import {sprintf} from 'sprintf-js';
|
||||
import {ComponentMetadata} from 'codelyzer/angular/metadata';
|
||||
import {Failure} from 'codelyzer/walkerFactory/walkerFactory';
|
||||
import {all, validateComponent} from 'codelyzer/walkerFactory/walkerFn';
|
||||
import {Maybe, F2} from 'codelyzer/util/function';
|
||||
import {IOptions} from 'tslint';
|
||||
import {NgWalker} from 'codelyzer/angular/ngWalker';
|
||||
|
||||
export class Rule extends Lint.Rules.AbstractRule {
|
||||
|
||||
public static metadata: Lint.IRuleMetadata = {
|
||||
ruleName: 'adf-class-name',
|
||||
type: 'maintainability',
|
||||
description: `Enforce consistent name avoid prefix`,
|
||||
descriptionDetails: `See more at https://angular.io/styleguide#style-05-13.`,
|
||||
rationale: `Consistent conventions make it easy to quickly identify class when you search with autocomplete.`,
|
||||
options: null,
|
||||
optionsDescription: "Not configurable.",
|
||||
typescriptOnly: true,
|
||||
};
|
||||
|
||||
public static FAILURE_STRING = 'The name of the class should not start with ADF Alfresco or Activiti prefix ';
|
||||
|
||||
static walkerBuilder: F2<ts.SourceFile, IOptions, NgWalker> =
|
||||
all(
|
||||
validateComponent((meta: ComponentMetadata, suffixList?: string[]) =>
|
||||
Maybe.lift(meta.controller)
|
||||
.fmap(controller => controller.name)
|
||||
.fmap(name => {
|
||||
const className = name.text;
|
||||
if (Rule.invalidName(className)) {
|
||||
return [new Failure(name, sprintf(Rule.FAILURE_STRING + className , className, suffixList))];
|
||||
}
|
||||
})
|
||||
));
|
||||
|
||||
static invalidName(className: string): boolean {
|
||||
var whiteList = ['ActivitiContentComponent', 'ActivitiForm'];
|
||||
|
||||
var classNameReg = /^(alfresco|activiti|adf|activity)/ig;
|
||||
var classNameMatch = classNameReg.exec(className);
|
||||
|
||||
var isWhiteListName = whiteList.find((currentWhiteListName)=>{
|
||||
return currentWhiteListName === className;
|
||||
});
|
||||
|
||||
if (classNameMatch && !isWhiteListName) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
|
||||
return this.applyWithWalker(
|
||||
Rule.walkerBuilder(sourceFile, this.getOptions())
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const Lint = require("tslint");
|
||||
class Rule extends Lint.Rules.AbstractRule {
|
||||
apply(sourceFile) {
|
||||
return this.applyWithWalker(new AdfFileName(sourceFile, this.getOptions()));
|
||||
}
|
||||
}
|
||||
Rule.metadata = {
|
||||
ruleName: 'adf-file-name',
|
||||
type: 'maintainability',
|
||||
description: `Enforce consistent name avoid prefix`,
|
||||
descriptionDetails: `See more at https://angular.io/styleguide#style-05-13.`,
|
||||
rationale: `Consistent conventions make it easy to quickly identify files when you search with autocomplete.`,
|
||||
options: null,
|
||||
optionsDescription: "Not configurable.",
|
||||
typescriptOnly: true,
|
||||
};
|
||||
Rule.FAILURE_STRING = 'The name of the File should not start with ADF Alfresco or Activiti prefix ';
|
||||
exports.Rule = Rule;
|
||||
class AdfFileName extends Lint.RuleWalker {
|
||||
visitSourceFile(node) {
|
||||
var whiteList = ['activiti-content.component.ts', 'activiti-alfresco.service.ts', 'activiti-content-service.ts',
|
||||
'alfresco-api.service.ts', 'alfresco-settings.service.ts', 'alfresco-content.service.ts',
|
||||
'activiti-content.component.spec.ts', 'activiti-alfresco.service.spec.ts', 'activiti-content-service.spec.ts',
|
||||
'alfresco-api.service.spec.ts', 'alfresco-settings.service.spec.ts', 'alfresco-content.service.spec.ts',
|
||||
'activiti-content.service.spec.ts', 'activiti-content.service.ts'];
|
||||
var fileName = this.getFilename();
|
||||
var fileNameReg = /^(alfresco|activiti|adf|activity)/ig;
|
||||
var filenameMatch = fileNameReg.exec(fileName);
|
||||
var isWhiteListName = whiteList.find((currentWhiteListName) => {
|
||||
return currentWhiteListName === fileName;
|
||||
});
|
||||
if (filenameMatch && !isWhiteListName) {
|
||||
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING + fileName));
|
||||
super.visitSourceFile(node);
|
||||
}
|
||||
}
|
||||
getFilename() {
|
||||
const filename = this.getSourceFile().fileName;
|
||||
const lastSlash = filename.lastIndexOf('/');
|
||||
if (lastSlash > -1) {
|
||||
return filename.substring(lastSlash + 1);
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import * as ts from "typescript";
|
||||
import * as Lint from "tslint";
|
||||
|
||||
|
||||
export class Rule extends Lint.Rules.AbstractRule {
|
||||
public static metadata: Lint.IRuleMetadata = {
|
||||
ruleName: 'adf-file-name',
|
||||
type: 'maintainability',
|
||||
description: `Enforce consistent name avoid prefix`,
|
||||
descriptionDetails: `See more at https://angular.io/styleguide#style-05-13.`,
|
||||
rationale: `Consistent conventions make it easy to quickly identify files when you search with autocomplete.`,
|
||||
options: null,
|
||||
optionsDescription: "Not configurable.",
|
||||
typescriptOnly: true,
|
||||
};
|
||||
|
||||
public static FAILURE_STRING = 'The name of the File should not start with ADF Alfresco or Activiti prefix ';
|
||||
|
||||
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
|
||||
return this.applyWithWalker(new AdfFileName(sourceFile, this.getOptions()));
|
||||
}
|
||||
}
|
||||
|
||||
// The walker takes care of all the work.
|
||||
class AdfFileName extends Lint.RuleWalker {
|
||||
public visitSourceFile(node: ts.SourceFile) {
|
||||
var whiteList = ['activiti-content.component.ts', 'activiti-alfresco.service.ts', 'activiti-content-service.ts',
|
||||
'alfresco-api.service.ts', 'alfresco-settings.service.ts', 'alfresco-content.service.ts',
|
||||
'activiti-content.component.spec.ts', 'activiti-alfresco.service.spec.ts', 'activiti-content-service.spec.ts',
|
||||
'alfresco-api.service.spec.ts', 'alfresco-settings.service.spec.ts', 'alfresco-content.service.spec.ts',
|
||||
'activiti-content.service.spec.ts', 'activiti-content.service.ts'];
|
||||
|
||||
var fileName = this.getFilename();
|
||||
|
||||
var fileNameReg = /^(alfresco|activiti|adf|activity)/ig;
|
||||
var filenameMatch = fileNameReg.exec(fileName);
|
||||
|
||||
var isWhiteListName = whiteList.find((currentWhiteListName)=>{
|
||||
return currentWhiteListName === fileName;
|
||||
});
|
||||
|
||||
if (filenameMatch && !isWhiteListName) {
|
||||
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING + fileName));
|
||||
super.visitSourceFile(node);
|
||||
}
|
||||
}
|
||||
|
||||
private getFilename(): string {
|
||||
const filename = this.getSourceFile().fileName;
|
||||
const lastSlash = filename.lastIndexOf('/');
|
||||
if (lastSlash > -1) {
|
||||
return filename.substring(lastSlash + 1);
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var adfClassNameRule_1 = require("./adfClassNameRule");
|
||||
exports.ADFClassNameRule = adfClassNameRule_1.Rule;
|
||||
var adfFileNameRule_1 = require("./adfFileNameRule");
|
||||
exports.ComponentSelectorRule = adfFileNameRule_1.Rule;
|
||||
@@ -0,0 +1,2 @@
|
||||
export { Rule as ADFClassNameRule } from './adfClassNameRule';
|
||||
export { Rule as ComponentSelectorRule } from './adfFileNameRule';
|
||||
Generated
+2141
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "adf-tslint-rules",
|
||||
"description": "Custom Rules for the ADF project",
|
||||
"version": "0.0.3",
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"tscv": "tsc --version",
|
||||
"tsc": "tsc",
|
||||
"tsc:watch": "tsc --w"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Eugenio Romano",
|
||||
"email": "eugenio.romano@alfresco.com"
|
||||
}
|
||||
],
|
||||
"devDependencies": {
|
||||
"@angular/compiler": "^4.2.3",
|
||||
"@angular/core": "^4.2.3",
|
||||
"@types/chai": "^3.4.33",
|
||||
"@types/less": "0.0.31",
|
||||
"@types/mocha": "^2.2.32",
|
||||
"@types/node": "^6.0.41",
|
||||
"@types/node-sass": "^3.10.31",
|
||||
"@types/source-map": "^0.5.0",
|
||||
"@types/sprintf-js": "0.0.27",
|
||||
"chai": "^3.5.0",
|
||||
"chai-spies": "^0.7.1",
|
||||
"minimalist": "1.0.0",
|
||||
"mocha": "3.0.2",
|
||||
"node-sass": "^3.13.0",
|
||||
"rimraf": "^2.5.2",
|
||||
"rxjs": "5.4.1",
|
||||
"ts-node": "1.2.2",
|
||||
"tslint": "^5.0.0",
|
||||
"typescript": "2.4.0",
|
||||
"zone.js": "^0.8.4",
|
||||
"js-yaml": "^3.8.4",
|
||||
"json-stringify-pretty-compact": "^1.0.4",
|
||||
"@types/js-yaml": "^3.5.31"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslint": "^5.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"app-root-path": "^2.0.1",
|
||||
"css-selector-tokenizer": "^0.7.0",
|
||||
"cssauron": "^1.4.0",
|
||||
"semver-dsl": "^1.0.1",
|
||||
"source-map": "^0.5.6",
|
||||
"sprintf-js": "^1.0.3",
|
||||
"codelyzer": "3.1.2"
|
||||
},
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"declaration": false,
|
||||
"noImplicitAny": false,
|
||||
"removeComments": true,
|
||||
"lib": ["es6", "es2015", "dom"],
|
||||
"noLib": false,
|
||||
"typeRoots": [
|
||||
"./node_modules/@types",
|
||||
"./node_modules"
|
||||
],
|
||||
"types": [
|
||||
"mocha",
|
||||
"chai",
|
||||
"node",
|
||||
"sprintf-js"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rules": {
|
||||
"adf-file-naming": true
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
# ADF Demo Application
|
||||
|
||||
Please note that this application is not an official product, but a testing and demo application to showcase complex interactions for ADF components.
|
||||
Please note that this application is not an official product, but a testing and demo application to showcase complex interactions of ADF components.
|
||||
|
||||
## Installing
|
||||
|
||||
To correctly use this demo check that on your machine is running [Node](https://nodejs.org/en/) version 5.x.x or higher.
|
||||
To correctly use this demo check that on your machine you have [Node](https://nodejs.org/en/) version 5.x.x or higher.
|
||||
|
||||
```sh
|
||||
git clone https://github.com/Alfresco/alfresco-ng2-components.git
|
||||
@@ -15,7 +15,7 @@ npm install
|
||||
|
||||
## Proxy settings and CORS
|
||||
|
||||
To simplify development and reduce the time to get started the application features the following Proxy settings:
|
||||
To simplify development and reduce the time to get the application started, we have the following Proxy settings:
|
||||
|
||||
- **http://localhost:3000/ecm** is mapped to **http://localhost:8080**
|
||||
- **http://localhost:3000/bpm** is mapped to **http://localhost:9999**
|
||||
@@ -82,18 +82,18 @@ npm run start:dist
|
||||
```
|
||||
|
||||
This command builds project in `production` mode.
|
||||
All output is placed to `dist` folder and can be served your preferred web server.
|
||||
All output is placed to `dist` folder and can be served to your preferred web server.
|
||||
You should need no additional files outside the `dist` folder.
|
||||
|
||||
### Important notes
|
||||
|
||||
By default demo application is configured to use [wsrv](https://www.npmjs.com/package/wsrv) tool (lightweight web server)
|
||||
to serve production build output. It will be running at `0.0.0.0` address with port `3000` and allow you accessing your application
|
||||
via network. However you can use any web server of your choice in production.
|
||||
to serve production build output. It will be running at `0.0.0.0` address with port `3000` and allow you to access your application
|
||||
via network. However, you can use any web server of your choice in production.
|
||||
|
||||
## Development branch build
|
||||
|
||||
If you want to run the demo shell with the latest change from the development branch, use the following command from the /script folder:
|
||||
If you want to run the demo shell with the latest changes from the development branch, use the following command from the /script folder:
|
||||
|
||||
```sh
|
||||
./npm-clean.sh
|
||||
|
||||
@@ -1,7 +1,29 @@
|
||||
{
|
||||
"ecmHost": "http://localhost:3000/ecm",
|
||||
"bpmHost": "http://localhost:3000/bpm",
|
||||
"ecmHost": "http://{hostname}:{port}/ecm",
|
||||
"bpmHost": "http://{hostname}:{port}/bpm",
|
||||
"application": {
|
||||
"name": "Alfresco"
|
||||
},
|
||||
"pagination": {
|
||||
"size": 25
|
||||
},
|
||||
"files": {
|
||||
"excluded": [".DS_Store", "desktop.ini", ".git"]
|
||||
},
|
||||
"activiti": {
|
||||
"rest": {
|
||||
"fields": [
|
||||
{
|
||||
"processId": "0",
|
||||
"taskId": "7501",
|
||||
"fieldId": "label10",
|
||||
"values": [
|
||||
{ "id": "f1", "name": "Field 1" },
|
||||
{ "id": "f2", "name": "Field 2" },
|
||||
{ "id": "f3", "name": "Field 3" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,29 @@
|
||||
{
|
||||
"ecmHost": "http://localhost:3000/ecm",
|
||||
"bpmHost": "http://localhost:3000/bpm",
|
||||
"ecmHost": "http://{hostname}",
|
||||
"bpmHost": "http://{hostname}",
|
||||
"application": {
|
||||
"name": "Alfresco"
|
||||
},
|
||||
"pagination": {
|
||||
"size": 25
|
||||
},
|
||||
"files": {
|
||||
"excluded": [".DS_Store", "desktop.ini", ".git"]
|
||||
},
|
||||
"activiti": {
|
||||
"rest": {
|
||||
"fields": [
|
||||
{
|
||||
"processId": "0",
|
||||
"taskId": "7501",
|
||||
"fieldId": "label10",
|
||||
"values": [
|
||||
{ "id": "f1", "name": "Field 1" },
|
||||
{ "id": "f2", "name": "Field 2" },
|
||||
{ "id": "f3", "name": "Field 3" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,7 @@
|
||||
@media screen and (max-width: 1024px) {
|
||||
.mdl-layout__header {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1024px) {
|
||||
.mdl-layout__header {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.mdl-layout-title {
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.user-profile {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.mdl-button-padding {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.mdl-navigation__link {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mdl-navigation__link label {
|
||||
cursor: pointer;
|
||||
.app-menu--spacer {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
@@ -1,73 +1,74 @@
|
||||
<!-- Always shows a header, even in smaller screens. -->
|
||||
<div mdl class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
|
||||
<header class="mdl-layout__header main_header_adf" [ngClass]="{hide: isAPageWithHeaderBar()}">
|
||||
<div class="mdl-button-padding mdl-layout__header-row">
|
||||
<md-toolbar color="primary" *ngIf="!isAPageWithHeaderBar()">
|
||||
<ng2-alfresco-userinfo
|
||||
class="user-profile"
|
||||
[menuOpenType]="left">
|
||||
</ng2-alfresco-userinfo>
|
||||
|
||||
<!-- User Info -->
|
||||
<ng2-alfresco-userinfo class="user-profile" [menuOpenType]="left">
|
||||
</ng2-alfresco-userinfo>
|
||||
<span>ADF Demo Application</span>
|
||||
|
||||
<!-- Title -->
|
||||
<span class="mdl-layout-title">Demo Application</span>
|
||||
<!-- Add spacer, to align navigation to the right -->
|
||||
<div class="mdl-layout-spacer"></div>
|
||||
<div class="app-menu--spacer"></div>
|
||||
|
||||
<!-- Search bar -->
|
||||
<search-bar (expand)="onToggleSearch($event)"></search-bar>
|
||||
<search-bar (expand)="onToggleSearch($event)"></search-bar>
|
||||
|
||||
<!-- Navigation. We hide it in small screens. -->
|
||||
<nav class="mdl-navigation mdl-layout--large-screen-only">
|
||||
<a class="mdl-navigation__link" data-automation-id="home" href="" routerLink="/">Home</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="files" href="" routerLink="/files">DocumentList</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="activiti" href="" routerLink="/activiti">Process Services</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="form" href="" routerLink="/form">Form</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="login" href="" routerLink="/login">Login</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="settings" href="" routerLink="/settings">Settings</a>
|
||||
</nav>
|
||||
<a md-button data-automation-id="home" href="" routerLink="/">Home</a>
|
||||
<a md-button data-automation-id="files" href="" routerLink="/files">Content Services</a>
|
||||
<a md-button data-automation-id="activiti" href="" routerLink="/activiti">Process Services</a>
|
||||
<a md-button data-automation-id="login" href="" routerLink="/login">Login</a>
|
||||
|
||||
</div>
|
||||
</header>
|
||||
<button md-icon-button [mdMenuTriggerFor]="langMenu">
|
||||
<md-icon>language</md-icon>
|
||||
</button>
|
||||
<md-menu #langMenu="mdMenu">
|
||||
<button md-menu-item (click)="changeLanguage('en')">English</button>
|
||||
<button md-menu-item (click)="changeLanguage('it')">Italian</button>
|
||||
<button md-menu-item (click)="changeLanguage('ru')">Russian</button>
|
||||
</md-menu>
|
||||
|
||||
<div class="mdl-layout__drawer">
|
||||
<nav class="mdl-navigation">
|
||||
<a class="mdl-navigation__link" (click)="onLogout($event)">
|
||||
<label tabindex="0">Logout</label>
|
||||
</a>
|
||||
</nav>
|
||||
<span class="mdl-layout-title">Languages</span>
|
||||
<nav class="mdl-navigation">
|
||||
<a class="mdl-navigation__link" (click)="changeLanguage('en')">
|
||||
<span class="adf-flag-icon adf-flag-icon-gb"></span>
|
||||
<label tabindex="0"> English</label>
|
||||
</a>
|
||||
<a class="mdl-navigation__link" (click)="changeLanguage('it')">
|
||||
<span class="adf-flag-icon adf-flag-icon-it"></span>
|
||||
<label tabindex="0"> Italian</label>
|
||||
</a>
|
||||
<a class="mdl-navigation__link" (click)="changeLanguage('ru')">
|
||||
<span class="adf-flag-icon adf-flag-icon-ru"></span>
|
||||
<label tabindex="0"> Russian</label>
|
||||
</a>
|
||||
</nav>
|
||||
<span class="mdl-layout-title">Components</span>
|
||||
<nav class="mdl-navigation">
|
||||
<a class="mdl-navigation__link" href="" routerLink="/" (click)="hideDrawer()">Home</a>
|
||||
<a class="mdl-navigation__link" href="" routerLink="/files" (click)="hideDrawer()">DocumentList</a>
|
||||
<a class="mdl-navigation__link" href="" routerLink="/datatable" (click)="hideDrawer()">DataTable</a>
|
||||
<a class="mdl-navigation__link" href="" routerLink="/uploader" (click)="hideDrawer()">Uploader</a>
|
||||
<a class="mdl-navigation__link" href="" routerLink="/login" (click)="hideDrawer()">Login</a>
|
||||
<a class="mdl-navigation__link" href="" routerLink="/activiti" (click)="hideDrawer()">Process Services</a>
|
||||
<a class="mdl-navigation__link" href="" routerLink="/webscript" (click)="hideDrawer()">Webscript</a>
|
||||
<a class="mdl-navigation__link" href="" routerLink="/tag" (click)="hideDrawer()">Tag</a>
|
||||
<a class="mdl-navigation__link" href="" routerLink="/social" (click)="hideDrawer()">Social</a>
|
||||
<a class="mdl-navigation__link" href="" routerLink="/about" (click)="hideDrawer()">About</a>
|
||||
<a class="mdl-navigation__link" href="" routerLink="/settings" (click)="hideDrawer()">Settings</a>
|
||||
</nav>
|
||||
</div>
|
||||
<main class="mdl-layout__content" (dragover)="onDragOverMainPage($event)"
|
||||
(drop)="onDragOverMainPage($event)">
|
||||
<div class="page-content">
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
<button md-icon-button [mdMenuTriggerFor]="appMenu">
|
||||
<md-icon>more_vert</md-icon>
|
||||
</button>
|
||||
<md-menu #appMenu="mdMenu">
|
||||
<a md-menu-item href="" routerLink="/datatable">
|
||||
<md-icon>view_module</md-icon>
|
||||
<span>DataTable</span>
|
||||
</a>
|
||||
<a md-menu-item href="" routerLink="/form">
|
||||
<md-icon>poll</md-icon>
|
||||
<span>Form</span>
|
||||
</a>
|
||||
<a md-menu-item href="" routerLink="/form-list">
|
||||
<md-icon>library_books</md-icon>
|
||||
<span>Form List</span>
|
||||
</a>
|
||||
<a md-menu-item href="" routerLink="/uploader">
|
||||
<md-icon>file_upload</md-icon>
|
||||
<span>Uploader</span>
|
||||
</a>
|
||||
<a md-menu-item href="" routerLink="/webscript">
|
||||
<md-icon>extension</md-icon>
|
||||
<span>Webscript</span>
|
||||
</a>
|
||||
<a md-menu-item href="" routerLink="/tag">
|
||||
<md-icon>local_offer</md-icon>
|
||||
<span>Tag</span>
|
||||
</a>
|
||||
<a md-menu-item href="" routerLink="/social">
|
||||
<md-icon>thumb_up</md-icon>
|
||||
<span>Social</span>
|
||||
</a>
|
||||
<a md-menu-item href="" routerLink="/settings">
|
||||
<md-icon>settings</md-icon>
|
||||
<span>Settings</span>
|
||||
</a>
|
||||
<a md-menu-item href="" routerLink="/about">
|
||||
<md-icon>info_outline</md-icon>
|
||||
<span>About</span>
|
||||
</a>
|
||||
<button md-menu-item (click)="onLogout($event)">
|
||||
<md-icon>exit_to_app</md-icon>
|
||||
<span>Logout</span>
|
||||
</button>
|
||||
</md-menu>
|
||||
</md-toolbar>
|
||||
|
||||
<router-outlet></router-outlet>
|
||||
|
||||
@@ -18,17 +18,17 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import {
|
||||
AlfrescoTranslationService,
|
||||
AlfrescoAuthenticationService,
|
||||
AlfrescoSettingsService,
|
||||
StorageService,
|
||||
LogService
|
||||
AlfrescoTranslationService,
|
||||
LogService,
|
||||
StorageService
|
||||
} from 'ng2-alfresco-core';
|
||||
|
||||
declare var document: any;
|
||||
|
||||
@Component({
|
||||
selector: 'alfresco-app',
|
||||
selector: 'adf-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.css']
|
||||
})
|
||||
@@ -42,10 +42,6 @@ export class AppComponent {
|
||||
private storage: StorageService,
|
||||
private logService: LogService) {
|
||||
this.setProvider();
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('app', 'resources');
|
||||
}
|
||||
}
|
||||
|
||||
isAPageWithHeaderBar(): boolean {
|
||||
@@ -72,7 +68,6 @@ export class AppComponent {
|
||||
|
||||
navigateToLogin() {
|
||||
this.router.navigate(['/login']);
|
||||
this.hideDrawer();
|
||||
}
|
||||
|
||||
onToggleSearch(event) {
|
||||
@@ -87,12 +82,6 @@ export class AppComponent {
|
||||
|
||||
changeLanguage(lang: string) {
|
||||
this.translateService.use(lang);
|
||||
this.hideDrawer();
|
||||
}
|
||||
|
||||
hideDrawer() {
|
||||
// todo: workaround for drawer closing
|
||||
document.querySelector('.mdl-layout').MaterialLayout.toggleDrawer();
|
||||
}
|
||||
|
||||
private setProvider() {
|
||||
@@ -100,9 +89,4 @@ export class AppComponent {
|
||||
this.settingsService.setProviders(this.storage.getItem(`providers`));
|
||||
}
|
||||
}
|
||||
|
||||
onDragOverMainPage(event: any): boolean {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,50 +18,56 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
|
||||
import { CoreModule, AppConfigService } from 'ng2-alfresco-core';
|
||||
import { SearchModule } from 'ng2-alfresco-search';
|
||||
import { LoginModule } from 'ng2-alfresco-login';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { DocumentListModule } from 'ng2-alfresco-documentlist';
|
||||
import { UploadModule } from 'ng2-alfresco-upload';
|
||||
import { TagModule } from 'ng2-alfresco-tag';
|
||||
import { SocialModule } from 'ng2-alfresco-social';
|
||||
import { WebScriptModule } from 'ng2-alfresco-webscript';
|
||||
import { ViewerModule } from 'ng2-alfresco-viewer';
|
||||
import { ActivitiFormModule } from 'ng2-activiti-form';
|
||||
import { ActivitiTaskListModule } from 'ng2-activiti-tasklist';
|
||||
import { ActivitiProcessListModule } from 'ng2-activiti-processlist';
|
||||
import { UserInfoComponentModule } from 'ng2-alfresco-userinfo';
|
||||
import { AnalyticsModule } from 'ng2-activiti-analytics';
|
||||
import { DiagramsModule } from 'ng2-activiti-diagrams';
|
||||
import { ActivitiFormModule } from 'ng2-activiti-form';
|
||||
import { ActivitiProcessListModule } from 'ng2-activiti-processlist';
|
||||
import { ActivitiTaskListModule } from 'ng2-activiti-tasklist';
|
||||
import { AppConfigService, CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { DocumentListModule } from 'ng2-alfresco-documentlist';
|
||||
import { LoginModule } from 'ng2-alfresco-login';
|
||||
import { SearchModule } from 'ng2-alfresco-search';
|
||||
import { SocialModule } from 'ng2-alfresco-social';
|
||||
import { TagModule } from 'ng2-alfresco-tag';
|
||||
import { UploadModule } from 'ng2-alfresco-upload';
|
||||
import { UserInfoComponentModule } from 'ng2-alfresco-userinfo';
|
||||
import { ViewerModule } from 'ng2-alfresco-viewer';
|
||||
import { WebScriptModule } from 'ng2-alfresco-webscript';
|
||||
|
||||
import { MaterialModule } from './material.module';
|
||||
import { Editor3DModule } from 'ng2-3d-editor';
|
||||
import { ChartsModule } from 'ng2-charts';
|
||||
import { AppComponent } from './app.component';
|
||||
import { routing } from './app.routes';
|
||||
import { CustomEditorsModule } from './components/activiti/custom-editor/custom-editor.component';
|
||||
import { Editor3DModule } from 'ng2-3d-editor';
|
||||
import { ChartsModule } from 'ng2-charts';
|
||||
import { CreateFolderDialog } from './dialogs/create-folder.dialog';
|
||||
import { MaterialModule } from './material.module';
|
||||
import { DebugAppConfigService } from './services/debug-app-config.service';
|
||||
|
||||
import { CreateFolderDialogComponent } from './dialogs/create-folder.dialog';
|
||||
import { DownloadZipDialogComponent } from './dialogs/download-zip.dialog';
|
||||
|
||||
import { FormListDemoComponent } from './components/form/form-list-demo.component';
|
||||
|
||||
import {
|
||||
HomeComponent,
|
||||
DataTableDemoComponent,
|
||||
SearchComponent,
|
||||
SearchBarComponent,
|
||||
LoginDemoComponent,
|
||||
ActivitiDemoComponent,
|
||||
ActivitiShowDiagramComponent,
|
||||
ActivitiAppsView,
|
||||
FormViewer,
|
||||
WebscriptComponent,
|
||||
TagComponent,
|
||||
SocialComponent,
|
||||
AboutComponent,
|
||||
ActivitiAppsViewComponent,
|
||||
ActivitiDemoComponent,
|
||||
ActivitiProcessAttachmentsComponent,
|
||||
ActivitiShowDiagramComponent,
|
||||
ActivitiTaskAttachmentsComponent,
|
||||
DataTableDemoComponent,
|
||||
FilesComponent,
|
||||
FormNodeViewer,
|
||||
FormDemoComponent,
|
||||
FormNodeViewerComponent,
|
||||
FormViewerComponent,
|
||||
HomeComponent,
|
||||
LoginDemoComponent,
|
||||
SearchBarComponent,
|
||||
SearchComponent,
|
||||
SettingsComponent,
|
||||
FormDemoComponent
|
||||
SocialComponent,
|
||||
TagComponent,
|
||||
WebscriptComponent
|
||||
} from './components/index';
|
||||
|
||||
let appConfigFile = 'app.config-dev.json';
|
||||
@@ -104,25 +110,38 @@ if (process.env.ENV === 'production') {
|
||||
SearchBarComponent,
|
||||
LoginDemoComponent,
|
||||
ActivitiDemoComponent,
|
||||
ActivitiTaskAttachmentsComponent,
|
||||
ActivitiProcessAttachmentsComponent,
|
||||
ActivitiShowDiagramComponent,
|
||||
ActivitiAppsView,
|
||||
FormViewer,
|
||||
ActivitiAppsViewComponent,
|
||||
FormViewerComponent,
|
||||
WebscriptComponent,
|
||||
TagComponent,
|
||||
SocialComponent,
|
||||
AboutComponent,
|
||||
FilesComponent,
|
||||
FormNodeViewer,
|
||||
CreateFolderDialog,
|
||||
FormNodeViewerComponent,
|
||||
CreateFolderDialogComponent,
|
||||
DownloadZipDialogComponent,
|
||||
SettingsComponent,
|
||||
FormDemoComponent
|
||||
FormDemoComponent,
|
||||
FormListDemoComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AppConfigService, useClass: DebugAppConfigService }
|
||||
{ provide: AppConfigService, useClass: DebugAppConfigService },
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'app',
|
||||
source: 'resources'
|
||||
}
|
||||
}
|
||||
],
|
||||
bootstrap: [ AppComponent ],
|
||||
entryComponents: [
|
||||
CreateFolderDialog
|
||||
CreateFolderDialogComponent,
|
||||
DownloadZipDialogComponent
|
||||
]
|
||||
})
|
||||
export class AppModule { }
|
||||
|
||||
@@ -15,30 +15,31 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ModuleWithProviders } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { AuthGuard, AuthGuardEcm, AuthGuardBpm } from 'ng2-alfresco-core';
|
||||
import { ModuleWithProviders } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { AuthGuard, AuthGuardBpm, AuthGuardEcm } from 'ng2-alfresco-core';
|
||||
|
||||
import {
|
||||
HomeComponent,
|
||||
FilesComponent,
|
||||
DataTableDemoComponent,
|
||||
SearchComponent,
|
||||
LoginDemoComponent,
|
||||
AboutComponent,
|
||||
ActivitiAppsViewComponent,
|
||||
ActivitiDemoComponent,
|
||||
ActivitiShowDiagramComponent,
|
||||
ActivitiAppsView,
|
||||
WebscriptComponent,
|
||||
TagComponent,
|
||||
SocialComponent,
|
||||
AboutComponent,
|
||||
FormViewer,
|
||||
FormNodeViewer,
|
||||
DataTableDemoComponent,
|
||||
FilesComponent,
|
||||
FormDemoComponent,
|
||||
FormNodeViewerComponent,
|
||||
FormViewerComponent,
|
||||
HomeComponent,
|
||||
LoginDemoComponent,
|
||||
SearchComponent,
|
||||
SettingsComponent,
|
||||
FormDemoComponent
|
||||
SocialComponent,
|
||||
TagComponent,
|
||||
WebscriptComponent
|
||||
} from './components/index';
|
||||
|
||||
import { UploadButtonComponent } from 'ng2-alfresco-upload';
|
||||
import { FormListDemoComponent } from './components/form/form-list-demo.component';
|
||||
|
||||
export const appRoutes: Routes = [
|
||||
{ path: 'login', component: LoginDemoComponent },
|
||||
@@ -79,12 +80,12 @@ export const appRoutes: Routes = [
|
||||
},
|
||||
{
|
||||
path: 'activiti',
|
||||
component: ActivitiAppsView,
|
||||
component: ActivitiAppsViewComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps',
|
||||
component: ActivitiAppsView,
|
||||
component: ActivitiAppsViewComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
@@ -93,7 +94,12 @@ export const appRoutes: Routes = [
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/diagram/:processDefinitionId',
|
||||
path: 'activiti/apps/:appId/processes',
|
||||
component: ActivitiDemoComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps/:appId/diagram/:processDefinitionId',
|
||||
component: ActivitiShowDiagramComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
@@ -106,13 +112,13 @@ export const appRoutes: Routes = [
|
||||
// TODO: check if needed
|
||||
{
|
||||
path: 'activiti/tasks/:id',
|
||||
component: FormViewer,
|
||||
component: FormViewerComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
// TODO: check if needed
|
||||
{
|
||||
path: 'activiti/tasksnode/:id',
|
||||
component: FormNodeViewer,
|
||||
component: FormNodeViewerComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
@@ -132,7 +138,8 @@ export const appRoutes: Routes = [
|
||||
},
|
||||
{ path: 'about', component: AboutComponent },
|
||||
{ path: 'settings', component: SettingsComponent },
|
||||
{ path: 'form', component: FormDemoComponent }
|
||||
{ path: 'form', component: FormDemoComponent },
|
||||
{ path: 'form-list', component: FormListDemoComponent }
|
||||
];
|
||||
|
||||
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
.about-container {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.adf-table-version {
|
||||
width: 60%;
|
||||
border: 0;
|
||||
border-spacing: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,101 @@
|
||||
<div class="about-container">
|
||||
|
||||
<h3>Server settings</h3>
|
||||
<small>The values below are taken from the AppConfigService and loaded from the '{{ configFile }}' file.</small>
|
||||
<div>
|
||||
Alfresco Process Services URL: <strong>{{ bpmHost }}</strong>
|
||||
</div>
|
||||
<md-list>
|
||||
<small>The values below are taken from the AppConfigService and loaded from the '{{ configFile }}' file.</small>
|
||||
<md-list-item>
|
||||
<h4 md-line> Alfresco Process Services URL: {{ bpmHost }}</h4>
|
||||
</md-list-item>
|
||||
<md-divider></md-divider>
|
||||
<md-list-item>
|
||||
<h4 md-line>Alfresco Content Services URL: {{ ecmHost }}</h4>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
|
||||
<div>
|
||||
Alfresco Content Services URL: <strong>{{ ecmHost }}</strong>
|
||||
<h3>Product Versions</h3>
|
||||
<div *ngIf="bpmVersion">
|
||||
<h3>BPM</h3>
|
||||
<label> Edition </label> {{ bpmVersion.edition }}
|
||||
<p></p>
|
||||
<table border="2" class="adf-table-version">
|
||||
<tr>
|
||||
<th>Major Version</th>
|
||||
<th>Revision Version</th>
|
||||
<th>Minor Version</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
<tr style="align-items: center">
|
||||
<td>{{ bpmVersion.majorVersion }}</td>
|
||||
<td>{{ bpmVersion.revisionVersion }}</td>
|
||||
<td>{{ bpmVersion.minorVersion }}</td>
|
||||
<td>{{ bpmVersion.type }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div *ngIf="ecmVersion">
|
||||
<h3>ECM</h3>
|
||||
<label> Edition </label> {{ ecmVersion.edition }}
|
||||
<p></p>
|
||||
<label> Version </label> {{ ecmVersion.version.display }}
|
||||
<p></p>
|
||||
<h4>License</h4>
|
||||
<table border="2" class="adf-table-version">
|
||||
<tr>
|
||||
<th> Issued At </th>
|
||||
<th> Expires At </th>
|
||||
<th> Remaining Days </th>
|
||||
<th> Holder </th>
|
||||
<th> Mode </th>
|
||||
<th> Is Cluster Enabled </th>
|
||||
<th> Is Cryptodoc Enable </th>
|
||||
</tr>
|
||||
<tr style="align-items: center">
|
||||
<td>{{ ecmVersion.license.issuedAt }}</td>
|
||||
<td>{{ ecmVersion.license.expiresAt }}</td>
|
||||
<td>{{ ecmVersion.license.remainingDays }}</td>
|
||||
<td>{{ ecmVersion.license.holder }}</td>
|
||||
<td>{{ ecmVersion.license.mode }}</td>
|
||||
<td>{{ ecmVersion.license.isClusterEnabled }}</td>
|
||||
<td>{{ ecmVersion.license.isCryptodocEnabled }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h4> Status</h4>
|
||||
<table border="2" class="adf-table-version">
|
||||
<tr>
|
||||
<th> ReadOnly </th>
|
||||
<th> Is Audit Enable </th>
|
||||
<th> Is quick shared enable </th>
|
||||
<th> Thumbnail Generation </th>
|
||||
</tr>
|
||||
<tr style="align-items: center">
|
||||
<td>{{ ecmVersion.status.isReadOnly }}</td>
|
||||
<td>{{ ecmVersion.status.isAuditEnabled }}</td>
|
||||
<td>{{ ecmVersion.status.isQuickShareEnabled }}</td>
|
||||
<td>{{ ecmVersion.status.isThumbnailGenerationEnabled }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h4>Modules</h4>
|
||||
<table border="2" class="adf-table-version">
|
||||
<tr>
|
||||
<th> ID </th>
|
||||
<th> Title </th>
|
||||
<th> Description </th>
|
||||
<th> Version </th>
|
||||
<th> Install Date </th>
|
||||
<th> Install State </th>
|
||||
<th> Version Minor </th>
|
||||
<th> Version Max </th>
|
||||
</tr>
|
||||
<tr *ngFor="let module of ecmVersion.modules" style="align-items: center">
|
||||
<td>{{ module.id }}</td>
|
||||
<td>{{ module.title }}</td>
|
||||
<td>{{ module.description }}</td>
|
||||
<td>{{ module.version }}</td>
|
||||
<td>{{ module.installDate }}</td>
|
||||
<td>{{ module.installState }}</td>
|
||||
<td>{{ module.versionMin }}</td>
|
||||
<td>{{ module.versionMax }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div *ngIf="githubUrlCommitAlpha">
|
||||
@@ -18,7 +106,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<h3>Packages</h3>
|
||||
<small>Current project is using the following ADF libraries:</small>
|
||||
<alfresco-datatable [data]="data"></alfresco-datatable>
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Http } from '@angular/http';
|
||||
import { AlfrescoAuthenticationService, AppConfigService, BpmProductVersionModel, DiscoveryApiService, EcmProductVersionModel, LogService } from 'ng2-alfresco-core';
|
||||
import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
import { LogService, AppConfigService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'about-page',
|
||||
@@ -34,12 +34,30 @@ export class AboutComponent implements OnInit {
|
||||
ecmHost: string = '';
|
||||
bpmHost: string = '';
|
||||
|
||||
ecmVersion: EcmProductVersionModel = null;
|
||||
bpmVersion: BpmProductVersionModel = null;
|
||||
|
||||
constructor(private http: Http,
|
||||
private appConfig: AppConfigService,
|
||||
private logService: LogService) {
|
||||
private authService: AlfrescoAuthenticationService,
|
||||
private logService: LogService,
|
||||
private discovery: DiscoveryApiService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
if (this.authService.isEcmLoggedIn()) {
|
||||
this.discovery.getEcmProductInfo().subscribe((ecmVers) => {
|
||||
this.ecmVersion = ecmVers;
|
||||
});
|
||||
}
|
||||
|
||||
if (this.authService.isBpmLoggedIn()) {
|
||||
this.discovery.getBpmProductInfo().subscribe((bpmVers) => {
|
||||
this.bpmVersion = bpmVers;
|
||||
});
|
||||
}
|
||||
|
||||
this.http.get('/versions.json').subscribe(response => {
|
||||
let regexp = new RegExp('^(ng2-activiti|ng2-alfresco|alfresco-)');
|
||||
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
.list-column {
|
||||
width: 320px;
|
||||
}
|
||||
|
||||
.mdl-layout__header {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
<div class="mdl-grid">
|
||||
<div class="mdl-cell mdl-cell--2-col task-column mdl-shadow--2dp">
|
||||
<div class="list-buttons">
|
||||
<activiti-start-task
|
||||
[appId]="appId"
|
||||
(onSuccess)="onStartTaskSuccess($event)">
|
||||
</activiti-start-task>
|
||||
<button md-raised-button data-automation-id="btn-start-task" (click)="navigateStartTask()">
|
||||
<md-icon>add</md-icon>
|
||||
<span>START TASK</span>
|
||||
</button>
|
||||
</div>
|
||||
<adf-accordion>
|
||||
<adf-accordion-group [heading]="'Tasks'" [isSelected]="true" [isOpen]="true" [headingIcon]="'assignment'">
|
||||
@@ -38,7 +38,7 @@
|
||||
</adf-accordion-group>
|
||||
</adf-accordion>
|
||||
</div>
|
||||
<div class="mdl-cell mdl-cell--3-col task-column mdl-shadow--2dp list-column">
|
||||
<div class="mdl-cell mdl-cell--3-col task-column mdl-shadow--2dp" *ngIf="taskFilter && !isStartTaskMode()">
|
||||
<activiti-tasklist
|
||||
[appId]="taskFilter?.appId"
|
||||
[processDefinitionKey]="taskFilter?.filter?.processDefinitionKey"
|
||||
@@ -62,38 +62,45 @@
|
||||
-->
|
||||
</activiti-tasklist>
|
||||
</div>
|
||||
<div class="mdl-cell mdl-cell--7-col task-column mdl-shadow--2dp">
|
||||
<div class="mdl-cell mdl-cell--7-col task-column mdl-shadow--2dp" *ngIf="!isStartTaskMode()"
|
||||
[class.mdl-cell--7-col]="taskFilter && !isStartTaskMode()"
|
||||
[class.mdl-cell--10-col]="!taskFilter || isStartTaskMode()">
|
||||
<activiti-task-details #activitidetails
|
||||
[debugMode]="true"
|
||||
[taskId]="currentTaskId"
|
||||
[fieldValidators]="fieldValidators"
|
||||
(formCompleted)="onFormCompleted($event)"
|
||||
(formContentClicked)="onFormContentClick($event)"
|
||||
(taskCreated)="onTaskCreated($event)"
|
||||
(assignTask)="onAssignTask()"
|
||||
(taskDeleted)="onTaskDeleted($event)">
|
||||
</activiti-task-details>
|
||||
<hr>
|
||||
<div id="attachment-task-list" *ngIf="currentTaskId">
|
||||
<h5>Attachments</h5>
|
||||
<div class="adf-no-form-container">
|
||||
<div class="action-header">
|
||||
<button [attr.disabled]="isTaskCompleted()" class="mdl-button mdl-js-button" (click)="toggleCreateTakAttach()">
|
||||
Attach Document
|
||||
<i class="material-icons">add</i>
|
||||
</button>
|
||||
</div>
|
||||
<adf-task-attachment-list #taskAttach
|
||||
*ngIf="currentTaskId"
|
||||
[taskId]="currentTaskId"
|
||||
(attachmentClick)="onAttachmentClick($event)">
|
||||
</adf-task-attachment-list>
|
||||
<div *ngIf="isCreateTaskAttachVisible()">
|
||||
<adf-create-task-attachment *ngIf="currentTaskId"
|
||||
[taskId]="currentTaskId"
|
||||
(success)="onCreateTaskSuccess()">
|
||||
</adf-create-task-attachment>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="currentTaskId">
|
||||
Task Audit log
|
||||
<button
|
||||
adf-task-audit
|
||||
[task-id]="currentTaskId"
|
||||
[download]="true"
|
||||
md-icon-button (clicked)="onAuditClick($event)" (error)="onAuditError($event)" >
|
||||
<md-icon>assignment_ind</md-icon>
|
||||
</button>
|
||||
<hr>
|
||||
</div>
|
||||
<md-card>
|
||||
<md-card-content>
|
||||
<activiti-task-attachments
|
||||
[taskId]="currentTaskId">
|
||||
</activiti-task-attachments>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
</div>
|
||||
<div class="mdl-cell mdl-cell--10-col task-column mdl-shadow--2dp" *ngIf="isStartTaskMode()">
|
||||
<adf-start-task
|
||||
[appId]="appId"
|
||||
(success)="onStartTaskSuccess($event)"
|
||||
(cancel)="onCancelStartTask()">
|
||||
</adf-start-task>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -127,7 +134,7 @@
|
||||
</adf-accordion-group>
|
||||
</adf-accordion>
|
||||
</div>
|
||||
<div class="mdl-cell mdl-cell--3-col task-column list-column mdl-shadow--2dp" *ngIf="processFilter && !isStartProcessMode()">
|
||||
<div class="mdl-cell mdl-cell--3-col task-column mdl-shadow--2dp" *ngIf="processFilter && !isStartProcessMode()">
|
||||
<activiti-process-instance-list
|
||||
*ngIf="processFilter?.hasFilter()" [appId]="processFilter.appId"
|
||||
[processDefinitionKey]="processFilter.filter.processDefinitionKey"
|
||||
@@ -156,28 +163,32 @@
|
||||
(taskClick)="onProcessDetailsTaskClick($event)">
|
||||
</activiti-process-instance-details>
|
||||
<hr>
|
||||
<div id="attachment-process-list" *ngIf="currentProcessInstanceId">
|
||||
<h5>Attachments</h5>
|
||||
<div class="action-header">
|
||||
<button id="show_process_attach" class="mdl-button mdl-js-button" (click)="toggleCreateProcessAttach()">
|
||||
Attach Document
|
||||
<i class="material-icons">add</i>
|
||||
</button>
|
||||
</div>
|
||||
<adf-process-attachment-list *ngIf="currentProcessInstanceId"
|
||||
[processInstanceId]="currentProcessInstanceId"
|
||||
(attachmentClick)="onAttachmentClick($event)">
|
||||
</adf-process-attachment-list>
|
||||
<div *ngIf="isCreateProcessAttachVisible()">
|
||||
<adf-create-process-attachment *ngIf="currentProcessInstanceId"
|
||||
[processInstanceId]="currentProcessInstanceId"
|
||||
(contentCreated)="onContentCreated()">
|
||||
</adf-create-process-attachment>
|
||||
</div>
|
||||
<div *ngIf="currentProcessInstanceId">
|
||||
Process Audit log
|
||||
<button adf-process-audit
|
||||
[process-id]="currentProcessInstanceId"
|
||||
[download]="true" md-icon-button
|
||||
[format]="'pdf'"
|
||||
(clicked)="onAuditClick($event)"
|
||||
(error)="onAuditError($event)">
|
||||
<md-icon>assignment_ind</md-icon>
|
||||
</button>
|
||||
<hr>
|
||||
</div>
|
||||
<md-card>
|
||||
<md-card-content>
|
||||
<activiti-process-attachments
|
||||
[processId]="currentProcessInstanceId">
|
||||
</activiti-process-attachments>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
</div>
|
||||
<div class="mdl-cell mdl-cell--10-col task-column mdl-shadow--2dp" *ngIf="isStartProcessMode()">
|
||||
<activiti-start-process [appId]="appId" (start)="onStartProcessInstance($event)"></activiti-start-process>
|
||||
<adf-start-process
|
||||
[appId]="appId"
|
||||
(start)="onStartProcessInstance($event)"
|
||||
(cancel)="onCancelProcessInstance()">
|
||||
</adf-start-process>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,74 +15,69 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AfterViewInit, Component, ElementRef, Input, ViewChild } from '@angular/core';
|
||||
import {
|
||||
ActivitiApps,
|
||||
ActivitiFilters,
|
||||
ActivitiTaskList,
|
||||
ActivitiTaskDetails,
|
||||
FilterRepresentationModel,
|
||||
TaskDetailsEvent,
|
||||
TaskAttachmentListComponent
|
||||
} from 'ng2-activiti-tasklist';
|
||||
import {
|
||||
ActivitiProcessFilters,
|
||||
ActivitiProcessInstanceDetails,
|
||||
ActivitiProcessInstanceListComponent,
|
||||
ActivitiStartProcessInstance,
|
||||
FilterProcessRepresentationModel,
|
||||
ProcessInstance,
|
||||
ActivitiProcessAttachmentListComponent
|
||||
} from 'ng2-activiti-processlist';
|
||||
import { AnalyticsReportListComponent } from 'ng2-activiti-analytics';
|
||||
// tslint:disable-next-line:adf-file-name
|
||||
import { AfterViewInit, Component, ElementRef, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
import { AnalyticsReportListComponent } from 'ng2-activiti-analytics';
|
||||
import { FORM_FIELD_VALIDATORS, FormEvent, FormFieldEvent, FormRenderingService, FormService } from 'ng2-activiti-form';
|
||||
import {
|
||||
ObjectDataTableAdapter,
|
||||
ObjectDataRow,
|
||||
DataSorting
|
||||
} from 'ng2-alfresco-datatable';
|
||||
FilterProcessRepresentationModel,
|
||||
ProcessFiltersComponent,
|
||||
ProcessInstance,
|
||||
ProcessInstanceDetailsComponent,
|
||||
ProcessInstanceListComponent,
|
||||
StartProcessInstanceComponent
|
||||
} from 'ng2-activiti-processlist';
|
||||
import {
|
||||
AppsListComponent,
|
||||
FilterRepresentationModel,
|
||||
TaskDetailsComponent,
|
||||
TaskDetailsEvent,
|
||||
TaskFiltersComponent,
|
||||
TaskListComponent
|
||||
} from 'ng2-activiti-tasklist';
|
||||
import { AlfrescoApiService } from 'ng2-alfresco-core';
|
||||
import { FormService, FormRenderingService, FormEvent, FormFieldEvent } from 'ng2-activiti-form';
|
||||
import {
|
||||
DataSorting,
|
||||
ObjectDataRow,
|
||||
ObjectDataTableAdapter
|
||||
} from 'ng2-alfresco-datatable';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
import { /*CustomEditorComponent*/ CustomStencil01 } from './custom-editor/custom-editor.component';
|
||||
import { DemoFieldValidator } from './demo-field-validator';
|
||||
|
||||
declare var componentHandler;
|
||||
|
||||
const currentProcessIdNew = '__NEW__';
|
||||
const currentTaskIdNew = '__NEW__';
|
||||
|
||||
@Component({
|
||||
selector: 'activiti-demo',
|
||||
templateUrl: './activiti-demo.component.html',
|
||||
styleUrls: ['./activiti-demo.component.css']
|
||||
})
|
||||
export class ActivitiDemoComponent implements AfterViewInit {
|
||||
export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit {
|
||||
|
||||
@ViewChild(ActivitiFilters)
|
||||
activitifilter: ActivitiFilters;
|
||||
@ViewChild(TaskFiltersComponent)
|
||||
activitifilter: TaskFiltersComponent;
|
||||
|
||||
@ViewChild(ActivitiTaskList)
|
||||
taskList: ActivitiTaskList;
|
||||
@ViewChild(TaskListComponent)
|
||||
taskList: TaskListComponent;
|
||||
|
||||
@ViewChild(TaskAttachmentListComponent)
|
||||
taskAttachList: TaskAttachmentListComponent;
|
||||
@ViewChild(ProcessFiltersComponent)
|
||||
activitiprocessfilter: ProcessFiltersComponent;
|
||||
|
||||
@ViewChild(ActivitiProcessFilters)
|
||||
activitiprocessfilter: ActivitiProcessFilters;
|
||||
@ViewChild(ProcessInstanceListComponent)
|
||||
processList: ProcessInstanceListComponent;
|
||||
|
||||
@ViewChild(ActivitiProcessInstanceListComponent)
|
||||
processList: ActivitiProcessInstanceListComponent;
|
||||
@ViewChild(ProcessInstanceDetailsComponent)
|
||||
activitiprocessdetails: ProcessInstanceDetailsComponent;
|
||||
|
||||
@ViewChild(ActivitiProcessInstanceDetails)
|
||||
activitiprocessdetails: ActivitiProcessInstanceDetails;
|
||||
@ViewChild(TaskDetailsComponent)
|
||||
activitidetails: TaskDetailsComponent;
|
||||
|
||||
@ViewChild(ActivitiTaskDetails)
|
||||
activitidetails: ActivitiTaskDetails;
|
||||
|
||||
@ViewChild(ActivitiProcessAttachmentListComponent)
|
||||
processAttachList: ActivitiProcessAttachmentListComponent;
|
||||
|
||||
@ViewChild(ActivitiStartProcessInstance)
|
||||
activitiStartProcess: ActivitiStartProcessInstance;
|
||||
@ViewChild(StartProcessInstanceComponent)
|
||||
activitiStartProcess: StartProcessInstanceComponent;
|
||||
|
||||
@ViewChild(AnalyticsReportListComponent)
|
||||
analyticsreportlist: AnalyticsReportListComponent;
|
||||
@@ -112,18 +107,21 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
sub: Subscription;
|
||||
blobFile: any;
|
||||
flag: boolean = true;
|
||||
createTaskAttach: boolean = false;
|
||||
createProcessAttach: boolean = false;
|
||||
|
||||
dataTasks: ObjectDataTableAdapter;
|
||||
dataProcesses: ObjectDataTableAdapter;
|
||||
|
||||
fieldValidators = [
|
||||
...FORM_FIELD_VALIDATORS,
|
||||
new DemoFieldValidator()
|
||||
];
|
||||
|
||||
constructor(private elementRef: ElementRef,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private apiService: AlfrescoApiService,
|
||||
private formRenderingService: FormRenderingService,
|
||||
private formService: FormService) {
|
||||
formRenderingService: FormRenderingService,
|
||||
formService: FormService) {
|
||||
this.dataTasks = new ObjectDataTableAdapter();
|
||||
this.dataTasks.setSorting(new DataSorting('created', 'desc'));
|
||||
|
||||
@@ -150,14 +148,19 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
console.log(`Field value changed. Form: ${e.form.id}, Field: ${e.field.id}, Value: ${e.field.value}`);
|
||||
});
|
||||
|
||||
// Uncomment this block to see form event handling in action
|
||||
/*
|
||||
formService.formEvents.subscribe((event: Event) => {
|
||||
console.log('Event fired:' + event.type);
|
||||
console.log('Event Target:' + event.target);
|
||||
});
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.router.url.includes('processes') ) {
|
||||
this.activeTab = 'processes';
|
||||
}
|
||||
this.sub = this.route.params.subscribe(params => {
|
||||
let applicationId = params['appId'];
|
||||
if (applicationId && applicationId !== '0') {
|
||||
@@ -169,7 +172,8 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
this.processFilter = null;
|
||||
this.currentProcessInstanceId = null;
|
||||
});
|
||||
this.layoutType = ActivitiApps.LAYOUT_GRID;
|
||||
this.layoutType = AppsListComponent.LAYOUT_GRID;
|
||||
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
@@ -200,6 +204,11 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
this.currentTaskId = event.id;
|
||||
}
|
||||
|
||||
onCancelStartTask() {
|
||||
this.currentTaskId = null;
|
||||
this.reloadTaskFilters();
|
||||
}
|
||||
|
||||
onSuccessTaskList(event: FilterRepresentationModel) {
|
||||
this.currentTaskId = this.taskList.getCurrentId();
|
||||
}
|
||||
@@ -244,16 +253,31 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
this.currentProcessInstanceId = currentProcessIdNew;
|
||||
}
|
||||
|
||||
navigateStartTask(): void {
|
||||
this.resetTaskFilters();
|
||||
this.reloadTaskFilters();
|
||||
this.currentTaskId = currentTaskIdNew;
|
||||
}
|
||||
|
||||
onStartProcessInstance(instance: ProcessInstance): void {
|
||||
this.currentProcessInstanceId = instance.id;
|
||||
this.activitiStartProcess.reset();
|
||||
this.resetProcessFilters();
|
||||
}
|
||||
|
||||
onCancelProcessInstance() {
|
||||
this.currentProcessInstanceId = null;
|
||||
this.reloadProcessFilters();
|
||||
}
|
||||
|
||||
isStartProcessMode(): boolean {
|
||||
return this.currentProcessInstanceId === currentProcessIdNew;
|
||||
}
|
||||
|
||||
isStartTaskMode(): boolean {
|
||||
return this.currentTaskId === currentTaskIdNew;
|
||||
}
|
||||
|
||||
processCancelled(data: any): void {
|
||||
this.currentProcessInstanceId = null;
|
||||
this.processList.reload();
|
||||
@@ -274,10 +298,12 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
this.contentName = content.name;
|
||||
}
|
||||
|
||||
onAttachmentClick(content: any): void {
|
||||
this.fileShowed = true;
|
||||
this.content = content.contentBlob;
|
||||
this.contentName = content.name;
|
||||
onAuditClick(event: any) {
|
||||
console.log(event);
|
||||
}
|
||||
|
||||
onAuditError(event: any): void {
|
||||
console.error('My custom error message' + event);
|
||||
}
|
||||
|
||||
onTaskCreated(data: any): void {
|
||||
@@ -310,7 +336,7 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
}
|
||||
|
||||
onShowProcessDiagram(event: any): void {
|
||||
this.router.navigate(['/activiti/diagram/' + event.value]);
|
||||
this.router.navigate(['/activiti/apps/' + this.appId + '/diagram/' + event.value]);
|
||||
}
|
||||
|
||||
onProcessDetailsTaskClick(event: TaskDetailsEvent): void {
|
||||
@@ -333,8 +359,16 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
this.processFilter = null;
|
||||
}
|
||||
|
||||
private resetTaskFilters(): void {
|
||||
this.taskFilter = null;
|
||||
}
|
||||
|
||||
private reloadProcessFilters(): void {
|
||||
this.activitiprocessfilter.selectFilter(null);
|
||||
this.activitiprocessfilter.selectFilter(this.activitiprocessfilter.getCurrentFilter());
|
||||
}
|
||||
|
||||
private reloadTaskFilters(): void {
|
||||
this.activitifilter.selectFilter(this.activitifilter.getCurrentFilter());
|
||||
}
|
||||
|
||||
onRowClick(event): void {
|
||||
@@ -345,33 +379,12 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
console.log(event);
|
||||
}
|
||||
|
||||
onCreateTaskSuccess(): void {
|
||||
this.taskAttachList.reload();
|
||||
this.toggleCreateTakAttach();
|
||||
}
|
||||
|
||||
onContentCreated() {
|
||||
this.processAttachList.reload();
|
||||
this.toggleCreateProcessAttach();
|
||||
}
|
||||
|
||||
toggleCreateTakAttach(): void {
|
||||
this.createTaskAttach = !this.createTaskAttach;
|
||||
}
|
||||
|
||||
isCreateTaskAttachVisible(): boolean {
|
||||
return this.createTaskAttach;
|
||||
}
|
||||
|
||||
toggleCreateProcessAttach(): void {
|
||||
this.createProcessAttach = !this.createProcessAttach;
|
||||
}
|
||||
|
||||
isCreateProcessAttachVisible(): boolean {
|
||||
return this.createProcessAttach;
|
||||
}
|
||||
|
||||
isTaskCompleted(): boolean {
|
||||
return this.activitidetails.isCompletedTask();
|
||||
}
|
||||
|
||||
onAssignTask() {
|
||||
this.taskList.reload();
|
||||
this.currentTaskId = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
adf-create-process-attachment >>> button {
|
||||
float: right;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<div id="attachment-process-list" *ngIf="processId">
|
||||
<h5>Attachments</h5>
|
||||
<div class="adf-no-form-container">
|
||||
<adf-upload-drag-area
|
||||
[parentId]="processId"
|
||||
[showNotificationBar]="false">
|
||||
<adf-process-attachment-list #processAttachList
|
||||
*ngIf="processId"
|
||||
[processInstanceId]="processId"
|
||||
(attachmentClick)="onAttachmentClick($event)">
|
||||
</adf-process-attachment-list>
|
||||
</adf-upload-drag-area>
|
||||
|
||||
<adf-create-process-attachment
|
||||
[processInstanceId]="processId"
|
||||
(success)="onFileUploadComplete($event)">
|
||||
</adf-create-process-attachment>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="fileShowed">
|
||||
<alfresco-viewer
|
||||
[(showViewer)]="fileShowed"
|
||||
[blobFile]="content"
|
||||
[displayName]="contentName"
|
||||
[overlayMode]="true">
|
||||
</alfresco-viewer>
|
||||
</div>
|
||||
@@ -0,0 +1,61 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { ProcessAttachmentListComponent, ProcessUploadService } from 'ng2-activiti-processlist';
|
||||
import { UploadService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'activiti-process-attachments',
|
||||
templateUrl: './activiti-process-attachments.component.html',
|
||||
styleUrls: ['./activiti-process-attachments.component.css'],
|
||||
providers: [
|
||||
{ provide: UploadService, useClass: ProcessUploadService }
|
||||
]
|
||||
})
|
||||
|
||||
export class ActivitiProcessAttachmentsComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
processId: string;
|
||||
|
||||
@ViewChild(ProcessAttachmentListComponent)
|
||||
processAttachList: ProcessAttachmentListComponent;
|
||||
|
||||
fileShowed: boolean = false;
|
||||
content: Blob;
|
||||
contentName: string;
|
||||
|
||||
constructor(private uploadService: UploadService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.uploadService.fileUploadComplete.subscribe(value => this.onFileUploadComplete(value.data));
|
||||
}
|
||||
|
||||
onFileUploadComplete(content: any) {
|
||||
this.processAttachList.add(content);
|
||||
}
|
||||
|
||||
onAttachmentClick(content: any): void {
|
||||
this.fileShowed = true;
|
||||
this.content = content.contentBlob;
|
||||
this.contentName = content.name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,9 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import {Location} from '@angular/common';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'activiti-show-diagram',
|
||||
@@ -27,23 +25,19 @@ import {Location} from '@angular/common';
|
||||
})
|
||||
export class ActivitiShowDiagramComponent {
|
||||
|
||||
sub: Subscription;
|
||||
processDefinitionId: string;
|
||||
appId: string;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private location: Location) {
|
||||
this.sub = this.route.params.subscribe(params => {
|
||||
private router: Router) {
|
||||
this.route.params.subscribe(params => {
|
||||
this.processDefinitionId = params['processDefinitionId'];
|
||||
this.appId = params['appId'];
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.sub.unsubscribe();
|
||||
}
|
||||
|
||||
onClickBack() {
|
||||
this.location.back();
|
||||
this.router.navigate(['/activiti/apps/' + this.appId + '/processes']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
adf-create-task-attachment >>> button {
|
||||
float: right;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<div id="attachment-task-list" *ngIf="taskId">
|
||||
<h5>Attachments</h5>
|
||||
<div class="adf-no-form-container">
|
||||
<adf-upload-drag-area
|
||||
[parentId]="taskId"
|
||||
[showNotificationBar]="false">
|
||||
<adf-task-attachment-list #taskAttachList
|
||||
*ngIf="taskId"
|
||||
[taskId]="taskId"
|
||||
(attachmentClick)="onAttachmentClick($event)">
|
||||
</adf-task-attachment-list>
|
||||
</adf-upload-drag-area>
|
||||
|
||||
<adf-create-task-attachment
|
||||
[taskId]="taskId"
|
||||
(success)="onFileUploadComplete($event)">
|
||||
</adf-create-task-attachment>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="fileShowed">
|
||||
<alfresco-viewer
|
||||
[(showViewer)]="fileShowed"
|
||||
[blobFile]="content"
|
||||
[displayName]="contentName"
|
||||
[overlayMode]="true">
|
||||
</alfresco-viewer>
|
||||
</div>
|
||||
@@ -0,0 +1,61 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { ProcessUploadService, TaskAttachmentListComponent } from 'ng2-activiti-tasklist';
|
||||
import { UploadService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'activiti-task-attachments',
|
||||
templateUrl: './activiti-task-attachments.component.html',
|
||||
styleUrls: ['./activiti-task-attachments.component.css'],
|
||||
providers: [
|
||||
{ provide: UploadService, useClass: ProcessUploadService }
|
||||
]
|
||||
})
|
||||
|
||||
export class ActivitiTaskAttachmentsComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
taskId: string;
|
||||
|
||||
@ViewChild(TaskAttachmentListComponent)
|
||||
taskAttachList: TaskAttachmentListComponent;
|
||||
|
||||
fileShowed: boolean = false;
|
||||
content: Blob;
|
||||
contentName: string;
|
||||
|
||||
constructor(private uploadService: UploadService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.uploadService.fileUploadComplete.subscribe(value => this.onFileUploadComplete(value.data));
|
||||
}
|
||||
|
||||
onFileUploadComplete(content: any) {
|
||||
this.taskAttachList.add(content);
|
||||
}
|
||||
|
||||
onAttachmentClick(content: any): void {
|
||||
this.fileShowed = true;
|
||||
this.content = content.contentBlob;
|
||||
this.contentName = content.name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { Router } from '@angular/router';
|
||||
import { AppDefinitionRepresentationModel } from 'ng2-activiti-tasklist';
|
||||
|
||||
@Component({
|
||||
@@ -25,9 +25,9 @@ import { AppDefinitionRepresentationModel } from 'ng2-activiti-tasklist';
|
||||
<activiti-apps (appClick)="onAppClicked($event)"></activiti-apps>
|
||||
`
|
||||
})
|
||||
export class ActivitiAppsView {
|
||||
export class ActivitiAppsViewComponent {
|
||||
|
||||
constructor(private router: Router, private route: ActivatedRoute) {
|
||||
constructor(private router: Router) {
|
||||
}
|
||||
|
||||
onAppClicked(app: AppDefinitionRepresentationModel) {
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NgModule, Component } from '@angular/core';
|
||||
/* tslint:disable */
|
||||
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { WidgetComponent } from 'ng2-activiti-form';
|
||||
|
||||
@Component({
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FormFieldModel, FormFieldTypes, FormFieldValidator } from 'ng2-activiti-form';
|
||||
|
||||
export class DemoFieldValidator implements FormFieldValidator {
|
||||
|
||||
isSupported(field: FormFieldModel): boolean {
|
||||
return field && field.type === FormFieldTypes.TEXT;
|
||||
}
|
||||
|
||||
validate(field: FormFieldModel): boolean {
|
||||
if (this.isSupported(field)) {
|
||||
if (field.value && field.value.toLowerCase() === 'admin') {
|
||||
field.validationSummary = 'Sorry, the value cannot be "admin".';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, OnInit, OnDestroy, AfterViewChecked } from '@angular/core';
|
||||
import { AfterViewChecked, Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
|
||||
@@ -26,7 +26,7 @@ declare var componentHandler;
|
||||
templateUrl: './form-node-viewer.component.html',
|
||||
styleUrls: ['./form-node-viewer.component.css']
|
||||
})
|
||||
export class FormNodeViewer implements OnInit, OnDestroy, AfterViewChecked {
|
||||
export class FormNodeViewerComponent implements OnInit, OnDestroy, AfterViewChecked {
|
||||
|
||||
nodeId: string;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, OnInit, OnDestroy, AfterViewChecked } from '@angular/core';
|
||||
import { AfterViewChecked, Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
|
||||
@@ -26,7 +26,7 @@ declare var componentHandler;
|
||||
templateUrl: './form-viewer.component.html',
|
||||
styleUrls: ['./form-viewer.component.css']
|
||||
})
|
||||
export class FormViewer implements OnInit, OnDestroy, AfterViewChecked {
|
||||
export class FormViewerComponent implements OnInit, OnDestroy, AfterViewChecked {
|
||||
|
||||
taskId: string;
|
||||
|
||||
|
||||
@@ -37,4 +37,5 @@
|
||||
<button md-raised-button (click)="addRow()">Add row</button>
|
||||
<button md-raised-button (click)="replaceRows()">Replace rows</button>
|
||||
<button md-raised-button (click)="replaceColumns()">Replace columns</button>
|
||||
<button md-raised-button (click)="getRowForNode()">Load Node</button>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
*/
|
||||
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { ObjectDataTableAdapter, DataSorting, ObjectDataRow, ObjectDataColumn, DataCellEvent, DataRowActionEvent } from 'ng2-alfresco-datatable';
|
||||
import { AlfrescoApiService } from 'ng2-alfresco-core';
|
||||
import { DataCellEvent, DataRowActionEvent, DataSorting, ObjectDataColumn, ObjectDataRow, ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
|
||||
@Component({
|
||||
selector: 'datatable-demo',
|
||||
@@ -43,7 +45,7 @@ export class DataTableDemoComponent {
|
||||
email: 'denys.vuika@alfresco.com'
|
||||
};
|
||||
|
||||
constructor() {
|
||||
constructor(private apiService: AlfrescoApiService) {
|
||||
this.reset();
|
||||
}
|
||||
|
||||
@@ -80,11 +82,11 @@ export class DataTableDemoComponent {
|
||||
}
|
||||
],
|
||||
[
|
||||
{type: 'image', key: 'icon', title: '', srTitle: 'Thumbnail'},
|
||||
{type: 'text', key: 'id', title: 'Id', sortable: true},
|
||||
{type: 'text', key: 'createdOn', title: 'Created On', sortable: true},
|
||||
{type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true},
|
||||
{type: 'text', key: 'createdBy.name', title: 'Created By', sortable: true}
|
||||
{ type: 'image', key: 'icon', title: '', srTitle: 'Thumbnail' },
|
||||
{ type: 'text', key: 'id', title: 'Id', sortable: true },
|
||||
{ type: 'text', key: 'createdOn', title: 'Created On', sortable: true },
|
||||
{ type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true },
|
||||
{ type: 'text', key: 'createdBy.name', title: 'Created By', sortable: true }
|
||||
]
|
||||
);
|
||||
|
||||
@@ -172,4 +174,33 @@ export class DataTableDemoComponent {
|
||||
onRowDblClick(event) {
|
||||
console.log(event);
|
||||
}
|
||||
|
||||
getRowForNode() {
|
||||
let opts: any = {
|
||||
includeSource: true,
|
||||
include: ['path', 'properties', 'allowableOperations']
|
||||
};
|
||||
|
||||
Observable.fromPromise(this.apiService.getInstance().nodes
|
||||
.getNodeInfo('-my-', opts)).subscribe((data) => {
|
||||
console.log('FUnNy');
|
||||
console.log(data);
|
||||
let objects = new ObjectDataTableAdapter([
|
||||
{
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
createdBy: data.createdByUser.displayName,
|
||||
createdOn: new Date(data.createdAt),
|
||||
icon: 'material-icons://face'
|
||||
}],
|
||||
[
|
||||
{ type: 'image', key: 'icon', title: '', srTitle: 'Thumbnail' },
|
||||
{ type: 'text', key: 'id', title: 'Id', sortable: true },
|
||||
{ type: 'text', key: 'createdOn', title: 'Created On', sortable: true },
|
||||
{ type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true },
|
||||
{ type: 'text', key: 'createdBy.name', title: 'Created By', sortable: true }
|
||||
]);
|
||||
this.data = objects;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,3 +19,42 @@
|
||||
.adf-not-overlay-viewer {
|
||||
height:900px;
|
||||
}
|
||||
|
||||
adf-document-list >>> adf-datatable tr.is-selected .image-table-cell {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
adf-document-list >>> adf-datatable tr.document-list__create {
|
||||
background: green !important;
|
||||
}
|
||||
|
||||
adf-document-list >>> adf-datatable tr.document-list__disable {
|
||||
background: red !important;
|
||||
}
|
||||
|
||||
adf-document-list >>> adf-datatable tr.is-selected .image-table-cell::before {
|
||||
content: "\E876"; /* "done" */
|
||||
font-family: "Material Icons";
|
||||
font-size: 24px;
|
||||
line-height: 32px;
|
||||
text-align: center;
|
||||
color: white;
|
||||
position: absolute;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -16px;
|
||||
margin-left: -14px;
|
||||
border-radius: 100%;
|
||||
background: #00bcd4;
|
||||
}
|
||||
|
||||
.adf-demo-site-container-style {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
width: 100%;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,26 +1,65 @@
|
||||
<div class="container">
|
||||
<div class="adf-demo-site-container-style" id="demo-container">
|
||||
<adf-sites-dropdown (change)="getSiteContent($event)">
|
||||
</adf-sites-dropdown>
|
||||
</div>
|
||||
<alfresco-upload-drag-area
|
||||
[rootFolderId]="documentList.currentFolderId"
|
||||
[parentId]="documentList.currentFolderId"
|
||||
[versioning]="versioning"
|
||||
[enabled]="documentList.hasCreatePermission()">
|
||||
<adf-breadcrumb
|
||||
[target]="documentList"
|
||||
[folderNode]="documentList.folderNode">
|
||||
</adf-breadcrumb>
|
||||
<div *ngIf="errorMessage" class="error-message">
|
||||
<button (click)="resetError()" class="mdl-button mdl-js-button mdl-button--icon">
|
||||
<i class="material-icons">highlight_off</i>
|
||||
<button (click)="resetError()" md-icon-button>
|
||||
<md-icon>highlight_off</md-icon>
|
||||
</button>
|
||||
<span class="error-message--text">{{errorMessage}}</span>
|
||||
</div>
|
||||
<ng-container *ngIf="useCustomToolbar">
|
||||
<adf-toolbar title="Toolbar">
|
||||
<button md-icon-button (click)="onCreateFolderClicked($event)">
|
||||
<adf-toolbar [color]="toolbarColor">
|
||||
<adf-toolbar-title>
|
||||
<adf-breadcrumb *ngIf="!useDropdownBreadcrumb"
|
||||
class="files-breadcrumb"
|
||||
root="Personal Files"
|
||||
[target]="documentList"
|
||||
[folderNode]="documentList.folderNode">
|
||||
</adf-breadcrumb>
|
||||
<adf-dropdown-breadcrumb *ngIf="useDropdownBreadcrumb"
|
||||
class="files-breadcrumb"
|
||||
[target]="documentList"
|
||||
[folderNode]="documentList.folderNode">
|
||||
</adf-dropdown-breadcrumb>
|
||||
</adf-toolbar-title>
|
||||
|
||||
<adf-toolbar-divider></adf-toolbar-divider>
|
||||
|
||||
<button md-icon-button
|
||||
(click)="onCreateFolderClicked($event)">
|
||||
<md-icon>create_new_folder</md-icon>
|
||||
</button>
|
||||
<button md-icon-button>
|
||||
<button md-icon-button
|
||||
[disabled]="!hasSelection(documentList.selection)"
|
||||
title="Download"
|
||||
(click)="downloadNodes(documentList.selection)">
|
||||
<md-icon>get_app</md-icon>
|
||||
</button>
|
||||
<button md-icon-button
|
||||
adf-node-permission="delete"
|
||||
[adf-nodes]="documentList.selection">
|
||||
<md-icon>delete</md-icon>
|
||||
</button>
|
||||
|
||||
<button md-icon-button [mdMenuTriggerFor]="themePicker">
|
||||
<md-icon>format_color_fill</md-icon>
|
||||
</button>
|
||||
|
||||
<md-menu #themePicker="mdMenu">
|
||||
<button md-menu-item (click)="toolbarColor = 'default'">Default</button>
|
||||
<button md-menu-item (click)="toolbarColor = 'primary'">Primary</button>
|
||||
<button md-menu-item (click)="toolbarColor = 'accent'">Accent</button>
|
||||
<button md-menu-item (click)="toolbarColor = 'warn'">Warn</button>
|
||||
</md-menu>
|
||||
|
||||
<adf-toolbar-divider></adf-toolbar-divider>
|
||||
|
||||
<button md-icon-button [mdMenuTriggerFor]="menu">
|
||||
<md-icon>more_vert</md-icon>
|
||||
</button>
|
||||
@@ -40,38 +79,32 @@
|
||||
</md-menu>
|
||||
</adf-toolbar>
|
||||
</ng-container>
|
||||
<alfresco-document-list
|
||||
<adf-document-list
|
||||
#documentList
|
||||
[permissionsStyle]="permissionsStyle"
|
||||
[creationMenuActions]="!useCustomToolbar"
|
||||
[currentFolderId]="currentFolderId"
|
||||
[contextMenuActions]="true"
|
||||
[contentActions]="true"
|
||||
[allowDropFiles]="true"
|
||||
[selectionMode]="selectionMode"
|
||||
[multiselect]="multiselect"
|
||||
(error)="onNavigationError($event)"
|
||||
(success)="resetError()"
|
||||
(preview)="showFile($event)"
|
||||
(folderChange)="onFolderChange($event)"
|
||||
(permissionError)="handlePermissionError($event)">
|
||||
<data-columns>
|
||||
<data-column key="$thumbnail" type="image" [sortable]="false"></data-column>
|
||||
<data-column
|
||||
key="$thumbnail"
|
||||
type="image"
|
||||
[sortable]="false"
|
||||
class="image-table-cell">
|
||||
</data-column>
|
||||
<data-column
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.DISPLAY_NAME' | translate}}"
|
||||
key="name"
|
||||
class="full-width ellipsis-cell">
|
||||
|
||||
<!-- Example #1: using custom template with implicit access to data context -->
|
||||
<!--
|
||||
<ng-template let-entry="$implicit">
|
||||
<span>Hi! {{entry.data.getValue(entry.row, entry.col)}}</span>
|
||||
</ng-template>
|
||||
-->
|
||||
|
||||
<!-- Example #2: using custom template with value access -->
|
||||
<!--
|
||||
<ng-template let-value="value">
|
||||
<span>Hi! {{value}}</span>
|
||||
</ng-template>
|
||||
-->
|
||||
|
||||
</data-column>
|
||||
<!-- Notes: has performance overhead due to multiple files/folders causing separate HTTP calls to get tags -->
|
||||
<!--
|
||||
@@ -79,57 +112,124 @@
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.TAG' | translate}}"
|
||||
key="id"
|
||||
class="full-width ellipsis-cell">
|
||||
<template let-entry="$implicit">
|
||||
<ng-template let-entry="$implicit">
|
||||
<alfresco-tag-node-list [nodeId]="entry.data.getValue(entry.row, entry.col)"></alfresco-tag-node-list>
|
||||
</template>
|
||||
</ng-template>
|
||||
</data-column>
|
||||
-->
|
||||
<data-column
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.CREATED_BY' | translate}}"
|
||||
key="createdByUser.displayName"
|
||||
class="desktop-only">
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.CREATED_BY' | translate}}"
|
||||
key="createdByUser.displayName"
|
||||
class="desktop-only">
|
||||
</data-column>
|
||||
<data-column
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.CREATED_ON' | translate}}"
|
||||
key="createdAt"
|
||||
type="date"
|
||||
format="medium"
|
||||
class="desktop-only">
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.CREATED' | translate}}"
|
||||
key="createdAt"
|
||||
type="date"
|
||||
format="medium"
|
||||
class="desktop-only">
|
||||
<ng-template let-value="value">
|
||||
<span title="{{ value }}">{{ value | adfTimeAgo }}</span>
|
||||
</ng-template>
|
||||
</data-column>
|
||||
</data-columns>
|
||||
|
||||
<content-actions>
|
||||
<!-- folder actions -->
|
||||
<content-action
|
||||
target="folder"
|
||||
permission="delete"
|
||||
[disableWithNoPermission]="true"
|
||||
title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.DELETE' | translate}}"
|
||||
(permissionEvent)="handlePermissionError($event)"
|
||||
handler="delete">
|
||||
icon="content_copy"
|
||||
target="folder"
|
||||
title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.COPY' | translate}}"
|
||||
permission="update"
|
||||
[disableWithNoPermission]="true"
|
||||
(error)="onContentActionError($event)"
|
||||
(success)="onContentActionSuccess($event)"
|
||||
handler="copy">
|
||||
</content-action>
|
||||
<content-action
|
||||
icon="redo"
|
||||
target="folder"
|
||||
title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.MOVE' | translate}}"
|
||||
permission="update"
|
||||
[disableWithNoPermission]="true"
|
||||
(error)="onContentActionError($event)"
|
||||
(success)="onContentActionSuccess($event)"
|
||||
handler="move">
|
||||
</content-action>
|
||||
<content-action
|
||||
icon="delete"
|
||||
target="folder"
|
||||
permission="delete"
|
||||
[disableWithNoPermission]="true"
|
||||
title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.DELETE' | translate}}"
|
||||
(permissionEvent)="handlePermissionError($event)"
|
||||
handler="delete">
|
||||
</content-action>
|
||||
<!-- document actions -->
|
||||
<content-action
|
||||
target="document"
|
||||
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.DOWNLOAD' | translate}}"
|
||||
handler="download">
|
||||
icon="content_copy"
|
||||
target="document"
|
||||
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.COPY' | translate}}"
|
||||
permission="update"
|
||||
[disableWithNoPermission]="true"
|
||||
(error)="onContentActionError($event)"
|
||||
(success)="onContentActionSuccess($event)"
|
||||
handler="copy">
|
||||
</content-action>
|
||||
<content-action
|
||||
target="document"
|
||||
permission="delete"
|
||||
[disableWithNoPermission]="true"
|
||||
(permissionEvent)="handlePermissionError($event)"
|
||||
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.DELETE' | translate}}"
|
||||
handler="delete">
|
||||
icon="redo"
|
||||
target="document"
|
||||
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.MOVE' | translate}}"
|
||||
permission="update"
|
||||
[disableWithNoPermission]="true"
|
||||
(error)="onContentActionError($event)"
|
||||
(success)="onContentActionSuccess($event)"
|
||||
handler="move">
|
||||
</content-action>
|
||||
<content-action
|
||||
icon="delete"
|
||||
target="document"
|
||||
permission="delete"
|
||||
[disableWithNoPermission]="true"
|
||||
(permissionEvent)="handlePermissionError($event)"
|
||||
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.DELETE' | translate}}"
|
||||
handler="delete">
|
||||
</content-action>
|
||||
</content-actions>
|
||||
</alfresco-document-list>
|
||||
</adf-document-list>
|
||||
</alfresco-upload-drag-area>
|
||||
</div>
|
||||
|
||||
<context-menu-holder></context-menu-holder>
|
||||
|
||||
<p>Current folder ID: {{ documentList.currentFolderId }}</p>
|
||||
|
||||
<div class="p-10">
|
||||
Selected Nodes:
|
||||
<ul>
|
||||
<li *ngFor="let node of documentList.selection">
|
||||
{{ node.entry.name }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<section *ngIf="!useViewerDialog">
|
||||
<md-slide-toggle [(ngModel)]="useInlineViewer">Use inline viewer (no overlay)</md-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<md-slide-toggle [(ngModel)]="useViewerDialog">Use File Viewer dialog</md-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<md-slide-toggle [(ngModel)]="multiselect">Multiselect (with checkboxes)</md-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<md-slide-toggle [(ngModel)]="useDropdownBreadcrumb">Dropdown breadcrumb</md-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<md-slide-toggle [(ngModel)]="useCustomToolbar">Use custom toolbar</md-slide-toggle>
|
||||
</section>
|
||||
@@ -192,29 +292,39 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<file-uploading-dialog #fileDialog></file-uploading-dialog>
|
||||
|
||||
<div *ngIf="fileShowed">
|
||||
<alfresco-viewer [(showViewer)]="fileShowed"
|
||||
[fileNodeId]="fileNodeId"
|
||||
[overlayMode]="true">
|
||||
|
||||
<extension-viewer [supportedExtensions]="['obj','3DS']" #extension>
|
||||
<ng-template let-urlFileContent="urlFileContent" let-extension="extension" >
|
||||
<threed-viewer [urlFile]="urlFileContent" [extension]="extension" ></threed-viewer>
|
||||
</ng-template>
|
||||
</extension-viewer>
|
||||
|
||||
</alfresco-viewer>
|
||||
|
||||
<!-- Comment the viewer above and uncomment that one below if you want test the overlay false viewer-->
|
||||
|
||||
<!--<div *ngIf="fileShowed" class="adf-not-overlay-viewer">-->
|
||||
<!--<alfresco-viewer [(showViewer)]="fileShowed"-->
|
||||
<!--[fileNodeId]="fileNodeId"-->
|
||||
<!--[overlayMode]="false">-->
|
||||
<!--</alfresco-viewer>-->
|
||||
<!--</div>-->
|
||||
|
||||
<div class="p-10">
|
||||
<p>For 'Multiple' selection mode use Cmd (macOS) or Ctrl (Win) to toggle selection of multiple items.</p>
|
||||
<md-select placeholder="Selection Mode" [(ngModel)]="selectionMode" name="food">
|
||||
<md-option *ngFor="let mode of selectionModes" [value]="mode.value">
|
||||
{{mode.viewValue}}
|
||||
</md-option>
|
||||
</md-select>
|
||||
</div>
|
||||
|
||||
<file-uploading-dialog #fileDialog></file-uploading-dialog>
|
||||
|
||||
<div *ngIf="showViewer">
|
||||
<ng-container *ngIf="!useInlineViewer">
|
||||
<alfresco-viewer
|
||||
[(showViewer)]="showViewer"
|
||||
[fileNodeId]="fileNodeId"
|
||||
[overlayMode]="true">
|
||||
|
||||
<extension-viewer [supportedExtensions]="['obj','3DS']" #extension>
|
||||
<ng-template let-urlFileContent="urlFileContent" let-extension="extension" >
|
||||
<threed-viewer [urlFile]="urlFileContent" [extension]="extension" ></threed-viewer>
|
||||
</ng-template>
|
||||
</extension-viewer>
|
||||
|
||||
</alfresco-viewer>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="useInlineViewer">
|
||||
<div class="adf-not-overlay-viewer">
|
||||
<alfresco-viewer
|
||||
[(showViewer)]="showViewer"
|
||||
[fileNodeId]="fileNodeId">
|
||||
</alfresco-viewer>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
||||
@@ -15,17 +15,23 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, OnInit, Optional, ViewChild, ChangeDetectorRef } from '@angular/core';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { ChangeDetectorRef, Component, Input, OnInit, Optional, ViewChild } from '@angular/core';
|
||||
import { MdDialog } from '@angular/material';
|
||||
import { AlfrescoContentService, FolderCreatedEvent, NotificationService } from 'ng2-alfresco-core';
|
||||
import { DocumentListComponent } from 'ng2-alfresco-documentlist';
|
||||
import { UploadService, FileUploadCompleteEvent } from 'ng2-alfresco-upload';
|
||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||
import { MinimalNodeEntity } from 'alfresco-js-api';
|
||||
import {
|
||||
AlfrescoApiService, AlfrescoContentService, AlfrescoTranslationService, FileUploadCompleteEvent,
|
||||
FolderCreatedEvent, NotificationService, SiteModel, UploadService
|
||||
} from 'ng2-alfresco-core';
|
||||
import { DocumentListComponent, PermissionStyleModel } from 'ng2-alfresco-documentlist';
|
||||
|
||||
import { CreateFolderDialog } from '../../dialogs/create-folder.dialog';
|
||||
import { CreateFolderDialogComponent } from '../../dialogs/create-folder.dialog';
|
||||
import { DownloadZipDialogComponent } from './../../dialogs/download-zip.dialog';
|
||||
|
||||
import { ViewerService } from 'ng2-alfresco-viewer';
|
||||
|
||||
@Component({
|
||||
selector: 'files-component',
|
||||
selector: 'adf-files-component',
|
||||
templateUrl: './files.component.html',
|
||||
styleUrls: ['./files.component.css']
|
||||
})
|
||||
@@ -35,9 +41,25 @@ export class FilesComponent implements OnInit {
|
||||
|
||||
errorMessage: string = null;
|
||||
fileNodeId: any;
|
||||
fileShowed: boolean = false;
|
||||
showViewer: boolean = false;
|
||||
|
||||
useCustomToolbar = true;
|
||||
toolbarColor = 'default';
|
||||
useDropdownBreadcrumb = false;
|
||||
useViewerDialog = true;
|
||||
useInlineViewer = false;
|
||||
|
||||
selectionModes = [
|
||||
{ value: 'none', viewValue: 'None' },
|
||||
{ value: 'single', viewValue: 'Single' },
|
||||
{ value: 'multiple', viewValue: 'Multiple' }
|
||||
];
|
||||
|
||||
@Input()
|
||||
selectionMode = 'multiple';
|
||||
|
||||
@Input()
|
||||
multiselect = false;
|
||||
|
||||
@Input()
|
||||
multipleFileUpload: boolean = false;
|
||||
@@ -63,23 +85,43 @@ export class FilesComponent implements OnInit {
|
||||
@ViewChild(DocumentListComponent)
|
||||
documentList: DocumentListComponent;
|
||||
|
||||
permissionsStyle: PermissionStyleModel[] = [];
|
||||
|
||||
constructor(private changeDetector: ChangeDetectorRef,
|
||||
private apiService: AlfrescoApiService,
|
||||
private notificationService: NotificationService,
|
||||
private uploadService: UploadService,
|
||||
private contentService: AlfrescoContentService,
|
||||
private dialog: MdDialog,
|
||||
private translateService: AlfrescoTranslationService,
|
||||
private viewerService: ViewerService,
|
||||
private router: Router,
|
||||
@Optional() private route: ActivatedRoute) {
|
||||
}
|
||||
|
||||
showFile(event) {
|
||||
if (event.value.entry.isFile) {
|
||||
this.fileNodeId = event.value.entry.id;
|
||||
this.fileShowed = true;
|
||||
if (this.useViewerDialog) {
|
||||
if (event.value.entry.isFile) {
|
||||
this.viewerService
|
||||
.showViewerForNode(event.value.entry)
|
||||
.then(result => {
|
||||
console.log(result);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.fileShowed = false;
|
||||
if (event.value.entry.isFile) {
|
||||
this.fileNodeId = event.value.entry.id;
|
||||
this.showViewer = true;
|
||||
} else {
|
||||
this.showViewer = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onFolderChange($event) {
|
||||
this.router.navigate(['/files', $event.value.id]);
|
||||
}
|
||||
|
||||
toggleFolder() {
|
||||
this.multipleFileUpload = false;
|
||||
this.folderUpload = !this.folderUpload;
|
||||
@@ -98,6 +140,9 @@ export class FilesComponent implements OnInit {
|
||||
|
||||
this.uploadService.fileUploadComplete.debounceTime(300).subscribe(value => this.onFileUploadComplete(value));
|
||||
this.contentService.folderCreated.subscribe(value => this.onFolderCreated(value));
|
||||
|
||||
// this.permissionsStyle.push(new PermissionStyleModel('document-list__create', PermissionsEnum.CREATE));
|
||||
// this.permissionsStyle.push(new PermissionStyleModel('document-list__disable', PermissionsEnum.NOT_CREATE, false, true));
|
||||
}
|
||||
|
||||
onNavigationError(err: any) {
|
||||
@@ -131,8 +176,31 @@ export class FilesComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
onContentActionError(errors) {
|
||||
const errorStatusCode = JSON.parse(errors.message).error.statusCode;
|
||||
let translatedErrorMessage: any;
|
||||
|
||||
switch (errorStatusCode) {
|
||||
case 403:
|
||||
translatedErrorMessage = this.translateService.get('OPERATION.ERROR.PERMISSION');
|
||||
break;
|
||||
case 409:
|
||||
translatedErrorMessage = this.translateService.get('OPERATION.ERROR.CONFLICT');
|
||||
break;
|
||||
default:
|
||||
translatedErrorMessage = this.translateService.get('OPERATION.ERROR.UNKNOWN');
|
||||
}
|
||||
|
||||
this.notificationService.openSnackMessage(translatedErrorMessage.value, 4000);
|
||||
}
|
||||
|
||||
onContentActionSuccess(message) {
|
||||
let translatedMessage: any = this.translateService.get(message);
|
||||
this.notificationService.openSnackMessage(translatedMessage.value, 4000);
|
||||
}
|
||||
|
||||
onCreateFolderClicked(event: Event) {
|
||||
let dialogRef = this.dialog.open(CreateFolderDialog);
|
||||
let dialogRef = this.dialog.open(CreateFolderDialogComponent);
|
||||
dialogRef.afterClosed().subscribe(folderName => {
|
||||
if (folderName) {
|
||||
this.contentService.createFolder('', folderName, this.documentList.currentFolderId).subscribe(
|
||||
@@ -142,4 +210,79 @@ export class FilesComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getSiteContent(site: SiteModel) {
|
||||
this.currentFolderId = site && site.guid ? site.guid : '-my-';
|
||||
}
|
||||
|
||||
hasSelection(selection: Array<MinimalNodeEntity>): boolean {
|
||||
return selection && selection.length > 0;
|
||||
}
|
||||
|
||||
downloadNodes(selection: Array<MinimalNodeEntity>) {
|
||||
if (!selection || selection.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (selection.length === 1) {
|
||||
this.downloadNode(selection[0]);
|
||||
} else {
|
||||
this.downloadZip(selection);
|
||||
}
|
||||
}
|
||||
|
||||
downloadNode(node: MinimalNodeEntity) {
|
||||
if (node && node.entry) {
|
||||
const entry = node.entry;
|
||||
|
||||
if (entry.isFile) {
|
||||
this.downloadFile(node);
|
||||
}
|
||||
|
||||
if (entry.isFolder) {
|
||||
this.downloadZip([node]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
downloadFile(node: MinimalNodeEntity) {
|
||||
if (node && node.entry) {
|
||||
const contentApi = this.apiService.getInstance().content;
|
||||
|
||||
const url = contentApi.getContentUrl(node.entry.id, true);
|
||||
const fileName = node.entry.name;
|
||||
|
||||
this.download(url, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
downloadZip(selection: Array<MinimalNodeEntity>) {
|
||||
if (selection && selection.length > 0) {
|
||||
const nodeIds = selection.map(node => node.entry.id);
|
||||
|
||||
const dialogRef = this.dialog.open(DownloadZipDialogComponent, {
|
||||
width: '600px',
|
||||
data: {
|
||||
nodeIds: nodeIds
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
console.log(result);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
download(url: string, fileName: string) {
|
||||
if (url && fileName) {
|
||||
const link = document.createElement('a');
|
||||
|
||||
link.style.display = 'none';
|
||||
link.download = fileName;
|
||||
link.href = url;
|
||||
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
.form-container {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.store-form-container{
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
}
|
||||
|
||||
@@ -1,32 +1,4 @@
|
||||
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
|
||||
<header class="mdl-layout__header">
|
||||
<div class="mdl-layout__tab-bar mdl-js-ripple-effect">
|
||||
<a id="demo-form" href="#demo" class="mdl-layout__tab" [class.is-active]="activeTab === 'demo'" (click)="changeToDemoForm()">DEMO</a>
|
||||
<a id="store-form" href="#store" class="mdl-layout__tab" [class.is-active]="activeTab === 'processes'" (click)="changeToStoreForm()">STORE</a>
|
||||
</div>
|
||||
</header>
|
||||
<main class="mdl-layout__content activiti">
|
||||
<section class="mdl-layout__tab-panel" [class.is-active]="activeTab === 'demo'" id="demo">
|
||||
<div class="form-container">
|
||||
<activiti-form [form]="form">
|
||||
</activiti-form>
|
||||
</div>
|
||||
</section>
|
||||
<section class="mdl-layout__tab-panel" [class.is-active]="activeTab === 'store'" id="store">
|
||||
<span>FORM NAME TO VISUALIZE</span>
|
||||
<input [(ngModel)]="formToLoadName" class="mdl-textfield__input" type="text" (ngModelChange)="loadForm()">
|
||||
<div *ngIf="formToLoadName && formToLoadName !== '' " class="store-form-container">
|
||||
<activiti-form [form]="form" [data]="restoredData" #storeForm>
|
||||
</activiti-form>
|
||||
<button class="mdl-button mdl-js-button" (click)="store()">STORE</button>
|
||||
<button class="mdl-button mdl-js-button" (click)="restore()">RESTORE</button>
|
||||
</div>
|
||||
<div>
|
||||
<span> Please create in APS the form with the name you entered</span>
|
||||
</div>
|
||||
<div *ngIf="showError">
|
||||
<span> Form Name not valid or form not present</span>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
<div class="form-container">
|
||||
<activiti-form [form]="form">
|
||||
</activiti-form>
|
||||
</div>
|
||||
|
||||
@@ -15,33 +15,25 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { FormModel, FormService } from 'ng2-activiti-form';
|
||||
import { InMemoryFormService } from '../../services/in-memory-form.service';
|
||||
import { DemoForm } from './demo-form';
|
||||
import { ActivitiForm } from 'ng2-activiti-form';
|
||||
|
||||
declare var componentHandler;
|
||||
|
||||
@Component({
|
||||
selector: 'form-demo',
|
||||
templateUrl: 'form-demo.component.html',
|
||||
styleUrls: [
|
||||
'form-demo.component.css'
|
||||
styleUrls: [ 'form-demo.component.css' ],
|
||||
providers: [
|
||||
{ provide: FormService, useClass: InMemoryFormService }
|
||||
]
|
||||
})
|
||||
export class FormDemoComponent implements OnInit, AfterViewInit {
|
||||
|
||||
@ViewChild(ActivitiForm)
|
||||
activitiForm: ActivitiForm;
|
||||
export class FormDemoComponent implements OnInit {
|
||||
|
||||
form: FormModel;
|
||||
activeTab: string = 'demo';
|
||||
storedData: any = {};
|
||||
restoredData: any = {};
|
||||
formToLoadName: string = null;
|
||||
showError: boolean = false;
|
||||
|
||||
constructor(private formService: FormService) {
|
||||
constructor(@Inject(FormService) private formService: InMemoryFormService) {
|
||||
// Prevent default outcome actions
|
||||
formService.executeOutcome.subscribe(e => {
|
||||
e.preventDefault();
|
||||
console.log(e.outcome);
|
||||
@@ -50,73 +42,7 @@ export class FormDemoComponent implements OnInit, AfterViewInit {
|
||||
|
||||
ngOnInit() {
|
||||
let formDefinitionJSON: any = DemoForm.getDefinition();
|
||||
let form = this.formService.parseForm(formDefinitionJSON);
|
||||
console.log(form);
|
||||
this.form = form;
|
||||
this.form = this.formService.parseForm(formDefinitionJSON);
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
// workaround for MDL issues with dynamic components
|
||||
if (componentHandler) {
|
||||
componentHandler.upgradeAllRegistered();
|
||||
}
|
||||
}
|
||||
|
||||
changeToStoreForm() {
|
||||
this.activeTab = 'store';
|
||||
this.showError = false;
|
||||
}
|
||||
|
||||
changeToDemoForm() {
|
||||
this.activeTab = 'demo';
|
||||
let formDefinitionJSON: any = DemoForm.getDefinition();
|
||||
let demoForm = this.formService.parseForm(formDefinitionJSON);
|
||||
this.form = demoForm;
|
||||
}
|
||||
|
||||
store() {
|
||||
this.clone(this.activitiForm.form.values, this.storedData);
|
||||
console.log('DATA SAVED');
|
||||
console.log(this.storedData);
|
||||
console.log('DATA SAVED');
|
||||
this.restoredData = null;
|
||||
}
|
||||
|
||||
restore() {
|
||||
this.restoredData = this.storedData;
|
||||
this.storedData = {};
|
||||
}
|
||||
|
||||
clone(objToCopyFrom, objToCopyTo) {
|
||||
for (let attribute in objToCopyFrom) {
|
||||
if (objToCopyFrom.hasOwnProperty(attribute)) {
|
||||
objToCopyTo[attribute] = objToCopyFrom[attribute];
|
||||
}
|
||||
}
|
||||
return objToCopyTo;
|
||||
}
|
||||
|
||||
loadForm() {
|
||||
if (this.formToLoadName) {
|
||||
this.showError = false;
|
||||
this.formService
|
||||
.getFormDefinitionByName(this.formToLoadName)
|
||||
.debounceTime(7000)
|
||||
.subscribe(
|
||||
id => {
|
||||
this.formService.getFormDefinitionById(id).subscribe(
|
||||
form => {
|
||||
this.form = this.formService.parseForm(form);
|
||||
},
|
||||
(error) => {
|
||||
this.showError = true;
|
||||
}
|
||||
);
|
||||
},
|
||||
(error) => {
|
||||
this.showError = true;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AfterViewInit, Component, ViewChild } from '@angular/core';
|
||||
import { FormModel, FormService } from 'ng2-activiti-form';
|
||||
import { ActivitiForm } from 'ng2-activiti-form';
|
||||
|
||||
declare var componentHandler;
|
||||
|
||||
@Component({
|
||||
selector: 'form-list-demo',
|
||||
template: `
|
||||
<adf-form-list [forms]="formList" (row-dblclick)="onRowDblClick($event)">
|
||||
</adf-form-list>
|
||||
<div class="form-container" *ngIf="!isEmptyForm()">
|
||||
<activiti-form [form]="form" [data]="restoredData">
|
||||
</activiti-form>
|
||||
</div>
|
||||
<button class="mdl-button mdl-js-button" (click)="store()">STORE</button>
|
||||
<button class="mdl-button mdl-js-button" (click)="restore()">RESTORE</button>
|
||||
`,
|
||||
styles: [`
|
||||
.form-container {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.store-form-container{
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
}
|
||||
`]
|
||||
})
|
||||
export class FormListDemoComponent implements AfterViewInit {
|
||||
|
||||
@ViewChild(ActivitiForm)
|
||||
activitiForm: ActivitiForm;
|
||||
|
||||
formList: any [] = [];
|
||||
|
||||
form: FormModel;
|
||||
formId: string;
|
||||
|
||||
storedData: any = {};
|
||||
restoredData: any = {};
|
||||
|
||||
constructor(private formService: FormService) {
|
||||
// Prevent default outcome actions
|
||||
formService.executeOutcome.subscribe(e => {
|
||||
e.preventDefault();
|
||||
console.log(e.outcome);
|
||||
});
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
// workaround for MDL issues with dynamic components
|
||||
if (componentHandler) {
|
||||
componentHandler.upgradeAllRegistered();
|
||||
}
|
||||
}
|
||||
|
||||
onRowDblClick(event: CustomEvent) {
|
||||
let rowForm = event.detail.value.obj;
|
||||
|
||||
this.formService.getFormDefinitionById(rowForm.id).subscribe((definition) => {
|
||||
let form = this.formService.parseForm(definition);
|
||||
this.form = form;
|
||||
});
|
||||
|
||||
console.log(rowForm);
|
||||
}
|
||||
|
||||
isEmptyForm() {
|
||||
return this.form === null || this.form === undefined;
|
||||
}
|
||||
|
||||
store() {
|
||||
this.clone(this.activitiForm.form.values, this.storedData);
|
||||
console.log('DATA SAVED');
|
||||
console.log(this.storedData);
|
||||
console.log('DATA SAVED');
|
||||
this.restoredData = null;
|
||||
}
|
||||
|
||||
clone(objToCopyFrom, objToCopyTo) {
|
||||
for (let attribute in objToCopyFrom) {
|
||||
if (objToCopyFrom.hasOwnProperty(attribute)) {
|
||||
objToCopyTo[attribute] = objToCopyFrom[attribute];
|
||||
}
|
||||
}
|
||||
return objToCopyTo;
|
||||
}
|
||||
|
||||
restore() {
|
||||
this.restoredData = this.storedData;
|
||||
this.storedData = {};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,14 +21,16 @@ export { SearchComponent } from './search/search.component';
|
||||
export { SearchBarComponent } from './search/search-bar.component';
|
||||
export { LoginDemoComponent } from './login/login-demo.component';
|
||||
export { ActivitiDemoComponent } from './activiti/activiti-demo.component';
|
||||
export { ActivitiTaskAttachmentsComponent } from './activiti/activiti-task-attachments.component';
|
||||
export { ActivitiProcessAttachmentsComponent } from './activiti/activiti-process-attachments.component';
|
||||
export { ActivitiShowDiagramComponent } from './activiti/activiti-show-diagram.component';
|
||||
export { FormViewer } from './activiti/form-viewer.component';
|
||||
export { FormViewerComponent } from './activiti/form-viewer.component';
|
||||
export { WebscriptComponent } from './webscript/webscript.component';
|
||||
export { TagComponent } from './tag/tag.component';
|
||||
export { SocialComponent } from './social/social.component';
|
||||
export { AboutComponent } from './about/about.component';
|
||||
export { FilesComponent } from './files/files.component';
|
||||
export { FormNodeViewer } from './activiti/form-node-viewer.component';
|
||||
export { ActivitiAppsView } from './activiti/apps.view';
|
||||
export { FormNodeViewerComponent } from './activiti/form-node-viewer.component';
|
||||
export { ActivitiAppsViewComponent } from './activiti/apps.view';
|
||||
export { SettingsComponent } from './settings/settings.component';
|
||||
export { FormDemoComponent } from './form/form-demo.component';
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
}
|
||||
|
||||
.toggle {
|
||||
width: 120px;
|
||||
margin: 20px;
|
||||
width: 190px;
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
<span class="mdl-switch__label">CSRF</span>
|
||||
</label>
|
||||
</p>
|
||||
<p class="toggle">
|
||||
<label for="switch4" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||
<input type="checkbox" id="switch4" class="mdl-switch__input" [checked]="showFooter" (click)="toggleFooter()">
|
||||
<span class="mdl-switch__label">Login footer</span>
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!--SETTING BUTTON-->
|
||||
@@ -34,6 +40,9 @@
|
||||
[providers]="providers"
|
||||
[fieldsValidation]="customValidation"
|
||||
[disableCsrf]="disableCsrf"
|
||||
[showLoginActions]="showFooter"
|
||||
[showRememberMe]="showFooter"
|
||||
copyrightText="© 2016 Alfresco Software, Inc. All Rights Reserved. (customised text)"
|
||||
(onSuccess)="onLogin($event)"
|
||||
(onError)="onError($event)">
|
||||
<div class="mobile-settings">
|
||||
@@ -57,5 +66,11 @@
|
||||
<span class="mdl-switch__label">CSRF</span>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label for="switch4-mobile" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||
<input type="checkbox" id="switch4-mobile" class="mdl-switch__input" [checked]="showFooter" (click)="toggleFooter()">
|
||||
<span class="mdl-switch__label">Login footer</span>
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
</alfresco-login>
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ViewChild, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Validators } from '@angular/forms';
|
||||
import { StorageService, LogService } from 'ng2-alfresco-core';
|
||||
import { Router } from '@angular/router';
|
||||
import { LogService, StorageService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'login-demo',
|
||||
@@ -36,6 +36,7 @@ export class LoginDemoComponent implements OnInit {
|
||||
disableCsrf: boolean = false;
|
||||
isECM: boolean = true;
|
||||
isBPM: boolean = false;
|
||||
showFooter: boolean = true;
|
||||
customMinLenght: number = 2;
|
||||
|
||||
constructor(private router: Router,
|
||||
@@ -94,6 +95,10 @@ export class LoginDemoComponent implements OnInit {
|
||||
this.disableCsrf = !this.disableCsrf;
|
||||
}
|
||||
|
||||
toggleFooter() {
|
||||
this.showFooter = !this.showFooter;
|
||||
}
|
||||
|
||||
updateProvider() {
|
||||
if (this.isBPM && this.isECM) {
|
||||
this.providers = 'ALL';
|
||||
@@ -112,5 +117,5 @@ export class LoginDemoComponent implements OnInit {
|
||||
|
||||
this.providers = '';
|
||||
return this.providers;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<alfresco-search-control *ngIf="isLoggedIn()"
|
||||
[searchTerm]="searchTerm"
|
||||
[autocomplete]="false"
|
||||
[highlight]="true"
|
||||
(searchSubmit)="onSearchSubmit($event);"
|
||||
(searchChange)="onSearchTermChange($event);"
|
||||
(expand)="onExpandToggle($event);"
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
import { Component, EventEmitter, Output } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||
import { MinimalNodeEntity } from 'alfresco-js-api';
|
||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'search-bar',
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<div class="search-results-container">
|
||||
<h1>Search results</h1>
|
||||
<alfresco-search (preview)="showFile($event)"></alfresco-search>
|
||||
<alfresco-search
|
||||
[navigate]="false"
|
||||
(nodeDbClick)="nodeDbClick($event)"></alfresco-search>
|
||||
</div>
|
||||
|
||||
<div *ngIf="fileShowed">
|
||||
|
||||
@@ -52,9 +52,17 @@ export class SearchComponent {
|
||||
constructor(public router: Router) {
|
||||
}
|
||||
|
||||
showFile(event) {
|
||||
if (event.value.entry.isFile) {
|
||||
this.fileNodeId = event.value.entry.id;
|
||||
nodeDbClick($event: any) {
|
||||
if ($event.value.entry.isFolder) {
|
||||
this.router.navigate(['/files', $event.value.entry.id]);
|
||||
} else {
|
||||
this.showFile($event);
|
||||
}
|
||||
}
|
||||
|
||||
showFile($event) {
|
||||
if ($event.value.entry.isFile) {
|
||||
this.fileNodeId = $event.value.entry.id;
|
||||
this.fileShowed = true;
|
||||
} else {
|
||||
this.fileShowed = false;
|
||||
|
||||
@@ -12,10 +12,19 @@
|
||||
<nav class="mdl-navigation">
|
||||
<i class="icon material-icons icon-margin">link</i>
|
||||
<div class="mdl-textfield mdl-js-textfield adf-setting-input-padding">
|
||||
<input data-automation-id="ecmHost" class="mdl-textfield__input" tabindex="1" type="text" tabindex="1" (change)="onChangeECMHost($event)"
|
||||
pattern="^(http|https):\/\/.*" id="ecmHost" value="{{ecmHost}}">
|
||||
<input
|
||||
data-automation-id="ecmHost"
|
||||
class="mdl-textfield__input"
|
||||
tabindex="1"
|
||||
type="text"
|
||||
tabindex="1"
|
||||
(change)="onChangeECMHost($event)"
|
||||
pattern="^(http|https):\/\/.*[^/]$"
|
||||
id="ecmHost"
|
||||
value="{{ecmHost}}"
|
||||
placeholder="http(s)://host|ip:port(/path)">
|
||||
<label class="mdl-textfield__label" for="ecmHost">ECM Host</label>
|
||||
<span class="mdl-textfield__error">ECM host is not valid!</span>
|
||||
<span class="mdl-textfield__error">ECM host is not valid! http(s)://host|ip:port(/path)</span>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@@ -25,10 +34,18 @@
|
||||
<nav class="mdl-navigation">
|
||||
<i class="icon material-icons icon-margin">link</i>
|
||||
<div class="mdl-textfield mdl-js-textfield adf-setting-input-padding">
|
||||
<input class="mdl-textfield__input" type="text" (change)="onChangeBPMHost($event)" tabindex="2" pattern="^(http|https):\/\/.*"
|
||||
id="bpmHost" value="{{bpmHost}}">
|
||||
<input
|
||||
data-automation-id="bpmHost"
|
||||
class="mdl-textfield__input"
|
||||
type="text"
|
||||
(change)="onChangeBPMHost($event)"
|
||||
tabindex="2"
|
||||
pattern="^(http|https):\/\/.*[^/]$"
|
||||
id="bpmHost"
|
||||
value="{{bpmHost}}"
|
||||
placeholder="http(s)://host|ip:port(/path)">
|
||||
<label class="mdl-textfield__label" for="bpmHost">BPM Host</label>
|
||||
<span class="mdl-textfield__error">BPM host is not valid!</span>
|
||||
<span class="mdl-textfield__error">BPM host is not valid! http(s)://host|ip:port(/path)</span>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, AfterViewChecked } from '@angular/core';
|
||||
import { AlfrescoSettingsService, StorageService, LogService } from 'ng2-alfresco-core';
|
||||
import { AfterViewChecked, Component } from '@angular/core';
|
||||
import { AlfrescoSettingsService, LogService, StorageService } from 'ng2-alfresco-core';
|
||||
|
||||
declare var componentHandler: any;
|
||||
|
||||
|
||||
@@ -39,6 +39,6 @@ import { Component } from '@angular/core';
|
||||
`
|
||||
]
|
||||
})
|
||||
export class CreateFolderDialog {
|
||||
export class CreateFolderDialogComponent {
|
||||
value: string = '';
|
||||
}
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { MD_DIALOG_DATA, MdDialogRef } from '@angular/material';
|
||||
|
||||
import { DownloadEntry, MinimalNodeEntity } from 'alfresco-js-api';
|
||||
import { AlfrescoApiService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-download-zip-dialog',
|
||||
template: `
|
||||
<h1 md-dialog-title>Download as ZIP</h1>
|
||||
<div md-dialog-content>
|
||||
<md-progress-bar color="primary" mode="indeterminate"></md-progress-bar>
|
||||
</div>
|
||||
<div md-dialog-actions>
|
||||
<span class="spacer"></span>
|
||||
<button md-button color="primary" (click)="cancelDownload()">Cancel</button>
|
||||
</div>
|
||||
`,
|
||||
styles: [`
|
||||
.spacer { flex: 1 1 auto; }
|
||||
|
||||
.adf-download-zip-dialog .mat-dialog-actions .mat-button-wrapper {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
`],
|
||||
host: { 'class': 'adf-download-zip-dialog' },
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class DownloadZipDialogComponent implements OnInit {
|
||||
|
||||
// flag for async threads
|
||||
private cancelled = false;
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
private dialogRef: MdDialogRef<DownloadZipDialogComponent>,
|
||||
@Inject(MD_DIALOG_DATA) private data: { nodeIds?: string[] }) {
|
||||
}
|
||||
|
||||
private get downloadsApi() {
|
||||
return this.apiService.getInstance().core.downloadsApi;
|
||||
}
|
||||
|
||||
private get nodesApi() {
|
||||
return this.apiService.getInstance().core.nodesApi;
|
||||
}
|
||||
|
||||
private get contentApi() {
|
||||
return this.apiService.getInstance().content;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.data && this.data.nodeIds && this.data.nodeIds.length > 0) {
|
||||
// change timeout to have a delay for demo purposes
|
||||
setTimeout(() => {
|
||||
if (!this.cancelled) {
|
||||
this.downloadZip(this.data.nodeIds);
|
||||
} else {
|
||||
console.log('Cancelled');
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
cancelDownload() {
|
||||
this.cancelled = true;
|
||||
this.dialogRef.close(false);
|
||||
}
|
||||
|
||||
// Download as ZIP prototype
|
||||
// js-api@alpha 1.8.0-c422a3b69b1b96f72abc61ab370eff53590f8ee4
|
||||
downloadZip(nodeIds: string[]) {
|
||||
if (nodeIds && nodeIds.length > 0) {
|
||||
|
||||
const promise: any = this.downloadsApi.createDownload({ nodeIds });
|
||||
|
||||
promise.on('progress', progress => console.log('Progress', progress));
|
||||
promise.on('error', error => console.log('Error', error));
|
||||
promise.on('abort', data => console.log('Abort', data));
|
||||
|
||||
promise.on('success', (data: DownloadEntry) => {
|
||||
console.log('Success', data);
|
||||
if (data && data.entry && data.entry.id) {
|
||||
const url = this.contentApi.getContentUrl(data.entry.id, true);
|
||||
// the call is needed only to get the name of the package
|
||||
this.nodesApi.getNode(data.entry.id).then((downloadNode: MinimalNodeEntity) => {
|
||||
console.log(downloadNode);
|
||||
const fileName = downloadNode.entry.name;
|
||||
// this.download(url, fileName);
|
||||
this.waitAndDownload(data.entry.id, url, fileName);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
waitAndDownload(downloadId: string, url: string, fileName: string) {
|
||||
if (this.cancelled) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.downloadsApi.getDownload(downloadId).then((d: DownloadEntry) => {
|
||||
if (d.entry) {
|
||||
if (d.entry.status === 'DONE') {
|
||||
this.download(url, fileName);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.waitAndDownload(downloadId, url, fileName);
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
download(url: string, fileName: string) {
|
||||
if (url && fileName) {
|
||||
const link = document.createElement('a');
|
||||
|
||||
link.style.display = 'none';
|
||||
link.download = fileName;
|
||||
link.href = url;
|
||||
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
this.dialogRef.close(true);
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
if (process.env.ENV === 'production') {
|
||||
|
||||
@@ -16,13 +16,20 @@
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { MdSlideToggleModule, MdInputModule, MdSelectModule, MdDialogModule } from '@angular/material';
|
||||
import {
|
||||
MdDialogModule,
|
||||
MdInputModule,
|
||||
MdProgressBarModule,
|
||||
MdSelectModule,
|
||||
MdSlideToggleModule
|
||||
} from '@angular/material';
|
||||
|
||||
const MATERIAL_MODULES = [
|
||||
MdSlideToggleModule,
|
||||
MdInputModule,
|
||||
MdSelectModule,
|
||||
MdDialogModule
|
||||
MdDialogModule,
|
||||
MdProgressBarModule
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* tslint:disable */
|
||||
|
||||
import 'core-js/es6';
|
||||
import 'core-js/es7/reflect';
|
||||
import 'intl';
|
||||
|
||||
@@ -32,6 +32,6 @@ export class DebugAppConfigService extends AppConfigService {
|
||||
return <T>(<any>this.storage.getItem(key) || super.get<T>(key));
|
||||
}
|
||||
return super.get<T>(key);
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { EcmModelService, FormFieldOption, FormService } from 'ng2-activiti-form';
|
||||
import { AlfrescoApiService, LogService } from 'ng2-alfresco-core';
|
||||
import { AppConfigService } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
|
||||
interface ActivitiData {
|
||||
rest: {
|
||||
fields: Array<{
|
||||
processId?: string,
|
||||
taskId?: string,
|
||||
fieldId?: string,
|
||||
values?: Array<{
|
||||
id: string,
|
||||
name: string
|
||||
}>
|
||||
}>
|
||||
};
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class InMemoryFormService extends FormService {
|
||||
|
||||
private data: ActivitiData;
|
||||
|
||||
constructor(appConfig: AppConfigService,
|
||||
ecmModelService: EcmModelService,
|
||||
apiService: AlfrescoApiService,
|
||||
logService: LogService) {
|
||||
super(ecmModelService, apiService, logService);
|
||||
this.data = appConfig.get<ActivitiData>('activiti');
|
||||
}
|
||||
|
||||
/** @override */
|
||||
getRestFieldValues(taskId: string, fieldId: string): Observable<FormFieldOption[]> {
|
||||
// Uncomment this to use original call
|
||||
// return super.getRestFieldValues(taskId, fieldId);
|
||||
|
||||
console.log(`getRestFieldValues: ${taskId} => ${fieldId}`);
|
||||
return new Observable<FormFieldOption[]>(observer => {
|
||||
let field = this.data.rest.fields.find(
|
||||
f => f.taskId === taskId && f.fieldId === fieldId
|
||||
);
|
||||
let values: FormFieldOption[] = field.values || [];
|
||||
console.log(values);
|
||||
observer.next(values);
|
||||
});
|
||||
}
|
||||
|
||||
/** @override */
|
||||
getRestFieldValuesByProcessId(processDefinitionId: string, fieldId: string): Observable<any> {
|
||||
// Uncomment this to use original call
|
||||
// return super.getRestFieldValuesByProcessId(processDefinitionId, fieldId);
|
||||
|
||||
console.log(`getRestFieldValuesByProcessId: ${processDefinitionId} => ${fieldId}`);
|
||||
return new Observable<FormFieldOption[]>(observer => {
|
||||
let field = this.data.rest.fields.find(
|
||||
f => f.processId === processDefinitionId && f.fieldId === fieldId
|
||||
);
|
||||
let values: FormFieldOption[] = field.values || [];
|
||||
console.log(values);
|
||||
observer.next(values);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
/* tslint:disable */
|
||||
|
||||
// Angular
|
||||
import '@angular/common';
|
||||
import '@angular/core';
|
||||
import '@angular/http';
|
||||
import '@angular/platform-browser';
|
||||
import '@angular/platform-browser-dynamic';
|
||||
import '@angular/core';
|
||||
import '@angular/common';
|
||||
import '@angular/http';
|
||||
import '@angular/router';
|
||||
|
||||
// RxJS
|
||||
@@ -14,43 +16,43 @@ import 'hammerjs';
|
||||
|
||||
// Alfresco
|
||||
import 'alfresco-js-api';
|
||||
import 'ng2-alfresco-core';
|
||||
import 'ng2-alfresco-datatable';
|
||||
import 'ng2-activiti-diagrams';
|
||||
import 'ng2-activiti-analytics';
|
||||
import 'ng2-activiti-diagrams';
|
||||
import 'ng2-activiti-form';
|
||||
import 'ng2-activiti-processlist';
|
||||
import 'ng2-activiti-tasklist';
|
||||
import 'ng2-alfresco-core';
|
||||
import 'ng2-alfresco-datatable';
|
||||
import 'ng2-alfresco-documentlist';
|
||||
import 'ng2-alfresco-login';
|
||||
import 'ng2-alfresco-search';
|
||||
import 'ng2-alfresco-tag';
|
||||
import 'ng2-alfresco-social';
|
||||
import 'ng2-alfresco-tag';
|
||||
import 'ng2-alfresco-upload';
|
||||
import 'ng2-alfresco-userinfo';
|
||||
import 'ng2-alfresco-viewer';
|
||||
import 'ng2-alfresco-webscript';
|
||||
import 'ng2-alfresco-userinfo';
|
||||
|
||||
// Load the Angular Material 2 stylesheet
|
||||
import '@angular/material/prebuilt-themes/indigo-pink.css';
|
||||
|
||||
// Polyfill(s) for dialogs
|
||||
require('script-loader!dialog-polyfill/dialog-polyfill');
|
||||
import 'dialog-polyfill/dialog-polyfill.css';
|
||||
|
||||
// Load the Angular Material 2 stylesheet
|
||||
import '@angular/material/prebuilt-themes/indigo-pink.css';
|
||||
|
||||
// Google Material Design Lite
|
||||
import 'material-design-lite/material.js';
|
||||
import 'material-design-lite/dist/material.orange-blue.min.css';
|
||||
import 'material-design-icons/iconfont/material-icons.css';
|
||||
import 'material-design-lite/dist/material.orange-blue.min.css';
|
||||
import 'material-design-lite/material.js';
|
||||
|
||||
import '../public/css/app.css';
|
||||
import '../public/css/muli-font.css';
|
||||
|
||||
import 'ng2-activiti-form/stencils/runtime.ng1';
|
||||
import 'ng2-activiti-form/stencils/runtime.adf';
|
||||
import 'ng2-activiti-form/stencils/runtime.ng1';
|
||||
|
||||
import 'ng2-charts';
|
||||
import 'chart.js';
|
||||
import 'ng2-charts';
|
||||
require('script-loader!raphael/raphael.min.js');
|
||||
|
||||
require('script-loader!moment/min/moment.min.js');
|
||||
@@ -73,5 +75,5 @@ require('pdfjs-dist/web/pdf_viewer.js');
|
||||
require('three/build/three.min.js');
|
||||
|
||||
// 3D viewer
|
||||
import 'three';
|
||||
import 'ng2-3d-editor';
|
||||
import 'three';
|
||||
|
||||
@@ -33,7 +33,8 @@ module.exports = {
|
||||
loader: 'tslint-loader',
|
||||
include: [helpers.root('app')],
|
||||
options: {
|
||||
emitErrors: true
|
||||
emitErrors: true,
|
||||
fix: true
|
||||
},
|
||||
exclude: [/node_modules/, /public/, /resources/, /dist/]
|
||||
},
|
||||
@@ -45,6 +46,7 @@ module.exports = {
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
include: [helpers.root('app'), helpers.root('../ng2-components')],
|
||||
loader: 'html-loader',
|
||||
exclude: [/node_modules/, /public/, /resources/, /dist/]
|
||||
},
|
||||
@@ -62,7 +64,8 @@ module.exports = {
|
||||
loader: 'raw-loader'
|
||||
},
|
||||
{
|
||||
test: /\.component.scss$/,
|
||||
test: /\.scss$/,
|
||||
include: [helpers.root('app'), helpers.root('../ng2-components')],
|
||||
use: [{
|
||||
loader: "to-string-loader"
|
||||
}, {
|
||||
@@ -72,7 +75,8 @@ module.exports = {
|
||||
options: {
|
||||
includePaths: [path.resolve(__dirname, '../../ng2-components/ng2-alfresco-core/styles')]
|
||||
}
|
||||
}]
|
||||
}],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
|
||||
@@ -87,7 +91,7 @@ module.exports = {
|
||||
emitErrors: true,
|
||||
licenseFile: path.resolve(__dirname, '../assets/license_header.txt')
|
||||
},
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -28,7 +28,7 @@ const alfrescoLibs = [
|
||||
|
||||
module.exports = webpackMerge(commonConfig, {
|
||||
|
||||
devtool: 'cheap-module-eval-source-map',
|
||||
devtool: 'cheap-module-source-map',
|
||||
|
||||
output: {
|
||||
path: helpers.root('dist'),
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</head>
|
||||
<!-- 3. Display the application -->
|
||||
<body>
|
||||
<alfresco-app>
|
||||
<adf-app>
|
||||
<div id="loader-container" class="loader-container">
|
||||
<div class="loader-item">
|
||||
<div id="loader-spin" class="mdl-progress mdl-js-progress mdl-progress__indeterminate is-upgraded"
|
||||
@@ -62,7 +62,7 @@
|
||||
<div id="loader-text" class="loader-text">Loading Demo Shell..</div>
|
||||
</div>
|
||||
</div>
|
||||
</alfresco-app>
|
||||
</adf-app>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Generated
+4059
-1796
File diff suppressed because it is too large
Load Diff
+24
-20
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "Alfresco-Angular2-Demo",
|
||||
"description": "Demo shell for Alfresco Angular2 components",
|
||||
"version": "1.6.1",
|
||||
"version": "1.7.0",
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"scripts": {
|
||||
"build": "npm run server-versions && rimraf dist && npm run webpack -- --config config/webpack.prod.js --progress --profile --bail",
|
||||
@@ -56,18 +56,19 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@angular/animations": "4.2.5",
|
||||
"@angular/cdk": "2.0.0-beta.8",
|
||||
"@angular/common": "4.2.5",
|
||||
"@angular/compiler": "4.2.5",
|
||||
"@angular/compiler-cli": "4.2.5",
|
||||
"@angular/core": "4.2.5",
|
||||
"@angular/forms": "4.2.5",
|
||||
"@angular/http": "4.2.5",
|
||||
"@angular/material": "2.0.0-beta.6",
|
||||
"@angular/material": "^2.0.0-beta.8",
|
||||
"@angular/platform-browser": "4.2.5",
|
||||
"@angular/platform-browser-dynamic": "4.2.5",
|
||||
"@angular/router": "4.2.5",
|
||||
"@ngx-translate/core": "7.0.0",
|
||||
"alfresco-js-api": "1.6.1",
|
||||
"alfresco-js-api": "1.7.0",
|
||||
"chart.js": "2.5.0",
|
||||
"core-js": "2.4.1",
|
||||
"dialog-polyfill": "0.4.7",
|
||||
@@ -76,24 +77,25 @@
|
||||
"material-design-icons": "2.2.3",
|
||||
"material-design-lite": "1.2.1",
|
||||
"md-date-time-picker": "2.2.0",
|
||||
"minimatch": "3.0.4",
|
||||
"moment": "2.15.1",
|
||||
"ng2-3d-editor": "0.0.15",
|
||||
"ng2-activiti-analytics": "1.6.1",
|
||||
"ng2-activiti-diagrams": "1.6.1",
|
||||
"ng2-activiti-form": "1.6.1",
|
||||
"ng2-activiti-processlist": "1.6.1",
|
||||
"ng2-activiti-tasklist": "1.6.1",
|
||||
"ng2-alfresco-core": "1.6.1",
|
||||
"ng2-alfresco-datatable": "1.6.1",
|
||||
"ng2-alfresco-documentlist": "1.6.1",
|
||||
"ng2-alfresco-login": "1.6.1",
|
||||
"ng2-alfresco-search": "1.6.1",
|
||||
"ng2-alfresco-social": "1.6.1",
|
||||
"ng2-alfresco-tag": "1.6.1",
|
||||
"ng2-alfresco-upload": "1.6.1",
|
||||
"ng2-alfresco-userinfo": "1.6.1",
|
||||
"ng2-alfresco-viewer": "1.6.1",
|
||||
"ng2-alfresco-webscript": "1.6.1",
|
||||
"ng2-activiti-analytics": "1.7.0",
|
||||
"ng2-activiti-diagrams": "1.7.0",
|
||||
"ng2-activiti-form": "1.7.0",
|
||||
"ng2-activiti-processlist": "1.7.0",
|
||||
"ng2-activiti-tasklist": "1.7.0",
|
||||
"ng2-alfresco-core": "1.7.0",
|
||||
"ng2-alfresco-datatable": "1.7.0",
|
||||
"ng2-alfresco-documentlist": "1.7.0",
|
||||
"ng2-alfresco-login": "1.7.0",
|
||||
"ng2-alfresco-search": "1.7.0",
|
||||
"ng2-alfresco-social": "1.7.0",
|
||||
"ng2-alfresco-tag": "1.7.0",
|
||||
"ng2-alfresco-upload": "1.7.0",
|
||||
"ng2-alfresco-userinfo": "1.7.0",
|
||||
"ng2-alfresco-viewer": "1.7.0",
|
||||
"ng2-alfresco-webscript": "1.7.0",
|
||||
"ng2-charts": "1.6.0",
|
||||
"pdfjs-dist": "1.5.404",
|
||||
"raphael": "2.2.7",
|
||||
@@ -105,7 +107,9 @@
|
||||
"@types/hammerjs": "2.0.34",
|
||||
"@types/jasmine": "2.5.35",
|
||||
"@types/node": "6.0.45",
|
||||
"adf-tslint-rules": "0.0.3",
|
||||
"angular2-template-loader": "0.6.2",
|
||||
"codelyzer": "3.1.2",
|
||||
"copy-webpack-plugin": "4.0.1",
|
||||
"css-loader": "0.26.1",
|
||||
"extract-text-webpack-plugin": "2.0.0-rc.3",
|
||||
@@ -136,7 +140,7 @@
|
||||
"style-loader": "0.13.1",
|
||||
"to-string-loader": "1.1.5",
|
||||
"ts-loader": "2.2.1",
|
||||
"tslint": "4.5.1",
|
||||
"tslint": "5.5.0",
|
||||
"tslint-loader": "3.5.3",
|
||||
"typescript": "2.3.4",
|
||||
"webpack": "2.2.1",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,25 @@
|
||||
@font-face {
|
||||
font-family: Muli;
|
||||
font-family: "Muli";
|
||||
src: url(../fonts/Muli-Light.ttf);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Muli";
|
||||
src: url(../fonts/Muli-LightItalic.ttf);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Muli";
|
||||
src: url(../fonts/Muli-Regular.ttf);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Muli";
|
||||
src: url(../fonts/Muli-Italic.ttf);
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
html, body {
|
||||
|
||||
@@ -6,19 +6,20 @@
|
||||
"DISPLAY_NAME": "Display name",
|
||||
"TAG": "Tag",
|
||||
"CREATED_BY": "Created by",
|
||||
"CREATED_ON": "Created on"
|
||||
"CREATED_ON": "Created on",
|
||||
"CREATED": "Created"
|
||||
},
|
||||
"ACTIONS": {
|
||||
"FOLDER": {
|
||||
"SYSTEM_1": "System folder action 1",
|
||||
"CUSTOM": "Custom folder action",
|
||||
"COPY": "Copy",
|
||||
"MOVE": "Move",
|
||||
"DELETE": "Delete"
|
||||
},
|
||||
"DOCUMENT": {
|
||||
"DOWNLOAD": "Download",
|
||||
"DELETE": "Delete",
|
||||
"SYSTEM_2": "System document action 2",
|
||||
"CUSTOM": "Custom action"
|
||||
"COPY": "Copy",
|
||||
"MOVE": "Move",
|
||||
"DELETE": "Delete"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
"@angular/*": ["node_modules/@angular/*"],
|
||||
"rxjs/*": ["node_modules/rxjs/*"]
|
||||
},
|
||||
"suppressImplicitAnyIndexErrors": true
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
"noUnusedLocals": true
|
||||
},
|
||||
"exclude": [
|
||||
"demo",
|
||||
|
||||
+142
-115
@@ -1,118 +1,145 @@
|
||||
{
|
||||
"rules": {
|
||||
"align": [
|
||||
true,
|
||||
"parameters",
|
||||
"statements"
|
||||
"rulesDirectory": [
|
||||
"node_modules/codelyzer"
|
||||
],
|
||||
"ban": false,
|
||||
"class-name": true,
|
||||
"comment-format": [
|
||||
true,
|
||||
"check-space"
|
||||
],
|
||||
"curly": true,
|
||||
"eofline": true,
|
||||
"forin": true,
|
||||
"indent": [
|
||||
true,
|
||||
"spaces"
|
||||
],
|
||||
"interface-name": false,
|
||||
"jsdoc-format": true,
|
||||
"label-position": true,
|
||||
"max-line-length": [
|
||||
true,
|
||||
180
|
||||
],
|
||||
"member-ordering": [
|
||||
true,
|
||||
"static-before-instance",
|
||||
"variables-before-functions"
|
||||
],
|
||||
"no-any": false,
|
||||
"no-arg": true,
|
||||
"no-bitwise": false,
|
||||
"no-conditional-assignment": true,
|
||||
"no-consecutive-blank-lines": true,
|
||||
"no-console": [
|
||||
true,
|
||||
"debug",
|
||||
"info",
|
||||
"time",
|
||||
"timeEnd",
|
||||
"trace"
|
||||
],
|
||||
"no-construct": true,
|
||||
"no-constructor-vars": false,
|
||||
"no-debugger": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-empty": false,
|
||||
"no-eval": true,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": true,
|
||||
"no-require-imports": false,
|
||||
"no-shadowed-variable": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unused-expression": true,
|
||||
"no-unused-variable": true,
|
||||
"no-use-before-declare": true,
|
||||
"no-var-keyword": true,
|
||||
"no-var-requires": false,
|
||||
"object-literal-sort-keys": false,
|
||||
"one-line": [
|
||||
true,
|
||||
"check-open-brace",
|
||||
"check-catch",
|
||||
"check-else",
|
||||
"check-whitespace"
|
||||
],
|
||||
"quotemark": [
|
||||
true,
|
||||
"single",
|
||||
"avoid-escape"
|
||||
],
|
||||
"radix": true,
|
||||
"semicolon": true,
|
||||
"switch-default": true,
|
||||
"trailing-comma": [
|
||||
true,
|
||||
{
|
||||
"multiline": "never",
|
||||
"singleline": "never"
|
||||
}
|
||||
],
|
||||
"triple-equals": [
|
||||
true,
|
||||
"allow-null-check"
|
||||
],
|
||||
"typedef": false,
|
||||
"typedef-whitespace": [
|
||||
true,
|
||||
{
|
||||
"call-signature": "nospace",
|
||||
"index-signature": "nospace",
|
||||
"parameter": "nospace",
|
||||
"property-declaration": "nospace",
|
||||
"variable-declaration": "nospace"
|
||||
}
|
||||
],
|
||||
"use-strict": false,
|
||||
"variable-name": [
|
||||
true,
|
||||
"check-format",
|
||||
"allow-leading-underscore",
|
||||
"ban-keywords"
|
||||
],
|
||||
"whitespace": [
|
||||
true,
|
||||
"check-branch",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-type",
|
||||
"check-module",
|
||||
"check-decl"
|
||||
]
|
||||
}
|
||||
"rules": {
|
||||
"align": [
|
||||
true,
|
||||
"parameters",
|
||||
"statements"
|
||||
],
|
||||
"ban": false,
|
||||
"class-name": true,
|
||||
"comment-format": [
|
||||
true,
|
||||
"check-space"
|
||||
],
|
||||
"curly": true,
|
||||
"eofline": true,
|
||||
"forin": true,
|
||||
"indent": [
|
||||
true,
|
||||
"spaces"
|
||||
],
|
||||
"interface-name": false,
|
||||
"jsdoc-format": true,
|
||||
"label-position": true,
|
||||
"max-line-length": [
|
||||
true,
|
||||
180
|
||||
],
|
||||
"member-ordering": [
|
||||
true,
|
||||
"static-before-instance",
|
||||
"variables-before-functions"
|
||||
],
|
||||
"no-any": false,
|
||||
"no-arg": true,
|
||||
"no-bitwise": false,
|
||||
"no-conditional-assignment": true,
|
||||
"no-consecutive-blank-lines": true,
|
||||
"no-console": [
|
||||
true,
|
||||
"debug",
|
||||
"info",
|
||||
"time",
|
||||
"timeEnd",
|
||||
"trace"
|
||||
],
|
||||
"no-construct": true,
|
||||
"no-constructor-vars": false,
|
||||
"no-debugger": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-empty": false,
|
||||
"no-eval": true,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": true,
|
||||
"no-require-imports": false,
|
||||
"no-shadowed-variable": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unused-expression": true,
|
||||
"no-unused-variable": true,
|
||||
"no-use-before-declare": true,
|
||||
"no-var-keyword": true,
|
||||
"no-var-requires": true,
|
||||
"object-literal-sort-keys": false,
|
||||
"one-line": [
|
||||
true,
|
||||
"check-open-brace",
|
||||
"check-catch",
|
||||
"check-else",
|
||||
"check-whitespace"
|
||||
],
|
||||
"quotemark": [
|
||||
true,
|
||||
"single",
|
||||
"avoid-escape"
|
||||
],
|
||||
"radix": true,
|
||||
"semicolon": true,
|
||||
"switch-default": true,
|
||||
"trailing-comma": [
|
||||
true,
|
||||
{
|
||||
"multiline": "never",
|
||||
"singleline": "never"
|
||||
}
|
||||
],
|
||||
"triple-equals": [
|
||||
true,
|
||||
"allow-null-check"
|
||||
],
|
||||
"typedef": false,
|
||||
"typedef-whitespace": [
|
||||
true,
|
||||
{
|
||||
"call-signature": "nospace",
|
||||
"index-signature": "nospace",
|
||||
"parameter": "nospace",
|
||||
"property-declaration": "nospace",
|
||||
"variable-declaration": "nospace"
|
||||
}
|
||||
],
|
||||
"use-strict": false,
|
||||
"variable-name": [
|
||||
true,
|
||||
"check-format",
|
||||
"allow-leading-underscore",
|
||||
"ban-keywords"
|
||||
],
|
||||
"callable-types": true,
|
||||
"import-blacklist": [
|
||||
true,
|
||||
"rxjs"
|
||||
],
|
||||
"import-spacing": true,
|
||||
"interface-over-type-literal": true,
|
||||
"member-access": false,
|
||||
"no-empty-interface": true,
|
||||
"no-string-literal": false,
|
||||
"no-string-throw": true,
|
||||
"prefer-const": false,
|
||||
"typeof-compare": true,
|
||||
"unified-signatures": true,
|
||||
"whitespace": [
|
||||
true,
|
||||
"check-branch",
|
||||
"check-decl",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-type"
|
||||
],
|
||||
"ordered-imports": true,
|
||||
"use-input-property-decorator": true,
|
||||
"use-output-property-decorator": true,
|
||||
"use-host-property-decorator": false,
|
||||
"use-life-cycle-interface": true,
|
||||
"use-pipe-transform-interface": true,
|
||||
"component-class-suffix": true,
|
||||
"directive-class-suffix": true,
|
||||
"no-access-missing-member": false,
|
||||
"templates-use-public": true,
|
||||
"invoke-injectable": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"MD032": false,
|
||||
"MD004": false,
|
||||
"MD024": false,
|
||||
"MD009": false,
|
||||
"MD013": false,
|
||||
"MD036": false,
|
||||
"MD033" : false,
|
||||
"MD031" : false
|
||||
}
|
||||
+133
-62
@@ -11,6 +11,7 @@
|
||||
* [Components](#components-1)
|
||||
- [Business service](#business-service)
|
||||
* [components](#components)
|
||||
- [Services](#services)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
@@ -22,94 +23,164 @@
|
||||
|
||||
<!-- CORE START-->
|
||||
- [adf-card-view](ng2-alfresco-core/README.md)
|
||||
- [adf-accordion-group](ng2-alfresco-core/README.md)
|
||||
- [adf-card-view-textitem](ng2-alfresco-core/README.md)
|
||||
- [adf-card-view-mapitem](ng2-alfresco-core/README.md)
|
||||
- [adf-card-view-item-dispatcher](ng2-alfresco-core/README.md)
|
||||
- [adf-card-view-dateitem](ng2-alfresco-core/README.md)
|
||||
- [adf-toolbar](ng2-alfresco-core/README.md)
|
||||
- [adf-toolbar-title](ng2-alfresco-core/README.md)
|
||||
- [adf-context-menu-holder](ng2-alfresco-core/README.md)
|
||||
- [adf-accordion](ng2-alfresco-core/README.md)
|
||||
- [adf-toolbar](ng2-alfresco-core/README.md)<!-- CORE END-->
|
||||
- [adf-accordion-group](ng2-alfresco-core/README.md)<!-- CORE END-->
|
||||
<!-- CORE END-->
|
||||
|
||||
### Directives
|
||||
|
||||
<!-- CORE DIRECTIVE START-->
|
||||
- [context-menu](ng2-alfresco-core/README.md)
|
||||
- [alfresco-mdl-textfield](ng2-alfresco-core/README.md)
|
||||
- [alfresco-mdl-menu](ng2-alfresco-core/README.md)
|
||||
- [alfresco-mdl-button](ng2-alfresco-core/README.md)
|
||||
- [mdl](ng2-alfresco-core/README.md)
|
||||
- [adf-card-view-content-proxy](ng2-alfresco-core/README.md)
|
||||
- [adf-context-menu](ng2-alfresco-core/README.md)
|
||||
- [adf-mdl-textfield](ng2-alfresco-core/README.md)
|
||||
- [adf-mdl-menu](ng2-alfresco-core/README.md)
|
||||
- [adf-upload](ng2-alfresco-core/README.md)<!-- CORE DIRECTIVE END-->
|
||||
|
||||
## Content service
|
||||
## Content service
|
||||
|
||||
### Components
|
||||
|
||||
<!-- CONTENT START-->
|
||||
- [alfresco-viewer](ng2-alfresco-viewer/README.md)
|
||||
- [ng2-alfresco-userinfo](ng2-alfresco-userinfo/README.md)
|
||||
- [alfresco-file-uploading-list](ng2-alfresco-upload/README.md)
|
||||
- [alfresco-upload-button](ng2-alfresco-upload/README.md)
|
||||
- [alfresco-upload-drag-area](ng2-alfresco-upload/README.md)
|
||||
- [alfresco-tag-node-list](ng2-alfresco-tag/README.md)
|
||||
- [alfresco-tag-list](ng2-alfresco-tag/README.md)
|
||||
- [alfresco-tag-node-actions-list](ng2-alfresco-tag/README.md)
|
||||
- [adf-like](ng2-alfresco-social/README.md)
|
||||
- [adf-search-control](ng2-alfresco-search/README.md)
|
||||
- [adf-search](ng2-alfresco-search/README.md)
|
||||
- [adf-search-autocomplete](ng2-alfresco-search/README.md)
|
||||
- [adf-upload-button](ng2-alfresco-upload/README.md)
|
||||
- [adf-upload-drag-area](ng2-alfresco-upload/README.md)
|
||||
- [adf-file-uploading-list](ng2-alfresco-upload/README.md)
|
||||
- [adf-file-uploading-dialog](ng2-alfresco-upload/README.md)
|
||||
- [adf-file-uploading-list-row](ng2-alfresco-upload/README.md)
|
||||
- [adf-sites-dropdown](ng2-alfresco-documentlist/README.md)
|
||||
- [adf-content-node-selector](ng2-alfresco-documentlist/README.md)
|
||||
- [adf-document-menu-action](ng2-alfresco-documentlist/README.md)
|
||||
- [adf-dropdown-breadcrumb](ng2-alfresco-documentlist/README.md)
|
||||
- [adf-breadcrumb](ng2-alfresco-documentlist/README.md)
|
||||
- [adf-document-list](ng2-alfresco-documentlist/README.md)
|
||||
- [adf-pagination](ng2-alfresco-core/src/components/pagination/pagination.md)
|
||||
- [adf-empty-list](ng2-alfresco-datatable/README.md)
|
||||
- [adf-datatable](ng2-alfresco-datatable/README.md)
|
||||
- [adf-datatable-cell](ng2-alfresco-datatable/README.md)
|
||||
- [adf-viewer](ng2-alfresco-viewer/README.md)
|
||||
- [adf-userinfo](ng2-alfresco-userinfo/README.md)
|
||||
- [adf-rating](ng2-alfresco-social/README.md)
|
||||
- [alfresco-search-autocomplete](ng2-alfresco-search/README.md)
|
||||
- [alfresco-search-control](ng2-alfresco-search/README.md)
|
||||
- [alfresco-search](ng2-alfresco-search/README.md)
|
||||
- [alfresco-login](ng2-alfresco-login/README.md)
|
||||
- [adf-breadcrumb, alfresco-document-list-breadcrumb](ng2-alfresco-documentlist/README.md)
|
||||
- [alfresco-document-menu-action](ng2-alfresco-documentlist/README.md)
|
||||
- [alfresco-document-list](ng2-alfresco-documentlist/README.md)
|
||||
- [alfresco-datatable-cell](ng2-alfresco-datatable/README.md)
|
||||
- [alfresco-datatable](ng2-alfresco-datatable/README.md)
|
||||
- [alfresco-pagination](ng2-alfresco-datatable/README.md)
|
||||
- [alfresco-webscript-get](ng2-alfresco-webscript/README.md)<!-- CONTENT END-->
|
||||
- [adf-like](ng2-alfresco-social/README.md)
|
||||
- [adf-tag-node-list](ng2-alfresco-tag/README.md)
|
||||
- [adf-tag-list](ng2-alfresco-tag/README.md)
|
||||
- [adf-tag-node-actions-list](ng2-alfresco-tag/README.md)
|
||||
- [adf-login](ng2-alfresco-login/README.md)
|
||||
- [adf-webscript-get](ng2-alfresco-webscript/README.md)<!-- CONTENT END-->
|
||||
<!-- CONTENT END-->
|
||||
|
||||
|
||||
<!-- CONTENT DIRECTIVE START--><!-- CONTENT DIRECTIVE END-->
|
||||
|
||||
## Business service
|
||||
## Business service
|
||||
|
||||
### components
|
||||
|
||||
<!-- BUSINESS START-->
|
||||
- [diagram-icon-alfresco-publish-task](ng2-activiti-diagrams/README.md)
|
||||
- [diagram-alfresco-publish-task](ng2-activiti-diagrams/README.md)
|
||||
- [activiti-process-instance-comments](ng2-activiti-processlist/README.md)
|
||||
- [activiti-process-instance-variables](ng2-activiti-processlist/README.md)
|
||||
- [activiti-process-instance-tasks](ng2-activiti-processlist/README.md)
|
||||
- [activiti-process-instance-header](ng2-activiti-processlist/README.md)
|
||||
- [adf-people-list](ng2-activiti-tasklist/README.md)
|
||||
- [adf-create-task-attachment](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-people-search](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-start-task](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-task-details](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-filters](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-task-header](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-people](ng2-activiti-tasklist/README.md)
|
||||
- [adf-task-attachment-list](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-comments](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-checklist](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-tasklist](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-apps](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-diagram](ng2-activiti-diagrams/README.md)
|
||||
- [adf-create-process-attachment](ng2-activiti-processlist/README.md)
|
||||
- [adf-diagram-publish-task](ng2-activiti-diagrams/README.md)
|
||||
- [adf-start-process](ng2-activiti-processlist/README.md)
|
||||
- [adf-process-instance-list](ng2-activiti-processlist/README.md)
|
||||
- [adf-process-instance-variables](ng2-activiti-processlist/README.md)
|
||||
- [adf-process-instance-tasks](ng2-activiti-processlist/README.md)
|
||||
- [adf-process-instance-header](ng2-activiti-processlist/README.md)
|
||||
- [adf-process-instance-details](ng2-activiti-processlist/README.md)
|
||||
- [adf-process-instance-filters](ng2-activiti-processlist/README.md)
|
||||
- [adf-process-instance-comments](ng2-activiti-processlist/README.md)
|
||||
- [adf-process-attachment-list](ng2-activiti-processlist/README.md)
|
||||
- [activiti-start-process](ng2-activiti-processlist/README.md)
|
||||
- [activiti-process-instance-details](ng2-activiti-processlist/README.md)
|
||||
- [activiti-process-instance-filters](ng2-activiti-processlist/README.md)
|
||||
- [activiti-process-instance-list](ng2-activiti-processlist/README.md)
|
||||
- [activiti-analytics-generator](ng2-activiti-analytics/README.md)
|
||||
- [activiti-analytics](ng2-activiti-analytics/README.md)
|
||||
- [activiti-start-form](ng2-activiti-form/README.md)
|
||||
- [activiti-content](ng2-activiti-form/README.md)
|
||||
- [activiti-form](ng2-activiti-form/README.md)<!-- BUSINESS END-->
|
||||
- [adf-create-process-attachment](ng2-activiti-processlist/README.md)
|
||||
- [adf-form-field](ng2-activiti-form/README.md)
|
||||
- [adf-start-form](ng2-activiti-form/README.md)
|
||||
- [adf-content](ng2-activiti-form/README.md)
|
||||
- [adf-form](ng2-activiti-form/README.md)
|
||||
- [adf-form-list](ng2-activiti-form/README.md)
|
||||
- [adf-diagram](ng2-activiti-diagrams/README.md)
|
||||
- [adf-diagram-sequence-flow](ng2-activiti-diagrams/README.md)
|
||||
- [adf-tasklist](ng2-activiti-tasklist/README.md)
|
||||
- [adf-filters](ng2-activiti-tasklist/README.md)
|
||||
- [adf-task-details](ng2-activiti-tasklist/README.md)
|
||||
- [adf-start-task](ng2-activiti-tasklist/README.md)
|
||||
- [adf-task-header](ng2-activiti-tasklist/README.md)
|
||||
- [adf-people-list](ng2-activiti-tasklist/README.md)
|
||||
- [adf-task-attachment-list](ng2-activiti-tasklist/README.md)
|
||||
- [adf-people-search](ng2-activiti-tasklist/README.md)
|
||||
- [adf-people](ng2-activiti-tasklist/README.md)
|
||||
- [adf-comments](ng2-activiti-tasklist/README.md)
|
||||
- [adf-create-task-attachment](ng2-activiti-tasklist/README.md)
|
||||
- [adf-comment-list](ng2-activiti-tasklist/README.md)
|
||||
- [adf-checklist](ng2-activiti-tasklist/README.md)
|
||||
- [adf-apps](ng2-activiti-tasklist/README.md)
|
||||
- [adf-analytics-report-parameters](ng2-activiti-analytics/README.md)
|
||||
- [adf-analytics](ng2-activiti-analytics/README.md)
|
||||
- [adf-analytics-report-list](ng2-activiti-analytics/README.md)
|
||||
- [adf-analytics-report-heat-map](ng2-activiti-analytics/README.md)
|
||||
- [adf-analytics-generator](ng2-activiti-analytics/README.md)<!-- BUSINESS END-->
|
||||
<!-- BUSINESS END-->
|
||||
|
||||
|
||||
<!-- BUSINESS DIRECTIVE START--><!-- BUSINESS DIRECTIVE END-->
|
||||
|
||||
## Services
|
||||
|
||||
<!-- SERVICES START-->
|
||||
- [ContextMenuService](ng2-alfresco-core/src/components/context-menu/context-menu.service.ts)
|
||||
- [FileUploadService](ng2-alfresco-upload/src/services/file-uploading.service.ts)
|
||||
- [DocumentListService](ng2-alfresco-documentlist/src/services/document-list.service.ts)
|
||||
- [NodeActionsService](ng2-alfresco-documentlist/src/services/node-actions.service.ts)
|
||||
- [FolderActionsService](ng2-alfresco-documentlist/src/services/folder-actions.service.ts)
|
||||
- [DocumentActionsService](ng2-alfresco-documentlist/src/services/document-actions.service.ts)
|
||||
- [ProcessService](ng2-activiti-processlist/src/services/process.service.ts)
|
||||
- [ProcessUploadService](ng2-activiti-processlist/src/services/process-upload.service.ts)
|
||||
- [WidgetVisibilityService](ng2-activiti-form/src/services/widget-visibility.service.ts)
|
||||
- [NodeService](ng2-activiti-form/src/services/node.service.ts)
|
||||
- [FormService](ng2-activiti-form/src/services/form.service.ts)
|
||||
- [FormRenderingService](ng2-activiti-form/src/services/form-rendering.service.ts)
|
||||
- [EcmModelService](ng2-activiti-form/src/services/ecm-model.service.ts)
|
||||
- [ActivitiContentService](ng2-activiti-form/src/services/activiti-content-service.ts)
|
||||
- [ActivitiAlfrescoContentService](ng2-activiti-form/src/services/activiti-alfresco.service.ts)
|
||||
- [CardViewUpdateService](ng2-alfresco-core/src/services/card-view-update.service.ts)
|
||||
- [SearchService](ng2-alfresco-core/src/services/search.service.ts)
|
||||
- [SitesApiService](ng2-alfresco-core/src/services/sites-api.service.ts)
|
||||
- [SharedLinksApiService](ng2-alfresco-core/src/services/shared-links-api.service.ts)
|
||||
- [SearchApiService](ng2-alfresco-core/src/services/search-api.service.ts)
|
||||
- [NodesApiService](ng2-alfresco-core/src/services/nodes-api.service.ts)
|
||||
- [PeopleApiService](ng2-alfresco-core/src/services/people-api.service.ts)
|
||||
- [FavoritesApiService](ng2-alfresco-core/src/services/favorites-api.service.ts)
|
||||
- [DiscoveryApiService](ng2-alfresco-core/src/services/discovery-api.service.ts)
|
||||
- [DeletedNodesApiService](ng2-alfresco-core/src/services/deleted-nodes-api.service.ts)
|
||||
- [UserPreferencesService](ng2-alfresco-core/src/services/user-preferences.service.ts)
|
||||
- [UploadService](ng2-alfresco-core/src/services/upload.service.ts)
|
||||
- [TranslationService](ng2-alfresco-core/src/services/translation.service.ts)
|
||||
- [ThumbnailService](ng2-alfresco-core/src/services/thumbnail.service.ts)
|
||||
- [StorageService](ng2-alfresco-core/src/services/storage.service.ts)
|
||||
- [AlfrescoApiService](ng2-alfresco-core/src/services/alfresco-api.service.ts)
|
||||
- [RenditionsService](ng2-alfresco-core/src/services/renditions.service.ts)
|
||||
- [LogService](ng2-alfresco-core/src/services/log.service.ts)
|
||||
- [NotificationService](ng2-alfresco-core/src/services/notification.service.ts)
|
||||
- [CookieService](ng2-alfresco-core/src/services/cookie.service.ts)
|
||||
- [ContentService](ng2-alfresco-core/src/services/content.service.ts)
|
||||
- [AuthenticationService](ng2-alfresco-core/src/services/authentication.service.ts)
|
||||
- [AlfrescoSettingsService](ng2-alfresco-core/src/services/alfresco-settings.service.ts)
|
||||
- [AlfrescoContentService](ng2-alfresco-core/src/services/alfresco-content.service.ts)
|
||||
- [AppConfigService](ng2-alfresco-core/src/services/app-config.service.ts)
|
||||
- [DiagramsService](ng2-activiti-diagrams/src/services/diagrams.service.ts)
|
||||
- [DiagramColorService](ng2-activiti-diagrams/src/services/diagram-color.service.ts)
|
||||
- [RaphaelService](ng2-activiti-diagrams/src/components/raphael/raphael.service.ts)
|
||||
- [BpmUserService](ng2-alfresco-userinfo/src/services/bpm-user.service.ts)
|
||||
- [EcmUserService](ng2-alfresco-userinfo/src/services/ecm-user.service.ts)
|
||||
- [RenderingQueueService](ng2-alfresco-viewer/src/services/rendering-queue.services.ts)
|
||||
- [RatingService](ng2-alfresco-social/src/services/rating.service.ts)
|
||||
- [TagService](ng2-alfresco-tag/src/services/tag.service.ts)
|
||||
- [TaskListService](ng2-activiti-tasklist/src/services/tasklist.service.ts)
|
||||
- [ProcessUploadService](ng2-activiti-tasklist/src/services/process-upload.service.ts)
|
||||
- [PeopleService](ng2-activiti-tasklist/src/services/people.service.ts)
|
||||
- [AnalyticsService](ng2-activiti-analytics/src/services/analytics.service.ts)<!-- SERVICES END-->
|
||||
|
||||
You can browse all the components at the following address:
|
||||
|
||||
http://devproducts.alfresco.com/
|
||||
[http://devproducts.alfresco.com/](http://devproducts.alfresco.com/)
|
||||
@@ -27,6 +27,8 @@ function eraseContentList() {
|
||||
var businessRegexDirective = /(?:<!-- BUSINESS DIRECTIVE START-->)([\s\S]*?)(?:<!-- BUSINESS DIRECTIVE END-->)/;
|
||||
var contentRegexDirective = /(?:<!-- CONTENT DIRECTIVE START-->)([\s\S]*?)(?:<!-- CONTENT DIRECTIVE END-->)/;
|
||||
var coreRegexDirective = /(?:<!-- CORE DIRECTIVE START-->)([\s\S]*?)(?:<!-- CORE DIRECTIVE END-->)/;
|
||||
var servicessRegex = /(?:<!-- SERVICES START-->)([\s\S]*?)(?:<!-- SERVICES END-->)/;
|
||||
|
||||
|
||||
readmeContent = readmeContent.replace(businessRegex, '<!-- BUSINESS START--><!-- BUSINESS END-->');
|
||||
readmeContent = readmeContent.replace(contentRegex, '<!-- CONTENT START--><!-- CONTENT END-->');
|
||||
@@ -36,6 +38,8 @@ function eraseContentList() {
|
||||
readmeContent = readmeContent.replace(contentRegexDirective, '<!-- CONTENT DIRECTIVE START--><!-- CONTENT DIRECTIVE END-->');
|
||||
readmeContent = readmeContent.replace(coreRegexDirective, '<!-- CORE DIRECTIVE START--><!-- CORE DIRECTIVE END-->');
|
||||
|
||||
readmeContent = readmeContent.replace(servicessRegex, '<!-- SERVICES START--><!-- SERVICES END-->');
|
||||
|
||||
writeFile(readmeFilePath, readmeContent)
|
||||
}
|
||||
}
|
||||
@@ -47,17 +51,16 @@ function generateListComponent(currentFileContent, webpackInstance) {
|
||||
var componentSection = componentReg.exec(currentFileContent);
|
||||
|
||||
if (componentSection) {
|
||||
var selectorReg = /(selector)(\s?):(\s?)('|")((.|)*)('|")/gm;
|
||||
|
||||
var selectorReg = /(adf)([a-zA-Z]|-)+((?!,)|(?! ))/g;
|
||||
var selector = selectorReg.exec(componentSection[0]);
|
||||
|
||||
|
||||
if (selector) {
|
||||
if (selector[0].indexOf('alfresco') > 0 || selector[0].indexOf('activiti') > 0 || selector[0].indexOf('adf') > 0) {
|
||||
var selector = selector[0].replace("selector: '[", "").replace("']", '').replace("]", '').replace("selector: '", "").replace("'", '');
|
||||
if (selector) {
|
||||
var removeRoot = webpackInstance.resourcePath.substr(webpackInstance.resourcePath.indexOf('/ng2-components') + 16, webpackInstance.resourcePath.length);
|
||||
var url = removeRoot.substr(0, removeRoot.indexOf('src')) + 'README.md';
|
||||
|
||||
var link = '- [' + selector + '](' + url + ')';
|
||||
|
||||
var link = '- [' + selector[0] + '](' + url + ')';
|
||||
|
||||
if (webpackInstance.resourcePath.match('ng2-alfresco-core')) {
|
||||
readmeContent = readmeContent.replace('<!-- CORE START-->', '<!-- CORE START-->\n' + link);
|
||||
@@ -68,14 +71,14 @@ function generateListComponent(currentFileContent, webpackInstance) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var directiveReg = /(@Directive)(\s?)\((\s?){(\s?)((.|\n)*)}(\s?)\)/gm;
|
||||
var directiveSection = directiveReg.exec(currentFileContent);
|
||||
|
||||
if (directiveSection) {
|
||||
var selectorReg = /(selector)(\s?):(\s?)('|")((.|)*)('|")/gm;
|
||||
var selectorReg = /(adf)([a-zA-Z]|-)+((?!,)|(?! ))/g;
|
||||
var selector = selectorReg.exec(directiveSection[0]);
|
||||
|
||||
if (selector) {
|
||||
@@ -103,6 +106,32 @@ function generateListComponent(currentFileContent, webpackInstance) {
|
||||
}
|
||||
}
|
||||
|
||||
function generateListservices(currentFileContent, webpackInstance) {
|
||||
if (!isFileEmpty(currentFileContent)) {
|
||||
|
||||
var servicesReg = /(@Injectable\(\))(([a-zA-Z ]|\n)*)/gm;
|
||||
var servicesSection = servicesReg.exec(currentFileContent);
|
||||
|
||||
if (servicesSection) {
|
||||
|
||||
var selectorReg = /([a-zA-Z])+Service/g;
|
||||
var selector = selectorReg.exec(servicesSection[0]);
|
||||
|
||||
if (selector) {
|
||||
var url = webpackInstance.resourcePath.substr(webpackInstance.resourcePath.indexOf('/ng2-components') + 16, webpackInstance.resourcePath.length);
|
||||
|
||||
var link = '- [' + selector[0] + '](' + url + ')';
|
||||
|
||||
readmeContent = readmeContent.replace('<!-- SERVICES START-->', '<!-- SERVICES START-->\n' + link);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
writeFile(readmeFilePath, readmeContent);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = function (input, map) {
|
||||
this.cacheable && this.cacheable();
|
||||
@@ -117,6 +146,7 @@ module.exports = function (input, map) {
|
||||
if (readmeContent) {
|
||||
eraseContentList();
|
||||
generateListComponent(input, this);
|
||||
generateListservices(input, this);
|
||||
}
|
||||
callback(null, input, map);
|
||||
}
|
||||
|
||||
@@ -34,8 +34,7 @@ module.exports = {
|
||||
resolveLoader: {
|
||||
alias: {
|
||||
"file-multi-loader": path.resolve(__dirname, "./custom-loaders/file-loader-multi"),
|
||||
"license-check": path.resolve(__dirname, "./custom-loaders/license-check"),
|
||||
"generate-list-component-loader": path.resolve(__dirname, "./custom-loaders/generateListComponent")
|
||||
"license-check": path.resolve(__dirname, "./custom-loaders/license-check")
|
||||
}
|
||||
},
|
||||
|
||||
@@ -81,8 +80,10 @@ module.exports = {
|
||||
test: /\.ts$/,
|
||||
loader: 'tslint-loader',
|
||||
options: {
|
||||
configFile : helpers.root('tslint.json'),
|
||||
emitErrors: true,
|
||||
failOnHint: true
|
||||
failOnHint: true,
|
||||
fix: true
|
||||
},
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
@@ -102,7 +103,7 @@ module.exports = {
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.component.scss$/,
|
||||
test: /\.scss$/,
|
||||
use: [{
|
||||
loader: "to-string-loader"
|
||||
}, {
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
const helpers = require('./helpers');
|
||||
const webpackMerge = require('webpack-merge');
|
||||
const webpackBuild = require('./webpack.build');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = webpackMerge(webpackBuild, {
|
||||
|
||||
resolveLoader: {
|
||||
alias: {
|
||||
"generate-list-component-loader": path.resolve(__dirname, "./custom-loaders/generateListComponent")
|
||||
}
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
|
||||
{
|
||||
test: /\.ts/,
|
||||
loader: 'generate-list-component-loader',
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
## Prerequisites
|
||||
|
||||
Before you start using this development framework, make sure you have installed all required software and done all the
|
||||
necessary configuration, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md).
|
||||
necessary configurations, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md).
|
||||
|
||||
> If you plan using this component with projects generated by Angular CLI, please refer to the following article: [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI)
|
||||
> If you plan to use this component with projects generated by Angular CLI, you can read more in [Using ADF with Angular CLI](https://github.com/Alfresco/alfresco-ng2-components/wiki/Angular-CLI)
|
||||
|
||||
## Install
|
||||
|
||||
@@ -53,14 +53,14 @@ The component shows the list of all the available reports
|
||||
| --- | --- | --- | --- | --- |
|
||||
| appId | string | optional | | The application id |
|
||||
| layoutType | string | required | | Define the layout of the apps. There are two possible values: GRID or LIST. LIST is the default value|
|
||||
| selectFirst | boolean | optional | false | Change the value to true if you want select the first item in the list as default|
|
||||
| selectFirst | boolean | optional | false | Change the value to true if you want to select the first item in the list as default|
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Description |
|
||||
| --- | --- |
|
||||
| onSuccess | The event is emitted when the report list are loaded |
|
||||
| onError | The event is emitted when an error occur during the loading |
|
||||
| onSuccess | The event is emitted when the report list is loaded |
|
||||
| onError | The event is emitted when an error occurs during the loading |
|
||||
| reportClick | The event is emitted when the report in the list is selected |
|
||||
|
||||
## Activiti Analytics Component
|
||||
@@ -68,10 +68,10 @@ The component shows the list of all the available reports
|
||||
The component shows the charts related to the reportId passed as input
|
||||
|
||||
```html
|
||||
<activiti-analytics
|
||||
<adf-analytics
|
||||
[appId]="1001"
|
||||
[reportId]="2006">
|
||||
</activiti-analytics>
|
||||
</adf-analytics>
|
||||
```
|
||||
|
||||
### Properties
|
||||
@@ -86,11 +86,11 @@ The component shows the charts related to the reportId passed as input
|
||||
You can also hide chart parameters UI by setting the `hideParameters` to `true`:
|
||||
|
||||
```html
|
||||
<activiti-analytics
|
||||
<adf-analytics
|
||||
[appId]="appId"
|
||||
[reportId]="reportId"
|
||||
[hideParameters]="true">
|
||||
</activiti-analytics>
|
||||
</adf-analytics>
|
||||
```
|
||||
|
||||

|
||||
@@ -100,19 +100,19 @@ You can also hide chart parameters UI by setting the `hideParameters` to `true`:
|
||||
| Name | Description |
|
||||
| --- | --- |
|
||||
| onSuccess | The event is emitted when the report parameters are loaded |
|
||||
| onError | The event is emitted when an error occur during the loading |
|
||||
| onError | The event is emitted when an error occurs during the loading |
|
||||
| reportSaved | The event is emitted when a report is saved |
|
||||
| reportDeleted | The event is emitted when a report is deleted |
|
||||
|
||||
## Analytics Generator Component
|
||||
|
||||
The component generate and show the charts
|
||||
The component generates and shows the charts
|
||||
|
||||
```html
|
||||
<activiti-analytics-generator
|
||||
<adf-analytics-generator
|
||||
[reportId]="reportId"
|
||||
[reportParamQuery]="reportParamQuery">
|
||||
</activiti-analytics>
|
||||
</adf-analytics>
|
||||
```
|
||||
|
||||
### Properties
|
||||
@@ -127,11 +127,11 @@ The component generate and show the charts
|
||||
| Name | Description |
|
||||
| --- | --- |
|
||||
| onSuccess | Raised when the charts are loaded |
|
||||
| onError | Raised when an error occur during the loading |
|
||||
| onError | Raised when an error occurs during the loading |
|
||||
|
||||
## Build from sources
|
||||
|
||||
You can build component from sources with the following commands:
|
||||
You can build the component from sources with the following commands:
|
||||
|
||||
```sh
|
||||
npm install
|
||||
|
||||
@@ -41,7 +41,8 @@ module.exports = {
|
||||
loader: 'tslint-loader',
|
||||
options: {
|
||||
emitErrors: true,
|
||||
failOnHint: true
|
||||
failOnHint: true,
|
||||
fix: true
|
||||
},
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
@@ -61,8 +62,17 @@ module.exports = {
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.component.scss$/,
|
||||
use: ['to-string-loader', 'raw-loader', 'sass-loader'],
|
||||
test: /\.scss$/,
|
||||
use: [{
|
||||
loader: "to-string-loader"
|
||||
}, {
|
||||
loader: "raw-loader"
|
||||
}, {
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
includePaths: [ path.resolve(__dirname, '../../ng2-alfresco-core/styles')]
|
||||
}
|
||||
}],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
# http://editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[package.json]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[karma.conf.js]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.md]
|
||||
insert_final_newline = false
|
||||
trim_trailing_whitespace = false
|
||||
@@ -1,6 +0,0 @@
|
||||
node_modules
|
||||
.idea
|
||||
coverage
|
||||
dist
|
||||
typings
|
||||
!systemjs.config.js
|
||||
@@ -1,3 +0,0 @@
|
||||
node_modules
|
||||
dist
|
||||
typings
|
||||
@@ -1,13 +0,0 @@
|
||||
# Activiti Analytics demo
|
||||
|
||||
Install:
|
||||
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
Run the project:
|
||||
|
||||
```
|
||||
npm start
|
||||
```
|
||||
@@ -1,10 +0,0 @@
|
||||
var path = require('path');
|
||||
|
||||
var _root = path.resolve(__dirname, '..');
|
||||
|
||||
function root(args) {
|
||||
args = Array.prototype.slice.call(arguments, 0);
|
||||
return path.join.apply(path, [_root].concat(args));
|
||||
}
|
||||
|
||||
exports.root = root;
|
||||
@@ -1,127 +0,0 @@
|
||||
const webpack = require('webpack');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||
const helpers = require('./helpers');
|
||||
const path = require('path');
|
||||
|
||||
const alfrescoLibs = [
|
||||
'ng2-activiti-analytics',
|
||||
'ng2-activiti-diagrams'
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
'polyfills': './src/polyfills.ts',
|
||||
'vendor': './src/vendor.ts',
|
||||
'dist': './src/main.ts'
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
include: [helpers.root('src'), helpers.root('../ng2-components')],
|
||||
loader: 'source-map-loader',
|
||||
exclude: [ /node_modules/, /public/, /resources/, /dist/]
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
include: [helpers.root('src'), helpers.root('..')],
|
||||
loader: [
|
||||
'ts-loader',
|
||||
'angular2-template-loader'
|
||||
],
|
||||
exclude: [ /node_modules/, /public/, /resources/, /dist/]
|
||||
},
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
loader: 'tslint-loader',
|
||||
include: [helpers.root('src')],
|
||||
options: {
|
||||
emitErrors: true
|
||||
},
|
||||
exclude: [ /node_modules/, /public/, /resources/, /dist/]
|
||||
},
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
use: 'source-map-loader',
|
||||
exclude: [ /public/, /resources/, /dist/]
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
loader: 'html-loader',
|
||||
exclude: [ /node_modules/, /public/, /resources/, /dist/]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
exclude: [helpers.root('src'), helpers.root('../ng2-components')],
|
||||
loader: ExtractTextPlugin.extract({
|
||||
fallback: 'style-loader',
|
||||
use: 'css-loader?sourceMap'
|
||||
})
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
include: [helpers.root('src'), helpers.root('../ng2-components')],
|
||||
loader: 'raw-loader'
|
||||
},
|
||||
{
|
||||
test: /\.component.scss$/,
|
||||
use: ['to-string-loader', 'raw-loader', 'sass-loader']
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
|
||||
loader: 'file-loader?name=assets/[name].[hash].[ext]'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
// Workaround for angular/angular#11580
|
||||
new webpack.ContextReplacementPlugin(
|
||||
// The (\\|\/) piece accounts for path separators in *nix and Windows
|
||||
/angular(\\|\/)core(\\|\/)@angular/,
|
||||
helpers.root('./src'), // location of your src
|
||||
{} // a map of your routes
|
||||
),
|
||||
new HtmlWebpackPlugin({
|
||||
template: './index.html'
|
||||
}),
|
||||
|
||||
new CopyWebpackPlugin([
|
||||
... alfrescoLibs.map(lib => {
|
||||
return {
|
||||
context: `../ng2-components/${lib}/bundles/assets/` ,
|
||||
from: '**/*',
|
||||
to: `assets/`
|
||||
}
|
||||
}),
|
||||
{
|
||||
context: 'resources/i18n',
|
||||
from: '**/*.json',
|
||||
to: 'resources/i18n'
|
||||
}
|
||||
]),
|
||||
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: ['src', 'vendor', 'polyfills']
|
||||
})
|
||||
],
|
||||
|
||||
devServer: {
|
||||
contentBase: helpers.root('dist'),
|
||||
compress: true,
|
||||
port: 3000,
|
||||
historyApiFallback: true,
|
||||
host: '0.0.0.0',
|
||||
inline: true
|
||||
},
|
||||
|
||||
node: {
|
||||
fs: 'empty'
|
||||
}
|
||||
};
|
||||
@@ -1,37 +0,0 @@
|
||||
const webpack = require('webpack');
|
||||
const webpackMerge = require('webpack-merge');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
const commonConfig = require('./webpack.common.js');
|
||||
const helpers = require('./helpers');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = webpackMerge(commonConfig, {
|
||||
|
||||
devtool: 'cheap-module-eval-source-map',
|
||||
|
||||
output: {
|
||||
path: helpers.root('dist'),
|
||||
filename: '[name].js',
|
||||
chunkFilename: '[id].chunk.js'
|
||||
},
|
||||
|
||||
resolve: {
|
||||
alias: {
|
||||
"ng2-alfresco-core$": path.resolve(__dirname, '../../ng2-alfresco-core/index.ts'),
|
||||
"ng2-activiti-diagrams$": path.resolve(__dirname, '../../ng2-activiti-diagrams/index.ts'),
|
||||
"ng2-activiti-analytics$": path.resolve(__dirname, '../../ng2-activiti-analytics/index.ts')
|
||||
},
|
||||
extensions: ['.ts', '.js'],
|
||||
modules: [path.resolve(__dirname, '../node_modules')]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
new ExtractTextPlugin('[name].[hash].css'),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
htmlLoader: {
|
||||
minimize: false // workaround for ng2
|
||||
}
|
||||
})
|
||||
]
|
||||
});
|
||||
@@ -1,66 +0,0 @@
|
||||
const webpack = require('webpack');
|
||||
const webpackMerge = require('webpack-merge');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
const commonConfig = require('./webpack.common.js');
|
||||
const helpers = require('./helpers');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
|
||||
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
|
||||
|
||||
const alfrescoLibs = [
|
||||
'ng2-activiti-analytics',
|
||||
'ng2-activiti-diagrams'
|
||||
];
|
||||
|
||||
module.exports = webpackMerge(commonConfig, {
|
||||
|
||||
devtool: 'source-map',
|
||||
|
||||
output: {
|
||||
path: helpers.root('dist'),
|
||||
publicPath: '/',
|
||||
filename: '[name].[hash].js',
|
||||
chunkFilename: '[id].[hash].chunk.js'
|
||||
},
|
||||
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
modules: [helpers.root('node_modules')]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new CopyWebpackPlugin([
|
||||
... alfrescoLibs.map(lib => {
|
||||
return {
|
||||
context: `node_modules/${lib}/bundles/assets/` ,
|
||||
from: '**/*',
|
||||
to: `assets/`
|
||||
}
|
||||
})
|
||||
]),
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618
|
||||
mangle: {
|
||||
keep_fnames: true
|
||||
},
|
||||
compress: {
|
||||
warnings: false
|
||||
},
|
||||
output: {
|
||||
comments: false
|
||||
},
|
||||
sourceMap: true
|
||||
}),
|
||||
new ExtractTextPlugin('[name].[hash].css'),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'ENV': JSON.stringify(ENV)
|
||||
}
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
htmlLoader: {
|
||||
minimize: false // workaround for ng2
|
||||
}
|
||||
})
|
||||
]
|
||||
});
|
||||
@@ -1,16 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Alfresco Angular 2 Activiti Analytics - Demo</title>
|
||||
<base href="./">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<alfresco-app-demo></alfresco-app-demo>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,79 +0,0 @@
|
||||
{
|
||||
"name": "ng2-activiti-analytics-demo",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
||||
"dev": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.8",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
|
||||
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
|
||||
"dev": true
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
||||
"dev": true
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
|
||||
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
|
||||
"dev": true
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dev": true
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
|
||||
"dev": true
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dev": true
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"dev": true
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz",
|
||||
"integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=",
|
||||
"dev": true
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
{
|
||||
"name": "ng2-activiti-analytics-demo",
|
||||
"description": "Alfresco Angular2 Diagrams Component - Demo",
|
||||
"version": "0.1.0",
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"scripts": {
|
||||
"build": "rimraf dist && npm run webpack -- --config config/webpack.prod.js --progress --profile --bail",
|
||||
"build:dev": "rimraf dist && npm run webpack -- --config config/webpack.dev.js --progress --profile --bail",
|
||||
"start:dist": "wsrv -s dist/ -p 3000 -a 0.0.0.0",
|
||||
"start": "npm run webpack-dev-server -- --config config/webpack.prod.js --progress --content-base app/",
|
||||
"start:dev": "npm run webpack-dev-server -- --config config/webpack.dev.js --progress --content-base app/",
|
||||
"clean": "npm run clean-build && rimraf dist node_modules typings dist",
|
||||
"clean-build": "rimraf 'app/{,**/}**.js' 'app/{,**/}**.js.map' 'app/{,**/}**.d.ts'",
|
||||
"webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
|
||||
"webpack": "webpack"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Maurizio Vitale",
|
||||
"email": "maurizio.vitale@alfresco.com"
|
||||
}
|
||||
],
|
||||
"keywords": [
|
||||
"ng2",
|
||||
"angular",
|
||||
"angular2",
|
||||
"activiti",
|
||||
"activiti-diagrams"
|
||||
],
|
||||
"dependencies": {
|
||||
"@angular/animations": "4.2.5",
|
||||
"@angular/common": "4.2.5",
|
||||
"@angular/compiler": "4.2.5",
|
||||
"@angular/core": "4.2.5",
|
||||
"@angular/forms": "4.2.5",
|
||||
"@angular/http": "4.2.5",
|
||||
"@angular/platform-browser": "4.2.5",
|
||||
"@angular/platform-browser-dynamic": "4.2.5",
|
||||
"@angular/router": "4.2.5",
|
||||
"@angular/material": "2.0.0-beta.1",
|
||||
"alfresco-js-api": "~1.6.1",
|
||||
"core-js": "2.4.1",
|
||||
"hammerjs": "2.0.8",
|
||||
"ng2-alfresco-core": "1.6.1",
|
||||
"@ngx-translate/core": "7.0.0",
|
||||
"reflect-metadata": "0.1.10",
|
||||
"rxjs": "5.1.0",
|
||||
"systemjs": "0.19.27",
|
||||
"zone.js": "0.7.6",
|
||||
"intl": "1.2.4",
|
||||
"dialog-polyfill": "0.4.7",
|
||||
"element.scrollintoviewifneeded-polyfill": "1.0.1",
|
||||
"material-design-icons": "2.2.3",
|
||||
"material-design-lite": "1.2.1",
|
||||
"chart.js": "2.5.0",
|
||||
"md-date-time-picker": "2.2.0",
|
||||
"ng2-charts": "1.6.0",
|
||||
"moment": "2.15.1",
|
||||
"raphael": "2.2.6",
|
||||
"ng2-activiti-diagrams": "1.6.1",
|
||||
"ng2-activiti-analytics": "1.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/hammerjs": "2.0.34",
|
||||
"@types/jasmine": "2.5.35",
|
||||
"@types/node": "6.0.45",
|
||||
"angular2-template-loader": "0.6.2",
|
||||
"autoprefixer": "6.5.4",
|
||||
"copy-webpack-plugin": "4.0.1",
|
||||
"css-loader": "0.23.1",
|
||||
"css-to-string-loader": "0.1.2",
|
||||
"cssnano": "3.8.1",
|
||||
"extract-text-webpack-plugin": "2.0.0-rc.3",
|
||||
"file-loader": "0.11.1",
|
||||
"html-loader": "0.4.4",
|
||||
"html-webpack-plugin": "2.28.0",
|
||||
"istanbul-instrumenter-loader": "0.2.0",
|
||||
"jasmine-ajax": "3.2.0",
|
||||
"jasmine-core": "2.4.1",
|
||||
"karma": "0.13.22",
|
||||
"karma-chrome-launcher": "~1.0.1",
|
||||
"karma-coverage": "1.1.1",
|
||||
"karma-jasmine": "~1.0.2",
|
||||
"karma-jasmine-ajax": "0.1.13",
|
||||
"karma-jasmine-html-reporter": "0.2.0",
|
||||
"karma-mocha-reporter": "2.2.2",
|
||||
"karma-remap-istanbul": "0.6.0",
|
||||
"karma-sourcemap-loader": "0.3.7",
|
||||
"karma-systemjs": "0.16.0",
|
||||
"karma-webpack": "2.0.3",
|
||||
"loader-utils": "1.1.0",
|
||||
"merge-stream": "1.0.1",
|
||||
"node-sass": "3.13.1",
|
||||
"null-loader": "0.1.1",
|
||||
"package-json-merge": "0.0.1",
|
||||
"raw-loader": "0.5.1",
|
||||
"remap-istanbul": "0.6.3",
|
||||
"rimraf": "2.6.1",
|
||||
"run-sequence": "1.2.2",
|
||||
"sass-loader": "6.0.2",
|
||||
"script-loader": "0.7.0",
|
||||
"source-map-loader": "0.1.6",
|
||||
"style-loader": "0.13.1",
|
||||
"systemjs-builder": "0.15.34",
|
||||
"to-string-loader": "1.1.5",
|
||||
"traceur": "0.0.91",
|
||||
"ts-loader": "2.2.1",
|
||||
"ts-node": "1.7.0",
|
||||
"tslint": "4.5.1",
|
||||
"tslint-loader": "3.5.3",
|
||||
"typescript": "2.1.6",
|
||||
"webpack": "2.2.1",
|
||||
"webpack-dev-server": "2.3.0",
|
||||
"webpack-merge": "2.6.1",
|
||||
"wsrv": "0.1.7"
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NgModule, Component, OnInit } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import { CoreModule, AlfrescoSettingsService, AlfrescoAuthenticationService, StorageService, LogService } from 'ng2-alfresco-core';
|
||||
import { AnalyticsModule } from 'ng2-activiti-analytics';
|
||||
|
||||
@Component({
|
||||
selector: 'alfresco-app-demo',
|
||||
template: `
|
||||
<label for="ticket"><b>Insert a valid ticket:</b></label><br>
|
||||
<input id="ticket" type="text" size="48" (change)="updateTicket()" [(ngModel)]="ticket"><br>
|
||||
<label for="host"><b>Insert the ip of your Activiti instance:</b></label><br>
|
||||
<input id="host" type="text" size="48" (change)="updateHost()" [(ngModel)]="host"><br><br>
|
||||
<div *ngIf="!authenticated" style="color:#FF2323">
|
||||
Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid ticket to perform
|
||||
operations.
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="page-content">
|
||||
<label for="appId"><b>Insert the appId:</b></label><br>
|
||||
<input id="appId" size="10" type="text" [(ngModel)]="appId">
|
||||
<div class="mdl-grid">
|
||||
<div class="mdl-cell mdl-cell--4-col task-column mdl-shadow--2dp">
|
||||
<analytics-report-list (reportClick)="onReportClick($event)"></analytics-report-list>
|
||||
</div>
|
||||
<div class="mdl-cell mdl-cell--8-col task-column mdl-shadow--2dp">
|
||||
<activiti-analytics [appId]="appId" *ngIf="report" [reportId]="report.id"></activiti-analytics>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
||||
export class AnalyticsDemoComponent implements OnInit {
|
||||
|
||||
appId: number;
|
||||
report: any;
|
||||
authenticated: boolean;
|
||||
host: string = 'http://localhost:9999';
|
||||
ticket: string;
|
||||
|
||||
constructor(private authService: AlfrescoAuthenticationService,
|
||||
private settingsService: AlfrescoSettingsService,
|
||||
private storage: StorageService,
|
||||
private logService: LogService) {
|
||||
settingsService.bpmHost = this.host;
|
||||
settingsService.setProviders('BPM');
|
||||
|
||||
if (this.authService.getTicketBpm()) {
|
||||
this.ticket = this.authService.getTicketBpm();
|
||||
}
|
||||
}
|
||||
|
||||
onReportClick(event: any) {
|
||||
this.report = event;
|
||||
}
|
||||
|
||||
public updateTicket(): void {
|
||||
this.storage.setItem('ticket-BPM', this.ticket);
|
||||
}
|
||||
|
||||
public updateHost(): void {
|
||||
this.settingsService.bpmHost = this.host;
|
||||
this.login();
|
||||
}
|
||||
|
||||
public ngOnInit(): void {
|
||||
this.login();
|
||||
}
|
||||
|
||||
login() {
|
||||
this.authService.login('admin', 'admin').subscribe(
|
||||
ticket => {
|
||||
this.logService.log(ticket);
|
||||
this.ticket = this.authService.getTicketBpm();
|
||||
this.authenticated = true;
|
||||
},
|
||||
error => {
|
||||
this.logService.error(error);
|
||||
this.authenticated = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
BrowserModule,
|
||||
CoreModule.forRoot(),
|
||||
AnalyticsModule
|
||||
],
|
||||
declarations: [AnalyticsDemoComponent],
|
||||
bootstrap: [AnalyticsDemoComponent]
|
||||
})
|
||||
export class AppModule {
|
||||
}
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
@@ -1,17 +0,0 @@
|
||||
import 'core-js/es6';
|
||||
import 'core-js/es7/reflect';
|
||||
import 'intl';
|
||||
|
||||
require('zone.js/dist/zone'); // IE 8-11
|
||||
require('element.scrollintoviewifneeded-polyfill'); // IE/FF
|
||||
|
||||
if (process.env.ENV === 'production') {
|
||||
// Production
|
||||
|
||||
} else {
|
||||
// Development
|
||||
|
||||
Error['stackTraceLimit'] = Infinity;
|
||||
|
||||
require('zone.js/dist/long-stack-trace-zone');
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user