mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACS-4536] deprecate and cleanup aca-settings module (#2978)
This commit is contained in:
parent
a4eb6c49bb
commit
5b054f234d
18
.github/workflows/test.yml
vendored
18
.github/workflows/test.yml
vendored
@ -95,24 +95,6 @@ jobs:
|
|||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm test aca-shared -- --browsers=ChromeHeadless --watch=false $TEST_OPTS
|
- run: npm test aca-shared -- --browsers=ChromeHeadless --watch=false $TEST_OPTS
|
||||||
|
|
||||||
test-aca-settings:
|
|
||||||
needs: [lint, build]
|
|
||||||
name: 'test: aca-settings'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 14
|
|
||||||
cache: 'npm'
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm test aca-settings -- --browsers=ChromeHeadless --watch=false $TEST_OPTS
|
|
||||||
|
|
||||||
test-aca-folder-rules:
|
test-aca-folder-rules:
|
||||||
needs: [lint, build]
|
needs: [lint, build]
|
||||||
name: 'test: aca-folder-rules'
|
name: 'test: aca-folder-rules'
|
||||||
|
51
angular.json
51
angular.json
@ -92,11 +92,6 @@
|
|||||||
"input": "projects/aca-about/assets",
|
"input": "projects/aca-about/assets",
|
||||||
"output": "./assets/plugins"
|
"output": "./assets/plugins"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"glob": "settings.plugin.json",
|
|
||||||
"input": "projects/aca-settings/assets",
|
|
||||||
"output": "./assets/plugins"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"glob": "folder-rules.plugin.json",
|
"glob": "folder-rules.plugin.json",
|
||||||
"input": "projects/aca-folder-rules/assets",
|
"input": "projects/aca-folder-rules/assets",
|
||||||
@ -515,52 +510,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"aca-settings": {
|
|
||||||
"projectType": "library",
|
|
||||||
"root": "projects/aca-settings",
|
|
||||||
"sourceRoot": "projects/aca-settings/src",
|
|
||||||
"prefix": "lib",
|
|
||||||
"architect": {
|
|
||||||
"build": {
|
|
||||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
|
||||||
"options": {
|
|
||||||
"tsConfig": "projects/aca-settings/tsconfig.lib.json",
|
|
||||||
"project": "projects/aca-settings/ng-package.json"
|
|
||||||
},
|
|
||||||
"configurations": {
|
|
||||||
"production": {
|
|
||||||
"tsConfig": "projects/aca-settings/tsconfig.lib.prod.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaultConfiguration": "production"
|
|
||||||
},
|
|
||||||
"test": {
|
|
||||||
"builder": "@angular-devkit/build-angular:karma",
|
|
||||||
"options": {
|
|
||||||
"main": "projects/aca-settings/src/test.ts",
|
|
||||||
"tsConfig": "projects/aca-settings/tsconfig.spec.json",
|
|
||||||
"karmaConfig": "projects/aca-settings/karma.conf.js"
|
|
||||||
},
|
|
||||||
"configurations": {
|
|
||||||
"adfprod": {
|
|
||||||
"tsConfig": "projects/aca-settings/tsconfig.spec.adf.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lint": {
|
|
||||||
"builder": "@angular-eslint/builder:lint",
|
|
||||||
"options": {
|
|
||||||
"lintFilePatterns": [
|
|
||||||
"projects/aca-settings/**/*.ts",
|
|
||||||
"projects/aca-settings/**/*.html"
|
|
||||||
],
|
|
||||||
"cache": true,
|
|
||||||
"cacheLocation": ".eslintcache",
|
|
||||||
"ignorePath": ".eslintignore"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"aca-folder-rules": {
|
"aca-folder-rules": {
|
||||||
"projectType": "library",
|
"projectType": "library",
|
||||||
"root": "projects/aca-folder-rules",
|
"root": "projects/aca-folder-rules",
|
||||||
|
@ -26,17 +26,11 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { AosExtensionModule } from '@alfresco/adf-office-services-ext';
|
import { AosExtensionModule } from '@alfresco/adf-office-services-ext';
|
||||||
import { AcaAboutModule } from '@alfresco/aca-about';
|
import { AcaAboutModule } from '@alfresco/aca-about';
|
||||||
import { AcaSettingsModule } from '@alfresco/aca-settings';
|
|
||||||
import { AcaFolderRulesModule } from '@alfresco/aca-folder-rules';
|
import { AcaFolderRulesModule } from '@alfresco/aca-folder-rules';
|
||||||
import { environment } from '../environments/environment';
|
import { environment } from '../environments/environment';
|
||||||
import packageJson from 'package.json';
|
import packageJson from 'package.json';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [AosExtensionModule, AcaAboutModule.forRoot(environment.production, packageJson), AcaFolderRulesModule]
|
||||||
AosExtensionModule,
|
|
||||||
...(environment.devTools ? [AcaSettingsModule] : []),
|
|
||||||
AcaAboutModule.forRoot(environment.production, packageJson),
|
|
||||||
AcaFolderRulesModule
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class AppExtensionsModule {}
|
export class AppExtensionsModule {}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"prebuild": "mkdir -p ./app/.tmp && cp ./app/src/app.config.json.tpl ./app/.tmp/app.config.json",
|
"prebuild": "mkdir -p ./app/.tmp && cp ./app/src/app.config.json.tpl ./app/.tmp/app.config.json",
|
||||||
"build": "ng build content-ce",
|
"build": "ng build content-ce",
|
||||||
"build.release": "npm run build -- --configuration=production,release",
|
"build.release": "npm run build -- --configuration=production,release",
|
||||||
"build-libs": "ng build aca-shared && ng build adf-office-services-ext && ng build aca-settings && ng build aca-about && ng build aca-viewer && ng build aca-preview && ng build aca-folder-rules && ng build aca-content",
|
"build-libs": "ng build aca-shared && ng build adf-office-services-ext && ng build aca-about && ng build aca-viewer && ng build aca-preview && ng build aca-folder-rules && ng build aca-content",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"test:ci": "ng test adf-office-services-ext && ng test content-ce --code-coverage",
|
"test:ci": "ng test adf-office-services-ext && ng test content-ce --code-coverage",
|
||||||
"lint": "NODE_OPTIONS=--max_old_space_size=4096 ng lint && npm run spellcheck && npm run e2e.typecheck",
|
"lint": "NODE_OPTIONS=--max_old_space_size=4096 ng lint && npm run spellcheck && npm run e2e.typecheck",
|
||||||
|
@ -16,7 +16,7 @@ module.exports = function (config) {
|
|||||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||||
},
|
},
|
||||||
coverageIstanbulReporter: {
|
coverageIstanbulReporter: {
|
||||||
dir: require('path').join(__dirname, '../../coverage/aca-settings'),
|
dir: require('path').join(__dirname, '../../coverage/aca-preview'),
|
||||||
reports: ['html', 'lcovonly', 'text-summary'],
|
reports: ['html', 'lcovonly', 'text-summary'],
|
||||||
fixWebpackSourcePaths: true
|
fixWebpackSourcePaths: true
|
||||||
},
|
},
|
||||||
|
@ -1,121 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc.json",
|
|
||||||
"ignorePatterns": [
|
|
||||||
"!**/*"
|
|
||||||
],
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": [
|
|
||||||
"*.ts"
|
|
||||||
],
|
|
||||||
"parserOptions": {
|
|
||||||
"project": [
|
|
||||||
"projects/aca-settings/tsconfig.lib.json",
|
|
||||||
"projects/aca-settings/tsconfig.spec.json"
|
|
||||||
],
|
|
||||||
"createDefaultProgram": true
|
|
||||||
},
|
|
||||||
"plugins": [
|
|
||||||
"eslint-plugin-rxjs",
|
|
||||||
"eslint-plugin-unicorn"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"@angular-eslint/component-selector": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"type": "element",
|
|
||||||
"prefix": [
|
|
||||||
"lib",
|
|
||||||
"aca",
|
|
||||||
"app",
|
|
||||||
"adf"
|
|
||||||
],
|
|
||||||
"style": "kebab-case"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@angular-eslint/directive-selector": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"type": "attribute",
|
|
||||||
"prefix": [
|
|
||||||
"lib",
|
|
||||||
"aca",
|
|
||||||
"app",
|
|
||||||
"adf"
|
|
||||||
],
|
|
||||||
"style": "camelCase"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@angular-eslint/no-host-metadata-property": "off",
|
|
||||||
"@typescript-eslint/consistent-type-definitions": "error",
|
|
||||||
"@typescript-eslint/dot-notation": "off",
|
|
||||||
"@typescript-eslint/explicit-member-accessibility": [
|
|
||||||
"off",
|
|
||||||
{
|
|
||||||
"accessibility": "explicit"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@typescript-eslint/member-delimiter-style": [
|
|
||||||
"off",
|
|
||||||
{
|
|
||||||
"multiline": {
|
|
||||||
"delimiter": "none",
|
|
||||||
"requireLast": true
|
|
||||||
},
|
|
||||||
"singleline": {
|
|
||||||
"delimiter": "semi",
|
|
||||||
"requireLast": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@typescript-eslint/semi": [
|
|
||||||
"off",
|
|
||||||
null
|
|
||||||
],
|
|
||||||
"@typescript-eslint/type-annotation-spacing": "off",
|
|
||||||
"arrow-parens": [
|
|
||||||
"off",
|
|
||||||
"always"
|
|
||||||
],
|
|
||||||
"brace-style": [
|
|
||||||
"off",
|
|
||||||
"off"
|
|
||||||
],
|
|
||||||
"eol-last": "off",
|
|
||||||
"id-blacklist": "off",
|
|
||||||
"id-match": "off",
|
|
||||||
"linebreak-style": "off",
|
|
||||||
"max-len": "off",
|
|
||||||
"new-parens": "off",
|
|
||||||
"newline-per-chained-call": "off",
|
|
||||||
"no-duplicate-imports": "error",
|
|
||||||
"no-extra-semi": "off",
|
|
||||||
"no-irregular-whitespace": "off",
|
|
||||||
"no-return-await": "error",
|
|
||||||
"no-underscore-dangle": "off",
|
|
||||||
"quote-props": "off",
|
|
||||||
"rxjs/no-create": "error",
|
|
||||||
"rxjs/no-subject-unsubscribe": "error",
|
|
||||||
"rxjs/no-subject-value": "error",
|
|
||||||
"rxjs/no-unsafe-takeuntil": "error",
|
|
||||||
"space-before-function-paren": "off",
|
|
||||||
"space-in-parens": [
|
|
||||||
"off",
|
|
||||||
"never"
|
|
||||||
],
|
|
||||||
"unicorn/filename-case": "error"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": [
|
|
||||||
"*.html"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"@angular-eslint/template/no-autofocus": "error",
|
|
||||||
"@angular-eslint/template/no-negated-async": "off",
|
|
||||||
"@angular-eslint/template/no-positive-tabindex": "error",
|
|
||||||
"@angular-eslint/template/eqeqeq": "error"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,110 +0,0 @@
|
|||||||
---
|
|
||||||
Title: Settings
|
|
||||||
---
|
|
||||||
|
|
||||||
# Settings
|
|
||||||
|
|
||||||
The application settings can be accessed via the `/settings` route.
|
|
||||||
|
|
||||||
You can project custom configuration groups via the `settings` section:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"settings": [
|
|
||||||
{
|
|
||||||
"id": "extensions.ps.settings",
|
|
||||||
"name": "Extensions: Process Services",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "Enable Process Services Extensions",
|
|
||||||
"key": "processServices",
|
|
||||||
"type": "boolean",
|
|
||||||
"value": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
At runtime, you are going to get an extra group called "Extensions: Process Services"
|
|
||||||
with a custom boolean setting "Enable Process Services Extensions".
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Parameters
|
|
||||||
|
|
||||||
Each setting parameter object supports the following properties:
|
|
||||||
|
|
||||||
| Property | Description |
|
|
||||||
| -------- | ----------------------------------------------- |
|
|
||||||
| id | (optional) Unique identifier |
|
|
||||||
| name | Public name, can be translation key |
|
|
||||||
| key | The key to use when saving to the storage |
|
|
||||||
| type | The type of the value (boolean / string) |
|
|
||||||
| value | (optional) Default value to use for the setting |
|
|
||||||
|
|
||||||
# Installing
|
|
||||||
|
|
||||||
Import the module into the application:
|
|
||||||
|
|
||||||
```ts
|
|
||||||
// src/app/extensions.module.ts
|
|
||||||
|
|
||||||
import { AcaSettingsModule } from '@alfresco/aca-settings';
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
// other modules
|
|
||||||
AcaSettingsModule
|
|
||||||
]
|
|
||||||
})
|
|
||||||
export class AppExtensionsModule {}
|
|
||||||
```
|
|
||||||
|
|
||||||
Update the `app.extensions.json` extension configuration to enable extra routes and components:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"actions": [
|
|
||||||
{
|
|
||||||
"id": "app.actions.settings",
|
|
||||||
"type": "NAVIGATE_URL",
|
|
||||||
"payload": "/settings"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
"routes": [
|
|
||||||
{
|
|
||||||
"id": "app.settings",
|
|
||||||
"path": "settings",
|
|
||||||
"layout": "blank",
|
|
||||||
"component": "app.settings.component"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
"features": {
|
|
||||||
"header": [
|
|
||||||
{
|
|
||||||
"id": "app.header.more",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"id": "app.header.settings",
|
|
||||||
"order": 110,
|
|
||||||
"title": "APP.SETTINGS.TITLE",
|
|
||||||
"description": "APP.SETTINGS.TITLE",
|
|
||||||
"icon": "info",
|
|
||||||
"actions": {
|
|
||||||
"click": "app.actions.settings"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively, you can use the `assets/settings.plugin.json` file.
|
|
||||||
|
|
||||||
Compile and distribute/run the application.
|
|
Binary file not shown.
Before Width: | Height: | Size: 65 KiB |
@ -1,45 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "../../../extension.schema.json",
|
|
||||||
"$id": "b1eac381-0268-450f-b1dc-8f041fba575d",
|
|
||||||
"$name": "Settings Plugin",
|
|
||||||
"$version": "0.0.1",
|
|
||||||
"$vendor": "Alfresco Software, Ltd.",
|
|
||||||
"$license": "LGPL-3.0",
|
|
||||||
|
|
||||||
"actions": [
|
|
||||||
{
|
|
||||||
"id": "app.actions.settings",
|
|
||||||
"type": "NAVIGATE_URL",
|
|
||||||
"payload": "/settings"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
"routes": [
|
|
||||||
{
|
|
||||||
"id": "app.settings",
|
|
||||||
"path": "settings",
|
|
||||||
"layout": "blank",
|
|
||||||
"component": "app.settings.component"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
"features": {
|
|
||||||
"header": [
|
|
||||||
{
|
|
||||||
"id": "app.header.more",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"id": "app.header.settings",
|
|
||||||
"order": 110,
|
|
||||||
"title": "APP.SETTINGS.TITLE",
|
|
||||||
"description": "APP.SETTINGS.TITLE",
|
|
||||||
"icon": "info",
|
|
||||||
"actions": {
|
|
||||||
"click": "app.actions.settings"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
// 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-settings'),
|
|
||||||
reports: ['html', 'lcovonly', 'text-summary'],
|
|
||||||
fixWebpackSourcePaths: true
|
|
||||||
},
|
|
||||||
reporters: ['progress', 'kjhtml'],
|
|
||||||
port: 9876,
|
|
||||||
colors: true,
|
|
||||||
logLevel: config.LOG_INFO,
|
|
||||||
autoWatch: true,
|
|
||||||
browsers: ['Chrome'],
|
|
||||||
singleRun: true,
|
|
||||||
restartOnFileChange: true
|
|
||||||
});
|
|
||||||
};
|
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
|
|
||||||
"dest": "../../dist/@alfresco/aca-settings",
|
|
||||||
"lib": {
|
|
||||||
"entryFile": "src/public-api.ts"
|
|
||||||
},
|
|
||||||
"assets": ["assets"]
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@alfresco/aca-settings",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"peerDependencies": {
|
|
||||||
"@angular/common": "^14.1.0",
|
|
||||||
"@angular/core": "^14.1.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": "^2.3.0"
|
|
||||||
},
|
|
||||||
"publishConfig": {
|
|
||||||
"access": "public"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,90 +0,0 @@
|
|||||||
<adf-toolbar class="app-menu" [style.background-color]="headerColor$ | async">
|
|
||||||
<adf-toolbar-title>
|
|
||||||
<a class="app-menu__title" title="{{ appName$ | async }}" [routerLink]="['/']">
|
|
||||||
<img [src]="logo" alt="{{ appName$ | async }}" />
|
|
||||||
</a>
|
|
||||||
</adf-toolbar-title>
|
|
||||||
</adf-toolbar>
|
|
||||||
|
|
||||||
<mat-accordion multi="true" displayMode="flat">
|
|
||||||
<mat-expansion-panel>
|
|
||||||
<mat-expansion-panel-header>
|
|
||||||
<mat-panel-title>{{ 'APP.SETTINGS.REPOSITORY-SETTINGS' | translate }}</mat-panel-title>
|
|
||||||
</mat-expansion-panel-header>
|
|
||||||
<form [formGroup]="form" novalidate (ngSubmit)="apply(form.value, form.valid)">
|
|
||||||
<div>
|
|
||||||
<mat-form-field class="settings-input" appearance="outline">
|
|
||||||
<mat-label>ACS Repository URL</mat-label>
|
|
||||||
<input matInput formControlName="ecmHost" type="text" />
|
|
||||||
<mat-error *ngIf="form.get('ecmHost').hasError('pattern')">
|
|
||||||
{{ 'APP.SETTINGS.INVALID-VALUE-FORMAT' | translate }}
|
|
||||||
</mat-error>
|
|
||||||
<mat-error *ngIf="form.get('ecmHost').hasError('required')">
|
|
||||||
{{ 'APP.SETTINGS.REQUIRED-FIELD' | translate }}
|
|
||||||
</mat-error>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<mat-form-field class="settings-input" appearance="outline">
|
|
||||||
<mat-label>Authentication Type</mat-label>
|
|
||||||
<mat-select formControlName="authType">
|
|
||||||
<mat-option value="BASIC">Basic</mat-option>
|
|
||||||
<mat-option value="OAUTH">OAuth (Identity Service)</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<mat-form-field class="settings-input" appearance="outline">
|
|
||||||
<mat-label>Alfresco Identity Service URL</mat-label>
|
|
||||||
<input matInput formControlName="aisHost" type="text" />
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="settings-buttons">
|
|
||||||
<button mat-button (click)="reset()">
|
|
||||||
{{ 'APP.SETTINGS.RESET' | translate }}
|
|
||||||
</button>
|
|
||||||
<button mat-button color="primary" type="submit" [disabled]="!form.valid">
|
|
||||||
{{ 'APP.SETTINGS.APPLY' | translate }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</mat-expansion-panel>
|
|
||||||
|
|
||||||
<mat-expansion-panel *ngFor="let group of settingGroups">
|
|
||||||
<mat-expansion-panel-header>
|
|
||||||
<mat-panel-title>{{ group.name | translate }}</mat-panel-title>
|
|
||||||
</mat-expansion-panel-header>
|
|
||||||
|
|
||||||
<div class="aca-settings-parameter-list">
|
|
||||||
<ng-container *ngFor="let param of group.parameters">
|
|
||||||
<ng-container [ngSwitch]="param.type">
|
|
||||||
<ng-container *ngSwitchCase="'boolean'">
|
|
||||||
<mat-checkbox [checked]="getBooleanParamValue(param)" (change)="setParamValue(param, $event.checked)">{{
|
|
||||||
param.name | translate
|
|
||||||
}}</mat-checkbox>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<ng-container *ngSwitchCase="'string'">
|
|
||||||
<mat-form-field class="settings-input" appearance="outline">
|
|
||||||
<mat-label>{{ param.name | translate }}</mat-label>
|
|
||||||
<input
|
|
||||||
matInput
|
|
||||||
type="text"
|
|
||||||
[value]="getStringParamValue(param)"
|
|
||||||
(blur)="onParamValueChanged($event, param)"
|
|
||||||
(keyup.enter)="onParamValueChanged($event, param)"
|
|
||||||
/>
|
|
||||||
</mat-form-field>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<ng-container *ngSwitchDefault>
|
|
||||||
<span>Unknown parameter type: {{ param.name | translate }}</span>
|
|
||||||
</ng-container>
|
|
||||||
</ng-container>
|
|
||||||
</ng-container>
|
|
||||||
</div>
|
|
||||||
</mat-expansion-panel>
|
|
||||||
</mat-accordion>
|
|
@ -1,77 +0,0 @@
|
|||||||
$app-menu-height: 64px;
|
|
||||||
|
|
||||||
.aca-settings-parameter-list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.aca-settings {
|
|
||||||
&-extensions-list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-input {
|
|
||||||
width: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-buttons {
|
|
||||||
text-align: right;
|
|
||||||
|
|
||||||
.mat-button {
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-menu {
|
|
||||||
height: $app-menu-height;
|
|
||||||
|
|
||||||
&.adf-toolbar {
|
|
||||||
.mat-toolbar {
|
|
||||||
background-color: inherit;
|
|
||||||
font-family: inherit;
|
|
||||||
min-height: $app-menu-height;
|
|
||||||
height: $app-menu-height;
|
|
||||||
|
|
||||||
.mat-toolbar-layout {
|
|
||||||
height: $app-menu-height;
|
|
||||||
|
|
||||||
.mat-toolbar-row {
|
|
||||||
height: $app-menu-height;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.adf-toolbar-divider {
|
|
||||||
margin-left: 5px;
|
|
||||||
margin-right: 5px;
|
|
||||||
|
|
||||||
& > div {
|
|
||||||
background-color: var(--theme-card-background-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.adf-toolbar-title {
|
|
||||||
color: var(--theme-card-background-color);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-menu__title {
|
|
||||||
width: 100px;
|
|
||||||
height: 50px;
|
|
||||||
margin-left: 40px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: stretch;
|
|
||||||
|
|
||||||
& > img {
|
|
||||||
width: 100%;
|
|
||||||
object-fit: contain;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,138 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @license
|
|
||||||
* Alfresco Example Content Application
|
|
||||||
*
|
|
||||||
* Copyright (C) 2005 - 2020 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 { SettingsComponent } from './settings.component';
|
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
import { CoreModule, setupTestBed, StorageService } from '@alfresco/adf-core';
|
|
||||||
import { AcaSettingsModule } from './settings.module';
|
|
||||||
import { By } from '@angular/platform-browser';
|
|
||||||
import { AppExtensionService, initialState, LibTestingModule, SettingsParameterRef } from '@alfresco/aca-shared';
|
|
||||||
import { provideMockStore } from '@ngrx/store/testing';
|
|
||||||
|
|
||||||
describe('SettingsComponent', () => {
|
|
||||||
let fixture: ComponentFixture<SettingsComponent>;
|
|
||||||
let component: SettingsComponent;
|
|
||||||
let storage: StorageService;
|
|
||||||
let appExtensions: AppExtensionService;
|
|
||||||
|
|
||||||
let stringParam: SettingsParameterRef;
|
|
||||||
let boolParam: SettingsParameterRef;
|
|
||||||
|
|
||||||
setupTestBed({
|
|
||||||
imports: [CoreModule.forRoot(), AcaSettingsModule, LibTestingModule],
|
|
||||||
providers: [provideMockStore({ initialState })]
|
|
||||||
});
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
fixture = TestBed.createComponent(SettingsComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
|
|
||||||
storage = TestBed.inject(StorageService);
|
|
||||||
appExtensions = TestBed.inject(AppExtensionService);
|
|
||||||
|
|
||||||
stringParam = {
|
|
||||||
key: 'key',
|
|
||||||
name: 'param1',
|
|
||||||
type: 'string',
|
|
||||||
value: 'paramValue'
|
|
||||||
};
|
|
||||||
|
|
||||||
boolParam = {
|
|
||||||
key: 'key',
|
|
||||||
name: 'param2',
|
|
||||||
type: 'boolean',
|
|
||||||
value: true
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should retrieve string param value from storage', () => {
|
|
||||||
spyOn(storage, 'getItem').and.returnValue('storageValue');
|
|
||||||
|
|
||||||
const value = component.getStringParamValue(stringParam);
|
|
||||||
expect(value).toBe('storageValue');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should use param value as fallback when storage is empty', () => {
|
|
||||||
spyOn(storage, 'getItem').and.returnValue(null);
|
|
||||||
|
|
||||||
const value = component.getStringParamValue(stringParam);
|
|
||||||
expect(value).toBe('paramValue');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should save param value', () => {
|
|
||||||
spyOn(storage, 'setItem').and.stub();
|
|
||||||
|
|
||||||
component.setParamValue(stringParam, 'test');
|
|
||||||
|
|
||||||
expect(stringParam.value).toBe('test');
|
|
||||||
expect(storage.setItem).toHaveBeenCalledWith(stringParam.key, stringParam.value);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should save param value only if changed', () => {
|
|
||||||
spyOn(storage, 'setItem').and.stub();
|
|
||||||
|
|
||||||
component.setParamValue(stringParam, 'test');
|
|
||||||
component.setParamValue(stringParam, 'test');
|
|
||||||
component.setParamValue(stringParam, 'test');
|
|
||||||
|
|
||||||
expect(storage.setItem).toHaveBeenCalledTimes(1);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should retrieve boolean param value', () => {
|
|
||||||
const getItemSpy = spyOn(storage, 'getItem').and.returnValue('true');
|
|
||||||
expect(component.getBooleanParamValue(boolParam)).toBe(true);
|
|
||||||
|
|
||||||
getItemSpy.and.returnValue('false');
|
|
||||||
expect(component.getBooleanParamValue(boolParam)).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should fallback to boolean param value when storage is empty', () => {
|
|
||||||
spyOn(storage, 'getItem').and.returnValue(null);
|
|
||||||
expect(component.getBooleanParamValue(boolParam)).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should render categories as expansion panels', async () => {
|
|
||||||
spyOn(component, 'reset').and.stub();
|
|
||||||
|
|
||||||
appExtensions.settingGroups = [
|
|
||||||
{
|
|
||||||
id: 'group1',
|
|
||||||
name: 'Group 1',
|
|
||||||
parameters: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'group2',
|
|
||||||
name: 'Group 2',
|
|
||||||
parameters: []
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
fixture.detectChanges();
|
|
||||||
await fixture.whenStable();
|
|
||||||
|
|
||||||
const panels = fixture.debugElement.queryAll(By.css('.mat-expansion-panel'));
|
|
||||||
expect(panels.length).toBe(3);
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,141 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @license
|
|
||||||
* Alfresco Example Content Application
|
|
||||||
*
|
|
||||||
* Copyright (C) 2005 - 2020 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 { Component, ViewEncapsulation, OnInit } from '@angular/core';
|
|
||||||
import { AppConfigService, StorageService, OauthConfigModel } from '@alfresco/adf-core';
|
|
||||||
import { Validators, UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';
|
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
import { Store } from '@ngrx/store';
|
|
||||||
import { AppStore, getHeaderColor, getAppName, getUserProfile, SetSettingsParameterAction } from '@alfresco/aca-shared/store';
|
|
||||||
import { ProfileState } from '@alfresco/adf-extensions';
|
|
||||||
import { AppExtensionService, SettingsGroupRef, SettingsParameterRef } from '@alfresco/aca-shared';
|
|
||||||
|
|
||||||
interface RepositoryConfig {
|
|
||||||
ecmHost: string;
|
|
||||||
authType: string;
|
|
||||||
aisHost: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'aca-settings',
|
|
||||||
templateUrl: './settings.component.html',
|
|
||||||
styleUrls: ['./settings.component.scss'],
|
|
||||||
encapsulation: ViewEncapsulation.None,
|
|
||||||
host: { class: 'aca-settings' }
|
|
||||||
})
|
|
||||||
export class SettingsComponent implements OnInit {
|
|
||||||
private defaultPath = '/assets/images/alfresco-logo-white.svg';
|
|
||||||
|
|
||||||
form: UntypedFormGroup;
|
|
||||||
|
|
||||||
profile$: Observable<ProfileState>;
|
|
||||||
appName$: Observable<string>;
|
|
||||||
headerColor$: Observable<string>;
|
|
||||||
|
|
||||||
get settingGroups(): SettingsGroupRef[] {
|
|
||||||
return this.appExtensions.getSettingsGroups();
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
private appExtensions: AppExtensionService,
|
|
||||||
private store: Store<AppStore>,
|
|
||||||
private appConfig: AppConfigService,
|
|
||||||
private storage: StorageService,
|
|
||||||
private fb: UntypedFormBuilder
|
|
||||||
) {
|
|
||||||
this.profile$ = store.select(getUserProfile);
|
|
||||||
this.appName$ = store.select(getAppName);
|
|
||||||
this.headerColor$ = store.select(getHeaderColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
get logo(): string {
|
|
||||||
return this.appConfig.get('application.logo', this.defaultPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
this.form = this.fb.group({
|
|
||||||
ecmHost: ['', [Validators.required, Validators.pattern('^(http|https)://.*[^/]$')]],
|
|
||||||
aisHost: ['', [Validators.required, Validators.pattern('^(http|https)://.*[^/]$')]],
|
|
||||||
authType: ['']
|
|
||||||
});
|
|
||||||
|
|
||||||
this.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
apply(model: RepositoryConfig, isValid: boolean) {
|
|
||||||
if (isValid) {
|
|
||||||
this.storage.setItem('ecmHost', model.ecmHost);
|
|
||||||
this.storage.setItem('authType', model.authType);
|
|
||||||
|
|
||||||
const config: OauthConfigModel = this.appConfig.get<OauthConfigModel>('oauth2', null);
|
|
||||||
config.host = model.aisHost;
|
|
||||||
this.storage.setItem('oauth2', JSON.stringify(config));
|
|
||||||
|
|
||||||
// window.location.reload(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
reset() {
|
|
||||||
const config: OauthConfigModel = this.appConfig.get<OauthConfigModel>('oauth2', null);
|
|
||||||
|
|
||||||
this.form.reset({
|
|
||||||
ecmHost: this.storage.getItem('ecmHost') || this.appConfig.get<string>('ecmHost'),
|
|
||||||
aisHost: config.host,
|
|
||||||
authType: this.appConfig.get<string>('authType')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getStringParamValue(param: SettingsParameterRef): string {
|
|
||||||
return this.storage.getItem(param.key) || param.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
setParamValue(param: SettingsParameterRef, value: any) {
|
|
||||||
const currentValue = this.getStringParamValue(param);
|
|
||||||
|
|
||||||
if (currentValue !== value.toString()) {
|
|
||||||
param.value = value;
|
|
||||||
this.saveToStorage(param);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onParamValueChanged(event: Event, param: SettingsParameterRef) {
|
|
||||||
const target = event.target as HTMLInputElement;
|
|
||||||
this.setParamValue(param, target.value);
|
|
||||||
}
|
|
||||||
|
|
||||||
getBooleanParamValue(param: SettingsParameterRef): boolean {
|
|
||||||
const result = this.storage.getItem(param.key);
|
|
||||||
if (result) {
|
|
||||||
return result === 'true';
|
|
||||||
} else {
|
|
||||||
return !!param.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private saveToStorage(param: SettingsParameterRef) {
|
|
||||||
this.storage.setItem(param.key, param.value ? param.value.toString() : param.value);
|
|
||||||
this.store.dispatch(new SetSettingsParameterAction({ name: param.key, value: param.value }));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @license
|
|
||||||
* Alfresco Example Content Application
|
|
||||||
*
|
|
||||||
* Copyright (C) 2005 - 2020 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 { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensions';
|
|
||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import { CoreModule } from '@alfresco/adf-core';
|
|
||||||
|
|
||||||
import { SettingsComponent } from './settings.component';
|
|
||||||
import { RouterModule } from '@angular/router';
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [CommonModule, RouterModule, CoreModule.forChild()],
|
|
||||||
declarations: [SettingsComponent],
|
|
||||||
providers: [provideExtensionConfig(['settings.plugin.json'])]
|
|
||||||
})
|
|
||||||
export class AcaSettingsModule {
|
|
||||||
constructor(extensions: ExtensionService) {
|
|
||||||
extensions.setComponents({
|
|
||||||
'app.settings.component': SettingsComponent
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @license
|
|
||||||
* Alfresco Example Content Application
|
|
||||||
*
|
|
||||||
* Copyright (C) 2005 - 2020 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/settings.component';
|
|
||||||
export * from './lib/settings.module';
|
|
@ -1,51 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @license
|
|
||||||
* Alfresco Example Content Application
|
|
||||||
*
|
|
||||||
* Copyright (C) 2005 - 2020 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||||
|
|
||||||
import 'zone.js';
|
|
||||||
import 'zone.js/testing';
|
|
||||||
import { getTestBed } from '@angular/core/testing';
|
|
||||||
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
|
|
||||||
|
|
||||||
declare const require: {
|
|
||||||
context(
|
|
||||||
path: string,
|
|
||||||
deep?: boolean,
|
|
||||||
filter?: RegExp
|
|
||||||
): {
|
|
||||||
keys(): string[];
|
|
||||||
<T>(id: string): T;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// First, initialize the Angular testing environment.
|
|
||||||
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
|
|
||||||
teardown: { destroyAfterEach: false }
|
|
||||||
});
|
|
||||||
// Then we find all the tests.
|
|
||||||
const context = require.context('./', true, /\.spec\.ts$/);
|
|
||||||
// And load the modules.
|
|
||||||
context.keys().map(context);
|
|
@ -1,25 +0,0 @@
|
|||||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../../out-tsc/lib",
|
|
||||||
"declarationMap": true,
|
|
||||||
"target": "es2020",
|
|
||||||
"declaration": true,
|
|
||||||
"inlineSources": true,
|
|
||||||
"types": [],
|
|
||||||
"lib": [
|
|
||||||
"dom",
|
|
||||||
"es2018"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"angularCompilerOptions": {
|
|
||||||
"skipTemplateCodegen": true,
|
|
||||||
"strictMetadataEmit": true,
|
|
||||||
"enableResourceInlining": true
|
|
||||||
},
|
|
||||||
"exclude": [
|
|
||||||
"src/test.ts",
|
|
||||||
"**/*.spec.ts"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
||||||
{
|
|
||||||
"extends": "./tsconfig.lib.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"declarationMap": false,
|
|
||||||
"paths": {
|
|
||||||
"@alfresco/aca-shared": ["dist/@alfresco/aca-shared"],
|
|
||||||
"@alfresco/aca-shared/store": ["dist/@alfresco/aca-shared/store"],
|
|
||||||
"@alfresco/aca-shared/rules": ["dist/@alfresco/aca-shared/rules"]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"angularCompilerOptions": {
|
|
||||||
"compilationMode": "partial"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../tsconfig.adf.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../../out-tsc/spec",
|
|
||||||
"types": [
|
|
||||||
"jasmine"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"src/test.ts"
|
|
||||||
],
|
|
||||||
"include": [
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.d.ts"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../../out-tsc/spec",
|
|
||||||
"types": [
|
|
||||||
"jasmine"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"src/test.ts"
|
|
||||||
],
|
|
||||||
"include": [
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.d.ts"
|
|
||||||
]
|
|
||||||
}
|
|
@ -16,7 +16,7 @@ module.exports = function (config) {
|
|||||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||||
},
|
},
|
||||||
coverageIstanbulReporter: {
|
coverageIstanbulReporter: {
|
||||||
dir: require('path').join(__dirname, '../../coverage/aca-settings'),
|
dir: require('path').join(__dirname, '../../coverage/aca-viewer'),
|
||||||
reports: ['html', 'lcovonly', 'text-summary'],
|
reports: ['html', 'lcovonly', 'text-summary'],
|
||||||
fixWebpackSourcePaths: true
|
fixWebpackSourcePaths: true
|
||||||
},
|
},
|
||||||
|
@ -42,7 +42,6 @@ PROJECTS=(
|
|||||||
'aca-shared'
|
'aca-shared'
|
||||||
'aca-folder-rules'
|
'aca-folder-rules'
|
||||||
'adf-office-services-ext'
|
'adf-office-services-ext'
|
||||||
'aca-settings'
|
|
||||||
'aca-about'
|
'aca-about'
|
||||||
'aca-preview'
|
'aca-preview'
|
||||||
'aca-viewer'
|
'aca-viewer'
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
"@alfresco/adf-office-services-ext": ["projects/adf-office-services-ext/src/public-api.ts"],
|
"@alfresco/adf-office-services-ext": ["projects/adf-office-services-ext/src/public-api.ts"],
|
||||||
"@alfresco/aca-testing-shared": ["projects/aca-testing-shared"],
|
"@alfresco/aca-testing-shared": ["projects/aca-testing-shared"],
|
||||||
"@alfresco/aca-about": ["projects/aca-about/src/public-api.ts"],
|
"@alfresco/aca-about": ["projects/aca-about/src/public-api.ts"],
|
||||||
"@alfresco/aca-settings": ["projects/aca-settings/src/public-api.ts"],
|
|
||||||
"@alfresco/aca-folder-rules": ["projects/aca-folder-rules/src/public-api.ts"],
|
"@alfresco/aca-folder-rules": ["projects/aca-folder-rules/src/public-api.ts"],
|
||||||
"@alfresco/aca-content": ["projects/aca-content/src/public-api.ts"],
|
"@alfresco/aca-content": ["projects/aca-content/src/public-api.ts"],
|
||||||
"@alfresco/aca-viewer": ["projects/aca-viewer/src/public-api.ts"],
|
"@alfresco/aca-viewer": ["projects/aca-viewer/src/public-api.ts"],
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
"@alfresco/adf-office-services-ext": ["projects/adf-office-services-ext/src/public-api.ts"],
|
"@alfresco/adf-office-services-ext": ["projects/adf-office-services-ext/src/public-api.ts"],
|
||||||
"@alfresco/aca-testing-shared": ["projects/aca-testing-shared"],
|
"@alfresco/aca-testing-shared": ["projects/aca-testing-shared"],
|
||||||
"@alfresco/aca-about": ["projects/aca-about/src/public-api.ts"],
|
"@alfresco/aca-about": ["projects/aca-about/src/public-api.ts"],
|
||||||
"@alfresco/aca-settings": ["projects/aca-settings/src/public-api.ts"],
|
|
||||||
"@alfresco/aca-folder-rules": ["projects/aca-folder-rules/src/public-api.ts"],
|
"@alfresco/aca-folder-rules": ["projects/aca-folder-rules/src/public-api.ts"],
|
||||||
"@alfresco/aca-content": ["projects/aca-content/src/public-api.ts"],
|
"@alfresco/aca-content": ["projects/aca-content/src/public-api.ts"],
|
||||||
"@alfresco/aca-viewer": ["projects/aca-viewer/src/public-api.ts"],
|
"@alfresco/aca-viewer": ["projects/aca-viewer/src/public-api.ts"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user