mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
shared library (#1080)
* shared project scaffold * rules package * move evaluators to shared lib * add rxjs peer dependency * use dedicated material namespaces * create store package, move actions * move selectors to shared library * move generic effects to shared lib * move routing extensions * minor code reorg * fix unit tests * move content-api service * move permission service * update tests * update plint config * move page layout * css variables * use dedicated css property * move generic error component to shared lib * fix test
This commit is contained in:
parent
f3c5ffb977
commit
9db1c2989f
3
.github/plint.yml
vendored
3
.github/plint.yml
vendored
@ -5,3 +5,6 @@ modules:
|
|||||||
spellcheck:
|
spellcheck:
|
||||||
words:
|
words:
|
||||||
- plint
|
- plint
|
||||||
|
- ngrx
|
||||||
|
- qshare
|
||||||
|
- snackbar
|
||||||
|
35
angular.json
35
angular.json
@ -273,6 +273,41 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"aca-shared": {
|
||||||
|
"root": "projects/aca-shared",
|
||||||
|
"sourceRoot": "projects/aca-shared/src",
|
||||||
|
"projectType": "library",
|
||||||
|
"prefix": "lib",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-ng-packagr:build",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": "projects/aca-shared/tsconfig.lib.json",
|
||||||
|
"project": "projects/aca-shared/ng-package.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular-devkit/build-angular:karma",
|
||||||
|
"options": {
|
||||||
|
"main": "projects/aca-shared/test.ts",
|
||||||
|
"tsConfig": "projects/aca-shared/tsconfig.spec.json",
|
||||||
|
"karmaConfig": "projects/aca-shared/karma.conf.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"projects/aca-shared/tsconfig.lib.json",
|
||||||
|
"projects/aca-shared/tsconfig.spec.json"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"**/node_modules/**"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultProject": "app",
|
"defaultProject": "app",
|
||||||
|
@ -161,7 +161,7 @@ Update `my-extension-dialog.component.ts`:
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { MatDialogRef } from '@angular/material';
|
import { MatDialogRef } from '@angular/material/dialog';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'aca-my-extension-dialog',
|
selector: 'aca-my-extension-dialog',
|
||||||
@ -229,7 +229,7 @@ See also:
|
|||||||
Update to raise a dialog
|
Update to raise a dialog
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { MatDialog } from '@angular/material';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my-extension-dialog.component';
|
import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my-extension-dialog.component';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -36,7 +36,7 @@ Update `my-extension-dialog.component.ts`:
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { MatDialogRef } from '@angular/material';
|
import { MatDialogRef } from '@angular/material/dialog';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'aca-my-extension-dialog',
|
selector: 'aca-my-extension-dialog',
|
||||||
@ -104,7 +104,7 @@ See also:
|
|||||||
Update to raise a dialog
|
Update to raise a dialog
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { MatDialog } from '@angular/material';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my-extension-dialog.component';
|
import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my-extension-dialog.component';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
41
package-lock.json
generated
41
package-lock.json
generated
@ -4959,7 +4959,8 @@
|
|||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"aproba": {
|
"aproba": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
@ -4980,12 +4981,14 @@
|
|||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"balanced-match": "^1.0.0",
|
"balanced-match": "^1.0.0",
|
||||||
"concat-map": "0.0.1"
|
"concat-map": "0.0.1"
|
||||||
@ -5000,17 +5003,20 @@
|
|||||||
"code-point-at": {
|
"code-point-at": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"console-control-strings": {
|
"console-control-strings": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"core-util-is": {
|
"core-util-is": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
@ -5127,7 +5133,8 @@
|
|||||||
"inherits": {
|
"inherits": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"ini": {
|
"ini": {
|
||||||
"version": "1.3.5",
|
"version": "1.3.5",
|
||||||
@ -5139,6 +5146,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"number-is-nan": "^1.0.0"
|
"number-is-nan": "^1.0.0"
|
||||||
}
|
}
|
||||||
@ -5153,6 +5161,7 @@
|
|||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^1.1.7"
|
||||||
}
|
}
|
||||||
@ -5160,12 +5169,14 @@
|
|||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "0.0.8",
|
"version": "0.0.8",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"minipass": {
|
"minipass": {
|
||||||
"version": "2.3.5",
|
"version": "2.3.5",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"safe-buffer": "^5.1.2",
|
"safe-buffer": "^5.1.2",
|
||||||
"yallist": "^3.0.0"
|
"yallist": "^3.0.0"
|
||||||
@ -5184,6 +5195,7 @@
|
|||||||
"version": "0.5.1",
|
"version": "0.5.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimist": "0.0.8"
|
"minimist": "0.0.8"
|
||||||
}
|
}
|
||||||
@ -5264,7 +5276,8 @@
|
|||||||
"number-is-nan": {
|
"number-is-nan": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"object-assign": {
|
"object-assign": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
@ -5276,6 +5289,7 @@
|
|||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"wrappy": "1"
|
"wrappy": "1"
|
||||||
}
|
}
|
||||||
@ -5361,7 +5375,8 @@
|
|||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
"version": "5.1.2",
|
"version": "5.1.2",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"safer-buffer": {
|
"safer-buffer": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
@ -5397,6 +5412,7 @@
|
|||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"code-point-at": "^1.0.0",
|
"code-point-at": "^1.0.0",
|
||||||
"is-fullwidth-code-point": "^1.0.0",
|
"is-fullwidth-code-point": "^1.0.0",
|
||||||
@ -5416,6 +5432,7 @@
|
|||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ansi-regex": "^2.0.0"
|
"ansi-regex": "^2.0.0"
|
||||||
}
|
}
|
||||||
@ -5459,12 +5476,14 @@
|
|||||||
"wrappy": {
|
"wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
11
package.json
11
package.json
@ -4,15 +4,16 @@
|
|||||||
"license": "LGPL-3.0",
|
"license": "LGPL-3.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "npm run build.extensions && ng serve --open",
|
"start": "npm run build.shared && npm run build.extensions && ng serve --open",
|
||||||
"start:prod": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng serve --prod --open",
|
"start:prod": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng serve --prod --open",
|
||||||
"build:aos-extension": "npx rimraf dist/@alfresco/adf-office-services-ext && ng build adf-office-services-ext && cpr projects/adf-office-services-ext/ngi.json dist/@alfresco/adf-office-services-ext/ngi.json && cpr projects/adf-office-services-ext/assets dist/@alfresco/adf-office-services-ext/assets",
|
"build:aos-extension": "npx rimraf dist/@alfresco/adf-office-services-ext && ng build adf-office-services-ext && cpr projects/adf-office-services-ext/ngi.json dist/@alfresco/adf-office-services-ext/ngi.json && cpr projects/adf-office-services-ext/assets dist/@alfresco/adf-office-services-ext/assets",
|
||||||
|
"build.shared": "ng build aca-shared",
|
||||||
"build.extensions": "npm run build:aos-extension",
|
"build.extensions": "npm run build:aos-extension",
|
||||||
"build.app": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build app",
|
"build.app": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build app",
|
||||||
"build": "npm run build.extensions && npm run build.app -- --prod",
|
"build": "npm run build.shared && npm run build.extensions && npm run build.app -- --prod",
|
||||||
"build.e2e": "npm run build.extensions && npm run build.app -- --prod --configuration=e2e",
|
"build.e2e": "npm run build.shared && npm run build.extensions && npm run build.app -- --prod --configuration=e2e",
|
||||||
"test": "ng test app --code-coverage",
|
"test": "ng test app --code-coverage",
|
||||||
"test:ci": "npm run build.extensions && ng test adf-office-services-ext --watch=false && ng test app --code-coverage --watch=false",
|
"test:ci": "npm run build.shared && npm run build.extensions && ng test adf-office-services-ext --watch=false && ng test app --code-coverage --watch=false",
|
||||||
"lint": "ng lint && npm run spellcheck && npm run format:check && npm run e2e.typecheck",
|
"lint": "ng lint && npm run spellcheck && npm run format:check && npm run e2e.typecheck",
|
||||||
"wd:update": "webdriver-manager update --gecko=false",
|
"wd:update": "webdriver-manager update --gecko=false",
|
||||||
"e2e.typecheck": "tsc -p ./e2e/tsconfig.e2e.typecheck.json",
|
"e2e.typecheck": "tsc -p ./e2e/tsconfig.e2e.typecheck.json",
|
||||||
@ -26,7 +27,7 @@
|
|||||||
"inspect.bundle": "ng build app --prod --stats-json && npx webpack-bundle-analyzer dist/app/stats.json",
|
"inspect.bundle": "ng build app --prod --stats-json && npx webpack-bundle-analyzer dist/app/stats.json",
|
||||||
"format:check": "prettier --check \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"",
|
"format:check": "prettier --check \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"",
|
||||||
"format:fix": "prettier --write \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"",
|
"format:fix": "prettier --write \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"",
|
||||||
"build.tomcat": "npm run build.extensions && npm run build.app -- --prod --base-href ./ && jar -cvf docker/tomcat/artifacts/content-app.war -C dist/app/ .",
|
"build.tomcat": "npm run build.shared && npm run build.extensions && npm run build.app -- --prod --base-href ./ && jar -cvf docker/tomcat/artifacts/content-app.war -C dist/app/ .",
|
||||||
"build.tomcat.e2e": "./build-tomcat-e2e.sh",
|
"build.tomcat.e2e": "./build-tomcat-e2e.sh",
|
||||||
"e2e.tomcat": "npm run wd:update && protractor --baseUrl=http://localhost:4000/content-app/ $SUITE",
|
"e2e.tomcat": "npm run wd:update && protractor --baseUrl=http://localhost:4000/content-app/ $SUITE",
|
||||||
"docker.tomcat.start": "cd docker/tomcat && docker-compose up -d --build && npm run wait:app",
|
"docker.tomcat.start": "cd docker/tomcat && docker-compose up -d --build && npm run wait:app",
|
||||||
|
24
projects/aca-shared/README.md
Normal file
24
projects/aca-shared/README.md
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# AcaShared
|
||||||
|
|
||||||
|
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.2.0.
|
||||||
|
|
||||||
|
## Code scaffolding
|
||||||
|
|
||||||
|
Run `ng generate component component-name --project aca-shared` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project aca-shared`.
|
||||||
|
> Note: Don't forget to add `--project aca-shared` or else it will be added to the default project in your `angular.json` file.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
Run `ng build aca-shared` to build the project. The build artifacts will be stored in the `dist/` directory.
|
||||||
|
|
||||||
|
## Publishing
|
||||||
|
|
||||||
|
After building your library with `ng build aca-shared`, go to the dist folder `cd dist/aca-shared` and run `npm publish`.
|
||||||
|
|
||||||
|
## Running unit tests
|
||||||
|
|
||||||
|
Run `ng test aca-shared` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||||
|
|
||||||
|
## Further help
|
||||||
|
|
||||||
|
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
32
projects/aca-shared/karma.conf.js
Normal file
32
projects/aca-shared/karma.conf.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
// Karma configuration file, see link for more information
|
||||||
|
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||||
|
|
||||||
|
module.exports = function(config) {
|
||||||
|
config.set({
|
||||||
|
basePath: '',
|
||||||
|
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||||
|
plugins: [
|
||||||
|
require('karma-jasmine'),
|
||||||
|
require('karma-chrome-launcher'),
|
||||||
|
require('karma-jasmine-html-reporter'),
|
||||||
|
require('karma-coverage-istanbul-reporter'),
|
||||||
|
require('@angular-devkit/build-angular/plugins/karma')
|
||||||
|
],
|
||||||
|
client: {
|
||||||
|
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||||
|
},
|
||||||
|
coverageIstanbulReporter: {
|
||||||
|
dir: require('path').join(__dirname, '../../coverage/aca-shared'),
|
||||||
|
reports: ['html', 'lcovonly'],
|
||||||
|
fixWebpackSourcePaths: true
|
||||||
|
},
|
||||||
|
reporters: ['progress', 'kjhtml'],
|
||||||
|
port: 9876,
|
||||||
|
colors: true,
|
||||||
|
logLevel: config.LOG_INFO,
|
||||||
|
autoWatch: true,
|
||||||
|
browsers: ['Chrome'],
|
||||||
|
singleRun: false,
|
||||||
|
restartOnFileChange: true
|
||||||
|
});
|
||||||
|
};
|
17
projects/aca-shared/ng-package.json
Normal file
17
projects/aca-shared/ng-package.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
|
||||||
|
"dest": "../../dist/@alfresco/aca-shared",
|
||||||
|
"lib": {
|
||||||
|
"entryFile": "src/public-api.ts",
|
||||||
|
"umdModuleIds": {
|
||||||
|
"rxjs": "rxjs",
|
||||||
|
"@alfresco/js-api": "@alfresco/js-api",
|
||||||
|
"@alfresco/adf-core": "@alfresco/adf-core",
|
||||||
|
"@alfresco/adf-extensions": "@alfresco/adf-extensions",
|
||||||
|
"@ngrx/store": "@ngrx/store",
|
||||||
|
"@ngrx/effects": "@ngrx/effects",
|
||||||
|
"@angular/material": "@angular/material",
|
||||||
|
"@ngx-translate/core": "@ngx-translate/core"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
15
projects/aca-shared/package.json
Normal file
15
projects/aca-shared/package.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "@alfresco/aca-shared",
|
||||||
|
"version": "1.8.0",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@angular/common": "^7.2.0",
|
||||||
|
"@angular/core": "^7.2.0",
|
||||||
|
"@angular/material": "^7.3.7",
|
||||||
|
"@ngrx/effects": "^7.4.0",
|
||||||
|
"@ngrx/store": "^7.4.0",
|
||||||
|
"@alfresco/adf-extensions": "^3.1.0",
|
||||||
|
"@alfresco/js-api": "^3.1.0",
|
||||||
|
"rxjs": "^6.4.0",
|
||||||
|
"@ngx-translate/core": "^11.0.1"
|
||||||
|
}
|
||||||
|
}
|
3
projects/aca-shared/rules/package.json
Normal file
3
projects/aca-shared/rules/package.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"ngPackage": {}
|
||||||
|
}
|
@ -23,7 +23,7 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as app from './app.evaluators';
|
import * as app from './app.rules';
|
||||||
|
|
||||||
describe('app.evaluators', () => {
|
describe('app.evaluators', () => {
|
||||||
describe('isWriteLocked', () => {
|
describe('isWriteLocked', () => {
|
@ -24,8 +24,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { RuleContext } from '@alfresco/adf-extensions';
|
import { RuleContext } from '@alfresco/adf-extensions';
|
||||||
import * as navigation from './navigation.evaluators';
|
import * as navigation from './navigation.rules';
|
||||||
import * as repository from './repository.evaluators';
|
import * as repository from './repository.rules';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if user can copy selected node.
|
* Checks if user can copy selected node.
|
@ -23,7 +23,7 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as app from './navigation.evaluators';
|
import * as app from './navigation.rules';
|
||||||
|
|
||||||
describe('navigation.evaluators', () => {
|
describe('navigation.evaluators', () => {
|
||||||
describe('isPreview', () => {
|
describe('isPreview', () => {
|
@ -23,4 +23,6 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './states/app.state';
|
export * from './app.rules';
|
||||||
|
export * from './navigation.rules';
|
||||||
|
export * from './repository.rules';
|
@ -1,4 +1,4 @@
|
|||||||
<mat-icon>ic_error</mat-icon>
|
<mat-icon>ic_error</mat-icon>
|
||||||
<p class="generic-error__title">
|
<p class="generic-error__title">
|
||||||
{{ 'APP.MESSAGES.ERRORS.MISSING_CONTENT' | translate }}
|
{{ text | translate }}
|
||||||
</p>
|
</p>
|
@ -0,0 +1,22 @@
|
|||||||
|
.aca-generic-error {
|
||||||
|
color: var(--theme-text-color, rgba(0, 0, 0, 0.54));
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
mat-icon {
|
||||||
|
color: var(--theme-warn-color, #f44336);
|
||||||
|
direction: rtl;
|
||||||
|
font-size: 52px;
|
||||||
|
height: 52px;
|
||||||
|
width: 52px;
|
||||||
|
}
|
||||||
|
}
|
@ -26,14 +26,19 @@
|
|||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
ViewEncapsulation,
|
ViewEncapsulation,
|
||||||
ChangeDetectionStrategy
|
ChangeDetectionStrategy,
|
||||||
|
Input
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'aca-generic-error',
|
selector: 'aca-generic-error',
|
||||||
templateUrl: './generic-error.component.html',
|
templateUrl: './generic-error.component.html',
|
||||||
|
styleUrls: ['./generic-error.component.scss'],
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
host: { class: 'aca-generic-error' }
|
host: { class: 'aca-generic-error' }
|
||||||
})
|
})
|
||||||
export class GenericErrorComponent {}
|
export class GenericErrorComponent {
|
||||||
|
@Input()
|
||||||
|
text = 'APP.MESSAGES.ERRORS.MISSING_CONTENT';
|
||||||
|
}
|
@ -23,11 +23,15 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Action } from '@ngrx/store';
|
import { NgModule } from '@angular/core';
|
||||||
|
import { GenericErrorComponent } from './generic-error.component';
|
||||||
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
export const CLOSE_MODAL_DIALOGS = 'CLOSE_MODAL_DIALOGS';
|
@NgModule({
|
||||||
|
imports: [CommonModule, MatIconModule, TranslateModule.forChild()],
|
||||||
export class CloseModalDialogsAction implements Action {
|
declarations: [GenericErrorComponent],
|
||||||
readonly type = CLOSE_MODAL_DIALOGS;
|
exports: [GenericErrorComponent]
|
||||||
constructor() {}
|
})
|
||||||
}
|
export class GenericErrorModule {}
|
@ -32,13 +32,13 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-layout-content',
|
selector: 'aca-page-layout-content',
|
||||||
template: `
|
template: `
|
||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
`,
|
`,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
host: { class: 'app-page-layout-content' }
|
host: { class: 'aca-page-layout-content' }
|
||||||
})
|
})
|
||||||
export class PageLayoutContentComponent {
|
export class PageLayoutContentComponent {
|
||||||
@Input()
|
@Input()
|
@ -30,12 +30,12 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-layout-error',
|
selector: 'aca-page-layout-error',
|
||||||
template: `
|
template: `
|
||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
`,
|
`,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
host: { class: 'app-page-layout-error' }
|
host: { class: 'aca-page-layout-error' }
|
||||||
})
|
})
|
||||||
export class PageLayoutErrorComponent {}
|
export class PageLayoutErrorComponent {}
|
@ -30,10 +30,10 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-layout-header',
|
selector: 'aca-page-layout-header',
|
||||||
template: '<ng-content></ng-content>',
|
template: '<ng-content></ng-content>',
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
host: { class: 'app-page-layout-header' }
|
host: { class: 'aca-page-layout-header' }
|
||||||
})
|
})
|
||||||
export class PageLayoutHeaderComponent {}
|
export class PageLayoutHeaderComponent {}
|
@ -0,0 +1,3 @@
|
|||||||
|
<ng-content select="aca-page-layout-header"></ng-content>
|
||||||
|
<ng-content select="aca-page-layout-error" *ngIf="hasError"></ng-content>
|
||||||
|
<ng-content select="aca-page-layout-content" *ngIf="!hasError"></ng-content>
|
@ -0,0 +1,44 @@
|
|||||||
|
@import '../../styles/mixins.scss';
|
||||||
|
|
||||||
|
.aca-page-layout {
|
||||||
|
@include flex-column;
|
||||||
|
|
||||||
|
.aca-page-layout-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex: 0 0 65px;
|
||||||
|
flex-basis: 48px;
|
||||||
|
background: #fafafa;
|
||||||
|
border-bottom: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.07));
|
||||||
|
padding: 0 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.aca-page-layout-content {
|
||||||
|
@include flex-row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.aca-page-layout-error {
|
||||||
|
@include flex-row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-content {
|
||||||
|
@include flex-column;
|
||||||
|
border-right: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.07));
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrollable {
|
||||||
|
overflow: auto !important;
|
||||||
|
|
||||||
|
.main-content {
|
||||||
|
overflow: auto !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
display: block;
|
||||||
|
height: 100%;
|
||||||
|
overflow-y: scroll;
|
||||||
|
max-width: 350px;
|
||||||
|
width: 350px;
|
||||||
|
}
|
||||||
|
}
|
@ -31,10 +31,11 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-layout',
|
selector: 'aca-page-layout',
|
||||||
templateUrl: 'page-layout.component.html',
|
templateUrl: 'page-layout.component.html',
|
||||||
|
styleUrls: ['./page-layout.component.scss'],
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
host: { class: 'app-page-layout' },
|
host: { class: 'aca-page-layout' },
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class PageLayoutComponent {
|
export class PageLayoutComponent {
|
@ -0,0 +1,48 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Alfresco Example Content Application
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||||
|
*
|
||||||
|
* This file is part of the Alfresco Example Content Application.
|
||||||
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
|
* the paid license agreement will prevail. Otherwise, the software is
|
||||||
|
* provided under the following open source license terms:
|
||||||
|
*
|
||||||
|
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { PageLayoutContentComponent } from './page-layout-content.component';
|
||||||
|
import { PageLayoutErrorComponent } from './page-layout-error.component';
|
||||||
|
import { PageLayoutHeaderComponent } from './page-layout-header.component';
|
||||||
|
import { PageLayoutComponent } from './page-layout.component';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [CommonModule],
|
||||||
|
declarations: [
|
||||||
|
PageLayoutContentComponent,
|
||||||
|
PageLayoutErrorComponent,
|
||||||
|
PageLayoutHeaderComponent,
|
||||||
|
PageLayoutComponent
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
PageLayoutContentComponent,
|
||||||
|
PageLayoutErrorComponent,
|
||||||
|
PageLayoutHeaderComponent,
|
||||||
|
PageLayoutComponent
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class PageLayoutModule {}
|
@ -25,14 +25,12 @@
|
|||||||
|
|
||||||
import { AppRouteReuseStrategy } from './app.routes.strategy';
|
import { AppRouteReuseStrategy } from './app.routes.strategy';
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
import { AppTestingModule } from './testing/app-testing.module';
|
|
||||||
|
|
||||||
describe('AppRouteReuseStrategy', () => {
|
describe('AppRouteReuseStrategy', () => {
|
||||||
let appRouteReuse: AppRouteReuseStrategy;
|
let appRouteReuse: AppRouteReuseStrategy;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [AppTestingModule],
|
|
||||||
providers: [AppRouteReuseStrategy]
|
providers: [AppRouteReuseStrategy]
|
||||||
});
|
});
|
||||||
|
|
@ -28,8 +28,7 @@ import { CanActivate } from '@angular/router';
|
|||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { ActivatedRouteSnapshot } from '@angular/router';
|
import { ActivatedRouteSnapshot } from '@angular/router';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { AppStore } from '../store/states/app.state';
|
import { AppStore, isQuickShareEnabled } from '@alfresco/aca-shared/store';
|
||||||
import { isQuickShareEnabled } from '../store/selectors/app.selectors';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
@ -25,10 +25,10 @@
|
|||||||
|
|
||||||
import { AppService } from './app.service';
|
import { AppService } from './app.service';
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
import { AppTestingModule } from '../testing/app-testing.module';
|
|
||||||
import { AuthenticationService, AppConfigService } from '@alfresco/adf-core';
|
import { AuthenticationService, AppConfigService } from '@alfresco/adf-core';
|
||||||
import { AppRouteReuseStrategy } from '../app.routes.strategy';
|
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
import { AppRouteReuseStrategy } from '../routing/app.routes.strategy';
|
||||||
|
|
||||||
describe('AppService', () => {
|
describe('AppService', () => {
|
||||||
let service: AppService;
|
let service: AppService;
|
||||||
@ -38,7 +38,7 @@ describe('AppService', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [AppTestingModule],
|
imports: [HttpClientModule],
|
||||||
providers: [
|
providers: [
|
||||||
AppRouteReuseStrategy,
|
AppRouteReuseStrategy,
|
||||||
{
|
{
|
@ -26,8 +26,8 @@
|
|||||||
import { Injectable, Inject } from '@angular/core';
|
import { Injectable, Inject } from '@angular/core';
|
||||||
import { AuthenticationService, AppConfigService } from '@alfresco/adf-core';
|
import { AuthenticationService, AppConfigService } from '@alfresco/adf-core';
|
||||||
import { Observable, BehaviorSubject } from 'rxjs';
|
import { Observable, BehaviorSubject } from 'rxjs';
|
||||||
import { AppRouteReuseStrategy } from '../app.routes.strategy';
|
|
||||||
import { RouteReuseStrategy } from '@angular/router';
|
import { RouteReuseStrategy } from '@angular/router';
|
||||||
|
import { AppRouteReuseStrategy } from '../routing/app.routes.strategy';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
@ -23,11 +23,17 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Action } from '@ngrx/store';
|
import { NgModule, ModuleWithProviders } from '@angular/core';
|
||||||
|
import { ContentApiService } from './services/content-api.service';
|
||||||
|
import { NodePermissionService } from './services/node-permission.service';
|
||||||
|
import { AppService } from './services/app.service';
|
||||||
|
|
||||||
export const SET_INFO_DRAWER_STATE = 'SET_INFO_DRAWER_STATE';
|
@NgModule({})
|
||||||
|
export class SharedModule {
|
||||||
export class SetInfoDrawerStateAction implements Action {
|
static forRoot(): ModuleWithProviders {
|
||||||
readonly type = SET_INFO_DRAWER_STATE;
|
return {
|
||||||
constructor(public payload: boolean) {}
|
ngModule: SharedModule,
|
||||||
|
providers: [ContentApiService, NodePermissionService, AppService]
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
16
projects/aca-shared/src/lib/styles/mixins.scss
Normal file
16
projects/aca-shared/src/lib/styles/mixins.scss
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
@mixin flex-column {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin flex-row {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
42
projects/aca-shared/src/public-api.ts
Normal file
42
projects/aca-shared/src/public-api.ts
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Alfresco Example Content Application
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
||||||
|
*
|
||||||
|
* This file is part of the Alfresco Example Content Application.
|
||||||
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
|
* the paid license agreement will prevail. Otherwise, the software is
|
||||||
|
* provided under the following open source license terms:
|
||||||
|
*
|
||||||
|
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export * from './lib/components/page-layout/page-layout-content.component';
|
||||||
|
export * from './lib/components/page-layout/page-layout-error.component';
|
||||||
|
export * from './lib/components/page-layout/page-layout-header.component';
|
||||||
|
export * from './lib/components/page-layout/page-layout.component';
|
||||||
|
export * from './lib/components/page-layout/page-layout.module';
|
||||||
|
|
||||||
|
export * from './lib/routing/app.routes.strategy';
|
||||||
|
export * from './lib/routing/shared.guard';
|
||||||
|
|
||||||
|
export * from './lib/services/app.service';
|
||||||
|
export * from './lib/services/content-api.service';
|
||||||
|
export * from './lib/services/node-permission.service';
|
||||||
|
|
||||||
|
export * from './lib/components/generic-error/generic-error.component';
|
||||||
|
export * from './lib/components/generic-error/generic-error.module';
|
||||||
|
|
||||||
|
export * from './lib/shared.module';
|
3
projects/aca-shared/store/package.json
Normal file
3
projects/aca-shared/store/package.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"ngPackage": {}
|
||||||
|
}
|
@ -24,57 +24,84 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Action } from '@ngrx/store';
|
import { Action } from '@ngrx/store';
|
||||||
import { Node, Person, Group } from '@alfresco/js-api';
|
import { Node, Person, Group, RepositoryInfo } from '@alfresco/js-api';
|
||||||
import { AppState } from '../states';
|
import { AppState } from '../states/app.state';
|
||||||
|
|
||||||
export const SET_INITIAL_STATE = 'SET_INITIAL_STATE';
|
export enum AppActionTypes {
|
||||||
export const SET_LANGUAGE_PICKER = 'SET_LANGUAGE_PICKER';
|
SetInitialState = 'SET_INITIAL_STATE',
|
||||||
export const SET_CURRENT_FOLDER = 'SET_CURRENT_FOLDER';
|
SetLanguagePicker = 'SET_LANGUAGE_PICKER',
|
||||||
export const SET_CURRENT_URL = 'SET_CURRENT_URL';
|
SetCurrentFolder = 'SET_CURRENT_FOLDER',
|
||||||
export const SET_USER_PROFILE = 'SET_USER_PROFILE';
|
SetCurrentUrl = 'SET_CURRENT_URL',
|
||||||
export const TOGGLE_INFO_DRAWER = 'TOGGLE_INFO_DRAWER';
|
SetUserProfile = 'SET_USER_PROFILE',
|
||||||
export const TOGGLE_DOCUMENT_DISPLAY_MODE = 'TOGGLE_DOCUMENT_DISPLAY_MODE';
|
SetRepositoryInfo = 'SET_REPOSITORY_INFO',
|
||||||
export const LOGOUT = 'LOGOUT';
|
ToggleInfoDrawer = 'TOGGLE_INFO_DRAWER',
|
||||||
export const RELOAD_DOCUMENT_LIST = 'RELOAD_DOCUMENT_LIST';
|
ToggleDocumentDisplayMode = 'TOGGLE_DOCUMENT_DISPLAY_MODE',
|
||||||
|
Logout = 'LOGOUT',
|
||||||
|
ReloadDocumentList = 'RELOAD_DOCUMENT_LIST',
|
||||||
|
SetInfoDrawerState = 'SET_INFO_DRAWER_STATE',
|
||||||
|
CloseModalDialogs = 'CLOSE_MODAL_DIALOGS'
|
||||||
|
}
|
||||||
|
|
||||||
export class SetInitialStateAction implements Action {
|
export class SetInitialStateAction implements Action {
|
||||||
readonly type = SET_INITIAL_STATE;
|
readonly type = AppActionTypes.SetInitialState;
|
||||||
|
|
||||||
constructor(public payload: AppState) {}
|
constructor(public payload: AppState) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SetLanguagePickerAction implements Action {
|
export class SetLanguagePickerAction implements Action {
|
||||||
readonly type = SET_LANGUAGE_PICKER;
|
readonly type = AppActionTypes.SetLanguagePicker;
|
||||||
|
|
||||||
constructor(public payload: boolean) {}
|
constructor(public payload: boolean) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SetCurrentFolderAction implements Action {
|
export class SetCurrentFolderAction implements Action {
|
||||||
readonly type = SET_CURRENT_FOLDER;
|
readonly type = AppActionTypes.SetCurrentFolder;
|
||||||
|
|
||||||
constructor(public payload: Node) {}
|
constructor(public payload: Node) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SetCurrentUrlAction implements Action {
|
export class SetCurrentUrlAction implements Action {
|
||||||
readonly type = SET_CURRENT_URL;
|
readonly type = AppActionTypes.SetCurrentUrl;
|
||||||
|
|
||||||
constructor(public payload: string) {}
|
constructor(public payload: string) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SetUserProfileAction implements Action {
|
export class SetUserProfileAction implements Action {
|
||||||
readonly type = SET_USER_PROFILE;
|
readonly type = AppActionTypes.SetUserProfile;
|
||||||
|
|
||||||
constructor(public payload: { person: Person; groups: Group[] }) {}
|
constructor(public payload: { person: Person; groups: Group[] }) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ToggleInfoDrawerAction implements Action {
|
export class ToggleInfoDrawerAction implements Action {
|
||||||
readonly type = TOGGLE_INFO_DRAWER;
|
readonly type = AppActionTypes.ToggleInfoDrawer;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ToggleDocumentDisplayMode implements Action {
|
export class ToggleDocumentDisplayMode implements Action {
|
||||||
readonly type = TOGGLE_DOCUMENT_DISPLAY_MODE;
|
readonly type = AppActionTypes.ToggleDocumentDisplayMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class LogoutAction implements Action {
|
export class LogoutAction implements Action {
|
||||||
readonly type = LOGOUT;
|
readonly type = AppActionTypes.Logout;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ReloadDocumentListAction implements Action {
|
export class ReloadDocumentListAction implements Action {
|
||||||
readonly type = RELOAD_DOCUMENT_LIST;
|
readonly type = AppActionTypes.ReloadDocumentList;
|
||||||
|
|
||||||
constructor(public payload?: any) {}
|
constructor(public payload?: any) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class SetInfoDrawerStateAction implements Action {
|
||||||
|
readonly type = AppActionTypes.SetInfoDrawerState;
|
||||||
|
|
||||||
|
constructor(public payload: boolean) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class CloseModalDialogsAction implements Action {
|
||||||
|
readonly type = AppActionTypes.CloseModalDialogs;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SetRepositoryInfoAction implements Action {
|
||||||
|
readonly type = AppActionTypes.SetRepositoryInfo;
|
||||||
|
|
||||||
|
constructor(public payload: RepositoryInfo) {}
|
||||||
|
}
|
@ -26,33 +26,38 @@
|
|||||||
import { Action } from '@ngrx/store';
|
import { Action } from '@ngrx/store';
|
||||||
import { SiteBody } from '@alfresco/js-api';
|
import { SiteBody } from '@alfresco/js-api';
|
||||||
|
|
||||||
export const DELETE_LIBRARY = 'DELETE_LIBRARY';
|
export enum LibraryActionTypes {
|
||||||
export const CREATE_LIBRARY = 'CREATE_LIBRARY';
|
Delete = 'DELETE_LIBRARY',
|
||||||
export const NAVIGATE_LIBRARY = 'NAVIGATE_LIBRARY';
|
Create = 'CREATE_LIBRARY',
|
||||||
export const UPDATE_LIBRARY = 'UPDATE_LIBRARY';
|
Navigate = 'NAVIGATE_LIBRARY',
|
||||||
export const LEAVE_LIBRARY = 'LEAVE_LIBRARY';
|
Update = 'UPDATE_LIBRARY',
|
||||||
|
Leave = 'LEAVE_LIBRARY'
|
||||||
|
}
|
||||||
|
|
||||||
export class DeleteLibraryAction implements Action {
|
export class DeleteLibraryAction implements Action {
|
||||||
readonly type = DELETE_LIBRARY;
|
readonly type = LibraryActionTypes.Delete;
|
||||||
|
|
||||||
constructor(public payload?: string) {}
|
constructor(public payload?: string) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CreateLibraryAction implements Action {
|
export class CreateLibraryAction implements Action {
|
||||||
readonly type = CREATE_LIBRARY;
|
readonly type = LibraryActionTypes.Create;
|
||||||
constructor() {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NavigateLibraryAction implements Action {
|
export class NavigateLibraryAction implements Action {
|
||||||
readonly type = NAVIGATE_LIBRARY;
|
readonly type = LibraryActionTypes.Navigate;
|
||||||
|
|
||||||
constructor(public payload?: string) {}
|
constructor(public payload?: string) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UpdateLibraryAction implements Action {
|
export class UpdateLibraryAction implements Action {
|
||||||
readonly type = UPDATE_LIBRARY;
|
readonly type = LibraryActionTypes.Update;
|
||||||
|
|
||||||
constructor(public payload?: SiteBody) {}
|
constructor(public payload?: SiteBody) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class LeaveLibraryAction implements Action {
|
export class LeaveLibraryAction implements Action {
|
||||||
readonly type = LEAVE_LIBRARY;
|
readonly type = LibraryActionTypes.Leave;
|
||||||
|
|
||||||
constructor(public payload?: string) {}
|
constructor(public payload?: string) {}
|
||||||
}
|
}
|
@ -26,111 +26,138 @@
|
|||||||
import { Action } from '@ngrx/store';
|
import { Action } from '@ngrx/store';
|
||||||
import { MinimalNodeEntity } from '@alfresco/js-api';
|
import { MinimalNodeEntity } from '@alfresco/js-api';
|
||||||
|
|
||||||
export const SET_SELECTED_NODES = 'SET_SELECTED_NODES';
|
export enum NodeActionTypes {
|
||||||
export const DELETE_NODES = 'DELETE_NODES';
|
SetSelection = 'SET_SELECTED_NODES',
|
||||||
export const UNDO_DELETE_NODES = 'UNDO_DELETE_NODES';
|
Delete = 'DELETE_NODES',
|
||||||
export const RESTORE_DELETED_NODES = 'RESTORE_DELETED_NODES';
|
UndoDelete = 'UNDO_DELETE_NODES',
|
||||||
export const PURGE_DELETED_NODES = 'PURGE_DELETED_NODES';
|
RestoreDeleted = 'RESTORE_DELETED_NODES',
|
||||||
export const DOWNLOAD_NODES = 'DOWNLOAD_NODES';
|
PurgeDeleted = 'PURGE_DELETED_NODES',
|
||||||
export const CREATE_FOLDER = 'CREATE_FOLDER';
|
Download = 'DOWNLOAD_NODES',
|
||||||
export const EDIT_FOLDER = 'EDIT_FOLDER';
|
CreateFolder = 'CREATE_FOLDER',
|
||||||
export const SHARE_NODE = 'SHARE_NODE';
|
EditFolder = 'EDIT_FOLDER',
|
||||||
export const UNSHARE_NODES = 'UNSHARE_NODES';
|
Share = 'SHARE_NODE',
|
||||||
export const COPY_NODES = 'COPY_NODES';
|
Unshare = 'UNSHARE_NODES',
|
||||||
export const MOVE_NODES = 'MOVE_NODES';
|
Copy = 'COPY_NODES',
|
||||||
export const MANAGE_PERMISSIONS = 'MANAGE_PERMISSIONS';
|
Move = 'MOVE_NODES',
|
||||||
export const PRINT_FILE = 'PRINT_FILE';
|
ManagePermissions = 'MANAGE_PERMISSIONS',
|
||||||
export const FULLSCREEN_VIEWER = 'FULLSCREEN_VIEWER';
|
PrintFile = 'PRINT_FILE',
|
||||||
export const MANAGE_VERSIONS = 'MANAGE_VERSIONS';
|
ManageVersions = 'MANAGE_VERSIONS',
|
||||||
export const EDIT_OFFLINE = 'EDIT_OFFLINE';
|
EditOffline = 'EDIT_OFFLINE',
|
||||||
export const UNLOCK_WRITE = 'UNLOCK_WRITE_LOCK';
|
UnlockForWriting = 'UNLOCK_WRITE_LOCK',
|
||||||
|
AddFavorite = 'ADD_FAVORITE',
|
||||||
|
RemoveFavorite = 'REMOVE_FAVORITE'
|
||||||
|
}
|
||||||
|
|
||||||
export class SetSelectedNodesAction implements Action {
|
export class SetSelectedNodesAction implements Action {
|
||||||
readonly type = SET_SELECTED_NODES;
|
readonly type = NodeActionTypes.SetSelection;
|
||||||
|
|
||||||
constructor(public payload: MinimalNodeEntity[] = []) {}
|
constructor(public payload: MinimalNodeEntity[] = []) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DeleteNodesAction implements Action {
|
export class DeleteNodesAction implements Action {
|
||||||
readonly type = DELETE_NODES;
|
readonly type = NodeActionTypes.Delete;
|
||||||
|
|
||||||
constructor(public payload: MinimalNodeEntity[] = []) {}
|
constructor(public payload: MinimalNodeEntity[] = []) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UndoDeleteNodesAction implements Action {
|
export class UndoDeleteNodesAction implements Action {
|
||||||
readonly type = UNDO_DELETE_NODES;
|
readonly type = NodeActionTypes.UndoDelete;
|
||||||
|
|
||||||
constructor(public payload: any[] = []) {}
|
constructor(public payload: any[] = []) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class RestoreDeletedNodesAction implements Action {
|
export class RestoreDeletedNodesAction implements Action {
|
||||||
readonly type = RESTORE_DELETED_NODES;
|
readonly type = NodeActionTypes.RestoreDeleted;
|
||||||
|
|
||||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class PurgeDeletedNodesAction implements Action {
|
export class PurgeDeletedNodesAction implements Action {
|
||||||
readonly type = PURGE_DELETED_NODES;
|
readonly type = NodeActionTypes.PurgeDeleted;
|
||||||
|
|
||||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DownloadNodesAction implements Action {
|
export class DownloadNodesAction implements Action {
|
||||||
readonly type = DOWNLOAD_NODES;
|
readonly type = NodeActionTypes.Download;
|
||||||
|
|
||||||
constructor(public payload: MinimalNodeEntity[] = []) {}
|
constructor(public payload: MinimalNodeEntity[] = []) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CreateFolderAction implements Action {
|
export class CreateFolderAction implements Action {
|
||||||
readonly type = CREATE_FOLDER;
|
readonly type = NodeActionTypes.CreateFolder;
|
||||||
|
|
||||||
constructor(public payload: string) {}
|
constructor(public payload: string) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class EditFolderAction implements Action {
|
export class EditFolderAction implements Action {
|
||||||
readonly type = EDIT_FOLDER;
|
readonly type = NodeActionTypes.EditFolder;
|
||||||
|
|
||||||
constructor(public payload: MinimalNodeEntity) {}
|
constructor(public payload: MinimalNodeEntity) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ShareNodeAction implements Action {
|
export class ShareNodeAction implements Action {
|
||||||
readonly type = SHARE_NODE;
|
readonly type = NodeActionTypes.Share;
|
||||||
|
|
||||||
constructor(public payload: MinimalNodeEntity) {}
|
constructor(public payload: MinimalNodeEntity) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UnshareNodesAction implements Action {
|
export class UnshareNodesAction implements Action {
|
||||||
readonly type = UNSHARE_NODES;
|
readonly type = NodeActionTypes.Unshare;
|
||||||
|
|
||||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CopyNodesAction implements Action {
|
export class CopyNodesAction implements Action {
|
||||||
readonly type = COPY_NODES;
|
readonly type = NodeActionTypes.Copy;
|
||||||
|
|
||||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class MoveNodesAction implements Action {
|
export class MoveNodesAction implements Action {
|
||||||
readonly type = MOVE_NODES;
|
readonly type = NodeActionTypes.Move;
|
||||||
|
|
||||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ManagePermissionsAction implements Action {
|
export class ManagePermissionsAction implements Action {
|
||||||
readonly type = MANAGE_PERMISSIONS;
|
readonly type = NodeActionTypes.ManagePermissions;
|
||||||
|
|
||||||
constructor(public payload: MinimalNodeEntity) {}
|
constructor(public payload: MinimalNodeEntity) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class PrintFileAction implements Action {
|
export class PrintFileAction implements Action {
|
||||||
readonly type = PRINT_FILE;
|
readonly type = NodeActionTypes.PrintFile;
|
||||||
constructor(public payload: MinimalNodeEntity) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class FullscreenViewerAction implements Action {
|
|
||||||
readonly type = FULLSCREEN_VIEWER;
|
|
||||||
constructor(public payload: MinimalNodeEntity) {}
|
constructor(public payload: MinimalNodeEntity) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ManageVersionsAction implements Action {
|
export class ManageVersionsAction implements Action {
|
||||||
readonly type = MANAGE_VERSIONS;
|
readonly type = NodeActionTypes.ManageVersions;
|
||||||
|
|
||||||
constructor(public payload: MinimalNodeEntity) {}
|
constructor(public payload: MinimalNodeEntity) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class EditOfflineAction implements Action {
|
export class EditOfflineAction implements Action {
|
||||||
readonly type = EDIT_OFFLINE;
|
readonly type = NodeActionTypes.EditOffline;
|
||||||
|
|
||||||
constructor(public payload: any) {}
|
constructor(public payload: any) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UnlockWriteAction implements Action {
|
export class UnlockWriteAction implements Action {
|
||||||
readonly type = UNLOCK_WRITE;
|
readonly type = NodeActionTypes.UnlockForWriting;
|
||||||
|
|
||||||
constructor(public payload: any) {}
|
constructor(public payload: any) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class AddFavoriteAction implements Action {
|
||||||
|
readonly type = NodeActionTypes.AddFavorite;
|
||||||
|
|
||||||
|
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class RemoveFavoriteAction implements Action {
|
||||||
|
readonly type = NodeActionTypes.RemoveFavorite;
|
||||||
|
|
||||||
|
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||||
|
}
|
@ -26,27 +26,33 @@
|
|||||||
import { Action } from '@ngrx/store';
|
import { Action } from '@ngrx/store';
|
||||||
import { MinimalNodeEntity } from '@alfresco/js-api';
|
import { MinimalNodeEntity } from '@alfresco/js-api';
|
||||||
|
|
||||||
export const NAVIGATE_URL = 'NAVIGATE_URL';
|
export enum RouterActionTypes {
|
||||||
export const NAVIGATE_ROUTE = 'NAVIGATE_ROUTE';
|
NavigateUrl = 'NAVIGATE_URL',
|
||||||
export const NAVIGATE_FOLDER = 'NAVIGATE_FOLDER';
|
NavigateRoute = 'NAVIGATE_ROUTE',
|
||||||
export const NAVIGATE_PARENT_FOLDER = 'NAVIGATE_PARENT_FOLDER';
|
NavigateFolder = 'NAVIGATE_FOLDER',
|
||||||
|
NavigateParentFolder = 'NAVIGATE_PARENT_FOLDER'
|
||||||
|
}
|
||||||
|
|
||||||
export class NavigateUrlAction implements Action {
|
export class NavigateUrlAction implements Action {
|
||||||
readonly type = NAVIGATE_URL;
|
readonly type = RouterActionTypes.NavigateUrl;
|
||||||
|
|
||||||
constructor(public payload: string) {}
|
constructor(public payload: string) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NavigateRouteAction implements Action {
|
export class NavigateRouteAction implements Action {
|
||||||
readonly type = NAVIGATE_ROUTE;
|
readonly type = RouterActionTypes.NavigateRoute;
|
||||||
|
|
||||||
constructor(public payload: any[]) {}
|
constructor(public payload: any[]) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NavigateToFolder implements Action {
|
export class NavigateToFolder implements Action {
|
||||||
readonly type = NAVIGATE_FOLDER;
|
readonly type = RouterActionTypes.NavigateFolder;
|
||||||
|
|
||||||
constructor(public payload: MinimalNodeEntity) {}
|
constructor(public payload: MinimalNodeEntity) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NavigateToParentFolder implements Action {
|
export class NavigateToParentFolder implements Action {
|
||||||
readonly type = NAVIGATE_PARENT_FOLDER;
|
readonly type = RouterActionTypes.NavigateParentFolder;
|
||||||
|
|
||||||
constructor(public payload: MinimalNodeEntity) {}
|
constructor(public payload: MinimalNodeEntity) {}
|
||||||
}
|
}
|
@ -24,15 +24,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Action } from '@ngrx/store';
|
import { Action } from '@ngrx/store';
|
||||||
import { SearchOptionModel } from '../models/searchOption.model';
|
import { SearchOptionModel } from '../models/search-option.model';
|
||||||
|
|
||||||
export const SEARCH_BY_TERM = 'SEARCH_BY_TERM';
|
export enum SearchActionTypes {
|
||||||
export const TOGGLE_SEARCH_FILTER = 'TOGGLE_SEARCH_FILTER';
|
SearchByTerm = 'SEARCH_BY_TERM',
|
||||||
export const SHOW_SEARCH_FILTER = 'SHOW_SEARCH_FILTER';
|
ToggleFilter = 'TOGGLE_SEARCH_FILTER',
|
||||||
export const HIDE_SEARCH_FILTER = 'HIDE_SEARCH_FILTER';
|
ShowFilter = 'SHOW_SEARCH_FILTER',
|
||||||
|
HideFilter = 'HIDE_SEARCH_FILTER'
|
||||||
|
}
|
||||||
|
|
||||||
export class SearchByTermAction implements Action {
|
export class SearchByTermAction implements Action {
|
||||||
readonly type = SEARCH_BY_TERM;
|
readonly type = SearchActionTypes.SearchByTerm;
|
||||||
constructor(
|
constructor(
|
||||||
public payload: string,
|
public payload: string,
|
||||||
public searchOptions?: SearchOptionModel[]
|
public searchOptions?: SearchOptionModel[]
|
||||||
@ -40,13 +42,13 @@ export class SearchByTermAction implements Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ToggleSearchFilterAction implements Action {
|
export class ToggleSearchFilterAction implements Action {
|
||||||
readonly type = TOGGLE_SEARCH_FILTER;
|
readonly type = SearchActionTypes.ToggleFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ShowSearchFilterAction implements Action {
|
export class ShowSearchFilterAction implements Action {
|
||||||
readonly type = SHOW_SEARCH_FILTER;
|
readonly type = SearchActionTypes.ShowFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class HideSearchFilterAction implements Action {
|
export class HideSearchFilterAction implements Action {
|
||||||
readonly type = HIDE_SEARCH_FILTER;
|
readonly type = SearchActionTypes.HideFilter;
|
||||||
}
|
}
|
@ -25,9 +25,11 @@
|
|||||||
|
|
||||||
import { Action } from '@ngrx/store';
|
import { Action } from '@ngrx/store';
|
||||||
|
|
||||||
export const SNACKBAR_INFO = 'SNACKBAR_INFO';
|
export enum SnackbarActionTypes {
|
||||||
export const SNACKBAR_WARNING = 'SNACKBAR_WARNING';
|
Info = 'SNACKBAR_INFO',
|
||||||
export const SNACKBAR_ERROR = 'SNACKBAR_ERROR';
|
Warning = 'SNACKBAR_WARNING',
|
||||||
|
Error = 'SNACKBAR_ERROR'
|
||||||
|
}
|
||||||
|
|
||||||
export interface SnackbarAction extends Action {
|
export interface SnackbarAction extends Action {
|
||||||
payload: string;
|
payload: string;
|
||||||
@ -41,7 +43,7 @@ export class SnackbarUserAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class SnackbarInfoAction implements SnackbarAction {
|
export class SnackbarInfoAction implements SnackbarAction {
|
||||||
readonly type = SNACKBAR_INFO;
|
readonly type = SnackbarActionTypes.Info;
|
||||||
|
|
||||||
userAction?: SnackbarUserAction;
|
userAction?: SnackbarUserAction;
|
||||||
duration = 4000;
|
duration = 4000;
|
||||||
@ -50,7 +52,7 @@ export class SnackbarInfoAction implements SnackbarAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class SnackbarWarningAction implements SnackbarAction {
|
export class SnackbarWarningAction implements SnackbarAction {
|
||||||
readonly type = SNACKBAR_WARNING;
|
readonly type = SnackbarActionTypes.Warning;
|
||||||
|
|
||||||
userAction?: SnackbarUserAction;
|
userAction?: SnackbarUserAction;
|
||||||
duration = 4000;
|
duration = 4000;
|
||||||
@ -59,7 +61,7 @@ export class SnackbarWarningAction implements SnackbarAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class SnackbarErrorAction implements SnackbarAction {
|
export class SnackbarErrorAction implements SnackbarAction {
|
||||||
readonly type = SNACKBAR_ERROR;
|
readonly type = SnackbarActionTypes.Error;
|
||||||
|
|
||||||
userAction?: SnackbarUserAction;
|
userAction?: SnackbarUserAction;
|
||||||
duration = 4000;
|
duration = 4000;
|
@ -25,20 +25,24 @@
|
|||||||
|
|
||||||
import { Action } from '@ngrx/store';
|
import { Action } from '@ngrx/store';
|
||||||
|
|
||||||
export const UPLOAD_FILES = 'UPLOAD_FILES';
|
export enum UploadActionTypes {
|
||||||
export const UPLOAD_FOLDER = 'UPLOAD_FOLDER';
|
UploadFiles = 'UPLOAD_FILES',
|
||||||
export const UPLOAD_FILE_VERSION = 'UPLOAD_FILE_VERSION';
|
UploadFolder = 'UPLOAD_FOLDER',
|
||||||
|
UploadFileVersion = 'UPLOAD_FILE_VERSION'
|
||||||
|
}
|
||||||
|
|
||||||
export class UploadFilesAction implements Action {
|
export class UploadFilesAction implements Action {
|
||||||
readonly type = UPLOAD_FILES;
|
readonly type = UploadActionTypes.UploadFiles;
|
||||||
|
|
||||||
constructor(public payload: any) {}
|
constructor(public payload: any) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UploadFolderAction implements Action {
|
export class UploadFolderAction implements Action {
|
||||||
readonly type = UPLOAD_FOLDER;
|
readonly type = UploadActionTypes.UploadFolder;
|
||||||
|
|
||||||
constructor(public payload: any) {}
|
constructor(public payload: any) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UploadFileVersionAction implements Action {
|
export class UploadFileVersionAction implements Action {
|
||||||
readonly type = UPLOAD_FILE_VERSION;
|
readonly type = UploadActionTypes.UploadFileVersion;
|
||||||
}
|
}
|
@ -26,15 +26,26 @@
|
|||||||
import { Action } from '@ngrx/store';
|
import { Action } from '@ngrx/store';
|
||||||
import { MinimalNodeEntity } from '@alfresco/js-api';
|
import { MinimalNodeEntity } from '@alfresco/js-api';
|
||||||
|
|
||||||
export const VIEW_FILE = 'VIEW_FILE';
|
export enum ViewerActionTypes {
|
||||||
export const VIEW_NODE = 'VIEW_NODE';
|
ViewFile = 'VIEW_FILE',
|
||||||
|
ViewNode = 'VIEW_NODE',
|
||||||
|
FullScreen = 'FULLSCREEN_VIEWER'
|
||||||
|
}
|
||||||
|
|
||||||
export class ViewFileAction implements Action {
|
export class ViewFileAction implements Action {
|
||||||
readonly type = VIEW_FILE;
|
readonly type = ViewerActionTypes.ViewFile;
|
||||||
|
|
||||||
constructor(public payload: MinimalNodeEntity, public parentId?: string) {}
|
constructor(public payload: MinimalNodeEntity, public parentId?: string) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ViewNodeAction implements Action {
|
export class ViewNodeAction implements Action {
|
||||||
readonly type = VIEW_NODE;
|
readonly type = ViewerActionTypes.ViewNode;
|
||||||
|
|
||||||
constructor(public nodeId: string, public location?: string) {}
|
constructor(public nodeId: string, public location?: string) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class FullscreenViewerAction implements Action {
|
||||||
|
readonly type = ViewerActionTypes.FullScreen;
|
||||||
|
|
||||||
|
constructor(public payload: MinimalNodeEntity) {}
|
||||||
|
}
|
@ -26,16 +26,19 @@
|
|||||||
import { Effect, Actions, ofType } from '@ngrx/effects';
|
import { Effect, Actions, ofType } from '@ngrx/effects';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { CloseModalDialogsAction, CLOSE_MODAL_DIALOGS } from '../actions';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { MatDialog } from '@angular/material';
|
import {
|
||||||
|
CloseModalDialogsAction,
|
||||||
|
AppActionTypes
|
||||||
|
} from '../actions/app.actions';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ModalsEffects {
|
export class DialogEffects {
|
||||||
constructor(private actions$: Actions, private matDialog: MatDialog) {}
|
constructor(private actions$: Actions, private matDialog: MatDialog) {}
|
||||||
|
|
||||||
@Effect({ dispatch: false })
|
@Effect({ dispatch: false })
|
||||||
closeAll$ = this.actions$.pipe(
|
closeAll$ = this.actions$.pipe(
|
||||||
ofType<CloseModalDialogsAction>(CLOSE_MODAL_DIALOGS),
|
ofType<CloseModalDialogsAction>(AppActionTypes.CloseModalDialogs),
|
||||||
map(() => this.matDialog.closeAll())
|
map(() => this.matDialog.closeAll())
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -28,19 +28,16 @@ import { Router } from '@angular/router';
|
|||||||
import { Actions, Effect, ofType } from '@ngrx/effects';
|
import { Actions, Effect, ofType } from '@ngrx/effects';
|
||||||
import { MinimalNodeEntryEntity, PathInfoEntity } from '@alfresco/js-api';
|
import { MinimalNodeEntryEntity, PathInfoEntity } from '@alfresco/js-api';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import {
|
|
||||||
NavigateRouteAction,
|
|
||||||
NavigateToParentFolder,
|
|
||||||
NAVIGATE_PARENT_FOLDER,
|
|
||||||
NAVIGATE_ROUTE,
|
|
||||||
NavigateToFolder,
|
|
||||||
NAVIGATE_FOLDER,
|
|
||||||
NavigateUrlAction,
|
|
||||||
NAVIGATE_URL,
|
|
||||||
SnackbarErrorAction
|
|
||||||
} from '../actions';
|
|
||||||
import { AppStore } from '../states/app.state';
|
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
|
import { AppStore } from '../states/app.state';
|
||||||
|
import {
|
||||||
|
NavigateUrlAction,
|
||||||
|
RouterActionTypes,
|
||||||
|
NavigateRouteAction,
|
||||||
|
NavigateToFolder,
|
||||||
|
NavigateToParentFolder
|
||||||
|
} from '../actions/router.actions';
|
||||||
|
import { SnackbarErrorAction } from '../actions/snackbar.actions';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class RouterEffects {
|
export class RouterEffects {
|
||||||
@ -52,7 +49,7 @@ export class RouterEffects {
|
|||||||
|
|
||||||
@Effect({ dispatch: false })
|
@Effect({ dispatch: false })
|
||||||
navigateUrl$ = this.actions$.pipe(
|
navigateUrl$ = this.actions$.pipe(
|
||||||
ofType<NavigateUrlAction>(NAVIGATE_URL),
|
ofType<NavigateUrlAction>(RouterActionTypes.NavigateUrl),
|
||||||
map(action => {
|
map(action => {
|
||||||
if (action.payload) {
|
if (action.payload) {
|
||||||
this.router.navigateByUrl(action.payload);
|
this.router.navigateByUrl(action.payload);
|
||||||
@ -62,7 +59,7 @@ export class RouterEffects {
|
|||||||
|
|
||||||
@Effect({ dispatch: false })
|
@Effect({ dispatch: false })
|
||||||
navigateRoute$ = this.actions$.pipe(
|
navigateRoute$ = this.actions$.pipe(
|
||||||
ofType<NavigateRouteAction>(NAVIGATE_ROUTE),
|
ofType<NavigateRouteAction>(RouterActionTypes.NavigateRoute),
|
||||||
map(action => {
|
map(action => {
|
||||||
this.router.navigate(action.payload);
|
this.router.navigate(action.payload);
|
||||||
})
|
})
|
||||||
@ -70,7 +67,7 @@ export class RouterEffects {
|
|||||||
|
|
||||||
@Effect({ dispatch: false })
|
@Effect({ dispatch: false })
|
||||||
navigateToFolder$ = this.actions$.pipe(
|
navigateToFolder$ = this.actions$.pipe(
|
||||||
ofType<NavigateToFolder>(NAVIGATE_FOLDER),
|
ofType<NavigateToFolder>(RouterActionTypes.NavigateFolder),
|
||||||
map(action => {
|
map(action => {
|
||||||
if (action.payload && action.payload.entry) {
|
if (action.payload && action.payload.entry) {
|
||||||
this.navigateToFolder(action.payload.entry);
|
this.navigateToFolder(action.payload.entry);
|
||||||
@ -80,7 +77,7 @@ export class RouterEffects {
|
|||||||
|
|
||||||
@Effect({ dispatch: false })
|
@Effect({ dispatch: false })
|
||||||
navigateToParentFolder$ = this.actions$.pipe(
|
navigateToParentFolder$ = this.actions$.pipe(
|
||||||
ofType<NavigateToParentFolder>(NAVIGATE_PARENT_FOLDER),
|
ofType<NavigateToParentFolder>(RouterActionTypes.NavigateParentFolder),
|
||||||
map(action => {
|
map(action => {
|
||||||
if (action.payload && action.payload.entry) {
|
if (action.payload && action.payload.entry) {
|
||||||
this.navigateToParentFolder(action.payload.entry);
|
this.navigateToParentFolder(action.payload.entry);
|
@ -25,20 +25,18 @@
|
|||||||
|
|
||||||
import { TranslationService } from '@alfresco/adf-core';
|
import { TranslationService } from '@alfresco/adf-core';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { MatSnackBar } from '@angular/material';
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||||
import { Actions, Effect, ofType } from '@ngrx/effects';
|
import { Actions, Effect, ofType } from '@ngrx/effects';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import {
|
|
||||||
SnackbarAction,
|
|
||||||
SnackbarErrorAction,
|
|
||||||
SnackbarInfoAction,
|
|
||||||
SnackbarWarningAction,
|
|
||||||
SNACKBAR_ERROR,
|
|
||||||
SNACKBAR_INFO,
|
|
||||||
SNACKBAR_WARNING
|
|
||||||
} from '../actions';
|
|
||||||
import { AppStore } from '../states/app.state';
|
import { AppStore } from '../states/app.state';
|
||||||
|
import {
|
||||||
|
SnackbarInfoAction,
|
||||||
|
SnackbarActionTypes,
|
||||||
|
SnackbarWarningAction,
|
||||||
|
SnackbarErrorAction,
|
||||||
|
SnackbarAction
|
||||||
|
} from '../actions/snackbar.actions';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SnackbarEffects {
|
export class SnackbarEffects {
|
||||||
@ -51,7 +49,7 @@ export class SnackbarEffects {
|
|||||||
|
|
||||||
@Effect({ dispatch: false })
|
@Effect({ dispatch: false })
|
||||||
infoEffect = this.actions$.pipe(
|
infoEffect = this.actions$.pipe(
|
||||||
ofType<SnackbarInfoAction>(SNACKBAR_INFO),
|
ofType<SnackbarInfoAction>(SnackbarActionTypes.Info),
|
||||||
map((action: SnackbarInfoAction) => {
|
map((action: SnackbarInfoAction) => {
|
||||||
this.showSnackBar(action, 'info-snackbar');
|
this.showSnackBar(action, 'info-snackbar');
|
||||||
})
|
})
|
||||||
@ -59,7 +57,7 @@ export class SnackbarEffects {
|
|||||||
|
|
||||||
@Effect({ dispatch: false })
|
@Effect({ dispatch: false })
|
||||||
warningEffect = this.actions$.pipe(
|
warningEffect = this.actions$.pipe(
|
||||||
ofType<SnackbarWarningAction>(SNACKBAR_WARNING),
|
ofType<SnackbarWarningAction>(SnackbarActionTypes.Warning),
|
||||||
map((action: SnackbarWarningAction) => {
|
map((action: SnackbarWarningAction) => {
|
||||||
this.showSnackBar(action, 'warning-snackbar');
|
this.showSnackBar(action, 'warning-snackbar');
|
||||||
})
|
})
|
||||||
@ -67,7 +65,7 @@ export class SnackbarEffects {
|
|||||||
|
|
||||||
@Effect({ dispatch: false })
|
@Effect({ dispatch: false })
|
||||||
errorEffect = this.actions$.pipe(
|
errorEffect = this.actions$.pipe(
|
||||||
ofType<SnackbarErrorAction>(SNACKBAR_ERROR),
|
ofType<SnackbarErrorAction>(SnackbarActionTypes.Error),
|
||||||
map((action: SnackbarErrorAction) => {
|
map((action: SnackbarErrorAction) => {
|
||||||
this.showSnackBar(action, 'error-snackbar');
|
this.showSnackBar(action, 'error-snackbar');
|
||||||
})
|
})
|
@ -24,15 +24,25 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './actions/app.actions';
|
export * from './actions/app.actions';
|
||||||
export * from './actions/favorite.actions';
|
|
||||||
export * from './actions/node.actions';
|
|
||||||
export * from './actions/snackbar.actions';
|
|
||||||
export * from './actions/router.actions';
|
|
||||||
export * from './actions/viewer.actions';
|
|
||||||
export * from './actions/search.actions';
|
|
||||||
export * from './actions/library.actions';
|
export * from './actions/library.actions';
|
||||||
|
export * from './actions/node.actions';
|
||||||
|
export * from './actions/router.actions';
|
||||||
|
export * from './actions/search.actions';
|
||||||
|
export * from './actions/snackbar.actions';
|
||||||
export * from './actions/upload.actions';
|
export * from './actions/upload.actions';
|
||||||
export * from './actions/modals.actions';
|
export * from './actions/viewer.actions';
|
||||||
export * from './actions/repository.actions';
|
|
||||||
export * from './actions/info-drawer.actions';
|
export * from './effects/dialog.effects';
|
||||||
export * from './actions/upload.actions';
|
export * from './effects/router.effects';
|
||||||
|
export * from './effects/snackbar.effects';
|
||||||
|
|
||||||
|
export * from './models/delete-status.model';
|
||||||
|
export * from './models/deleted-node-info.model';
|
||||||
|
export * from './models/node-info.model';
|
||||||
|
export * from './models/search-option.model';
|
||||||
|
|
||||||
|
export * from './selectors/app.selectors';
|
||||||
|
|
||||||
|
export * from './states/app.state';
|
||||||
|
|
||||||
|
export * from './store.module';
|
@ -23,57 +23,57 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { createSelector } from '@ngrx/store';
|
|
||||||
import { AppStore } from '../states/app.state';
|
import { AppStore } from '../states/app.state';
|
||||||
|
import { createSelector } from '@ngrx/store';
|
||||||
|
|
||||||
export const selectApp = (state: AppStore) => state.app;
|
export const selectApp = (state: AppStore) => state.app;
|
||||||
|
|
||||||
export const selectHeaderColor = createSelector(
|
export const getHeaderColor = createSelector(
|
||||||
selectApp,
|
selectApp,
|
||||||
state => state.headerColor
|
state => state.headerColor
|
||||||
);
|
);
|
||||||
|
|
||||||
export const selectAppName = createSelector(
|
export const getAppName = createSelector(
|
||||||
selectApp,
|
selectApp,
|
||||||
state => state.appName
|
state => state.appName
|
||||||
);
|
);
|
||||||
|
|
||||||
export const selectLogoPath = createSelector(
|
export const getLogoPath = createSelector(
|
||||||
selectApp,
|
selectApp,
|
||||||
state => state.logoPath
|
state => state.logoPath
|
||||||
);
|
);
|
||||||
|
|
||||||
export const appSelection = createSelector(
|
export const getLanguagePickerState = createSelector(
|
||||||
selectApp,
|
|
||||||
state => state.selection
|
|
||||||
);
|
|
||||||
|
|
||||||
export const appLanguagePicker = createSelector(
|
|
||||||
selectApp,
|
selectApp,
|
||||||
state => state.languagePicker
|
state => state.languagePicker
|
||||||
);
|
);
|
||||||
|
|
||||||
export const selectUser = createSelector(
|
export const getUserProfile = createSelector(
|
||||||
selectApp,
|
selectApp,
|
||||||
state => state.user
|
state => state.user
|
||||||
);
|
);
|
||||||
|
|
||||||
export const sharedUrl = createSelector(
|
export const getCurrentFolder = createSelector(
|
||||||
selectApp,
|
|
||||||
state => state.sharedUrl
|
|
||||||
);
|
|
||||||
|
|
||||||
export const appNavigation = createSelector(
|
|
||||||
selectApp,
|
|
||||||
state => state.navigation
|
|
||||||
);
|
|
||||||
|
|
||||||
export const currentFolder = createSelector(
|
|
||||||
selectApp,
|
selectApp,
|
||||||
state => state.navigation.currentFolder
|
state => state.navigation.currentFolder
|
||||||
);
|
);
|
||||||
|
|
||||||
export const infoDrawerOpened = createSelector(
|
export const getAppSelection = createSelector(
|
||||||
|
selectApp,
|
||||||
|
state => state.selection
|
||||||
|
);
|
||||||
|
|
||||||
|
export const getSharedUrl = createSelector(
|
||||||
|
selectApp,
|
||||||
|
state => state.sharedUrl
|
||||||
|
);
|
||||||
|
|
||||||
|
export const getNavigationState = createSelector(
|
||||||
|
selectApp,
|
||||||
|
state => state.navigation
|
||||||
|
);
|
||||||
|
|
||||||
|
export const isInfoDrawerOpened = createSelector(
|
||||||
selectApp,
|
selectApp,
|
||||||
state => state.infoDrawerOpened
|
state => state.infoDrawerOpened
|
||||||
);
|
);
|
||||||
@ -83,18 +83,18 @@ export const showFacetFilter = createSelector(
|
|||||||
state => state.showFacetFilter
|
state => state.showFacetFilter
|
||||||
);
|
);
|
||||||
|
|
||||||
export const documentDisplayMode = createSelector(
|
export const getDocumentDisplayMode = createSelector(
|
||||||
selectApp,
|
selectApp,
|
||||||
state => state.documentDisplayMode
|
state => state.documentDisplayMode
|
||||||
);
|
);
|
||||||
|
|
||||||
export const repositoryStatus = createSelector(
|
export const getRepositoryStatus = createSelector(
|
||||||
selectApp,
|
selectApp,
|
||||||
state => state.repository
|
state => state.repository
|
||||||
);
|
);
|
||||||
|
|
||||||
export const isQuickShareEnabled = createSelector(
|
export const isQuickShareEnabled = createSelector(
|
||||||
repositoryStatus,
|
getRepositoryStatus,
|
||||||
info => info.status.isQuickShareEnabled
|
info => info.status.isQuickShareEnabled
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -103,9 +103,9 @@ export const isAdmin = createSelector(
|
|||||||
state => state.user.isAdmin
|
state => state.user.isAdmin
|
||||||
);
|
);
|
||||||
|
|
||||||
export const sidenavState = createSelector(
|
export const getSideNavState = createSelector(
|
||||||
appSelection,
|
getAppSelection,
|
||||||
appNavigation,
|
getNavigationState,
|
||||||
(selection, navigation) => {
|
(selection, navigation) => {
|
||||||
return {
|
return {
|
||||||
selection,
|
selection,
|
||||||
@ -114,11 +114,11 @@ export const sidenavState = createSelector(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
export const ruleContext = createSelector(
|
export const getRuleContext = createSelector(
|
||||||
appSelection,
|
getAppSelection,
|
||||||
appNavigation,
|
getNavigationState,
|
||||||
selectUser,
|
getUserProfile,
|
||||||
repositoryStatus,
|
getRepositoryStatus,
|
||||||
(selection, navigation, profile, repository) => {
|
(selection, navigation, profile, repository) => {
|
||||||
return {
|
return {
|
||||||
selection,
|
selection,
|
@ -23,18 +23,28 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Action } from '@ngrx/store';
|
import {
|
||||||
import { MinimalNodeEntity } from '@alfresco/js-api';
|
SelectionState,
|
||||||
|
ProfileState,
|
||||||
|
NavigationState
|
||||||
|
} from '@alfresco/adf-extensions';
|
||||||
|
import { RepositoryInfo } from '@alfresco/js-api';
|
||||||
|
|
||||||
export const ADD_FAVORITE = 'ADD_FAVORITE';
|
export interface AppState {
|
||||||
export const REMOVE_FAVORITE = 'REMOVE_FAVORITE';
|
appName: string;
|
||||||
|
headerColor: string;
|
||||||
export class AddFavoriteAction implements Action {
|
logoPath: string;
|
||||||
readonly type = ADD_FAVORITE;
|
languagePicker: boolean;
|
||||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
sharedUrl: string;
|
||||||
|
selection: SelectionState;
|
||||||
|
user: ProfileState;
|
||||||
|
navigation: NavigationState;
|
||||||
|
infoDrawerOpened: boolean;
|
||||||
|
showFacetFilter: boolean;
|
||||||
|
documentDisplayMode: string;
|
||||||
|
repository: RepositoryInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class RemoveFavoriteAction implements Action {
|
export interface AppStore {
|
||||||
readonly type = REMOVE_FAVORITE;
|
app: AppState;
|
||||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
|
||||||
}
|
}
|
@ -23,12 +23,15 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Action } from '@ngrx/store';
|
import { NgModule } from '@angular/core';
|
||||||
import { RepositoryInfo } from '@alfresco/js-api';
|
import { EffectsModule } from '@ngrx/effects';
|
||||||
|
import { SnackbarEffects } from './effects/snackbar.effects';
|
||||||
|
import { DialogEffects } from './effects/dialog.effects';
|
||||||
|
import { RouterEffects } from './effects/router.effects';
|
||||||
|
|
||||||
export const SET_REPOSITORY_INFO = 'SET_REPOSITORY_INFO';
|
@NgModule({
|
||||||
|
imports: [
|
||||||
export class SetRepositoryInfoAction implements Action {
|
EffectsModule.forFeature([SnackbarEffects, DialogEffects, RouterEffects])
|
||||||
readonly type = SET_REPOSITORY_INFO;
|
]
|
||||||
constructor(public payload: RepositoryInfo) {}
|
})
|
||||||
}
|
export class SharedStoreModule {}
|
22
projects/aca-shared/test.ts
Normal file
22
projects/aca-shared/test.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
||||||
|
|
||||||
|
import 'core-js/es7/reflect';
|
||||||
|
import 'zone.js/dist/zone';
|
||||||
|
import 'zone.js/dist/zone-testing';
|
||||||
|
import { getTestBed } from '@angular/core/testing';
|
||||||
|
import {
|
||||||
|
BrowserDynamicTestingModule,
|
||||||
|
platformBrowserDynamicTesting
|
||||||
|
} from '@angular/platform-browser-dynamic/testing';
|
||||||
|
|
||||||
|
declare const require: any;
|
||||||
|
|
||||||
|
// First, initialize the Angular testing environment.
|
||||||
|
getTestBed().initTestEnvironment(
|
||||||
|
BrowserDynamicTestingModule,
|
||||||
|
platformBrowserDynamicTesting()
|
||||||
|
);
|
||||||
|
// Then we find all the tests.
|
||||||
|
const context = require.context('./', true, /\.spec\.ts$/);
|
||||||
|
// And load the modules.
|
||||||
|
context.keys().map(context);
|
29
projects/aca-shared/tsconfig.lib.json
Normal file
29
projects/aca-shared/tsconfig.lib.json
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../out-tsc/lib",
|
||||||
|
"target": "es2015",
|
||||||
|
"module": "es2015",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"declaration": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"inlineSources": true,
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"importHelpers": true,
|
||||||
|
"types": [],
|
||||||
|
"lib": ["dom", "es2018"],
|
||||||
|
"paths": {
|
||||||
|
"@alfresco/aca-shared/*": ["./*"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"annotateForClosureCompiler": true,
|
||||||
|
"skipTemplateCodegen": true,
|
||||||
|
"strictMetadataEmit": true,
|
||||||
|
"fullTemplateTypeCheck": true,
|
||||||
|
"strictInjectionParameters": true,
|
||||||
|
"enableResourceInlining": true
|
||||||
|
},
|
||||||
|
"exclude": ["test.ts", "**/*.spec.ts"]
|
||||||
|
}
|
9
projects/aca-shared/tsconfig.spec.json
Normal file
9
projects/aca-shared/tsconfig.spec.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../out-tsc/spec",
|
||||||
|
"types": ["jasmine", "node"]
|
||||||
|
},
|
||||||
|
"files": ["test.ts"],
|
||||||
|
"include": ["**/*.spec.ts", "**/*.d.ts"]
|
||||||
|
}
|
7
projects/aca-shared/tslint.json
Normal file
7
projects/aca-shared/tslint.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tslint.json",
|
||||||
|
"rules": {
|
||||||
|
"directive-selector": [true, "attribute", "aca", "camelCase"],
|
||||||
|
"component-selector": [true, "element", "aca", "kebab-case"]
|
||||||
|
}
|
||||||
|
}
|
@ -2,17 +2,6 @@
|
|||||||
"name": "@alfresco/adf-office-services-ext",
|
"name": "@alfresco/adf-office-services-ext",
|
||||||
"version": "0.0.6",
|
"version": "0.0.6",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"author": {
|
|
||||||
"name": "Keensoft",
|
|
||||||
"url": "http://www.keensoft.es/en/"
|
|
||||||
},
|
|
||||||
"contributors": [
|
|
||||||
{
|
|
||||||
"name": "Denys Vuika",
|
|
||||||
"email": "denys.vuka@gmail.com",
|
|
||||||
"url": "https://medium.com/@denysvuika"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"homepage": "https://github.com/Alfresco/alfresco-content-app",
|
"homepage": "https://github.com/Alfresco/alfresco-content-app",
|
||||||
"keywords": ["Alfresco", "ADF", "ACA", "Content Application"],
|
"keywords": ["Alfresco", "ADF", "ACA", "Content Application"],
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { SetInitialStateAction } from './store/actions';
|
import { SetInitialStateAction } from '@alfresco/aca-shared/store';
|
||||||
|
|
||||||
describe('AppComponent', () => {
|
describe('AppComponent', () => {
|
||||||
let component: AppComponent;
|
let component: AppComponent;
|
||||||
|
@ -35,24 +35,21 @@ import { Component, OnInit, OnDestroy } from '@angular/core';
|
|||||||
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
|
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { AppExtensionService } from './extensions/extension.service';
|
import { AppExtensionService } from './extensions/extension.service';
|
||||||
import {
|
|
||||||
SnackbarErrorAction,
|
|
||||||
SetCurrentUrlAction,
|
|
||||||
SetInitialStateAction,
|
|
||||||
CloseModalDialogsAction,
|
|
||||||
SetRepositoryInfoAction,
|
|
||||||
SetUserProfileAction
|
|
||||||
} from './store/actions';
|
|
||||||
import {
|
import {
|
||||||
AppStore,
|
AppStore,
|
||||||
AppState,
|
AppState,
|
||||||
INITIAL_APP_STATE
|
SetCurrentUrlAction,
|
||||||
} from './store/states/app.state';
|
SetInitialStateAction,
|
||||||
|
SetUserProfileAction,
|
||||||
|
SnackbarErrorAction,
|
||||||
|
CloseModalDialogsAction,
|
||||||
|
SetRepositoryInfoAction
|
||||||
|
} from '@alfresco/aca-shared/store';
|
||||||
import { filter, takeUntil } from 'rxjs/operators';
|
import { filter, takeUntil } from 'rxjs/operators';
|
||||||
import { ContentApiService } from './services/content-api.service';
|
import { AppService, ContentApiService } from '@alfresco/aca-shared';
|
||||||
import { DiscoveryEntry, GroupsApi, Group } from '@alfresco/js-api';
|
import { DiscoveryEntry, GroupsApi, Group } from '@alfresco/js-api';
|
||||||
import { AppService } from './services/app.service';
|
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
|
import { INITIAL_APP_STATE } from './store/initial-state';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
|
@ -41,6 +41,7 @@ import {
|
|||||||
LibraryDialogComponent,
|
LibraryDialogComponent,
|
||||||
ContentModule
|
ContentModule
|
||||||
} from '@alfresco/adf-content-services';
|
} from '@alfresco/adf-content-services';
|
||||||
|
import { AppRouteReuseStrategy, SharedModule } from '@alfresco/aca-shared';
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { APP_ROUTES } from './app.routes';
|
import { APP_ROUTES } from './app.routes';
|
||||||
@ -55,7 +56,6 @@ import { AppStoreModule } from './store/app-store.module';
|
|||||||
import { MaterialModule } from './material.module';
|
import { MaterialModule } from './material.module';
|
||||||
import { AppExtensionsModule } from './extensions.module';
|
import { AppExtensionsModule } from './extensions.module';
|
||||||
import { CoreExtensionsModule } from './extensions/core.extensions.module';
|
import { CoreExtensionsModule } from './extensions/core.extensions.module';
|
||||||
import { AppRouteReuseStrategy } from './app.routes.strategy';
|
|
||||||
import { AppInfoDrawerModule } from './components/info-drawer/info.drawer.module';
|
import { AppInfoDrawerModule } from './components/info-drawer/info.drawer.module';
|
||||||
import { DirectivesModule } from './directives/directives.module';
|
import { DirectivesModule } from './directives/directives.module';
|
||||||
import { ContextMenuModule } from './components/context-menu/context-menu.module';
|
import { ContextMenuModule } from './components/context-menu/context-menu.module';
|
||||||
@ -89,6 +89,7 @@ import { environment } from '../environments/environment';
|
|||||||
MaterialModule,
|
MaterialModule,
|
||||||
CoreModule.forRoot(),
|
CoreModule.forRoot(),
|
||||||
ContentModule.forRoot(),
|
ContentModule.forRoot(),
|
||||||
|
SharedModule.forRoot(),
|
||||||
AppStoreModule,
|
AppStoreModule,
|
||||||
CoreExtensionsModule.forRoot(),
|
CoreExtensionsModule.forRoot(),
|
||||||
ExtensionsModule,
|
ExtensionsModule,
|
||||||
|
@ -28,11 +28,13 @@ import { AppLayoutComponent } from './components/layout/app-layout/app-layout.co
|
|||||||
import { FilesComponent } from './components/files/files.component';
|
import { FilesComponent } from './components/files/files.component';
|
||||||
import { LibrariesComponent } from './components/libraries/libraries.component';
|
import { LibrariesComponent } from './components/libraries/libraries.component';
|
||||||
import { FavoriteLibrariesComponent } from './components/favorite-libraries/favorite-libraries.component';
|
import { FavoriteLibrariesComponent } from './components/favorite-libraries/favorite-libraries.component';
|
||||||
import { GenericErrorComponent } from './components/common/generic-error/generic-error.component';
|
|
||||||
import { SearchResultsComponent } from './components/search/search-results/search-results.component';
|
import { SearchResultsComponent } from './components/search/search-results/search-results.component';
|
||||||
import { SearchLibrariesResultsComponent } from './components/search/search-libraries-results/search-libraries-results.component';
|
import { SearchLibrariesResultsComponent } from './components/search/search-libraries-results/search-libraries-results.component';
|
||||||
import { LoginComponent } from './components/login/login.component';
|
import { LoginComponent } from './components/login/login.component';
|
||||||
import { AppSharedRuleGuard } from './guards/shared.guard';
|
import {
|
||||||
|
AppSharedRuleGuard,
|
||||||
|
GenericErrorComponent
|
||||||
|
} from '@alfresco/aca-shared';
|
||||||
import { AuthGuardEcm } from '@alfresco/adf-core';
|
import { AuthGuardEcm } from '@alfresco/adf-core';
|
||||||
|
|
||||||
export const APP_ROUTES: Routes = [
|
export const APP_ROUTES: Routes = [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<app-page-layout>
|
<aca-page-layout>
|
||||||
<app-page-layout-content [scrollable]="true">
|
<aca-page-layout-content [scrollable]="true">
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<article>
|
<article>
|
||||||
<header>{{ 'application.name' | adfAppConfig }}</header>
|
<header>{{ 'application.name' | adfAppConfig }}</header>
|
||||||
@ -43,5 +43,5 @@
|
|||||||
<app-package-list [data]="dependencyEntries"></app-package-list>
|
<app-package-list [data]="dependencyEntries"></app-package-list>
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
</app-page-layout-content>
|
</aca-page-layout-content>
|
||||||
</app-page-layout>
|
</aca-page-layout>
|
||||||
|
@ -29,7 +29,7 @@ import { RepositoryInfo } from '@alfresco/js-api';
|
|||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { AppExtensionService } from '../../extensions/extension.service';
|
import { AppExtensionService } from '../../extensions/extension.service';
|
||||||
import { ContentApiService } from '../../services/content-api.service';
|
import { ContentApiService } from '@alfresco/aca-shared';
|
||||||
import { version, dependencies } from '../../../../package.json';
|
import { version, dependencies } from '../../../../package.json';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-about',
|
selector: 'app-about',
|
||||||
|
@ -29,7 +29,7 @@ import { AboutComponent } from './about.component';
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { CoreModule } from '@alfresco/adf-core';
|
import { CoreModule } from '@alfresco/adf-core';
|
||||||
import { AppLayoutModule } from '../layout/layout.module';
|
import { AppLayoutModule } from '../layout/layout.module';
|
||||||
import { MatTableModule } from '@angular/material';
|
import { MatTableModule } from '@angular/material/table';
|
||||||
import { PackageListComponent } from './package-list/package-list.component';
|
import { PackageListComponent } from './package-list/package-list.component';
|
||||||
import { ExtensionListComponent } from './extension-list/extension-list.component';
|
import { ExtensionListComponent } from './extension-list/extension-list.component';
|
||||||
import { StatusListComponent } from './status-list/status-list.component';
|
import { StatusListComponent } from './status-list/status-list.component';
|
||||||
|
@ -23,23 +23,22 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import { GenericErrorComponent } from './generic-error/generic-error.component';
|
|
||||||
import { CoreModule } from '@alfresco/adf-core';
|
import { CoreModule } from '@alfresco/adf-core';
|
||||||
import { LocationLinkComponent } from './location-link/location-link.component';
|
|
||||||
import { MatIconModule } from '@angular/material';
|
|
||||||
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { GenericErrorModule } from '@alfresco/aca-shared';
|
||||||
|
import { LocationLinkComponent } from './location-link/location-link.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
CoreModule.forChild(),
|
CoreModule.forChild(),
|
||||||
MatIconModule,
|
ExtensionsModule,
|
||||||
ExtensionsModule
|
GenericErrorModule
|
||||||
],
|
],
|
||||||
declarations: [GenericErrorComponent, LocationLinkComponent],
|
declarations: [LocationLinkComponent],
|
||||||
exports: [ExtensionsModule, GenericErrorComponent, LocationLinkComponent],
|
exports: [ExtensionsModule, LocationLinkComponent, GenericErrorModule],
|
||||||
entryComponents: [LocationLinkComponent]
|
entryComponents: [LocationLinkComponent]
|
||||||
})
|
})
|
||||||
export class AppCommonModule {}
|
export class AppCommonModule {}
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
@mixin aca-generic-error-theme($theme) {
|
|
||||||
$warn: map-get($theme, warn);
|
|
||||||
$foreground: map-get($theme, foreground);
|
|
||||||
|
|
||||||
.aca-generic-error {
|
|
||||||
color: mat-color($foreground, text, 0.54);
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
&__title {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
mat-icon {
|
|
||||||
color: mat-color($warn);
|
|
||||||
direction: rtl;
|
|
||||||
font-size: 52px;
|
|
||||||
height: 52px;
|
|
||||||
width: 52px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -35,9 +35,8 @@ import { PathInfo, MinimalNodeEntity } from '@alfresco/js-api';
|
|||||||
import { Observable, BehaviorSubject, of } from 'rxjs';
|
import { Observable, BehaviorSubject, of } from 'rxjs';
|
||||||
|
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { AppStore } from '../../../store/states/app.state';
|
import { AppStore, NavigateToParentFolder } from '@alfresco/aca-shared/store';
|
||||||
import { NavigateToParentFolder } from '../../../store/actions';
|
import { ContentApiService } from '@alfresco/aca-shared';
|
||||||
import { ContentApiService } from '../../../services/content-api.service';
|
|
||||||
import { TranslationService } from '@alfresco/adf-core';
|
import { TranslationService } from '@alfresco/adf-core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -32,11 +32,10 @@ import {
|
|||||||
ViewChild,
|
ViewChild,
|
||||||
AfterViewInit
|
AfterViewInit
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { MatMenuTrigger } from '@angular/material';
|
import { MatMenuTrigger } from '@angular/material/menu';
|
||||||
|
|
||||||
import { AppExtensionService } from '../../extensions/extension.service';
|
import { AppExtensionService } from '../../extensions/extension.service';
|
||||||
import { AppStore } from '../../store/states';
|
import { AppStore, getAppSelection } from '@alfresco/aca-shared/store';
|
||||||
import { appSelection } from '../../store/selectors/app.selectors';
|
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
@ -91,7 +90,7 @@ export class ContextMenuComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.store
|
this.store
|
||||||
.select(appSelection)
|
.select(getAppSelection)
|
||||||
.pipe(takeUntil(this.onDestroy$))
|
.pipe(takeUntil(this.onDestroy$))
|
||||||
.subscribe(selection => {
|
.subscribe(selection => {
|
||||||
if (selection.count) {
|
if (selection.count) {
|
||||||
|
@ -23,22 +23,19 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { NgModule } from '@angular/core';
|
|
||||||
import {
|
|
||||||
MatMenuModule,
|
|
||||||
MatListModule,
|
|
||||||
MatIconModule,
|
|
||||||
MatButtonModule
|
|
||||||
} from '@angular/material';
|
|
||||||
import { CoreModule } from '@alfresco/adf-core';
|
import { CoreModule } from '@alfresco/adf-core';
|
||||||
import { CoreExtensionsModule } from '../../extensions/core.extensions.module';
|
|
||||||
|
|
||||||
import { ContextActionsDirective } from './context-menu.directive';
|
|
||||||
import { ContextMenuComponent } from './context-menu.component';
|
|
||||||
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
||||||
import { OutsideEventDirective } from './context-menu-outside-event.directive';
|
import { NgModule } from '@angular/core';
|
||||||
import { ContextMenuItemComponent } from './context-menu-item.component';
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
|
import { MatListModule } from '@angular/material/list';
|
||||||
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
|
import { CoreExtensionsModule } from '../../extensions/core.extensions.module';
|
||||||
import { AppCommonModule } from '../common/common.module';
|
import { AppCommonModule } from '../common/common.module';
|
||||||
|
import { ContextMenuItemComponent } from './context-menu-item.component';
|
||||||
|
import { OutsideEventDirective } from './context-menu-outside-event.directive';
|
||||||
|
import { ContextMenuComponent } from './context-menu.component';
|
||||||
|
import { ContextActionsDirective } from './context-menu.directive';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -31,10 +31,9 @@ import {
|
|||||||
ViewEncapsulation
|
ViewEncapsulation
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||||
import { AppStore } from '../../store/states';
|
import { AppStore, getCurrentFolder } from '@alfresco/aca-shared/store';
|
||||||
import { AppExtensionService } from '../../extensions/extension.service';
|
import { AppExtensionService } from '../../extensions/extension.service';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { currentFolder } from '../../store/selectors/app.selectors';
|
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
|
|
||||||
@ -62,7 +61,7 @@ export class CreateMenuComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.store
|
this.store
|
||||||
.select(currentFolder)
|
.select(getCurrentFolder)
|
||||||
.pipe(takeUntil(this.onDestroy$))
|
.pipe(takeUntil(this.onDestroy$))
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
this.createActions = this.extensions.getCreateActions();
|
this.createActions = this.extensions.getCreateActions();
|
||||||
|
@ -26,14 +26,14 @@
|
|||||||
import { Component, ViewEncapsulation } from '@angular/core';
|
import { Component, ViewEncapsulation } from '@angular/core';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import {
|
|
||||||
selectUser,
|
|
||||||
appLanguagePicker
|
|
||||||
} from '../../store/selectors/app.selectors';
|
|
||||||
import { AppStore } from '../../store/states';
|
|
||||||
import { ProfileState } from '@alfresco/adf-extensions';
|
import { ProfileState } from '@alfresco/adf-extensions';
|
||||||
import { SetSelectedNodesAction } from '../../store/actions';
|
import {
|
||||||
import { AppService } from '../../services/app.service';
|
AppStore,
|
||||||
|
SetSelectedNodesAction,
|
||||||
|
getUserProfile,
|
||||||
|
getLanguagePickerState
|
||||||
|
} from '@alfresco/aca-shared/store';
|
||||||
|
import { AppService } from '@alfresco/aca-shared';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'aca-current-user',
|
selector: 'aca-current-user',
|
||||||
@ -50,8 +50,8 @@ export class CurrentUserComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constructor(private store: Store<AppStore>, private appService: AppService) {
|
constructor(private store: Store<AppStore>, private appService: AppService) {
|
||||||
this.profile$ = this.store.select(selectUser);
|
this.profile$ = this.store.select(getUserProfile);
|
||||||
this.languagePicker$ = store.select(appLanguagePicker);
|
this.languagePicker$ = store.select(getLanguagePickerState);
|
||||||
}
|
}
|
||||||
|
|
||||||
onLogoutEvent() {
|
onLogoutEvent() {
|
||||||
|
@ -28,7 +28,7 @@ import {
|
|||||||
import { Actions, ofType } from '@ngrx/effects';
|
import { Actions, ofType } from '@ngrx/effects';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { filter, takeUntil } from 'rxjs/operators';
|
import { filter, takeUntil } from 'rxjs/operators';
|
||||||
import { EDIT_OFFLINE } from '../../../store/actions';
|
import { NodeActionTypes } from '@alfresco/aca-shared/store';
|
||||||
import { isLocked } from '../../../utils/node.utils';
|
import { isLocked } from '../../../utils/node.utils';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -75,7 +75,7 @@ export class CustomNameColumnComponent extends NameColumnComponent
|
|||||||
|
|
||||||
this.actions$
|
this.actions$
|
||||||
.pipe(
|
.pipe(
|
||||||
ofType<any>(EDIT_OFFLINE),
|
ofType<any>(NodeActionTypes.EditOffline),
|
||||||
filter(val => {
|
filter(val => {
|
||||||
return this.node.entry.id === val.payload.entry.id;
|
return this.node.entry.id === val.payload.entry.id;
|
||||||
}),
|
}),
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<app-page-layout>
|
<aca-page-layout>
|
||||||
<app-page-layout-header>
|
<aca-page-layout-header>
|
||||||
<adf-breadcrumb root="APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.TITLE">
|
<adf-breadcrumb root="APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.TITLE">
|
||||||
</adf-breadcrumb>
|
</adf-breadcrumb>
|
||||||
|
|
||||||
@ -8,9 +8,9 @@
|
|||||||
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
|
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</adf-toolbar>
|
</adf-toolbar>
|
||||||
</app-page-layout-header>
|
</aca-page-layout-header>
|
||||||
|
|
||||||
<app-page-layout-content>
|
<aca-page-layout-content>
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<adf-document-list
|
<adf-document-list
|
||||||
#documentList
|
#documentList
|
||||||
@ -91,5 +91,5 @@
|
|||||||
<div class="sidebar" *ngIf="(infoDrawerOpened$ | async)">
|
<div class="sidebar" *ngIf="(infoDrawerOpened$ | async)">
|
||||||
<aca-info-drawer [node]="selection.last"></aca-info-drawer>
|
<aca-info-drawer [node]="selection.last"></aca-info-drawer>
|
||||||
</div>
|
</div>
|
||||||
</app-page-layout-content>
|
</aca-page-layout-content>
|
||||||
</app-page-layout>
|
</aca-page-layout>
|
||||||
|
@ -36,11 +36,12 @@ import {
|
|||||||
import { DocumentListComponent } from '@alfresco/adf-content-services';
|
import { DocumentListComponent } from '@alfresco/adf-content-services';
|
||||||
import { FavoriteLibrariesComponent } from './favorite-libraries.component';
|
import { FavoriteLibrariesComponent } from './favorite-libraries.component';
|
||||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||||
import { ContentApiService } from '../../services/content-api.service';
|
import { ContentApiService } from '@alfresco/aca-shared';
|
||||||
import { ContentManagementService } from '../../services/content-management.service';
|
import { ContentManagementService } from '../../services/content-management.service';
|
||||||
import { EffectsModule } from '@ngrx/effects';
|
import { EffectsModule } from '@ngrx/effects';
|
||||||
import { LibraryEffects, RouterEffects } from '../../store/effects';
|
import { RouterEffects } from '@alfresco/aca-shared/store';
|
||||||
import { of, throwError } from 'rxjs';
|
import { of, throwError } from 'rxjs';
|
||||||
|
import { LibraryEffects } from '../../store/effects';
|
||||||
|
|
||||||
describe('FavoriteLibrariesComponent', () => {
|
describe('FavoriteLibrariesComponent', () => {
|
||||||
let fixture: ComponentFixture<FavoriteLibrariesComponent>;
|
let fixture: ComponentFixture<FavoriteLibrariesComponent>;
|
||||||
|
@ -29,9 +29,8 @@ import { Store } from '@ngrx/store';
|
|||||||
import { SiteEntry, FavoritePaging, Pagination } from '@alfresco/js-api';
|
import { SiteEntry, FavoritePaging, Pagination } from '@alfresco/js-api';
|
||||||
import { AppExtensionService } from '../../extensions/extension.service';
|
import { AppExtensionService } from '../../extensions/extension.service';
|
||||||
import { ContentManagementService } from '../../services/content-management.service';
|
import { ContentManagementService } from '../../services/content-management.service';
|
||||||
import { ContentApiService } from '../../services/content-api.service';
|
import { ContentApiService } from '@alfresco/aca-shared';
|
||||||
import { NavigateLibraryAction } from '../../store/actions';
|
import { NavigateLibraryAction } from '@alfresco/aca-shared/store';
|
||||||
import { AppStore } from '../../store/states/app.state';
|
|
||||||
import { PageComponent } from '../page.component';
|
import { PageComponent } from '../page.component';
|
||||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
import { UserPreferencesService } from '@alfresco/adf-core';
|
||||||
@Component({
|
@Component({
|
||||||
@ -47,7 +46,7 @@ export class FavoriteLibrariesComponent extends PageComponent
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
content: ContentManagementService,
|
content: ContentManagementService,
|
||||||
store: Store<AppStore>,
|
store: Store<any>,
|
||||||
extensions: AppExtensionService,
|
extensions: AppExtensionService,
|
||||||
private contentApiService: ContentApiService,
|
private contentApiService: ContentApiService,
|
||||||
private breakpointObserver: BreakpointObserver,
|
private breakpointObserver: BreakpointObserver,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<app-page-layout>
|
<aca-page-layout>
|
||||||
<app-page-layout-header>
|
<aca-page-layout-header>
|
||||||
<adf-breadcrumb root="APP.BROWSE.FAVORITES.TITLE"> </adf-breadcrumb>
|
<adf-breadcrumb root="APP.BROWSE.FAVORITES.TITLE"> </adf-breadcrumb>
|
||||||
|
|
||||||
<adf-toolbar class="adf-toolbar--inline">
|
<adf-toolbar class="adf-toolbar--inline">
|
||||||
@ -7,9 +7,9 @@
|
|||||||
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
|
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</adf-toolbar>
|
</adf-toolbar>
|
||||||
</app-page-layout-header>
|
</aca-page-layout-header>
|
||||||
|
|
||||||
<app-page-layout-content>
|
<aca-page-layout-content>
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<adf-document-list
|
<adf-document-list
|
||||||
#documentList
|
#documentList
|
||||||
@ -78,5 +78,5 @@
|
|||||||
<div class="sidebar" *ngIf="(infoDrawerOpened$ | async)">
|
<div class="sidebar" *ngIf="(infoDrawerOpened$ | async)">
|
||||||
<aca-info-drawer [node]="selection.last"></aca-info-drawer>
|
<aca-info-drawer [node]="selection.last"></aca-info-drawer>
|
||||||
</div>
|
</div>
|
||||||
</app-page-layout-content>
|
</aca-page-layout-content>
|
||||||
</app-page-layout>
|
</aca-page-layout>
|
||||||
|
@ -36,7 +36,7 @@ import { DocumentListComponent } from '@alfresco/adf-content-services';
|
|||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { FavoritesComponent } from './favorites.component';
|
import { FavoritesComponent } from './favorites.component';
|
||||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||||
import { ContentApiService } from '../../services/content-api.service';
|
import { ContentApiService } from '@alfresco/aca-shared';
|
||||||
|
|
||||||
describe('FavoritesComponent', () => {
|
describe('FavoritesComponent', () => {
|
||||||
let fixture: ComponentFixture<FavoritesComponent>;
|
let fixture: ComponentFixture<FavoritesComponent>;
|
||||||
|
@ -23,23 +23,23 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { ContentApiService } from '@alfresco/aca-shared';
|
||||||
import { Router } from '@angular/router';
|
import { AppStore } from '@alfresco/aca-shared/store';
|
||||||
import { Store } from '@ngrx/store';
|
import { UploadService } from '@alfresco/adf-core';
|
||||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
||||||
import {
|
import {
|
||||||
MinimalNodeEntity,
|
MinimalNodeEntity,
|
||||||
MinimalNodeEntryEntity,
|
MinimalNodeEntryEntity,
|
||||||
PathElementEntity,
|
PathElementEntity,
|
||||||
PathInfo
|
PathInfo
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
import { ContentManagementService } from '../../services/content-management.service';
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||||
import { AppStore } from '../../store/states/app.state';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { PageComponent } from '../page.component';
|
import { Router } from '@angular/router';
|
||||||
import { ContentApiService } from '../../services/content-api.service';
|
import { Store } from '@ngrx/store';
|
||||||
|
import { debounceTime, map } from 'rxjs/operators';
|
||||||
import { AppExtensionService } from '../../extensions/extension.service';
|
import { AppExtensionService } from '../../extensions/extension.service';
|
||||||
import { map, debounceTime } from 'rxjs/operators';
|
import { ContentManagementService } from '../../services/content-management.service';
|
||||||
import { UploadService } from '@alfresco/adf-core';
|
import { PageComponent } from '../page.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './favorites.component.html'
|
templateUrl: './favorites.component.html'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<app-page-layout [hasError]="!isValidPath">
|
<aca-page-layout [hasError]="!isValidPath">
|
||||||
<app-page-layout-header>
|
<aca-page-layout-header>
|
||||||
<adf-breadcrumb
|
<adf-breadcrumb
|
||||||
[root]="title"
|
[root]="title"
|
||||||
[folderNode]="node"
|
[folderNode]="node"
|
||||||
@ -13,13 +13,13 @@
|
|||||||
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
|
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</adf-toolbar>
|
</adf-toolbar>
|
||||||
</app-page-layout-header>
|
</aca-page-layout-header>
|
||||||
|
|
||||||
<app-page-layout-error>
|
<aca-page-layout-error>
|
||||||
<aca-generic-error></aca-generic-error>
|
<aca-generic-error></aca-generic-error>
|
||||||
</app-page-layout-error>
|
</aca-page-layout-error>
|
||||||
|
|
||||||
<app-page-layout-content>
|
<aca-page-layout-content>
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<adf-upload-drag-area [rootFolderId]="node?.id" [disabled]="!canUpload">
|
<adf-upload-drag-area [rootFolderId]="node?.id" [disabled]="!canUpload">
|
||||||
<adf-document-list
|
<adf-document-list
|
||||||
@ -87,5 +87,5 @@
|
|||||||
<div class="sidebar" *ngIf="(infoDrawerOpened$ | async)">
|
<div class="sidebar" *ngIf="(infoDrawerOpened$ | async)">
|
||||||
<aca-info-drawer [node]="selection.last"></aca-info-drawer>
|
<aca-info-drawer [node]="selection.last"></aca-info-drawer>
|
||||||
</div>
|
</div>
|
||||||
</app-page-layout-content>
|
</aca-page-layout-content>
|
||||||
</app-page-layout>
|
</aca-page-layout>
|
||||||
|
@ -41,7 +41,7 @@ import { DocumentListComponent } from '@alfresco/adf-content-services';
|
|||||||
import { NodeActionsService } from '../../services/node-actions.service';
|
import { NodeActionsService } from '../../services/node-actions.service';
|
||||||
import { FilesComponent } from './files.component';
|
import { FilesComponent } from './files.component';
|
||||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||||
import { ContentApiService } from '../../services/content-api.service';
|
import { ContentApiService } from '@alfresco/aca-shared';
|
||||||
import { of, throwError } from 'rxjs';
|
import { of, throwError } from 'rxjs';
|
||||||
|
|
||||||
describe('FilesComponent', () => {
|
describe('FilesComponent', () => {
|
||||||
|
@ -35,14 +35,13 @@ import {
|
|||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
import { ContentManagementService } from '../../services/content-management.service';
|
import { ContentManagementService } from '../../services/content-management.service';
|
||||||
import { NodeActionsService } from '../../services/node-actions.service';
|
import { NodeActionsService } from '../../services/node-actions.service';
|
||||||
import { AppStore } from '../../store/states/app.state';
|
import { AppStore } from '@alfresco/aca-shared/store';
|
||||||
import { PageComponent } from '../page.component';
|
import { PageComponent } from '../page.component';
|
||||||
import { ContentApiService } from '../../services/content-api.service';
|
import { ContentApiService } from '@alfresco/aca-shared';
|
||||||
import { AppExtensionService } from '../../extensions/extension.service';
|
import { AppExtensionService } from '../../extensions/extension.service';
|
||||||
import { SetCurrentFolderAction } from '../../store/actions';
|
import { SetCurrentFolderAction, isAdmin } from '@alfresco/aca-shared/store';
|
||||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||||
import { debounceTime, takeUntil } from 'rxjs/operators';
|
import { debounceTime, takeUntil } from 'rxjs/operators';
|
||||||
import { isAdmin } from '../../store/selectors/app.selectors';
|
|
||||||
import { ShareDataRow } from '@alfresco/adf-content-services';
|
import { ShareDataRow } from '@alfresco/adf-content-services';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -32,14 +32,14 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import {
|
|
||||||
selectHeaderColor,
|
|
||||||
selectAppName,
|
|
||||||
selectLogoPath
|
|
||||||
} from '../../store/selectors/app.selectors';
|
|
||||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||||
import { AppExtensionService } from '../../extensions/extension.service';
|
import { AppExtensionService } from '../../extensions/extension.service';
|
||||||
import { AppStore } from '../../store/states';
|
import {
|
||||||
|
AppStore,
|
||||||
|
getHeaderColor,
|
||||||
|
getAppName,
|
||||||
|
getLogoPath
|
||||||
|
} from '@alfresco/aca-shared/store';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-header',
|
selector: 'app-header',
|
||||||
@ -61,9 +61,9 @@ export class AppHeaderComponent implements OnInit {
|
|||||||
store: Store<AppStore>,
|
store: Store<AppStore>,
|
||||||
private appExtensions: AppExtensionService
|
private appExtensions: AppExtensionService
|
||||||
) {
|
) {
|
||||||
this.headerColor$ = store.select(selectHeaderColor);
|
this.headerColor$ = store.select(getHeaderColor);
|
||||||
this.appName$ = store.select(selectAppName);
|
this.appName$ = store.select(getAppName);
|
||||||
this.logo$ = store.select(selectLogoPath);
|
this.logo$ = store.select(getLogoPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -27,7 +27,7 @@ import { CommentsTabComponent } from './comments-tab.component';
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { NodePermissionService } from '../../../services/node-permission.service';
|
import { NodePermissionService } from '@alfresco/aca-shared';
|
||||||
|
|
||||||
describe('CommentsTabComponent', () => {
|
describe('CommentsTabComponent', () => {
|
||||||
let component: CommentsTabComponent;
|
let component: CommentsTabComponent;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
|
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
|
||||||
import { NodePermissionService } from '../../../services/node-permission.service';
|
import { NodePermissionService } from '@alfresco/aca-shared';
|
||||||
import { isLocked } from '../../../utils/node.utils';
|
import { isLocked } from '../../../utils/node.utils';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -26,10 +26,10 @@ import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|||||||
import { InfoDrawerComponent } from './info-drawer.component';
|
import { InfoDrawerComponent } from './info-drawer.component';
|
||||||
import { TestBed, ComponentFixture, async } from '@angular/core/testing';
|
import { TestBed, ComponentFixture, async } from '@angular/core/testing';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { SetInfoDrawerStateAction } from '../../store/actions';
|
import { SetInfoDrawerStateAction } from '@alfresco/aca-shared/store';
|
||||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||||
import { AppExtensionService } from '../../extensions/extension.service';
|
import { AppExtensionService } from '../../extensions/extension.service';
|
||||||
import { ContentApiService } from '../../services/content-api.service';
|
import { ContentApiService } from '@alfresco/aca-shared';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
|
|
||||||
describe('InfoDrawerComponent', () => {
|
describe('InfoDrawerComponent', () => {
|
||||||
|
@ -29,11 +29,11 @@ import {
|
|||||||
MinimalNodeEntryEntity,
|
MinimalNodeEntryEntity,
|
||||||
SiteEntry
|
SiteEntry
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
import { ContentApiService } from '../../services/content-api.service';
|
import { ContentApiService } from '@alfresco/aca-shared';
|
||||||
import { AppExtensionService } from '../../extensions/extension.service';
|
import { AppExtensionService } from '../../extensions/extension.service';
|
||||||
import { SidebarTabRef } from '@alfresco/adf-extensions';
|
import { SidebarTabRef } from '@alfresco/adf-extensions';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { SetInfoDrawerStateAction } from '../../store/actions';
|
import { SetInfoDrawerStateAction } from '@alfresco/aca-shared/store';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'aca-info-drawer',
|
selector: 'aca-info-drawer',
|
||||||
|
@ -30,7 +30,7 @@ import {
|
|||||||
tick
|
tick
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { UpdateLibraryAction } from '../../../store/actions';
|
import { UpdateLibraryAction } from '@alfresco/aca-shared/store';
|
||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { Site, SiteBody } from '@alfresco/js-api';
|
import { Site, SiteBody } from '@alfresco/js-api';
|
||||||
|
@ -27,8 +27,7 @@ import { Component, Input, OnInit, OnChanges, OnDestroy } from '@angular/core';
|
|||||||
import { FormGroup, FormControl, Validators } from '@angular/forms';
|
import { FormGroup, FormControl, Validators } from '@angular/forms';
|
||||||
import { SiteEntry, SitePaging } from '@alfresco/js-api';
|
import { SiteEntry, SitePaging } from '@alfresco/js-api';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { UpdateLibraryAction } from '../../../store/actions';
|
import { AppStore, UpdateLibraryAction } from '@alfresco/aca-shared/store';
|
||||||
import { AppStore } from '../../../store/states/app.state';
|
|
||||||
import { debounceTime, mergeMap, takeUntil } from 'rxjs/operators';
|
import { debounceTime, mergeMap, takeUntil } from 'rxjs/operators';
|
||||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||||
import { Observable, from, Subject } from 'rxjs';
|
import { Observable, from, Subject } from 'rxjs';
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { MetadataTabComponent } from './metadata-tab.component';
|
import { MetadataTabComponent } from './metadata-tab.component';
|
||||||
import { NodePermissionService } from '../../../services/node-permission.service';
|
import { NodePermissionService } from '@alfresco/aca-shared';
|
||||||
import { Node } from '@alfresco/js-api';
|
import { Node } from '@alfresco/js-api';
|
||||||
|
|
||||||
describe('MetadataTabComponent', () => {
|
describe('MetadataTabComponent', () => {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
import { Component, Input, ViewEncapsulation } from '@angular/core';
|
import { Component, Input, ViewEncapsulation } from '@angular/core';
|
||||||
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
|
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
|
||||||
import { NodePermissionService } from '../../../services/node-permission.service';
|
import { NodePermissionService } from '@alfresco/aca-shared';
|
||||||
import { AppExtensionService } from '../../../extensions/extension.service';
|
import { AppExtensionService } from '../../../extensions/extension.service';
|
||||||
import { AppConfigService } from '@alfresco/adf-core';
|
import { AppConfigService } from '@alfresco/adf-core';
|
||||||
import { isLocked } from '../../../utils/node.utils';
|
import { isLocked } from '../../../utils/node.utils';
|
||||||
|
@ -29,10 +29,12 @@ import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
|
|||||||
import { AppLayoutComponent } from './app-layout.component';
|
import { AppLayoutComponent } from './app-layout.component';
|
||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { AppStore } from '../../../store/states';
|
import {
|
||||||
import { SetSelectedNodesAction } from '../../../store/actions';
|
AppStore,
|
||||||
|
SetSelectedNodesAction,
|
||||||
|
getAppSelection
|
||||||
|
} from '@alfresco/aca-shared/store';
|
||||||
import { Router, NavigationStart } from '@angular/router';
|
import { Router, NavigationStart } from '@angular/router';
|
||||||
import { appSelection } from '../../../store/selectors/app.selectors';
|
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
|
|
||||||
class MockRouter {
|
class MockRouter {
|
||||||
@ -145,7 +147,7 @@ describe('AppLayoutComponent', () => {
|
|||||||
|
|
||||||
router.navigateByUrl('somewhere/over/the/rainbow');
|
router.navigateByUrl('somewhere/over/the/rainbow');
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
store.select(appSelection).subscribe(state => {
|
store.select(getAppSelection).subscribe(state => {
|
||||||
expect(state.isEmpty).toBe(true);
|
expect(state.isEmpty).toBe(true);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
@ -158,7 +160,7 @@ describe('AppLayoutComponent', () => {
|
|||||||
|
|
||||||
router.navigateByUrl('/search;q=');
|
router.navigateByUrl('/search;q=');
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
store.select(appSelection).subscribe(state => {
|
store.select(getAppSelection).subscribe(state => {
|
||||||
expect(state.isEmpty).toBe(false);
|
expect(state.isEmpty).toBe(false);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user