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:
|
||||
words:
|
||||
- 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",
|
||||
|
@ -161,7 +161,7 @@ Update `my-extension-dialog.component.ts`:
|
||||
|
||||
```ts
|
||||
import { Component } from '@angular/core';
|
||||
import { MatDialogRef } from '@angular/material';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-my-extension-dialog',
|
||||
@ -229,7 +229,7 @@ See also:
|
||||
Update to raise a dialog
|
||||
|
||||
```ts
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my-extension-dialog.component';
|
||||
|
||||
@Injectable()
|
||||
|
@ -36,7 +36,7 @@ Update `my-extension-dialog.component.ts`:
|
||||
|
||||
```ts
|
||||
import { Component } from '@angular/core';
|
||||
import { MatDialogRef } from '@angular/material';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-my-extension-dialog',
|
||||
@ -104,7 +104,7 @@ See also:
|
||||
Update to raise a dialog
|
||||
|
||||
```ts
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my-extension-dialog.component';
|
||||
|
||||
@Injectable()
|
||||
|
41
package-lock.json
generated
41
package-lock.json
generated
@ -4959,7 +4959,8 @@
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"aproba": {
|
||||
"version": "1.2.0",
|
||||
@ -4980,12 +4981,14 @@
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
@ -5000,17 +5003,20 @@
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
@ -5127,7 +5133,8 @@
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.5",
|
||||
@ -5139,6 +5146,7 @@
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
@ -5153,6 +5161,7 @@
|
||||
"version": "3.0.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
@ -5160,12 +5169,14 @@
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"minipass": {
|
||||
"version": "2.3.5",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.0"
|
||||
@ -5184,6 +5195,7 @@
|
||||
"version": "0.5.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
@ -5264,7 +5276,8 @@
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
@ -5276,6 +5289,7 @@
|
||||
"version": "1.4.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
@ -5361,7 +5375,8 @@
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
@ -5397,6 +5412,7 @@
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"code-point-at": "^1.0.0",
|
||||
"is-fullwidth-code-point": "^1.0.0",
|
||||
@ -5416,6 +5432,7 @@
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
@ -5459,12 +5476,14 @@
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.0.3",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
11
package.json
11
package.json
@ -4,15 +4,16 @@
|
||||
"license": "LGPL-3.0",
|
||||
"scripts": {
|
||||
"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",
|
||||
"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.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.e2e": "npm run build.extensions && npm run build.app -- --prod --configuration=e2e",
|
||||
"build": "npm run build.shared && npm run build.extensions && npm run build.app -- --prod",
|
||||
"build.e2e": "npm run build.shared && npm run build.extensions && npm run build.app -- --prod --configuration=e2e",
|
||||
"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",
|
||||
"wd:update": "webdriver-manager update --gecko=false",
|
||||
"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",
|
||||
"format:check": "prettier --check \"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",
|
||||
"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",
|
||||
|
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/>.
|
||||
*/
|
||||
|
||||
import * as app from './app.evaluators';
|
||||
import * as app from './app.rules';
|
||||
|
||||
describe('app.evaluators', () => {
|
||||
describe('isWriteLocked', () => {
|
@ -24,8 +24,8 @@
|
||||
*/
|
||||
|
||||
import { RuleContext } from '@alfresco/adf-extensions';
|
||||
import * as navigation from './navigation.evaluators';
|
||||
import * as repository from './repository.evaluators';
|
||||
import * as navigation from './navigation.rules';
|
||||
import * as repository from './repository.rules';
|
||||
|
||||
/**
|
||||
* Checks if user can copy selected node.
|
@ -23,7 +23,7 @@
|
||||
* 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('isPreview', () => {
|
@ -23,4 +23,6 @@
|
||||
* 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>
|
||||
<p class="generic-error__title">
|
||||
{{ 'APP.MESSAGES.ERRORS.MISSING_CONTENT' | translate }}
|
||||
{{ text | translate }}
|
||||
</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 {
|
||||
Component,
|
||||
ViewEncapsulation,
|
||||
ChangeDetectionStrategy
|
||||
ChangeDetectionStrategy,
|
||||
Input
|
||||
} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-generic-error',
|
||||
templateUrl: './generic-error.component.html',
|
||||
styleUrls: ['./generic-error.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
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/>.
|
||||
*/
|
||||
|
||||
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';
|
||||
|
||||
export class CloseModalDialogsAction implements Action {
|
||||
readonly type = CLOSE_MODAL_DIALOGS;
|
||||
constructor() {}
|
||||
}
|
||||
@NgModule({
|
||||
imports: [CommonModule, MatIconModule, TranslateModule.forChild()],
|
||||
declarations: [GenericErrorComponent],
|
||||
exports: [GenericErrorComponent]
|
||||
})
|
||||
export class GenericErrorModule {}
|
@ -32,13 +32,13 @@ import {
|
||||
} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-page-layout-content',
|
||||
selector: 'aca-page-layout-content',
|
||||
template: `
|
||||
<ng-content></ng-content>
|
||||
`,
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
host: { class: 'app-page-layout-content' }
|
||||
host: { class: 'aca-page-layout-content' }
|
||||
})
|
||||
export class PageLayoutContentComponent {
|
||||
@Input()
|
@ -30,12 +30,12 @@ import {
|
||||
} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-page-layout-error',
|
||||
selector: 'aca-page-layout-error',
|
||||
template: `
|
||||
<ng-content></ng-content>
|
||||
`,
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
host: { class: 'app-page-layout-error' }
|
||||
host: { class: 'aca-page-layout-error' }
|
||||
})
|
||||
export class PageLayoutErrorComponent {}
|
@ -30,10 +30,10 @@ import {
|
||||
} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-page-layout-header',
|
||||
selector: 'aca-page-layout-header',
|
||||
template: '<ng-content></ng-content>',
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
host: { class: 'app-page-layout-header' }
|
||||
host: { class: 'aca-page-layout-header' }
|
||||
})
|
||||
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';
|
||||
|
||||
@Component({
|
||||
selector: 'app-page-layout',
|
||||
selector: 'aca-page-layout',
|
||||
templateUrl: 'page-layout.component.html',
|
||||
styleUrls: ['./page-layout.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
host: { class: 'app-page-layout' },
|
||||
host: { class: 'aca-page-layout' },
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
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 { TestBed } from '@angular/core/testing';
|
||||
import { AppTestingModule } from './testing/app-testing.module';
|
||||
|
||||
describe('AppRouteReuseStrategy', () => {
|
||||
let appRouteReuse: AppRouteReuseStrategy;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppTestingModule],
|
||||
providers: [AppRouteReuseStrategy]
|
||||
});
|
||||
|
@ -28,8 +28,7 @@ import { CanActivate } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ActivatedRouteSnapshot } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AppStore } from '../store/states/app.state';
|
||||
import { isQuickShareEnabled } from '../store/selectors/app.selectors';
|
||||
import { AppStore, isQuickShareEnabled } from '@alfresco/aca-shared/store';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
@ -25,10 +25,10 @@
|
||||
|
||||
import { AppService } from './app.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AppTestingModule } from '../testing/app-testing.module';
|
||||
import { AuthenticationService, AppConfigService } from '@alfresco/adf-core';
|
||||
import { AppRouteReuseStrategy } from '../app.routes.strategy';
|
||||
import { Subject } from 'rxjs';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { AppRouteReuseStrategy } from '../routing/app.routes.strategy';
|
||||
|
||||
describe('AppService', () => {
|
||||
let service: AppService;
|
||||
@ -38,7 +38,7 @@ describe('AppService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppTestingModule],
|
||||
imports: [HttpClientModule],
|
||||
providers: [
|
||||
AppRouteReuseStrategy,
|
||||
{
|
@ -26,8 +26,8 @@
|
||||
import { Injectable, Inject } from '@angular/core';
|
||||
import { AuthenticationService, AppConfigService } from '@alfresco/adf-core';
|
||||
import { Observable, BehaviorSubject } from 'rxjs';
|
||||
import { AppRouteReuseStrategy } from '../app.routes.strategy';
|
||||
import { RouteReuseStrategy } from '@angular/router';
|
||||
import { AppRouteReuseStrategy } from '../routing/app.routes.strategy';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
@ -23,11 +23,17 @@
|
||||
* 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';
|
||||
|
||||
export class SetInfoDrawerStateAction implements Action {
|
||||
readonly type = SET_INFO_DRAWER_STATE;
|
||||
constructor(public payload: boolean) {}
|
||||
@NgModule({})
|
||||
export class SharedModule {
|
||||
static forRoot(): ModuleWithProviders {
|
||||
return {
|
||||
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 { Node, Person, Group } from '@alfresco/js-api';
|
||||
import { AppState } from '../states';
|
||||
import { Node, Person, Group, RepositoryInfo } from '@alfresco/js-api';
|
||||
import { AppState } from '../states/app.state';
|
||||
|
||||
export const SET_INITIAL_STATE = 'SET_INITIAL_STATE';
|
||||
export const SET_LANGUAGE_PICKER = 'SET_LANGUAGE_PICKER';
|
||||
export const SET_CURRENT_FOLDER = 'SET_CURRENT_FOLDER';
|
||||
export const SET_CURRENT_URL = 'SET_CURRENT_URL';
|
||||
export const SET_USER_PROFILE = 'SET_USER_PROFILE';
|
||||
export const TOGGLE_INFO_DRAWER = 'TOGGLE_INFO_DRAWER';
|
||||
export const TOGGLE_DOCUMENT_DISPLAY_MODE = 'TOGGLE_DOCUMENT_DISPLAY_MODE';
|
||||
export const LOGOUT = 'LOGOUT';
|
||||
export const RELOAD_DOCUMENT_LIST = 'RELOAD_DOCUMENT_LIST';
|
||||
export enum AppActionTypes {
|
||||
SetInitialState = 'SET_INITIAL_STATE',
|
||||
SetLanguagePicker = 'SET_LANGUAGE_PICKER',
|
||||
SetCurrentFolder = 'SET_CURRENT_FOLDER',
|
||||
SetCurrentUrl = 'SET_CURRENT_URL',
|
||||
SetUserProfile = 'SET_USER_PROFILE',
|
||||
SetRepositoryInfo = 'SET_REPOSITORY_INFO',
|
||||
ToggleInfoDrawer = 'TOGGLE_INFO_DRAWER',
|
||||
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 {
|
||||
readonly type = SET_INITIAL_STATE;
|
||||
readonly type = AppActionTypes.SetInitialState;
|
||||
|
||||
constructor(public payload: AppState) {}
|
||||
}
|
||||
|
||||
export class SetLanguagePickerAction implements Action {
|
||||
readonly type = SET_LANGUAGE_PICKER;
|
||||
readonly type = AppActionTypes.SetLanguagePicker;
|
||||
|
||||
constructor(public payload: boolean) {}
|
||||
}
|
||||
|
||||
export class SetCurrentFolderAction implements Action {
|
||||
readonly type = SET_CURRENT_FOLDER;
|
||||
readonly type = AppActionTypes.SetCurrentFolder;
|
||||
|
||||
constructor(public payload: Node) {}
|
||||
}
|
||||
|
||||
export class SetCurrentUrlAction implements Action {
|
||||
readonly type = SET_CURRENT_URL;
|
||||
readonly type = AppActionTypes.SetCurrentUrl;
|
||||
|
||||
constructor(public payload: string) {}
|
||||
}
|
||||
|
||||
export class SetUserProfileAction implements Action {
|
||||
readonly type = SET_USER_PROFILE;
|
||||
readonly type = AppActionTypes.SetUserProfile;
|
||||
|
||||
constructor(public payload: { person: Person; groups: Group[] }) {}
|
||||
}
|
||||
|
||||
export class ToggleInfoDrawerAction implements Action {
|
||||
readonly type = TOGGLE_INFO_DRAWER;
|
||||
readonly type = AppActionTypes.ToggleInfoDrawer;
|
||||
}
|
||||
|
||||
export class ToggleDocumentDisplayMode implements Action {
|
||||
readonly type = TOGGLE_DOCUMENT_DISPLAY_MODE;
|
||||
readonly type = AppActionTypes.ToggleDocumentDisplayMode;
|
||||
}
|
||||
|
||||
export class LogoutAction implements Action {
|
||||
readonly type = LOGOUT;
|
||||
readonly type = AppActionTypes.Logout;
|
||||
}
|
||||
|
||||
export class ReloadDocumentListAction implements Action {
|
||||
readonly type = RELOAD_DOCUMENT_LIST;
|
||||
readonly type = AppActionTypes.ReloadDocumentList;
|
||||
|
||||
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 { SiteBody } from '@alfresco/js-api';
|
||||
|
||||
export const DELETE_LIBRARY = 'DELETE_LIBRARY';
|
||||
export const CREATE_LIBRARY = 'CREATE_LIBRARY';
|
||||
export const NAVIGATE_LIBRARY = 'NAVIGATE_LIBRARY';
|
||||
export const UPDATE_LIBRARY = 'UPDATE_LIBRARY';
|
||||
export const LEAVE_LIBRARY = 'LEAVE_LIBRARY';
|
||||
export enum LibraryActionTypes {
|
||||
Delete = 'DELETE_LIBRARY',
|
||||
Create = 'CREATE_LIBRARY',
|
||||
Navigate = 'NAVIGATE_LIBRARY',
|
||||
Update = 'UPDATE_LIBRARY',
|
||||
Leave = 'LEAVE_LIBRARY'
|
||||
}
|
||||
|
||||
export class DeleteLibraryAction implements Action {
|
||||
readonly type = DELETE_LIBRARY;
|
||||
readonly type = LibraryActionTypes.Delete;
|
||||
|
||||
constructor(public payload?: string) {}
|
||||
}
|
||||
|
||||
export class CreateLibraryAction implements Action {
|
||||
readonly type = CREATE_LIBRARY;
|
||||
constructor() {}
|
||||
readonly type = LibraryActionTypes.Create;
|
||||
}
|
||||
|
||||
export class NavigateLibraryAction implements Action {
|
||||
readonly type = NAVIGATE_LIBRARY;
|
||||
readonly type = LibraryActionTypes.Navigate;
|
||||
|
||||
constructor(public payload?: string) {}
|
||||
}
|
||||
|
||||
export class UpdateLibraryAction implements Action {
|
||||
readonly type = UPDATE_LIBRARY;
|
||||
readonly type = LibraryActionTypes.Update;
|
||||
|
||||
constructor(public payload?: SiteBody) {}
|
||||
}
|
||||
|
||||
export class LeaveLibraryAction implements Action {
|
||||
readonly type = LEAVE_LIBRARY;
|
||||
readonly type = LibraryActionTypes.Leave;
|
||||
|
||||
constructor(public payload?: string) {}
|
||||
}
|
@ -26,111 +26,138 @@
|
||||
import { Action } from '@ngrx/store';
|
||||
import { MinimalNodeEntity } from '@alfresco/js-api';
|
||||
|
||||
export const SET_SELECTED_NODES = 'SET_SELECTED_NODES';
|
||||
export const DELETE_NODES = 'DELETE_NODES';
|
||||
export const UNDO_DELETE_NODES = 'UNDO_DELETE_NODES';
|
||||
export const RESTORE_DELETED_NODES = 'RESTORE_DELETED_NODES';
|
||||
export const PURGE_DELETED_NODES = 'PURGE_DELETED_NODES';
|
||||
export const DOWNLOAD_NODES = 'DOWNLOAD_NODES';
|
||||
export const CREATE_FOLDER = 'CREATE_FOLDER';
|
||||
export const EDIT_FOLDER = 'EDIT_FOLDER';
|
||||
export const SHARE_NODE = 'SHARE_NODE';
|
||||
export const UNSHARE_NODES = 'UNSHARE_NODES';
|
||||
export const COPY_NODES = 'COPY_NODES';
|
||||
export const MOVE_NODES = 'MOVE_NODES';
|
||||
export const MANAGE_PERMISSIONS = 'MANAGE_PERMISSIONS';
|
||||
export const PRINT_FILE = 'PRINT_FILE';
|
||||
export const FULLSCREEN_VIEWER = 'FULLSCREEN_VIEWER';
|
||||
export const MANAGE_VERSIONS = 'MANAGE_VERSIONS';
|
||||
export const EDIT_OFFLINE = 'EDIT_OFFLINE';
|
||||
export const UNLOCK_WRITE = 'UNLOCK_WRITE_LOCK';
|
||||
export enum NodeActionTypes {
|
||||
SetSelection = 'SET_SELECTED_NODES',
|
||||
Delete = 'DELETE_NODES',
|
||||
UndoDelete = 'UNDO_DELETE_NODES',
|
||||
RestoreDeleted = 'RESTORE_DELETED_NODES',
|
||||
PurgeDeleted = 'PURGE_DELETED_NODES',
|
||||
Download = 'DOWNLOAD_NODES',
|
||||
CreateFolder = 'CREATE_FOLDER',
|
||||
EditFolder = 'EDIT_FOLDER',
|
||||
Share = 'SHARE_NODE',
|
||||
Unshare = 'UNSHARE_NODES',
|
||||
Copy = 'COPY_NODES',
|
||||
Move = 'MOVE_NODES',
|
||||
ManagePermissions = 'MANAGE_PERMISSIONS',
|
||||
PrintFile = 'PRINT_FILE',
|
||||
ManageVersions = 'MANAGE_VERSIONS',
|
||||
EditOffline = 'EDIT_OFFLINE',
|
||||
UnlockForWriting = 'UNLOCK_WRITE_LOCK',
|
||||
AddFavorite = 'ADD_FAVORITE',
|
||||
RemoveFavorite = 'REMOVE_FAVORITE'
|
||||
}
|
||||
|
||||
export class SetSelectedNodesAction implements Action {
|
||||
readonly type = SET_SELECTED_NODES;
|
||||
readonly type = NodeActionTypes.SetSelection;
|
||||
|
||||
constructor(public payload: MinimalNodeEntity[] = []) {}
|
||||
}
|
||||
|
||||
export class DeleteNodesAction implements Action {
|
||||
readonly type = DELETE_NODES;
|
||||
readonly type = NodeActionTypes.Delete;
|
||||
|
||||
constructor(public payload: MinimalNodeEntity[] = []) {}
|
||||
}
|
||||
|
||||
export class UndoDeleteNodesAction implements Action {
|
||||
readonly type = UNDO_DELETE_NODES;
|
||||
readonly type = NodeActionTypes.UndoDelete;
|
||||
|
||||
constructor(public payload: any[] = []) {}
|
||||
}
|
||||
|
||||
export class RestoreDeletedNodesAction implements Action {
|
||||
readonly type = RESTORE_DELETED_NODES;
|
||||
readonly type = NodeActionTypes.RestoreDeleted;
|
||||
|
||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||
}
|
||||
|
||||
export class PurgeDeletedNodesAction implements Action {
|
||||
readonly type = PURGE_DELETED_NODES;
|
||||
readonly type = NodeActionTypes.PurgeDeleted;
|
||||
|
||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||
}
|
||||
|
||||
export class DownloadNodesAction implements Action {
|
||||
readonly type = DOWNLOAD_NODES;
|
||||
readonly type = NodeActionTypes.Download;
|
||||
|
||||
constructor(public payload: MinimalNodeEntity[] = []) {}
|
||||
}
|
||||
|
||||
export class CreateFolderAction implements Action {
|
||||
readonly type = CREATE_FOLDER;
|
||||
readonly type = NodeActionTypes.CreateFolder;
|
||||
|
||||
constructor(public payload: string) {}
|
||||
}
|
||||
|
||||
export class EditFolderAction implements Action {
|
||||
readonly type = EDIT_FOLDER;
|
||||
readonly type = NodeActionTypes.EditFolder;
|
||||
|
||||
constructor(public payload: MinimalNodeEntity) {}
|
||||
}
|
||||
|
||||
export class ShareNodeAction implements Action {
|
||||
readonly type = SHARE_NODE;
|
||||
readonly type = NodeActionTypes.Share;
|
||||
|
||||
constructor(public payload: MinimalNodeEntity) {}
|
||||
}
|
||||
|
||||
export class UnshareNodesAction implements Action {
|
||||
readonly type = UNSHARE_NODES;
|
||||
readonly type = NodeActionTypes.Unshare;
|
||||
|
||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||
}
|
||||
|
||||
export class CopyNodesAction implements Action {
|
||||
readonly type = COPY_NODES;
|
||||
readonly type = NodeActionTypes.Copy;
|
||||
|
||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||
}
|
||||
|
||||
export class MoveNodesAction implements Action {
|
||||
readonly type = MOVE_NODES;
|
||||
readonly type = NodeActionTypes.Move;
|
||||
|
||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||
}
|
||||
|
||||
export class ManagePermissionsAction implements Action {
|
||||
readonly type = MANAGE_PERMISSIONS;
|
||||
readonly type = NodeActionTypes.ManagePermissions;
|
||||
|
||||
constructor(public payload: MinimalNodeEntity) {}
|
||||
}
|
||||
|
||||
export class PrintFileAction implements Action {
|
||||
readonly type = PRINT_FILE;
|
||||
constructor(public payload: MinimalNodeEntity) {}
|
||||
}
|
||||
readonly type = NodeActionTypes.PrintFile;
|
||||
|
||||
export class FullscreenViewerAction implements Action {
|
||||
readonly type = FULLSCREEN_VIEWER;
|
||||
constructor(public payload: MinimalNodeEntity) {}
|
||||
}
|
||||
|
||||
export class ManageVersionsAction implements Action {
|
||||
readonly type = MANAGE_VERSIONS;
|
||||
readonly type = NodeActionTypes.ManageVersions;
|
||||
|
||||
constructor(public payload: MinimalNodeEntity) {}
|
||||
}
|
||||
|
||||
export class EditOfflineAction implements Action {
|
||||
readonly type = EDIT_OFFLINE;
|
||||
readonly type = NodeActionTypes.EditOffline;
|
||||
|
||||
constructor(public payload: any) {}
|
||||
}
|
||||
|
||||
export class UnlockWriteAction implements Action {
|
||||
readonly type = UNLOCK_WRITE;
|
||||
readonly type = NodeActionTypes.UnlockForWriting;
|
||||
|
||||
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 { MinimalNodeEntity } from '@alfresco/js-api';
|
||||
|
||||
export const NAVIGATE_URL = 'NAVIGATE_URL';
|
||||
export const NAVIGATE_ROUTE = 'NAVIGATE_ROUTE';
|
||||
export const NAVIGATE_FOLDER = 'NAVIGATE_FOLDER';
|
||||
export const NAVIGATE_PARENT_FOLDER = 'NAVIGATE_PARENT_FOLDER';
|
||||
export enum RouterActionTypes {
|
||||
NavigateUrl = 'NAVIGATE_URL',
|
||||
NavigateRoute = 'NAVIGATE_ROUTE',
|
||||
NavigateFolder = 'NAVIGATE_FOLDER',
|
||||
NavigateParentFolder = 'NAVIGATE_PARENT_FOLDER'
|
||||
}
|
||||
|
||||
export class NavigateUrlAction implements Action {
|
||||
readonly type = NAVIGATE_URL;
|
||||
readonly type = RouterActionTypes.NavigateUrl;
|
||||
|
||||
constructor(public payload: string) {}
|
||||
}
|
||||
|
||||
export class NavigateRouteAction implements Action {
|
||||
readonly type = NAVIGATE_ROUTE;
|
||||
readonly type = RouterActionTypes.NavigateRoute;
|
||||
|
||||
constructor(public payload: any[]) {}
|
||||
}
|
||||
|
||||
export class NavigateToFolder implements Action {
|
||||
readonly type = NAVIGATE_FOLDER;
|
||||
readonly type = RouterActionTypes.NavigateFolder;
|
||||
|
||||
constructor(public payload: MinimalNodeEntity) {}
|
||||
}
|
||||
|
||||
export class NavigateToParentFolder implements Action {
|
||||
readonly type = NAVIGATE_PARENT_FOLDER;
|
||||
readonly type = RouterActionTypes.NavigateParentFolder;
|
||||
|
||||
constructor(public payload: MinimalNodeEntity) {}
|
||||
}
|
@ -24,15 +24,17 @@
|
||||
*/
|
||||
|
||||
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 const TOGGLE_SEARCH_FILTER = 'TOGGLE_SEARCH_FILTER';
|
||||
export const SHOW_SEARCH_FILTER = 'SHOW_SEARCH_FILTER';
|
||||
export const HIDE_SEARCH_FILTER = 'HIDE_SEARCH_FILTER';
|
||||
export enum SearchActionTypes {
|
||||
SearchByTerm = 'SEARCH_BY_TERM',
|
||||
ToggleFilter = 'TOGGLE_SEARCH_FILTER',
|
||||
ShowFilter = 'SHOW_SEARCH_FILTER',
|
||||
HideFilter = 'HIDE_SEARCH_FILTER'
|
||||
}
|
||||
|
||||
export class SearchByTermAction implements Action {
|
||||
readonly type = SEARCH_BY_TERM;
|
||||
readonly type = SearchActionTypes.SearchByTerm;
|
||||
constructor(
|
||||
public payload: string,
|
||||
public searchOptions?: SearchOptionModel[]
|
||||
@ -40,13 +42,13 @@ export class SearchByTermAction implements Action {
|
||||
}
|
||||
|
||||
export class ToggleSearchFilterAction implements Action {
|
||||
readonly type = TOGGLE_SEARCH_FILTER;
|
||||
readonly type = SearchActionTypes.ToggleFilter;
|
||||
}
|
||||
|
||||
export class ShowSearchFilterAction implements Action {
|
||||
readonly type = SHOW_SEARCH_FILTER;
|
||||
readonly type = SearchActionTypes.ShowFilter;
|
||||
}
|
||||
|
||||
export class HideSearchFilterAction implements Action {
|
||||
readonly type = HIDE_SEARCH_FILTER;
|
||||
readonly type = SearchActionTypes.HideFilter;
|
||||
}
|
@ -25,9 +25,11 @@
|
||||
|
||||
import { Action } from '@ngrx/store';
|
||||
|
||||
export const SNACKBAR_INFO = 'SNACKBAR_INFO';
|
||||
export const SNACKBAR_WARNING = 'SNACKBAR_WARNING';
|
||||
export const SNACKBAR_ERROR = 'SNACKBAR_ERROR';
|
||||
export enum SnackbarActionTypes {
|
||||
Info = 'SNACKBAR_INFO',
|
||||
Warning = 'SNACKBAR_WARNING',
|
||||
Error = 'SNACKBAR_ERROR'
|
||||
}
|
||||
|
||||
export interface SnackbarAction extends Action {
|
||||
payload: string;
|
||||
@ -41,7 +43,7 @@ export class SnackbarUserAction {
|
||||
}
|
||||
|
||||
export class SnackbarInfoAction implements SnackbarAction {
|
||||
readonly type = SNACKBAR_INFO;
|
||||
readonly type = SnackbarActionTypes.Info;
|
||||
|
||||
userAction?: SnackbarUserAction;
|
||||
duration = 4000;
|
||||
@ -50,7 +52,7 @@ export class SnackbarInfoAction implements SnackbarAction {
|
||||
}
|
||||
|
||||
export class SnackbarWarningAction implements SnackbarAction {
|
||||
readonly type = SNACKBAR_WARNING;
|
||||
readonly type = SnackbarActionTypes.Warning;
|
||||
|
||||
userAction?: SnackbarUserAction;
|
||||
duration = 4000;
|
||||
@ -59,7 +61,7 @@ export class SnackbarWarningAction implements SnackbarAction {
|
||||
}
|
||||
|
||||
export class SnackbarErrorAction implements SnackbarAction {
|
||||
readonly type = SNACKBAR_ERROR;
|
||||
readonly type = SnackbarActionTypes.Error;
|
||||
|
||||
userAction?: SnackbarUserAction;
|
||||
duration = 4000;
|
@ -25,20 +25,24 @@
|
||||
|
||||
import { Action } from '@ngrx/store';
|
||||
|
||||
export const UPLOAD_FILES = 'UPLOAD_FILES';
|
||||
export const UPLOAD_FOLDER = 'UPLOAD_FOLDER';
|
||||
export const UPLOAD_FILE_VERSION = 'UPLOAD_FILE_VERSION';
|
||||
export enum UploadActionTypes {
|
||||
UploadFiles = 'UPLOAD_FILES',
|
||||
UploadFolder = 'UPLOAD_FOLDER',
|
||||
UploadFileVersion = 'UPLOAD_FILE_VERSION'
|
||||
}
|
||||
|
||||
export class UploadFilesAction implements Action {
|
||||
readonly type = UPLOAD_FILES;
|
||||
readonly type = UploadActionTypes.UploadFiles;
|
||||
|
||||
constructor(public payload: any) {}
|
||||
}
|
||||
|
||||
export class UploadFolderAction implements Action {
|
||||
readonly type = UPLOAD_FOLDER;
|
||||
readonly type = UploadActionTypes.UploadFolder;
|
||||
|
||||
constructor(public payload: any) {}
|
||||
}
|
||||
|
||||
export class UploadFileVersionAction implements Action {
|
||||
readonly type = UPLOAD_FILE_VERSION;
|
||||
readonly type = UploadActionTypes.UploadFileVersion;
|
||||
}
|
@ -26,15 +26,26 @@
|
||||
import { Action } from '@ngrx/store';
|
||||
import { MinimalNodeEntity } from '@alfresco/js-api';
|
||||
|
||||
export const VIEW_FILE = 'VIEW_FILE';
|
||||
export const VIEW_NODE = 'VIEW_NODE';
|
||||
export enum ViewerActionTypes {
|
||||
ViewFile = 'VIEW_FILE',
|
||||
ViewNode = 'VIEW_NODE',
|
||||
FullScreen = 'FULLSCREEN_VIEWER'
|
||||
}
|
||||
|
||||
export class ViewFileAction implements Action {
|
||||
readonly type = VIEW_FILE;
|
||||
readonly type = ViewerActionTypes.ViewFile;
|
||||
|
||||
constructor(public payload: MinimalNodeEntity, public parentId?: string) {}
|
||||
}
|
||||
|
||||
export class ViewNodeAction implements Action {
|
||||
readonly type = VIEW_NODE;
|
||||
readonly type = ViewerActionTypes.ViewNode;
|
||||
|
||||
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 { Injectable } from '@angular/core';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { CloseModalDialogsAction, CLOSE_MODAL_DIALOGS } from '../actions';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import {
|
||||
CloseModalDialogsAction,
|
||||
AppActionTypes
|
||||
} from '../actions/app.actions';
|
||||
|
||||
@Injectable()
|
||||
export class ModalsEffects {
|
||||
export class DialogEffects {
|
||||
constructor(private actions$: Actions, private matDialog: MatDialog) {}
|
||||
|
||||
@Effect({ dispatch: false })
|
||||
closeAll$ = this.actions$.pipe(
|
||||
ofType<CloseModalDialogsAction>(CLOSE_MODAL_DIALOGS),
|
||||
ofType<CloseModalDialogsAction>(AppActionTypes.CloseModalDialogs),
|
||||
map(() => this.matDialog.closeAll())
|
||||
);
|
||||
}
|
@ -28,19 +28,16 @@ import { Router } from '@angular/router';
|
||||
import { Actions, Effect, ofType } from '@ngrx/effects';
|
||||
import { MinimalNodeEntryEntity, PathInfoEntity } from '@alfresco/js-api';
|
||||
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 { AppStore } from '../states/app.state';
|
||||
import {
|
||||
NavigateUrlAction,
|
||||
RouterActionTypes,
|
||||
NavigateRouteAction,
|
||||
NavigateToFolder,
|
||||
NavigateToParentFolder
|
||||
} from '../actions/router.actions';
|
||||
import { SnackbarErrorAction } from '../actions/snackbar.actions';
|
||||
|
||||
@Injectable()
|
||||
export class RouterEffects {
|
||||
@ -52,7 +49,7 @@ export class RouterEffects {
|
||||
|
||||
@Effect({ dispatch: false })
|
||||
navigateUrl$ = this.actions$.pipe(
|
||||
ofType<NavigateUrlAction>(NAVIGATE_URL),
|
||||
ofType<NavigateUrlAction>(RouterActionTypes.NavigateUrl),
|
||||
map(action => {
|
||||
if (action.payload) {
|
||||
this.router.navigateByUrl(action.payload);
|
||||
@ -62,7 +59,7 @@ export class RouterEffects {
|
||||
|
||||
@Effect({ dispatch: false })
|
||||
navigateRoute$ = this.actions$.pipe(
|
||||
ofType<NavigateRouteAction>(NAVIGATE_ROUTE),
|
||||
ofType<NavigateRouteAction>(RouterActionTypes.NavigateRoute),
|
||||
map(action => {
|
||||
this.router.navigate(action.payload);
|
||||
})
|
||||
@ -70,7 +67,7 @@ export class RouterEffects {
|
||||
|
||||
@Effect({ dispatch: false })
|
||||
navigateToFolder$ = this.actions$.pipe(
|
||||
ofType<NavigateToFolder>(NAVIGATE_FOLDER),
|
||||
ofType<NavigateToFolder>(RouterActionTypes.NavigateFolder),
|
||||
map(action => {
|
||||
if (action.payload && action.payload.entry) {
|
||||
this.navigateToFolder(action.payload.entry);
|
||||
@ -80,7 +77,7 @@ export class RouterEffects {
|
||||
|
||||
@Effect({ dispatch: false })
|
||||
navigateToParentFolder$ = this.actions$.pipe(
|
||||
ofType<NavigateToParentFolder>(NAVIGATE_PARENT_FOLDER),
|
||||
ofType<NavigateToParentFolder>(RouterActionTypes.NavigateParentFolder),
|
||||
map(action => {
|
||||
if (action.payload && action.payload.entry) {
|
||||
this.navigateToParentFolder(action.payload.entry);
|
@ -25,20 +25,18 @@
|
||||
|
||||
import { TranslationService } from '@alfresco/adf-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 { Store } from '@ngrx/store';
|
||||
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 {
|
||||
SnackbarInfoAction,
|
||||
SnackbarActionTypes,
|
||||
SnackbarWarningAction,
|
||||
SnackbarErrorAction,
|
||||
SnackbarAction
|
||||
} from '../actions/snackbar.actions';
|
||||
|
||||
@Injectable()
|
||||
export class SnackbarEffects {
|
||||
@ -51,7 +49,7 @@ export class SnackbarEffects {
|
||||
|
||||
@Effect({ dispatch: false })
|
||||
infoEffect = this.actions$.pipe(
|
||||
ofType<SnackbarInfoAction>(SNACKBAR_INFO),
|
||||
ofType<SnackbarInfoAction>(SnackbarActionTypes.Info),
|
||||
map((action: SnackbarInfoAction) => {
|
||||
this.showSnackBar(action, 'info-snackbar');
|
||||
})
|
||||
@ -59,7 +57,7 @@ export class SnackbarEffects {
|
||||
|
||||
@Effect({ dispatch: false })
|
||||
warningEffect = this.actions$.pipe(
|
||||
ofType<SnackbarWarningAction>(SNACKBAR_WARNING),
|
||||
ofType<SnackbarWarningAction>(SnackbarActionTypes.Warning),
|
||||
map((action: SnackbarWarningAction) => {
|
||||
this.showSnackBar(action, 'warning-snackbar');
|
||||
})
|
||||
@ -67,7 +65,7 @@ export class SnackbarEffects {
|
||||
|
||||
@Effect({ dispatch: false })
|
||||
errorEffect = this.actions$.pipe(
|
||||
ofType<SnackbarErrorAction>(SNACKBAR_ERROR),
|
||||
ofType<SnackbarErrorAction>(SnackbarActionTypes.Error),
|
||||
map((action: SnackbarErrorAction) => {
|
||||
this.showSnackBar(action, 'error-snackbar');
|
||||
})
|
@ -24,15 +24,25 @@
|
||||
*/
|
||||
|
||||
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/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/modals.actions';
|
||||
export * from './actions/repository.actions';
|
||||
export * from './actions/info-drawer.actions';
|
||||
export * from './actions/upload.actions';
|
||||
export * from './actions/viewer.actions';
|
||||
|
||||
export * from './effects/dialog.effects';
|
||||
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/>.
|
||||
*/
|
||||
|
||||
import { createSelector } from '@ngrx/store';
|
||||
import { AppStore } from '../states/app.state';
|
||||
import { createSelector } from '@ngrx/store';
|
||||
|
||||
export const selectApp = (state: AppStore) => state.app;
|
||||
|
||||
export const selectHeaderColor = createSelector(
|
||||
export const getHeaderColor = createSelector(
|
||||
selectApp,
|
||||
state => state.headerColor
|
||||
);
|
||||
|
||||
export const selectAppName = createSelector(
|
||||
export const getAppName = createSelector(
|
||||
selectApp,
|
||||
state => state.appName
|
||||
);
|
||||
|
||||
export const selectLogoPath = createSelector(
|
||||
export const getLogoPath = createSelector(
|
||||
selectApp,
|
||||
state => state.logoPath
|
||||
);
|
||||
|
||||
export const appSelection = createSelector(
|
||||
selectApp,
|
||||
state => state.selection
|
||||
);
|
||||
|
||||
export const appLanguagePicker = createSelector(
|
||||
export const getLanguagePickerState = createSelector(
|
||||
selectApp,
|
||||
state => state.languagePicker
|
||||
);
|
||||
|
||||
export const selectUser = createSelector(
|
||||
export const getUserProfile = createSelector(
|
||||
selectApp,
|
||||
state => state.user
|
||||
);
|
||||
|
||||
export const sharedUrl = createSelector(
|
||||
selectApp,
|
||||
state => state.sharedUrl
|
||||
);
|
||||
|
||||
export const appNavigation = createSelector(
|
||||
selectApp,
|
||||
state => state.navigation
|
||||
);
|
||||
|
||||
export const currentFolder = createSelector(
|
||||
export const getCurrentFolder = createSelector(
|
||||
selectApp,
|
||||
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,
|
||||
state => state.infoDrawerOpened
|
||||
);
|
||||
@ -83,18 +83,18 @@ export const showFacetFilter = createSelector(
|
||||
state => state.showFacetFilter
|
||||
);
|
||||
|
||||
export const documentDisplayMode = createSelector(
|
||||
export const getDocumentDisplayMode = createSelector(
|
||||
selectApp,
|
||||
state => state.documentDisplayMode
|
||||
);
|
||||
|
||||
export const repositoryStatus = createSelector(
|
||||
export const getRepositoryStatus = createSelector(
|
||||
selectApp,
|
||||
state => state.repository
|
||||
);
|
||||
|
||||
export const isQuickShareEnabled = createSelector(
|
||||
repositoryStatus,
|
||||
getRepositoryStatus,
|
||||
info => info.status.isQuickShareEnabled
|
||||
);
|
||||
|
||||
@ -103,9 +103,9 @@ export const isAdmin = createSelector(
|
||||
state => state.user.isAdmin
|
||||
);
|
||||
|
||||
export const sidenavState = createSelector(
|
||||
appSelection,
|
||||
appNavigation,
|
||||
export const getSideNavState = createSelector(
|
||||
getAppSelection,
|
||||
getNavigationState,
|
||||
(selection, navigation) => {
|
||||
return {
|
||||
selection,
|
||||
@ -114,11 +114,11 @@ export const sidenavState = createSelector(
|
||||
}
|
||||
);
|
||||
|
||||
export const ruleContext = createSelector(
|
||||
appSelection,
|
||||
appNavigation,
|
||||
selectUser,
|
||||
repositoryStatus,
|
||||
export const getRuleContext = createSelector(
|
||||
getAppSelection,
|
||||
getNavigationState,
|
||||
getUserProfile,
|
||||
getRepositoryStatus,
|
||||
(selection, navigation, profile, repository) => {
|
||||
return {
|
||||
selection,
|
@ -23,18 +23,28 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Action } from '@ngrx/store';
|
||||
import { MinimalNodeEntity } from '@alfresco/js-api';
|
||||
import {
|
||||
SelectionState,
|
||||
ProfileState,
|
||||
NavigationState
|
||||
} from '@alfresco/adf-extensions';
|
||||
import { RepositoryInfo } from '@alfresco/js-api';
|
||||
|
||||
export const ADD_FAVORITE = 'ADD_FAVORITE';
|
||||
export const REMOVE_FAVORITE = 'REMOVE_FAVORITE';
|
||||
|
||||
export class AddFavoriteAction implements Action {
|
||||
readonly type = ADD_FAVORITE;
|
||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||
export interface AppState {
|
||||
appName: string;
|
||||
headerColor: string;
|
||||
logoPath: string;
|
||||
languagePicker: boolean;
|
||||
sharedUrl: string;
|
||||
selection: SelectionState;
|
||||
user: ProfileState;
|
||||
navigation: NavigationState;
|
||||
infoDrawerOpened: boolean;
|
||||
showFacetFilter: boolean;
|
||||
documentDisplayMode: string;
|
||||
repository: RepositoryInfo;
|
||||
}
|
||||
|
||||
export class RemoveFavoriteAction implements Action {
|
||||
readonly type = REMOVE_FAVORITE;
|
||||
constructor(public payload: Array<MinimalNodeEntity>) {}
|
||||
export interface AppStore {
|
||||
app: AppState;
|
||||
}
|
@ -23,12 +23,15 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Action } from '@ngrx/store';
|
||||
import { RepositoryInfo } from '@alfresco/js-api';
|
||||
import { NgModule } from '@angular/core';
|
||||
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';
|
||||
|
||||
export class SetRepositoryInfoAction implements Action {
|
||||
readonly type = SET_REPOSITORY_INFO;
|
||||
constructor(public payload: RepositoryInfo) {}
|
||||
}
|
||||
@NgModule({
|
||||
imports: [
|
||||
EffectsModule.forFeature([SnackbarEffects, DialogEffects, RouterEffects])
|
||||
]
|
||||
})
|
||||
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",
|
||||
"version": "0.0.6",
|
||||
"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",
|
||||
"keywords": ["Alfresco", "ADF", "ACA", "Content Application"],
|
||||
"peerDependencies": {
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { SetInitialStateAction } from './store/actions';
|
||||
import { SetInitialStateAction } from '@alfresco/aca-shared/store';
|
||||
|
||||
describe('AppComponent', () => {
|
||||
let component: AppComponent;
|
||||
|
@ -35,24 +35,21 @@ import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AppExtensionService } from './extensions/extension.service';
|
||||
import {
|
||||
SnackbarErrorAction,
|
||||
SetCurrentUrlAction,
|
||||
SetInitialStateAction,
|
||||
CloseModalDialogsAction,
|
||||
SetRepositoryInfoAction,
|
||||
SetUserProfileAction
|
||||
} from './store/actions';
|
||||
import {
|
||||
AppStore,
|
||||
AppState,
|
||||
INITIAL_APP_STATE
|
||||
} from './store/states/app.state';
|
||||
SetCurrentUrlAction,
|
||||
SetInitialStateAction,
|
||||
SetUserProfileAction,
|
||||
SnackbarErrorAction,
|
||||
CloseModalDialogsAction,
|
||||
SetRepositoryInfoAction
|
||||
} from '@alfresco/aca-shared/store';
|
||||
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 { AppService } from './services/app.service';
|
||||
import { Subject } from 'rxjs';
|
||||
import { INITIAL_APP_STATE } from './store/initial-state';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
|
@ -41,6 +41,7 @@ import {
|
||||
LibraryDialogComponent,
|
||||
ContentModule
|
||||
} from '@alfresco/adf-content-services';
|
||||
import { AppRouteReuseStrategy, SharedModule } from '@alfresco/aca-shared';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { APP_ROUTES } from './app.routes';
|
||||
@ -55,7 +56,6 @@ import { AppStoreModule } from './store/app-store.module';
|
||||
import { MaterialModule } from './material.module';
|
||||
import { AppExtensionsModule } from './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 { DirectivesModule } from './directives/directives.module';
|
||||
import { ContextMenuModule } from './components/context-menu/context-menu.module';
|
||||
@ -89,6 +89,7 @@ import { environment } from '../environments/environment';
|
||||
MaterialModule,
|
||||
CoreModule.forRoot(),
|
||||
ContentModule.forRoot(),
|
||||
SharedModule.forRoot(),
|
||||
AppStoreModule,
|
||||
CoreExtensionsModule.forRoot(),
|
||||
ExtensionsModule,
|
||||
|
@ -28,11 +28,13 @@ import { AppLayoutComponent } from './components/layout/app-layout/app-layout.co
|
||||
import { FilesComponent } from './components/files/files.component';
|
||||
import { LibrariesComponent } from './components/libraries/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 { SearchLibrariesResultsComponent } from './components/search/search-libraries-results/search-libraries-results.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';
|
||||
|
||||
export const APP_ROUTES: Routes = [
|
||||
|
@ -1,5 +1,5 @@
|
||||
<app-page-layout>
|
||||
<app-page-layout-content [scrollable]="true">
|
||||
<aca-page-layout>
|
||||
<aca-page-layout-content [scrollable]="true">
|
||||
<div class="main-content">
|
||||
<article>
|
||||
<header>{{ 'application.name' | adfAppConfig }}</header>
|
||||
@ -43,5 +43,5 @@
|
||||
<app-package-list [data]="dependencyEntries"></app-package-list>
|
||||
</article>
|
||||
</div>
|
||||
</app-page-layout-content>
|
||||
</app-page-layout>
|
||||
</aca-page-layout-content>
|
||||
</aca-page-layout>
|
||||
|
@ -29,7 +29,7 @@ import { RepositoryInfo } from '@alfresco/js-api';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
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';
|
||||
@Component({
|
||||
selector: 'app-about',
|
||||
|
@ -29,7 +29,7 @@ import { AboutComponent } from './about.component';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
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 { ExtensionListComponent } from './extension-list/extension-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/>.
|
||||
*/
|
||||
|
||||
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 { LocationLinkComponent } from './location-link/location-link.component';
|
||||
import { MatIconModule } from '@angular/material';
|
||||
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({
|
||||
imports: [
|
||||
CommonModule,
|
||||
CoreModule.forChild(),
|
||||
MatIconModule,
|
||||
ExtensionsModule
|
||||
ExtensionsModule,
|
||||
GenericErrorModule
|
||||
],
|
||||
declarations: [GenericErrorComponent, LocationLinkComponent],
|
||||
exports: [ExtensionsModule, GenericErrorComponent, LocationLinkComponent],
|
||||
declarations: [LocationLinkComponent],
|
||||
exports: [ExtensionsModule, LocationLinkComponent, GenericErrorModule],
|
||||
entryComponents: [LocationLinkComponent]
|
||||
})
|
||||
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 { Store } from '@ngrx/store';
|
||||
import { AppStore } from '../../../store/states/app.state';
|
||||
import { NavigateToParentFolder } from '../../../store/actions';
|
||||
import { ContentApiService } from '../../../services/content-api.service';
|
||||
import { AppStore, NavigateToParentFolder } from '@alfresco/aca-shared/store';
|
||||
import { ContentApiService } from '@alfresco/aca-shared';
|
||||
import { TranslationService } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
|
@ -32,11 +32,10 @@ import {
|
||||
ViewChild,
|
||||
AfterViewInit
|
||||
} from '@angular/core';
|
||||
import { MatMenuTrigger } from '@angular/material';
|
||||
import { MatMenuTrigger } from '@angular/material/menu';
|
||||
|
||||
import { AppExtensionService } from '../../extensions/extension.service';
|
||||
import { AppStore } from '../../store/states';
|
||||
import { appSelection } from '../../store/selectors/app.selectors';
|
||||
import { AppStore, getAppSelection } from '@alfresco/aca-shared/store';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
@ -91,7 +90,7 @@ export class ContextMenuComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.store
|
||||
.select(appSelection)
|
||||
.select(getAppSelection)
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(selection => {
|
||||
if (selection.count) {
|
||||
|
@ -23,22 +23,19 @@
|
||||
* 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 { 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 { OutsideEventDirective } from './context-menu-outside-event.directive';
|
||||
import { ContextMenuItemComponent } from './context-menu-item.component';
|
||||
import { NgModule } from '@angular/core';
|
||||
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 { 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({
|
||||
imports: [
|
||||
|
@ -31,10 +31,9 @@ import {
|
||||
ViewEncapsulation
|
||||
} from '@angular/core';
|
||||
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 { Store } from '@ngrx/store';
|
||||
import { currentFolder } from '../../store/selectors/app.selectors';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@ -62,7 +61,7 @@ export class CreateMenuComponent implements OnInit, OnDestroy {
|
||||
|
||||
ngOnInit() {
|
||||
this.store
|
||||
.select(currentFolder)
|
||||
.select(getCurrentFolder)
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(() => {
|
||||
this.createActions = this.extensions.getCreateActions();
|
||||
|
@ -26,14 +26,14 @@
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { Observable } from 'rxjs';
|
||||
import {
|
||||
selectUser,
|
||||
appLanguagePicker
|
||||
} from '../../store/selectors/app.selectors';
|
||||
import { AppStore } from '../../store/states';
|
||||
import { ProfileState } from '@alfresco/adf-extensions';
|
||||
import { SetSelectedNodesAction } from '../../store/actions';
|
||||
import { AppService } from '../../services/app.service';
|
||||
import {
|
||||
AppStore,
|
||||
SetSelectedNodesAction,
|
||||
getUserProfile,
|
||||
getLanguagePickerState
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { AppService } from '@alfresco/aca-shared';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-current-user',
|
||||
@ -50,8 +50,8 @@ export class CurrentUserComponent {
|
||||
}
|
||||
|
||||
constructor(private store: Store<AppStore>, private appService: AppService) {
|
||||
this.profile$ = this.store.select(selectUser);
|
||||
this.languagePicker$ = store.select(appLanguagePicker);
|
||||
this.profile$ = this.store.select(getUserProfile);
|
||||
this.languagePicker$ = store.select(getLanguagePickerState);
|
||||
}
|
||||
|
||||
onLogoutEvent() {
|
||||
|
@ -28,7 +28,7 @@ import {
|
||||
import { Actions, ofType } from '@ngrx/effects';
|
||||
import { Subject } from 'rxjs';
|
||||
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';
|
||||
|
||||
@Component({
|
||||
@ -75,7 +75,7 @@ export class CustomNameColumnComponent extends NameColumnComponent
|
||||
|
||||
this.actions$
|
||||
.pipe(
|
||||
ofType<any>(EDIT_OFFLINE),
|
||||
ofType<any>(NodeActionTypes.EditOffline),
|
||||
filter(val => {
|
||||
return this.node.entry.id === val.payload.entry.id;
|
||||
}),
|
||||
|
@ -1,5 +1,5 @@
|
||||
<app-page-layout>
|
||||
<app-page-layout-header>
|
||||
<aca-page-layout>
|
||||
<aca-page-layout-header>
|
||||
<adf-breadcrumb root="APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.TITLE">
|
||||
</adf-breadcrumb>
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
|
||||
</ng-container>
|
||||
</adf-toolbar>
|
||||
</app-page-layout-header>
|
||||
</aca-page-layout-header>
|
||||
|
||||
<app-page-layout-content>
|
||||
<aca-page-layout-content>
|
||||
<div class="main-content">
|
||||
<adf-document-list
|
||||
#documentList
|
||||
@ -91,5 +91,5 @@
|
||||
<div class="sidebar" *ngIf="(infoDrawerOpened$ | async)">
|
||||
<aca-info-drawer [node]="selection.last"></aca-info-drawer>
|
||||
</div>
|
||||
</app-page-layout-content>
|
||||
</app-page-layout>
|
||||
</aca-page-layout-content>
|
||||
</aca-page-layout>
|
||||
|
@ -36,11 +36,12 @@ import {
|
||||
import { DocumentListComponent } from '@alfresco/adf-content-services';
|
||||
import { FavoriteLibrariesComponent } from './favorite-libraries.component';
|
||||
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 { EffectsModule } from '@ngrx/effects';
|
||||
import { LibraryEffects, RouterEffects } from '../../store/effects';
|
||||
import { RouterEffects } from '@alfresco/aca-shared/store';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { LibraryEffects } from '../../store/effects';
|
||||
|
||||
describe('FavoriteLibrariesComponent', () => {
|
||||
let fixture: ComponentFixture<FavoriteLibrariesComponent>;
|
||||
|
@ -29,9 +29,8 @@ import { Store } from '@ngrx/store';
|
||||
import { SiteEntry, FavoritePaging, Pagination } from '@alfresco/js-api';
|
||||
import { AppExtensionService } from '../../extensions/extension.service';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { ContentApiService } from '../../services/content-api.service';
|
||||
import { NavigateLibraryAction } from '../../store/actions';
|
||||
import { AppStore } from '../../store/states/app.state';
|
||||
import { ContentApiService } from '@alfresco/aca-shared';
|
||||
import { NavigateLibraryAction } from '@alfresco/aca-shared/store';
|
||||
import { PageComponent } from '../page.component';
|
||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
||||
@Component({
|
||||
@ -47,7 +46,7 @@ export class FavoriteLibrariesComponent extends PageComponent
|
||||
|
||||
constructor(
|
||||
content: ContentManagementService,
|
||||
store: Store<AppStore>,
|
||||
store: Store<any>,
|
||||
extensions: AppExtensionService,
|
||||
private contentApiService: ContentApiService,
|
||||
private breakpointObserver: BreakpointObserver,
|
||||
|
@ -1,5 +1,5 @@
|
||||
<app-page-layout>
|
||||
<app-page-layout-header>
|
||||
<aca-page-layout>
|
||||
<aca-page-layout-header>
|
||||
<adf-breadcrumb root="APP.BROWSE.FAVORITES.TITLE"> </adf-breadcrumb>
|
||||
|
||||
<adf-toolbar class="adf-toolbar--inline">
|
||||
@ -7,9 +7,9 @@
|
||||
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
|
||||
</ng-container>
|
||||
</adf-toolbar>
|
||||
</app-page-layout-header>
|
||||
</aca-page-layout-header>
|
||||
|
||||
<app-page-layout-content>
|
||||
<aca-page-layout-content>
|
||||
<div class="main-content">
|
||||
<adf-document-list
|
||||
#documentList
|
||||
@ -78,5 +78,5 @@
|
||||
<div class="sidebar" *ngIf="(infoDrawerOpened$ | async)">
|
||||
<aca-info-drawer [node]="selection.last"></aca-info-drawer>
|
||||
</div>
|
||||
</app-page-layout-content>
|
||||
</app-page-layout>
|
||||
</aca-page-layout-content>
|
||||
</aca-page-layout>
|
||||
|
@ -36,7 +36,7 @@ import { DocumentListComponent } from '@alfresco/adf-content-services';
|
||||
import { of } from 'rxjs';
|
||||
import { FavoritesComponent } from './favorites.component';
|
||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||
import { ContentApiService } from '../../services/content-api.service';
|
||||
import { ContentApiService } from '@alfresco/aca-shared';
|
||||
|
||||
describe('FavoritesComponent', () => {
|
||||
let fixture: ComponentFixture<FavoritesComponent>;
|
||||
|
@ -23,23 +23,23 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
import { ContentApiService } from '@alfresco/aca-shared';
|
||||
import { AppStore } from '@alfresco/aca-shared/store';
|
||||
import { UploadService } from '@alfresco/adf-core';
|
||||
import {
|
||||
MinimalNodeEntity,
|
||||
MinimalNodeEntryEntity,
|
||||
PathElementEntity,
|
||||
PathInfo
|
||||
} from '@alfresco/js-api';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { AppStore } from '../../store/states/app.state';
|
||||
import { PageComponent } from '../page.component';
|
||||
import { ContentApiService } from '../../services/content-api.service';
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { debounceTime, map } from 'rxjs/operators';
|
||||
import { AppExtensionService } from '../../extensions/extension.service';
|
||||
import { map, debounceTime } from 'rxjs/operators';
|
||||
import { UploadService } from '@alfresco/adf-core';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { PageComponent } from '../page.component';
|
||||
|
||||
@Component({
|
||||
templateUrl: './favorites.component.html'
|
||||
|
@ -1,5 +1,5 @@
|
||||
<app-page-layout [hasError]="!isValidPath">
|
||||
<app-page-layout-header>
|
||||
<aca-page-layout [hasError]="!isValidPath">
|
||||
<aca-page-layout-header>
|
||||
<adf-breadcrumb
|
||||
[root]="title"
|
||||
[folderNode]="node"
|
||||
@ -13,13 +13,13 @@
|
||||
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
|
||||
</ng-container>
|
||||
</adf-toolbar>
|
||||
</app-page-layout-header>
|
||||
</aca-page-layout-header>
|
||||
|
||||
<app-page-layout-error>
|
||||
<aca-page-layout-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">
|
||||
<adf-upload-drag-area [rootFolderId]="node?.id" [disabled]="!canUpload">
|
||||
<adf-document-list
|
||||
@ -87,5 +87,5 @@
|
||||
<div class="sidebar" *ngIf="(infoDrawerOpened$ | async)">
|
||||
<aca-info-drawer [node]="selection.last"></aca-info-drawer>
|
||||
</div>
|
||||
</app-page-layout-content>
|
||||
</app-page-layout>
|
||||
</aca-page-layout-content>
|
||||
</aca-page-layout>
|
||||
|
@ -41,7 +41,7 @@ import { DocumentListComponent } from '@alfresco/adf-content-services';
|
||||
import { NodeActionsService } from '../../services/node-actions.service';
|
||||
import { FilesComponent } from './files.component';
|
||||
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';
|
||||
|
||||
describe('FilesComponent', () => {
|
||||
|
@ -35,14 +35,13 @@ import {
|
||||
} from '@alfresco/js-api';
|
||||
import { ContentManagementService } from '../../services/content-management.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 { ContentApiService } from '../../services/content-api.service';
|
||||
import { ContentApiService } from '@alfresco/aca-shared';
|
||||
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 { debounceTime, takeUntil } from 'rxjs/operators';
|
||||
import { isAdmin } from '../../store/selectors/app.selectors';
|
||||
import { ShareDataRow } from '@alfresco/adf-content-services';
|
||||
|
||||
@Component({
|
||||
|
@ -32,14 +32,14 @@ import {
|
||||
} from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { Observable } from 'rxjs';
|
||||
import {
|
||||
selectHeaderColor,
|
||||
selectAppName,
|
||||
selectLogoPath
|
||||
} from '../../store/selectors/app.selectors';
|
||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||
import { AppExtensionService } from '../../extensions/extension.service';
|
||||
import { AppStore } from '../../store/states';
|
||||
import {
|
||||
AppStore,
|
||||
getHeaderColor,
|
||||
getAppName,
|
||||
getLogoPath
|
||||
} from '@alfresco/aca-shared/store';
|
||||
|
||||
@Component({
|
||||
selector: 'app-header',
|
||||
@ -61,9 +61,9 @@ export class AppHeaderComponent implements OnInit {
|
||||
store: Store<AppStore>,
|
||||
private appExtensions: AppExtensionService
|
||||
) {
|
||||
this.headerColor$ = store.select(selectHeaderColor);
|
||||
this.appName$ = store.select(selectAppName);
|
||||
this.logo$ = store.select(selectLogoPath);
|
||||
this.headerColor$ = store.select(getHeaderColor);
|
||||
this.appName$ = store.select(getAppName);
|
||||
this.logo$ = store.select(getLogoPath);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@ -27,7 +27,7 @@ import { CommentsTabComponent } from './comments-tab.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { NodePermissionService } from '../../../services/node-permission.service';
|
||||
import { NodePermissionService } from '@alfresco/aca-shared';
|
||||
|
||||
describe('CommentsTabComponent', () => {
|
||||
let component: CommentsTabComponent;
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
import { Component, Input } from '@angular/core';
|
||||
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';
|
||||
|
||||
@Component({
|
||||
|
@ -26,10 +26,10 @@ import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { InfoDrawerComponent } from './info-drawer.component';
|
||||
import { TestBed, ComponentFixture, async } from '@angular/core/testing';
|
||||
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 { AppExtensionService } from '../../extensions/extension.service';
|
||||
import { ContentApiService } from '../../services/content-api.service';
|
||||
import { ContentApiService } from '@alfresco/aca-shared';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
describe('InfoDrawerComponent', () => {
|
||||
|
@ -29,11 +29,11 @@ import {
|
||||
MinimalNodeEntryEntity,
|
||||
SiteEntry
|
||||
} from '@alfresco/js-api';
|
||||
import { ContentApiService } from '../../services/content-api.service';
|
||||
import { ContentApiService } from '@alfresco/aca-shared';
|
||||
import { AppExtensionService } from '../../extensions/extension.service';
|
||||
import { SidebarTabRef } from '@alfresco/adf-extensions';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { SetInfoDrawerStateAction } from '../../store/actions';
|
||||
import { SetInfoDrawerStateAction } from '@alfresco/aca-shared/store';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-info-drawer',
|
||||
|
@ -30,7 +30,7 @@ import {
|
||||
tick
|
||||
} from '@angular/core/testing';
|
||||
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 { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
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 { SiteEntry, SitePaging } from '@alfresco/js-api';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { UpdateLibraryAction } from '../../../store/actions';
|
||||
import { AppStore } from '../../../store/states/app.state';
|
||||
import { AppStore, UpdateLibraryAction } from '@alfresco/aca-shared/store';
|
||||
import { debounceTime, mergeMap, takeUntil } from 'rxjs/operators';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { Observable, from, Subject } from 'rxjs';
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
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';
|
||||
|
||||
describe('MetadataTabComponent', () => {
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
import { Component, Input, ViewEncapsulation } from '@angular/core';
|
||||
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 { AppConfigService } from '@alfresco/adf-core';
|
||||
import { isLocked } from '../../../utils/node.utils';
|
||||
|
@ -29,10 +29,12 @@ import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { AppLayoutComponent } from './app-layout.component';
|
||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AppStore } from '../../../store/states';
|
||||
import { SetSelectedNodesAction } from '../../../store/actions';
|
||||
import {
|
||||
AppStore,
|
||||
SetSelectedNodesAction,
|
||||
getAppSelection
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { Router, NavigationStart } from '@angular/router';
|
||||
import { appSelection } from '../../../store/selectors/app.selectors';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
class MockRouter {
|
||||
@ -145,7 +147,7 @@ describe('AppLayoutComponent', () => {
|
||||
|
||||
router.navigateByUrl('somewhere/over/the/rainbow');
|
||||
fixture.detectChanges();
|
||||
store.select(appSelection).subscribe(state => {
|
||||
store.select(getAppSelection).subscribe(state => {
|
||||
expect(state.isEmpty).toBe(true);
|
||||
done();
|
||||
});
|
||||
@ -158,7 +160,7 @@ describe('AppLayoutComponent', () => {
|
||||
|
||||
router.navigateByUrl('/search;q=');
|
||||
fixture.detectChanges();
|
||||
store.select(appSelection).subscribe(state => {
|
||||
store.select(getAppSelection).subscribe(state => {
|
||||
expect(state.isEmpty).toBe(false);
|
||||
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