Ng16 migration (#10114)

* NG-16 - migration step 1

* NG16 - fixed the builds

* [MIGRATION] - Switching off no empty functions rule

* [MIGRATION] - Somehow the fix for the cli types got lost

* [MIGRATION] - Something happened on the way to heaven

* [MIGRATION] - Ok this is weird

* [MIGRATION] - Ok this is really weird

* [MIGRATION] - change selector for expanded expansion panel content

* [MIGRATION] - storybook chips related e2e fails fix, unit alignments

* [MIGRATION] - Ok this is really weird

* [MIGRATION] - Updating outdated packages

* [MIGRATION] - updated deps for process cloud

* [MIGRATION] - Rebased to latest

* [MIGRATION] - Fixed lint

* [MIGRATION] - Fixed package version

* Rebased with lastest changes

* [MIGRATION] - check to update the script

* [MIGRATION] - rebased after the move of AlfrescoApiService

* [MIGRATION] - fixed schematics build

* [MIGRATION] - the lesson is : do not change what is already working

* Rebased to latestp

* Fixes after CR (#10202)

* Fixed white background issue in sidenav after ng16 upgrade (#10207)

* [MIGRATION] fix header background color not being read from input prop

* Fixed build

* Rebased

* Fix package version after release

* Thanks apollo deps

* custom theme missing sidenav color

* fix filter subscript overlapping dropdown items

* [ACS-8749] View More tags button no longer shows when all tags are removed from a node (#10285)

* [ACS-8741] Sidenav text for Process and Task filters is now grey (#10284)

* AAE-26037 Moved permissions role selector styles to a dedicated file (#10297)

* Removed fallback and starting using simple token

* Removed fallback and starting using simple token

* Fixed related unit test

* Fixed related unit test

* Writing should use the same calss as reading

* Fixed unit tests for insights

* Fixed unit tests for insights

* Added fallback for JWT token

* Added fallback for JWT token

* Auto import fix

* Added fallback for injection

* Added fallback for injection

* Trying to fix JWT token issue

* Fixed unit tests

* Fixed unit tests

* Fixed style for collaborators

* fixed permission row height

* AAE-26163 Fix infinite loop when authentication error event occured (#10272)

* AAE-26163 Logout user after 3 login attempts failed, avoiding infinite loop when an authentication error occured, like when a user machine clock is significantly out of sync

* AAE-26163 Wait to discovery document to be loaded and user not authenticated to perform a ssoLogin, logout user if login fails after 3 attempts

* AAE-26163 Fix missed id_token_hint invoking logout when a login error occured due to a clock significantly out of sync

* AAE-26163 Add fake observable to unit test

* AAE-26163 Show oauth event logs if showDebugInformation is enabled, remove auth items if access token is not valid

* AAE-26163 Improve tryLogin error message

* AAE-26163 Check if token has expired to fix case when user access the application after the token is expired and with a clock significantly out of sync

* AAE-26163 Test logout when clock is out of sync

* AAE-26163 Create a service to check if local machine time is out of sync

* AAE-26163 Update oauthErrorEvent$ and combinedOAuthErrorsStream$ to return errors

* AAE-26163 Output error within combined oauth error event subscription

* AAE-26163 Fix lint problems

* AAE-26163 Logout user when token refresh error happens for the second time, if the token is not refreshed properly after first refresh error

* AAE-26163 Logout user once an oauth error event occur due to clock out of sync

* AAE-26163 Fix retry login error message if the OAuthErrorEvent doesn t return reason

* AAE-26163 Fix the issue where the logout API call is canceled by the authorize call when login fails due to clock synchronization problems, causing an infinite loop.

* remove console.log

* AAE-26163 Fix retry login error message if the OAuthErrorEvent reason is an empty object

* Updating dependencies

* Fixed subject complete to avoid calling a reset event when complete

---------

Co-authored-by: Wojciech Duda <69160975+wojd0@users.noreply.github.com>
Co-authored-by: dominikiwanekhyland <141320833+dominikiwanekhyland@users.noreply.github.com>
Co-authored-by: swapnil-verma-gl <92505353+swapnil-verma-gl@users.noreply.github.com>
Co-authored-by: Ehsan Rezaei <ehsan.rezaei@hyland.com>
Co-authored-by: Amedeo Lepore <amedeo.lepore@hyland.com>
This commit is contained in:
Vito Albano 2024-10-23 15:23:38 +01:00 committed by GitHub
parent 0a89d9be97
commit 41391a0bb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
91 changed files with 13720 additions and 13462 deletions

View File

@ -9,3 +9,4 @@ scripts
/angular.json /angular.json
docs/**/*.md docs/**/*.md
lib/js-api/docs/**/*.md lib/js-api/docs/**/*.md
.storybook

View File

@ -12,7 +12,7 @@ module.exports = {
'**/docs' '**/docs'
], ],
plugins: ['@nrwl/nx'], plugins: ['@nx'],
overrides: [ overrides: [
{ {
@ -22,11 +22,10 @@ module.exports = {
createDefaultProgram: true createDefaultProgram: true
}, },
extends: [ extends: [
'plugin:@nrwl/nx/typescript', 'plugin:@nx/typescript',
'plugin:@nrwl/nx/angular', 'plugin:@nx/angular',
'plugin:@cspell/recommended', 'plugin:@cspell/recommended',
'plugin:@angular-eslint/ng-cli-compat', 'plugin:@angular-eslint/recommended',
'plugin:@angular-eslint/ng-cli-compat--formatting-add-on',
'plugin:@angular-eslint/template/process-inline-templates', 'plugin:@angular-eslint/template/process-inline-templates',
'plugin:jsdoc/recommended-typescript-error' 'plugin:jsdoc/recommended-typescript-error'
], ],
@ -104,6 +103,7 @@ module.exports = {
} }
], ],
'@typescript-eslint/member-ordering': 'off', '@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/no-empty-function': 'off',
'prefer-arrow/prefer-arrow-functions': 'off', 'prefer-arrow/prefer-arrow-functions': 'off',
'prefer-promise-reject-errors': 'error', 'prefer-promise-reject-errors': 'error',
'brace-style': 'off', 'brace-style': 'off',

View File

@ -171,7 +171,6 @@ jobs:
npx nx run js-api:bundle npx nx run js-api:bundle
npx nx run cli:bundle npx nx run cli:bundle
npx nx run testing:bundle npx nx run testing:bundle
- run: npx nx print-affected $NX_CALCULATION_FLAGS
- uses: ./.github/actions/upload-node-modules-and-artifacts - uses: ./.github/actions/upload-node-modules-and-artifacts
unit-tests: unit-tests:

View File

@ -98,16 +98,16 @@ jobs:
setMigrations(); setMigrations();
- name: Build libraries - name: Build libraries
run: | run: |
npx nx affected:build $NX_CALCULATION_FLAGS --prod --skip-nx-cache npx nx run-many --target=build --prod --exclude="demoshell" --skip-nx-cache
npx nx affected $NX_CALCULATION_FLAGS --target=pretheme npx nx run-many --target=pretheme
npx nx affected $NX_CALCULATION_FLAGS --target=build-schematics npx nx run-many --target=build-schematics
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
name: release libraries GH registry name: release libraries GH registry
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
registry-url: 'https://npm.pkg.github.com' registry-url: 'https://npm.pkg.github.com'
scope: '@alfresco' scope: '@alfresco'
- run: npx nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=branch|| exit 1 - run: npx nx run-many --target=npm-publish --tag=branch|| exit 1
env: env:
NODE_AUTH_TOKEN: ${{ secrets.PAT_WRITE_PKG }} NODE_AUTH_TOKEN: ${{ secrets.PAT_WRITE_PKG }}
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
@ -116,7 +116,7 @@ jobs:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
registry-url: 'https://${{ vars.NPM_REGISTRY_ADDRESS }}' registry-url: 'https://${{ vars.NPM_REGISTRY_ADDRESS }}'
scope: '@alfresco' scope: '@alfresco'
- run: npx nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=branch || exit 1 - run: npx nx run-many --target=npm-publish --tag=branch || exit 1
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}

View File

@ -6,5 +6,5 @@ module.exports = {
staticDirs: [], staticDirs: [],
docs: {}, docs: {},
stories: [], stories: [],
addons: [] addons: ['@chromatic-com/storybook']
}; };

View File

@ -2,4 +2,4 @@ export const parameters = {
docs: { inlineStories: true }, docs: { inlineStories: true },
controls: { expanded: true } controls: { expanded: true }
}; };
export const tags = ['autodocs']; export const tags = ['autodocs', 'autodocs', 'autodocs'];

View File

@ -4,7 +4,7 @@
"overrides": [ "overrides": [
{ {
"files": ["*.ts"], "files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular"], "extends": ["plugin:@nx/angular"],
"parserOptions": { "parserOptions": {
"project": ["lib/cli/tsconfig.json"], "project": ["lib/cli/tsconfig.json"],
"createDefaultProgram": true "createDefaultProgram": true
@ -44,7 +44,7 @@
"project": ["lib/cli/tsconfig.json"], "project": ["lib/cli/tsconfig.json"],
"createDefaultProgram": true "createDefaultProgram": true
}, },
"extends": ["plugin:@nrwl/nx/angular-template"], "extends": ["plugin:@nx/angular-template"],
"rules": {} "rules": {}
} }
] ]

View File

@ -19,7 +19,7 @@
"target": "es2018", "target": "es2018",
"lib": ["es2018", "dom"], "lib": ["es2018", "dom"],
"baseUrl": ".", "baseUrl": ".",
"typeRoots": ["node_modules/@types"], "typeRoots": ["node_modules/@types", "../../node_modules/@types"],
"types": ["node"], "types": ["node"],
"paths": { "paths": {
"@alfresco/js-api": ["../../dist/libs/js-api"], "@alfresco/js-api": ["../../dist/libs/js-api"],

View File

@ -4,7 +4,7 @@
"overrides": [ "overrides": [
{ {
"files": ["*.ts"], "files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular"], "extends": ["plugin:@nx/angular"],
"parserOptions": { "parserOptions": {
"project": ["lib/content-services/tsconfig.lib.json", "lib/content-services/tsconfig.spec.json"], "project": ["lib/content-services/tsconfig.lib.json", "lib/content-services/tsconfig.spec.json"],
"createDefaultProgram": true "createDefaultProgram": true
@ -15,7 +15,12 @@
"@typescript-eslint/consistent-type-assertions": "warn", "@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/prefer-for-of": "warn", "@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/member-ordering": "off", "@typescript-eslint/member-ordering": "off",
"no-underscore-dangle": ["error", { "allowAfterThis": true }], "no-underscore-dangle": [
"error",
{
"allowAfterThis": true
}
],
"no-shadow": "warn", "no-shadow": "warn",
"quote-props": "warn", "quote-props": "warn",
"object-shorthand": "warn", "object-shorthand": "warn",
@ -23,7 +28,6 @@
"arrow-body-style": "warn", "arrow-body-style": "warn",
"@angular-eslint/no-output-native": "off", "@angular-eslint/no-output-native": "off",
"space-before-function-paren": "warn", "space-before-function-paren": "warn",
"@angular-eslint/component-selector": [ "@angular-eslint/component-selector": [
"error", "error",
{ {
@ -80,7 +84,7 @@
"project": ["lib/content-services/tsconfig.lib.json", "lib/content-services/tsconfig.spec.json"], "project": ["lib/content-services/tsconfig.lib.json", "lib/content-services/tsconfig.spec.json"],
"createDefaultProgram": true "createDefaultProgram": true
}, },
"extends": ["plugin:@nrwl/nx/angular-template"], "extends": ["plugin:@nx/angular-template"],
"rules": { "rules": {
"@angular-eslint/template/no-autofocus": "error", "@angular-eslint/template/no-autofocus": "error",
"@angular-eslint/template/no-positive-tabindex": "error" "@angular-eslint/template/no-positive-tabindex": "error"

View File

@ -17,11 +17,5 @@ module.exports = {
options: {} options: {}
}, },
docs: { docs: {}
autodocs: true
},
core: {
builder: '@storybook/builder-webpack5'
}
}; };

View File

@ -2,3 +2,4 @@ export const parameters = {
docs: { inlineStories: true }, docs: { inlineStories: true },
controls: { expanded: true } controls: { expanded: true }
}; };
export const tags = ['autodocs', 'autodocs'];

View File

@ -17,7 +17,6 @@
import { ContentAuthLoaderService } from './content-auth-loader.service'; import { ContentAuthLoaderService } from './content-auth-loader.service';
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
/** /**
* Create a content auth factory * Create a content auth factory
* *

View File

@ -115,7 +115,9 @@ export class RenditionService {
try { try {
await this.renditionsApi.createRendition(nodeId, { id: renditionId }); await this.renditionsApi.createRendition(nodeId, { id: renditionId });
rendition = await this.waitRendition(nodeId, renditionId, 0); rendition = await this.waitRendition(nodeId, renditionId, 0);
} catch {} } catch {
return null;
}
} }
} }
return new Promise<RenditionEntry>((resolve) => resolve(rendition)); return new Promise<RenditionEntry>((resolve) => resolve(rendition));

View File

@ -238,7 +238,9 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
try { try {
statusCode = JSON.parse(error.message).error.statusCode; statusCode = JSON.parse(error.message).error.statusCode;
} catch {} } catch {
/* empty */
}
let message = `METADATA.ERRORS.${statusCode}`; let message = `METADATA.ERRORS.${statusCode}`;

View File

@ -252,7 +252,9 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
try { try {
statusCode = JSON.parse(error.message).error.statusCode; statusCode = JSON.parse(error.message).error.statusCode;
} catch {} } catch {
/* empty */
}
if (statusCode === 403) { if (statusCode === 403) {
message = 'SHARE.UNSHARE_PERMISSION_ERROR'; message = 'SHARE.UNSHARE_PERMISSION_ERROR';

View File

@ -1049,7 +1049,9 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
if (JSON.parse(err.message).error.statusCode === 403) { if (JSON.parse(err.message).error.statusCode === 403) {
this.noPermission = true; this.noPermission = true;
} }
} catch (error) {} } catch (error) {
/* empty */
}
} }
this.setLoadingState(false); this.setLoadingState(false);
this.error.emit(err); this.error.emit(err);

View File

@ -0,0 +1,11 @@
@import 'styles/mat-selectors';
.adf-role-selector-field#{$mat-form-field} {
width: 100%;
max-width: 200px;
height: 40px;
#{$mat-form-field-infix}:not(:disabled) {
padding-top: 8px;
}
}

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewEncapsulation } from '@angular/core';
import { RoleModel } from '../../models/role.model'; import { RoleModel } from '../../models/role.model';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { MatFormFieldModule } from '@angular/material/form-field'; import { MatFormFieldModule } from '@angular/material/form-field';
@ -32,7 +32,7 @@ export interface RoleModelOption {
standalone: true, standalone: true,
imports: [CommonModule, MatFormFieldModule, MatSelectModule, TranslateModule], imports: [CommonModule, MatFormFieldModule, MatSelectModule, TranslateModule],
template: ` template: `
<mat-form-field class="adf-role-selector-field" *ngIf="!readonly"> <mat-form-field class="adf-role-selector-field" *ngIf="!readonly" subscriptSizing="dynamic">
<mat-select <mat-select
class="adf-role-selector" class="adf-role-selector"
(click)="$event.stopPropagation()" (click)="$event.stopPropagation()"
@ -52,24 +52,9 @@ export interface RoleModelOption {
{{ i18nValue | translate }} {{ i18nValue | translate }}
</span> </span>
`, `,
encapsulation: ViewEncapsulation.None,
host: { class: 'adf-user-role-column adf-datatable-content-cell adf-expand-cell-4' }, host: { class: 'adf-user-role-column adf-datatable-content-cell adf-expand-cell-4' },
styles: [ styleUrls: ['./user-role-column.component.scss']
`
.adf-role-selector-field.mat-mdc-form-field {
width: 100%;
height: 40px;
max-width: 200px;
.mat-mdc-form-field-infix {
padding-top: 8px;
}
.mat-mdc-form-field-subscript-wrapper {
display: none;
}
}
`
]
}) })
export class UserRoleColumnComponent implements OnChanges { export class UserRoleColumnComponent implements OnChanges {
@Input() @Input()

View File

@ -25,7 +25,6 @@ import { TreeViewService } from '../services/tree-view.service';
@Injectable() @Injectable()
export class TreeViewDataSource { export class TreeViewDataSource {
treeNodes: TreeBaseNode[]; treeNodes: TreeBaseNode[];
dataChange = new BehaviorSubject<TreeBaseNode[]>([]); dataChange = new BehaviorSubject<TreeBaseNode[]>([]);
childrenSubscription = null; childrenSubscription = null;
@ -40,15 +39,13 @@ export class TreeViewDataSource {
this.dataChange.next(value); this.dataChange.next(value);
} }
constructor(private treeControl: FlatTreeControl<TreeBaseNode>, constructor(private treeControl: FlatTreeControl<TreeBaseNode>, private treeViewService: TreeViewService) {
private treeViewService: TreeViewService) { this.dataChange.subscribe((treeNodes) => (this.treeNodes = treeNodes));
this.dataChange.subscribe((treeNodes) => this.treeNodes = treeNodes);
} }
connect(collectionViewer: CollectionViewer): Observable<TreeBaseNode[]> { connect(collectionViewer: CollectionViewer): Observable<TreeBaseNode[]> {
this.changeSubscription = this.treeControl.expansionModel.changed.subscribe((change) => { this.changeSubscription = this.treeControl.expansionModel.changed.subscribe((change) => {
if ((change as SelectionChange<TreeBaseNode>).added && if ((change as SelectionChange<TreeBaseNode>).added && (change as SelectionChange<TreeBaseNode>).added.length > 0) {
(change as SelectionChange<TreeBaseNode>).added.length > 0) {
this.expandTreeNodes(change as SelectionChange<TreeBaseNode>); this.expandTreeNodes(change as SelectionChange<TreeBaseNode>);
} else if ((change as SelectionChange<TreeBaseNode>).removed) { } else if ((change as SelectionChange<TreeBaseNode>).removed) {
this.reduceTreeNodes(change as SelectionChange<TreeBaseNode>); this.reduceTreeNodes(change as SelectionChange<TreeBaseNode>);
@ -71,12 +68,14 @@ export class TreeViewDataSource {
} }
private reduceTreeNodes(change: SelectionChange<TreeBaseNode>) { private reduceTreeNodes(change: SelectionChange<TreeBaseNode>) {
change.removed.slice().reverse().forEach((node) => this.toggleNode(node)); change.removed
.slice()
.reverse()
.forEach((node) => this.toggleNode(node));
} }
private expandNode(node: TreeBaseNode) { private expandNode(node: TreeBaseNode) {
this.childrenSubscription = this.treeViewService.getTreeNodes(node.nodeId) this.childrenSubscription = this.treeViewService.getTreeNodes(node.nodeId).subscribe((children) => {
.subscribe((children) => {
const index = this.data.indexOf(node); const index = this.data.indexOf(node);
if (!children || index < 0) { if (!children || index < 0) {
node.expandable = false; node.expandable = false;
@ -94,10 +93,10 @@ export class TreeViewDataSource {
toggleNode(node: TreeBaseNode) { toggleNode(node: TreeBaseNode) {
const index = this.data.indexOf(node); const index = this.data.indexOf(node);
let count = 0; let count = 0;
for (let i = index + 1; i < this.data.length for (let i = index + 1; i < this.data.length && this.data[i].level > node.level; i++, count++) {
&& this.data[i].level > node.level; i++ , count++) { } /* empty */
}
this.data.splice(index + 1, count); this.data.splice(index + 1, count);
this.dataChange.next(this.data); this.dataChange.next(this.data);
} }
} }

View File

@ -17,7 +17,6 @@
import { VersionCompatibilityService } from './version-compatibility.service'; import { VersionCompatibilityService } from './version-compatibility.service';
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
/** /**
* Create a version compatibility factory * Create a version compatibility factory
* *

View File

@ -4,7 +4,7 @@
"overrides": [ "overrides": [
{ {
"files": ["*.ts"], "files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular"], "extends": ["plugin:@nx/angular"],
"parserOptions": { "parserOptions": {
"project": ["lib/core/tsconfig.lib.json", "lib/core/tsconfig.spec.json"], "project": ["lib/core/tsconfig.lib.json", "lib/core/tsconfig.spec.json"],
"createDefaultProgram": true "createDefaultProgram": true
@ -15,7 +15,12 @@
"@typescript-eslint/consistent-type-assertions": "warn", "@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/prefer-for-of": "off", "@typescript-eslint/prefer-for-of": "off",
"@typescript-eslint/member-ordering": "off", "@typescript-eslint/member-ordering": "off",
"no-underscore-dangle": ["error", { "allowAfterThis": true }], "no-underscore-dangle": [
"error",
{
"allowAfterThis": true
}
],
"no-shadow": "warn", "no-shadow": "warn",
"quote-props": "warn", "quote-props": "warn",
"object-shorthand": "warn", "object-shorthand": "warn",
@ -24,7 +29,6 @@
"arrow-body-style": "warn", "arrow-body-style": "warn",
"@angular-eslint/no-output-native": "off", "@angular-eslint/no-output-native": "off",
"space-before-function-paren": "warn", "space-before-function-paren": "warn",
"@angular-eslint/component-selector": [ "@angular-eslint/component-selector": [
"error", "error",
{ {
@ -77,11 +81,10 @@
}, },
{ {
"files": ["*.html"], "files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"], "extends": ["plugin:@nx/angular-template"],
"rules": { "rules": {
"@angular-eslint/template/no-autofocus": "error", "@angular-eslint/template/no-autofocus": "error",
"@angular-eslint/template/no-positive-tabindex": "error", "@angular-eslint/template/no-positive-tabindex": "error",
"@angular-eslint/template/no-negated-async": "off" "@angular-eslint/template/no-negated-async": "off"
} }
} }

View File

@ -4,14 +4,19 @@ module.exports = {
...rootMain, ...rootMain,
core: { ...rootMain.core, builder: 'webpack5' }, core: { ...rootMain.core, builder: 'webpack5' },
stories: [...rootMain.stories, '../**/*.stories.@(js|jsx|ts|tsx)'], stories: [...rootMain.stories, '../**/*.stories.@(js|jsx|ts|tsx)'],
framework: { framework: {
name: "@storybook/angular", name: "@storybook/angular",
options: (()=>console.log('loaded config!'))() options: (()=>console.log('loaded config!'))()
}, },
staticDirs: [ staticDirs: [
...rootMain.staticDirs, ...rootMain.staticDirs,
{ from: __dirname + '/../src/lib/i18n', to: 'assets/adf-core/i18n' }, { from: __dirname + '/../src/lib/i18n', to: 'assets/adf-core/i18n' },
{ from: __dirname + '/../src/lib/assets/images', to: 'assets/images' } { from: __dirname + '/../src/lib/assets/images', to: 'assets/images' }
], ],
addons: ['@storybook/addon-essentials', ...rootMain.addons]
addons: ['@storybook/addon-essentials', ...rootMain.addons],
docs: {}
}; };

View File

@ -3,3 +3,4 @@ const rootPreview = require('../../../.storybook/preview');
export const parameters = { export const parameters = {
...rootPreview.preview ...rootPreview.preview
}; };
export const tags = ['autodocs', 'autodocs'];

View File

@ -17,13 +17,13 @@
import { Inject, Injectable, inject } from '@angular/core'; import { Inject, Injectable, inject } from '@angular/core';
import { FeaturesServiceToken, IFeaturesService } from '../interfaces/features.interface'; import { FeaturesServiceToken, IFeaturesService } from '../interfaces/features.interface';
import { CanMatch, Route } from '@angular/router'; import { Route } from '@angular/router';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
export const isFeatureOff = (flag: string) => () => inject(FeaturesServiceToken).isOff$(flag); export const isFeatureOff = (flag: string) => () => inject(FeaturesServiceToken).isOff$(flag);
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class IsFeatureOff implements CanMatch { export class IsFeatureOff {
constructor(@Inject(FeaturesServiceToken) private featuresServiceToken: IFeaturesService) {} constructor(@Inject(FeaturesServiceToken) private featuresServiceToken: IFeaturesService) {}
canMatch(route: Route): Observable<boolean> { canMatch(route: Route): Observable<boolean> {

View File

@ -17,13 +17,13 @@
import { Inject, Injectable, inject } from '@angular/core'; import { Inject, Injectable, inject } from '@angular/core';
import { FeaturesServiceToken, IFeaturesService } from '../interfaces/features.interface'; import { FeaturesServiceToken, IFeaturesService } from '../interfaces/features.interface';
import { CanMatch, Route } from '@angular/router'; import { Route } from '@angular/router';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
export const isFeatureOn = (flag: string) => () => inject(FeaturesServiceToken).isOn$(flag); export const isFeatureOn = (flag: string) => () => inject(FeaturesServiceToken).isOn$(flag);
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class IsFeatureOn implements CanMatch { export class IsFeatureOn {
constructor(@Inject(FeaturesServiceToken) private featuresServiceToken: IFeaturesService) {} constructor(@Inject(FeaturesServiceToken) private featuresServiceToken: IFeaturesService) {}
canMatch(route: Route): Observable<boolean> { canMatch(route: Route): Observable<boolean> {

View File

@ -17,12 +17,12 @@
import { Inject, Injectable, Optional, inject } from '@angular/core'; import { Inject, Injectable, Optional, inject } from '@angular/core';
import { FlagsOverrideToken } from '../interfaces/features.interface'; import { FlagsOverrideToken } from '../interfaces/features.interface';
import { CanMatch } from '@angular/router';
export const isFlagsOverrideOn = () => () => inject(FlagsOverrideToken) ?? false; export const isFlagsOverrideOn = () => () => inject(FlagsOverrideToken) ?? false;
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class IsFlagsOverrideOn implements CanMatch { export class IsFlagsOverrideOn {
constructor(@Optional() @Inject(FlagsOverrideToken) private devToolsToken: boolean) {} constructor(@Optional() @Inject(FlagsOverrideToken) private devToolsToken: boolean) {}
canMatch(): boolean { canMatch(): boolean {

View File

@ -24,13 +24,14 @@
"defaultConfiguration": "production" "defaultConfiguration": "production"
}, },
"build-schematics": { "build-schematics": {
"executor": "nx:run-commands", "executor": "@nrwl/js:tsc",
"outputs": ["{options.outputPath}"],
"options": { "options": {
"commands": [ "outputPath": "dist/libs/core/schematics/migrations",
{ "main": "lib/core/schematics/migrations/index.ts",
"command": "npx tsc -p lib/core/tsconfig.schematics.json && cp lib/core/schematics/migrations/collection.json dist/libs/core/schematics/migrations/collection.json" "tsConfig": "lib/core/tsconfig.schematics.json",
} "externalBuildTargets": ["build-schematics"],
] "assets": ["lib/core/schematics/migrations/collection.json"]
} }
}, },
"test": { "test": {

View File

@ -1,5 +1,5 @@
{ {
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json", "$schema": "../../../../node_modules/@angular-devkit/schematics/collection-schema.json",
"schematics": { "schematics": {
"move-out-alfresco-api": { "move-out-alfresco-api": {
"description": "Update alfresco-api imports", "description": "Update alfresco-api imports",

View File

@ -28,6 +28,7 @@ import { EMPTY, of } from 'rxjs';
import { OidcAuthenticationService } from '../oidc/oidc-authentication.service'; import { OidcAuthenticationService } from '../oidc/oidc-authentication.service';
import { NoopTranslateModule } from '../../testing/noop-translate.module'; import { NoopTranslateModule } from '../../testing/noop-translate.module';
describe('AuthGuardService ECM', () => { describe('AuthGuardService ECM', () => {
let authGuard: Promise<boolean>; let authGuard: Promise<boolean>;
let authService: AuthenticationService; let authService: AuthenticationService;

View File

@ -21,6 +21,7 @@ import { AuthGuardSsoRoleService } from './auth-guard-sso-role.service';
import { JwtHelperService } from '../services/jwt-helper.service'; import { JwtHelperService } from '../services/jwt-helper.service';
import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { MatDialog, MatDialogModule } from '@angular/material/dialog';
import { NoopTranslateModule } from '../../testing/noop-translate.module'; import { NoopTranslateModule } from '../../testing/noop-translate.module';
import { AuthModule } from '../oidc/auth.module';
describe('Auth Guard SSO role service', () => { describe('Auth Guard SSO role service', () => {
let jwtHelperService: JwtHelperService; let jwtHelperService: JwtHelperService;
@ -29,7 +30,7 @@ describe('Auth Guard SSO role service', () => {
beforeEach(() => { beforeEach(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [NoopTranslateModule, MatDialogModule] imports: [NoopTranslateModule, MatDialogModule, AuthModule.forRoot({ useHash: true })]
}); });
localStorage.clear(); localStorage.clear();
jwtHelperService = TestBed.inject(JwtHelperService); jwtHelperService = TestBed.inject(JwtHelperService);

View File

@ -28,6 +28,7 @@ import { EMPTY, of } from 'rxjs';
import { MatDialogModule } from '@angular/material/dialog'; import { MatDialogModule } from '@angular/material/dialog';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { NoopTranslateModule } from '../../testing/noop-translate.module'; import { NoopTranslateModule } from '../../testing/noop-translate.module';
import { NoopAuthModule } from '../../testing';
describe('AuthGuardService', () => { describe('AuthGuardService', () => {
let state: RouterStateSnapshot; let state: RouterStateSnapshot;
@ -42,11 +43,10 @@ describe('AuthGuardService', () => {
beforeEach(() => { beforeEach(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [NoopTranslateModule, MatDialogModule, RouterTestingModule], imports: [NoopTranslateModule, MatDialogModule, RouterTestingModule, NoopAuthModule],
providers: [ providers: [
AppConfigService, AppConfigService,
StorageService, { provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of(), init: () => {} } },
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } },
{ {
provide: OidcAuthenticationService, provide: OidcAuthenticationService,
useValue: { useValue: {

View File

@ -15,10 +15,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core'; import { APP_INITIALIZER, inject, ModuleWithProviders, NgModule, InjectionToken } from '@angular/core';
import { AUTH_CONFIG, OAuthModule, OAuthStorage } from 'angular-oauth2-oidc'; import { AUTH_CONFIG, OAuthModule, OAuthStorage } from 'angular-oauth2-oidc';
import { AuthenticationService } from '../services/authentication.service'; import { AuthenticationService } from '../services/authentication.service';
import { StorageService } from '../../common/services/storage.service';
import { AuthModuleConfig, AUTH_MODULE_CONFIG } from './auth-config'; import { AuthModuleConfig, AUTH_MODULE_CONFIG } from './auth-config';
import { authConfigFactory, AuthConfigService } from './auth-config.service'; import { authConfigFactory, AuthConfigService } from './auth-config.service';
import { AuthRoutingModule } from './auth-routing.module'; import { AuthRoutingModule } from './auth-routing.module';
@ -27,6 +26,12 @@ import { RedirectAuthService } from './redirect-auth.service';
import { AuthenticationConfirmationComponent } from './view/authentication-confirmation/authentication-confirmation.component'; import { AuthenticationConfirmationComponent } from './view/authentication-confirmation/authentication-confirmation.component';
import { HTTP_INTERCEPTORS } from '@angular/common/http'; import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { TokenInterceptor } from './token.interceptor'; import { TokenInterceptor } from './token.interceptor';
import { StorageService } from '../../common/services/storage.service';
export const JWT_STORAGE_SERVICE = new InjectionToken<OAuthStorage>('JWT_STORAGE_SERVICE', {
providedIn: 'root',
factory: () => inject(StorageService)
});
/** /**
* Create a Login Factory function * Create a Login Factory function
@ -38,11 +43,18 @@ export function loginFactory(redirectService: RedirectAuthService): () => Promis
return () => redirectService.init(); return () => redirectService.init();
} }
/**
* @returns current instance of OAuthStorage
*/
export function oauthStorageFactory(): OAuthStorage {
return inject(JWT_STORAGE_SERVICE);
}
@NgModule({ @NgModule({
declarations: [AuthenticationConfirmationComponent], declarations: [AuthenticationConfirmationComponent],
imports: [AuthRoutingModule, OAuthModule.forRoot()], imports: [AuthRoutingModule, OAuthModule.forRoot()],
providers: [ providers: [
{ provide: OAuthStorage, useExisting: StorageService }, { provide: OAuthStorage, useFactory: oauthStorageFactory },
{ provide: AuthenticationService }, { provide: AuthenticationService },
{ {
provide: AUTH_CONFIG, provide: AUTH_CONFIG,

View File

@ -35,6 +35,7 @@ import { IdentityRoleModel } from '../models/identity-role.model';
import { AdfHttpClient } from '../../../../api/src'; import { AdfHttpClient } from '../../../../api/src';
import { StorageService } from '../../common/services/storage.service'; import { StorageService } from '../../common/services/storage.service';
import { NoopTranslateModule } from '../../testing/noop-translate.module'; import { NoopTranslateModule } from '../../testing/noop-translate.module';
import { OAuthStorage } from 'angular-oauth2-oidc';
describe('IdentityUserService', () => { describe('IdentityUserService', () => {
const mockRoles = [ const mockRoles = [
@ -53,7 +54,7 @@ describe('IdentityUserService', () => {
beforeEach(() => { beforeEach(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [NoopTranslateModule], imports: [NoopTranslateModule],
providers: [StorageService, AdfHttpClient] providers: [AdfHttpClient, { provide: OAuthStorage, useClass: StorageService }]
}); });
storageService = TestBed.inject(StorageService); storageService = TestBed.inject(StorageService);
service = TestBed.inject(IdentityUserService); service = TestBed.inject(IdentityUserService);

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { JWT_STORAGE_SERVICE, JwtHelperService } from './jwt-helper.service'; import { JwtHelperService } from './jwt-helper.service';
import { mockToken } from '../mock/jwt-helper.service.spec'; import { mockToken } from '../mock/jwt-helper.service.spec';
import { TestBed } from '@angular/core/testing'; import { TestBed } from '@angular/core/testing';
import { StorageService } from '../../common'; import { StorageService } from '../../common';
@ -42,7 +42,7 @@ describe('JwtHelperService', () => {
beforeEach(() => { beforeEach(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
providers: [JwtHelperService, { provide: StorageService, useValue: mockStorage }] providers: [JwtHelperService, { provide: OAuthStorage, useValue: mockStorage }]
}); });
jwtHelperService = TestBed.inject(JwtHelperService); jwtHelperService = TestBed.inject(JwtHelperService);
}); });
@ -140,15 +140,11 @@ describe('JwtHelperService with custom storage service', () => {
beforeEach(() => { beforeEach(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
providers: [ providers: [JwtHelperService, { provide: StorageService, useValue: mockStorage }, { provide: OAuthStorage, useValue: mockCustomStorage }]
JwtHelperService,
{ provide: StorageService, useValue: mockStorage },
{ provide: JWT_STORAGE_SERVICE, useValue: mockCustomStorage }
]
}); });
jwtHelperService = TestBed.inject(JwtHelperService); jwtHelperService = TestBed.inject(JwtHelperService);
defaultStorage = TestBed.inject(StorageService); defaultStorage = TestBed.inject(StorageService);
customStorage = TestBed.inject(JWT_STORAGE_SERVICE); customStorage = TestBed.inject(OAuthStorage);
}); });
it('should use the custom storage service', () => { it('should use the custom storage service', () => {

View File

@ -15,14 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { inject, Injectable, InjectionToken } from '@angular/core'; import { inject, Injectable } from '@angular/core';
import { OAuthStorage } from 'angular-oauth2-oidc'; import { OAuthStorage } from 'angular-oauth2-oidc';
import { StorageService } from '../../common/services/storage.service';
export const JWT_STORAGE_SERVICE = new InjectionToken<OAuthStorage>('JWT_STORAGE_SERVICE', {
providedIn: 'root',
factory: () => inject(StorageService)
});
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@ -39,7 +33,7 @@ export class JwtHelperService {
static USER_PREFERRED_USERNAME = 'preferred_username'; static USER_PREFERRED_USERNAME = 'preferred_username';
static HXP_AUTHORIZATION = 'hxp_authorization'; static HXP_AUTHORIZATION = 'hxp_authorization';
private storageService: OAuthStorage = inject(JWT_STORAGE_SERVICE); private storageService: OAuthStorage = inject(OAuthStorage)
/** /**
* Decodes a JSON web token into a JS object. * Decodes a JSON web token into a JS object.

View File

@ -20,6 +20,8 @@ import { UserAccessService } from './user-access.service';
import { JwtHelperService } from './jwt-helper.service'; import { JwtHelperService } from './jwt-helper.service';
import { AppConfigService } from '../../app-config'; import { AppConfigService } from '../../app-config';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { AuthModule, JWT_STORAGE_SERVICE } from '../oidc/auth.module';
import { StorageService } from '../../common/services/storage.service';
describe('UserAccessService', () => { describe('UserAccessService', () => {
let userAccessService: UserAccessService; let userAccessService: UserAccessService;
@ -28,8 +30,8 @@ describe('UserAccessService', () => {
beforeEach(() => { beforeEach(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [HttpClientTestingModule], imports: [HttpClientTestingModule, AuthModule.forRoot({ useHash: true })],
providers: [UserAccessService] providers: [{ provide: JWT_STORAGE_SERVICE, useClass: StorageService }, UserAccessService]
}); });
userAccessService = TestBed.inject(UserAccessService); userAccessService = TestBed.inject(UserAccessService);
jwtHelperService = TestBed.inject(JwtHelperService); jwtHelperService = TestBed.inject(JwtHelperService);

View File

@ -1,6 +1,6 @@
<div class="adf-select-filter-input-container"> <div class="adf-select-filter-input-container">
<mat-form-field> <mat-form-field subscriptSizing="dynamic">
<input matInput <input matInput
autocomplete="off" autocomplete="off"
(keydown)="handleKeydown($event)" (keydown)="handleKeydown($event)"

View File

@ -53,7 +53,9 @@ export class ClipboardService {
this.document.execCommand('copy'); this.document.execCommand('copy');
} }
this.notify(message); this.notify(message);
} catch {} } catch {
/* empty */
}
} }
} }
@ -76,7 +78,9 @@ export class ClipboardService {
document.execCommand('copy'); document.execCommand('copy');
} }
this.notify(message); this.notify(message);
} catch {} } catch {
/* empty */
}
} }
private notify(message) { private notify(message) {

View File

@ -29,7 +29,7 @@ import { Subject } from 'rxjs';
providedIn: 'root' providedIn: 'root'
}) })
export class LogService { export class LogService {
get currentLogLevel() { get currentLogLevel(): number {
const configLevel: string = this.appConfig.get<string>(AppConfigValues.LOG_LEVEL); const configLevel: string = this.appConfig.get<string>(AppConfigValues.LOG_LEVEL);
if (configLevel) { if (configLevel) {
@ -171,7 +171,7 @@ export class LogService {
* @param level Level name * @param level Level name
* @returns Numeric log level * @returns Numeric log level
*/ */
getLogLevel(level: string): LogLevelsEnum { getLogLevel(level: string): number {
const referencedLevel = logLevels.find((currentLevel: any) => currentLevel.name.toLocaleLowerCase() === level.toLocaleLowerCase()); const referencedLevel = logLevels.find((currentLevel: any) => currentLevel.name.toLocaleLowerCase() === level.toLocaleLowerCase());
return referencedLevel ? referencedLevel.level : 5; return referencedLevel ? referencedLevel.level : 5;

View File

@ -22,19 +22,19 @@ export interface FileInfo {
} }
export class FileUtils { export class FileUtils {
static flatten(folder: any): Promise<FileInfo[]> { static flatten(folder: any): Promise<FileInfo[]> {
const reader = folder.createReader(); const reader = folder.createReader();
const files: FileInfo[] = []; const files: FileInfo[] = [];
return new Promise((resolve) => { return new Promise((resolve) => {
const iterations = []; const iterations = [];
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
(function traverse() { (function traverse() {
reader.readEntries((entries) => { reader.readEntries((entries) => {
if (!entries.length) { if (!entries.length) {
Promise.all(iterations).then(() => resolve(files)); Promise.all(iterations).then(() => resolve(files));
} else { } else {
iterations.push(Promise.all(entries.map((entry) => { iterations.push(
Promise.all(
entries.map((entry) => {
if (entry.isFile) { if (entry.isFile) {
return new Promise<void>((resolveFile) => { return new Promise<void>((resolveFile) => {
entry.file((file: File) => { entry.file((file: File) => {
@ -51,7 +51,9 @@ export class FileUtils {
files.push(...result); files.push(...result);
}); });
} }
}))); })
)
);
// Try calling traverse() again for the same dir, according to spec // Try calling traverse() again for the same dir, according to spec
traverse(); traverse();
} }

View File

@ -26,7 +26,7 @@
<button <button
data-automation-id="adf-dynamic-chip-list-view-more-button" data-automation-id="adf-dynamic-chip-list-view-more-button"
mat-button mat-button
[hidden]="!limitChipsDisplayed" [hidden]="chipsToDisplay.length === 0 || !limitChipsDisplayed"
[style.left.px]="viewMoreButtonLeftOffset" [style.left.px]="viewMoreButtonLeftOffset"
[style.top.px]="viewMoreButtonTop" [style.top.px]="viewMoreButtonTop"
class="adf-dynamic-chip-list-view-more-button" class="adf-dynamic-chip-list-view-more-button"

View File

@ -317,5 +317,15 @@ describe('DynamicChipListComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
expect(viewMoreButton.hidden).toBeTrue(); expect(viewMoreButton.hidden).toBeTrue();
})); }));
it('should not render View more button if there are no chips', fakeAsync(() => {
renderChips();
component.chips = [];
tick();
fixture.detectChanges();
expect(component.chipsToDisplay).toEqual([]);
expect(findViewMoreButton().hidden).toBeTrue();
}));
}); });
}); });

View File

@ -2,7 +2,6 @@
adf-layout-header .adf-toolbar-container-row { adf-layout-header .adf-toolbar-container-row {
color: var(--theme-header-text-color); color: var(--theme-header-text-color);
background-color: var(--theme-primary-color);
position: relative; position: relative;
padding: 0 24px; padding: 0 24px;

View File

@ -5,6 +5,13 @@ adf-layout-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
.adf-layout-container-sidenav {
overflow: hidden;
border-right: 1px solid var(--adf-theme-foreground-text-color-007);
background-color: var(--theme-background-color);
color: var(--adf-theme-foreground-text-color);
}
} }
.adf-container-full-width { .adf-container-full-width {
@ -26,13 +33,7 @@ adf-layout-container {
overflow: hidden; overflow: hidden;
} }
.adf-layout-container-sidenav { /* stylelint-disable selector-class-pattern, declaration-no-important */
overflow: hidden;
border-right: 1px solid var(--adf-theme-foreground-text-color-007);
background-color: var(--theme-background-color);
}
/* stylelint-disable selector-class-pattern */
#{$mat-sidenav-content}, #{$mat-sidenav-content},
#{$mat-drawer-transition} #{$mat-drawer-content} { #{$mat-drawer-transition} #{$mat-drawer-content} {
margin-left: 0 !important; margin-left: 0 !important;

View File

@ -1,6 +1,7 @@
<div (keyup)="onKeyPress($event)" tabindex="-1" role="button" class="adf-notification-history-container"> <div (keyup)="onKeyPress($event)" tabindex="-1" role="button" class="adf-notification-history-container">
<button mat-button <button mat-button
[matMenuTriggerFor]="menu" [matMenuTriggerFor]="menu"
aria-hidden="false"
[attr.aria-label]="'NOTIFICATIONS.OPEN_HISTORY' | translate" [attr.aria-label]="'NOTIFICATIONS.OPEN_HISTORY' | translate"
title="{{ 'NOTIFICATIONS.OPEN_HISTORY' | translate }}" title="{{ 'NOTIFICATIONS.OPEN_HISTORY' | translate }}"
class="adf-notification-history-menu_button" class="adf-notification-history-menu_button"

View File

@ -166,9 +166,12 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
private toggleSearch = new Subject<any>(); private toggleSearch = new Subject<any>();
private focusSubscription: Subscription; private focusSubscription: Subscription;
private valueChange = new Subject<string>(); private valueChange = new Subject<string>();
private toggleSubscription: Subscription;
toggle$ = this.toggleSearch.asObservable();
constructor(private userPreferencesService: UserPreferencesService) { constructor(private userPreferencesService: UserPreferencesService) {
this.toggleSearch.pipe(debounceTime(200), takeUntil(this.onDestroy$)).subscribe(() => { this.toggleSubscription = this.toggle$.pipe(debounceTime(200), takeUntil(this.onDestroy$)).subscribe(() => {
if (this.expandable) { if (this.expandable) {
this.subscriptAnimationState = this.toggleAnimation(); this.subscriptAnimationState = this.toggleAnimation();
if (this.subscriptAnimationState.value === 'inactive') { if (this.subscriptAnimationState.value === 'inactive') {
@ -302,6 +305,7 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
ngOnDestroy() { ngOnDestroy() {
if (this.toggleSearch) { if (this.toggleSearch) {
this.toggleSubscription.unsubscribe();
this.toggleSearch.complete(); this.toggleSearch.complete();
this.toggleSearch = null; this.toggleSearch = null;
} }

View File

@ -16,7 +16,7 @@
*/ */
import { APP_INITIALIZER, Injectable, NgModule } from '@angular/core'; import { APP_INITIALIZER, Injectable, NgModule } from '@angular/core';
import { AuthModule, RedirectAuthService } from '../auth'; import { AuthModule, JWT_STORAGE_SERVICE, RedirectAuthService } from '../auth';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { AppConfigService, StoragePrefixFactory } from '../app-config'; import { AppConfigService, StoragePrefixFactory } from '../app-config';
@ -47,7 +47,8 @@ export class NoopRedirectAuthService extends RedirectAuthService {
useFactory: loadAppConfig, useFactory: loadAppConfig,
deps: [AppConfigService, StorageService, AdfHttpClient, StoragePrefixFactory], deps: [AppConfigService, StorageService, AdfHttpClient, StoragePrefixFactory],
multi: true multi: true
} },
{ provide: JWT_STORAGE_SERVICE, useClass: StorageService }
] ]
}) })
export class NoopAuthModule {} export class NoopAuthModule {}

View File

@ -20,7 +20,7 @@ import { TranslateLoaderService } from './translate-loader.service';
import { TranslationService } from './translation.service'; import { TranslationService } from './translation.service';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { CoreModule } from '../core.module'; import { CoreModule } from '../core.module';
import { AuthModule } from '../auth'; import { AuthModule } from '../auth/oidc/auth.module';
declare let jasmine: any; declare let jasmine: any;
@ -30,14 +30,8 @@ describe('TranslateLoader', () => {
beforeEach(() => { beforeEach(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [ imports: [AuthModule.forRoot({ useHash: true }), TranslateModule.forRoot(), CoreModule.forRoot()],
AuthModule.forRoot({ useHash: true }), providers: [TranslationService]
TranslateModule.forRoot(),
CoreModule.forRoot()
],
providers: [
TranslationService
]
}); });
translationService = TestBed.inject(TranslationService); translationService = TestBed.inject(TranslationService);
customLoader = translationService.translate.currentLoader as TranslateLoaderService; customLoader = translationService.translate.currentLoader as TranslateLoaderService;

View File

@ -21,7 +21,8 @@
"sourceMap": true, "sourceMap": true,
"strictNullChecks": true, "strictNullChecks": true,
"target": "es2015", "target": "es2015",
"types": [] "typeRoots": ["node_modules/@types"],
"types": ["node"]
}, },
"include": [ "include": [
"migrations/**/*" "migrations/**/*"

View File

@ -20,7 +20,7 @@
"sourceMap": true, "sourceMap": true,
"strictNullChecks": true, "strictNullChecks": true,
"target": "es2015", "target": "es2015",
"types": [] "types": ["node"]
}, },
"include": [ "include": [
"schematics/**/*" "schematics/**/*"

View File

@ -4,14 +4,18 @@
"overrides": [ "overrides": [
{ {
"files": ["*.ts"], "files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular"], "extends": ["plugin:@nx/angular"],
"parserOptions": { "parserOptions": {
"project": ["lib/extensions/tsconfig.lib.json", "lib/extensions/tsconfig.spec.json"], "project": ["lib/extensions/tsconfig.lib.json", "lib/extensions/tsconfig.spec.json"],
"createDefaultProgram": true "createDefaultProgram": true
}, },
"rules": { "rules": {
"no-underscore-dangle": ["error", { "allowAfterThis": true }], "no-underscore-dangle": [
"error",
{
"allowAfterThis": true
}
],
"@angular-eslint/component-selector": [ "@angular-eslint/component-selector": [
"error", "error",
{ {
@ -64,7 +68,7 @@
}, },
{ {
"files": ["*.html"], "files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"], "extends": ["plugin:@nx/angular-template"],
"rules": { "rules": {
"@angular-eslint/template/no-autofocus": "error", "@angular-eslint/template/no-autofocus": "error",
"@angular-eslint/template/no-positive-tabindex": "error" "@angular-eslint/template/no-positive-tabindex": "error"

View File

@ -27,7 +27,6 @@ import { RuleService } from './rule.service';
import { ExtensionElement } from '../config/extension-element'; import { ExtensionElement } from '../config/extension-element';
import { BehaviorSubject, Observable } from 'rxjs'; import { BehaviorSubject, Observable } from 'rxjs';
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
/** /**
* The default extensions factory * The default extensions factory
* *
@ -47,7 +46,6 @@ export const EXTENSION_JSON_VALUES = new InjectionToken<string[][]>('extension-j
factory: extensionJsonsFactory factory: extensionJsonsFactory
}); });
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
/** /**
* Provides the extension json values for the angular modules * Provides the extension json values for the angular modules
* *

View File

@ -4,39 +4,32 @@
"overrides": [ "overrides": [
{ {
"files": ["*.ts"], "files": ["*.ts"],
"extends": [ "extends": ["plugin:@nx/angular"],
"plugin:@nrwl/nx/angular"
],
"parserOptions": { "parserOptions": {
"project": ["lib/insights/tsconfig.lib.json", "lib/insights/tsconfig.spec.json"], "project": ["lib/insights/tsconfig.lib.json", "lib/insights/tsconfig.spec.json"],
"createDefaultProgram": true "createDefaultProgram": true
}, },
"rules": { "rules": {
"no-underscore-dangle": ["error", { "allowAfterThis": true }], "no-underscore-dangle": [
"error",
{
"allowAfterThis": true
}
],
"@angular-eslint/no-output-native": "off", "@angular-eslint/no-output-native": "off",
"@angular-eslint/component-selector": [ "@angular-eslint/component-selector": [
"error", "error",
{ {
"type": "element", "type": "element",
"prefix": [ "prefix": ["adf", "app"],
"adf",
"app"
],
"style": "kebab-case" "style": "kebab-case"
} }
], ],
"@angular-eslint/directive-selector": [ "@angular-eslint/directive-selector": [
"error", "error",
{ {
"type": [ "type": ["element", "attribute"],
"element", "prefix": ["adf", "app"],
"attribute"
],
"prefix": [
"adf",
"app"
],
"style": "kebab-case" "style": "kebab-case"
} }
], ],
@ -77,7 +70,7 @@
}, },
{ {
"files": ["*.html"], "files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"], "extends": ["plugin:@nx/angular-template"],
"parserOptions": { "parserOptions": {
"project": ["lib/insights/tsconfig.lib.json", "lib/insights/tsconfig.spec.json"], "project": ["lib/insights/tsconfig.lib.json", "lib/insights/tsconfig.spec.json"],
"createDefaultProgram": true "createDefaultProgram": true

View File

@ -17,17 +17,13 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { import { AppConfigService, AppConfigServiceMock, AuthModule, JWT_STORAGE_SERVICE, NoopTranslateModule, StorageService } from '@alfresco/adf-core';
AppConfigService,
AppConfigServiceMock,
AuthModule,
NoopTranslateModule
} from '@alfresco/adf-core';
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services'; import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
@NgModule({ @NgModule({
imports: [AuthModule.forRoot({ useHash: true }), NoopAnimationsModule, NoopTranslateModule], imports: [AuthModule.forRoot({ useHash: true }), NoopAnimationsModule, NoopTranslateModule],
providers: [ providers: [
{ provide: JWT_STORAGE_SERVICE, useClass: StorageService },
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }, { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
{ provide: AppConfigService, useClass: AppConfigServiceMock } { provide: AppConfigService, useClass: AppConfigServiceMock }
], ],

View File

@ -4,9 +4,14 @@
"overrides": [ "overrides": [
{ {
"files": ["*.ts"], "files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular"], "extends": ["plugin:@nx/angular"],
"rules": { "rules": {
"no-underscore-dangle": ["warn", { "allowAfterThis": true }], "no-underscore-dangle": [
"warn",
{
"allowAfterThis": true
}
],
"@typescript-eslint/dot-notation": "off", "@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [ "@typescript-eslint/explicit-member-accessibility": [
"off", "off",
@ -30,7 +35,6 @@
"no-duplicate-imports": "error", "no-duplicate-imports": "error",
"no-multiple-empty-lines": "error", "no-multiple-empty-lines": "error",
"no-return-await": "error", "no-return-await": "error",
"unicorn/filename-case": "off", "unicorn/filename-case": "off",
"@typescript-eslint/no-unused-expressions": "off", "@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/consistent-type-assertions": "off", "@typescript-eslint/consistent-type-assertions": "off",

View File

@ -19,7 +19,6 @@
"superagent": "^9.0.1", "superagent": "^9.0.1",
"tslib": "^2.6.1" "tslib": "^2.6.1"
}, },
"main": "./index.js",
"typings": "./typings/index.d.ts", "typings": "./typings/index.d.ts",
"module": "./esm5/index.js", "module": "./esm5/index.js",
"es2015": "./esm2015/index.js" "es2015": "./esm2015/index.js"

View File

@ -4,9 +4,7 @@
"overrides": [ "overrides": [
{ {
"files": ["*.ts"], "files": ["*.ts"],
"extends": [ "extends": ["plugin:@nx/angular"],
"plugin:@nrwl/nx/angular"
],
"parserOptions": { "parserOptions": {
"project": ["lib/process-services-cloud/tsconfig.lib.json", "lib/process-services-cloud/tsconfig.spec.json"], "project": ["lib/process-services-cloud/tsconfig.lib.json", "lib/process-services-cloud/tsconfig.spec.json"],
"createDefaultProgram": true "createDefaultProgram": true
@ -17,7 +15,12 @@
"@typescript-eslint/consistent-type-assertions": "warn", "@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/prefer-for-of": "warn", "@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/member-ordering": "off", "@typescript-eslint/member-ordering": "off",
"no-underscore-dangle": ["error", { "allowAfterThis": true }], "no-underscore-dangle": [
"error",
{
"allowAfterThis": true
}
],
"no-shadow": "warn", "no-shadow": "warn",
"quote-props": "warn", "quote-props": "warn",
"object-shorthand": "warn", "object-shorthand": "warn",
@ -25,7 +28,6 @@
"arrow-body-style": "warn", "arrow-body-style": "warn",
"@angular-eslint/no-output-native": "off", "@angular-eslint/no-output-native": "off",
"space-before-function-paren": "warn", "space-before-function-paren": "warn",
"@angular-eslint/component-selector": [ "@angular-eslint/component-selector": [
"error", "error",
{ {
@ -78,7 +80,7 @@
}, },
{ {
"files": ["*.html"], "files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"], "extends": ["plugin:@nx/angular-template"],
"parserOptions": { "parserOptions": {
"project": ["lib/process-services-cloud/tsconfig.lib.json", "lib/process-services-cloud/tsconfig.spec.json"], "project": ["lib/process-services-cloud/tsconfig.lib.json", "lib/process-services-cloud/tsconfig.spec.json"],
"createDefaultProgram": true "createDefaultProgram": true

View File

@ -2,13 +2,9 @@ var rootPath = require('../../../.storybook/main');
module.exports = { module.exports = {
rootMain: rootPath, rootMain: rootPath,
stories: [...rootPath.stories, '../src/lib/**/*.stories.@(js|jsx|ts|tsx)'], stories: [...rootPath.stories, '../**/*.stories.@(js|jsx|ts|tsx)'],
staticDirs: [ staticDirs: [...rootPath.staticDirs, { from: __dirname + '/../src/lib/i18n', to: 'assets/adf-core/i18n' }],
...rootPath.staticDirs,
{ from: '../../core/src/lib/i18n', to: 'assets/adf-core/i18n' },
{ from: __dirname + '/../src/lib/i18n', to: 'assets/adf-process-services-cloud/i18n' }
],
addons: ['@storybook/addon-essentials', ...rootPath.addons], addons: ['@storybook/addon-essentials', ...rootPath.addons],
@ -17,11 +13,5 @@ module.exports = {
options: {} options: {}
}, },
docs: { docs: {}
autodocs: true
},
core: {
builder: '@storybook/builder-webpack5'
}
}; };

View File

@ -2,3 +2,4 @@ export const parameters = {
docs: { inlineStories: true }, docs: { inlineStories: true },
controls: { expanded: true } controls: { expanded: true }
}; };
export const tags = ['autodocs', 'autodocs'];

File diff suppressed because it is too large Load Diff

View File

@ -39,9 +39,9 @@
"@alfresco/js-api": ">=8.0.0-alpha.4-0", "@alfresco/js-api": ">=8.0.0-alpha.4-0",
"@alfresco/adf-core": ">=7.0.0-alpha.4-0", "@alfresco/adf-core": ">=7.0.0-alpha.4-0",
"@alfresco/adf-content-services": ">=7.0.0-alpha.4-0", "@alfresco/adf-content-services": ">=7.0.0-alpha.4-0",
"@apollo/client": "^3.7.2", "@apollo/client": ">=3.7.2",
"@ngx-translate/core": ">=14.0.0", "@ngx-translate/core": ">=14.0.0",
"apollo-angular": "^4.0.1", "apollo-angular": ">=4.0.1",
"subscriptions-transport-ws": "^0.11.0" "subscriptions-transport-ws": "^0.11.0"
}, },
"keywords": [ "keywords": [

View File

@ -60,12 +60,12 @@ import { FormCloudRepresentation } from '../models/form-cloud-representation.mod
import { FormCloudService } from '../services/form-cloud.service'; import { FormCloudService } from '../services/form-cloud.service';
import { DisplayModeService } from '../services/display-mode.service'; import { DisplayModeService } from '../services/display-mode.service';
import { FormCloudComponent } from './form-cloud.component'; import { FormCloudComponent } from './form-cloud.component';
import { ProcessServicesCloudModule } from '../../process-services-cloud.module';
import { MatButtonHarness } from '@angular/material/button/testing'; import { MatButtonHarness } from '@angular/material/button/testing';
import { FormCloudDisplayMode } from '../../services/form-fields.interfaces'; import { FormCloudDisplayMode } from '../../services/form-fields.interfaces';
import { CloudFormRenderingService } from './cloud-form-rendering.service'; import { CloudFormRenderingService } from './cloud-form-rendering.service';
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module'; import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
import { TaskVariableCloud } from '../models/task-variable-cloud.model'; import { TaskVariableCloud } from '../models/task-variable-cloud.model';
import { ProcessServicesCloudModule } from '../../process-services-cloud.module';
const mockOauth2Auth: any = { const mockOauth2Auth: any = {
oauth2Auth: { oauth2Auth: {

View File

@ -23,7 +23,6 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { HarnessLoader } from '@angular/cdk/testing'; import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { MatChipHarness } from '@angular/material/chips/testing'; import { MatChipHarness } from '@angular/material/chips/testing';
import { MatFormFieldHarness } from '@angular/material/form-field/testing';
describe('GroupCloudWidgetComponent', () => { describe('GroupCloudWidgetComponent', () => {
let fixture: ComponentFixture<GroupCloudWidgetComponent>; let fixture: ComponentFixture<GroupCloudWidgetComponent>;
@ -145,12 +144,6 @@ describe('GroupCloudWidgetComponent', () => {
value: mockSpaghetti value: mockSpaghetti
}); });
fixture.detectChanges();
await fixture.whenStable();
const formField = await loader.getHarness(MatFormFieldHarness);
expect(await formField.isDisabled()).toBeTrue();
const groupChip = await loader.getHarness(MatChipHarness); const groupChip = await loader.getHarness(MatChipHarness);
expect(await groupChip.isDisabled()).toBeTrue(); expect(await groupChip.isDisabled()).toBeTrue();
}); });
@ -166,12 +159,6 @@ describe('GroupCloudWidgetComponent', () => {
value: mockSpaghetti value: mockSpaghetti
}); });
fixture.detectChanges();
await fixture.whenStable();
const formField = await loader.getHarness(MatFormFieldHarness);
expect(await formField.isDisabled()).toBeTrue();
const groupChips = await loader.getAllHarnesses(MatChipHarness); const groupChips = await loader.getAllHarnesses(MatChipHarness);
expect(await groupChips[0].isDisabled()).toBeTrue(); expect(await groupChips[0].isDisabled()).toBeTrue();
expect(await groupChips[1].isDisabled()).toBeTrue(); expect(await groupChips[1].isDisabled()).toBeTrue();

View File

@ -24,8 +24,7 @@ import { IdentityUserService } from '../../../../people/services/identity-user.s
import { mockShepherdsPie, mockYorkshirePudding } from '../../../../people/mock/people-cloud.mock'; import { mockShepherdsPie, mockYorkshirePudding } from '../../../../people/mock/people-cloud.mock';
import { HarnessLoader } from '@angular/cdk/testing'; import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { MatFormFieldHarness } from '@angular/material/form-field/testing'; import { MatChipRowHarness } from '@angular/material/chips/testing';
import { MatChipHarness } from '@angular/material/chips/testing';
describe('PeopleCloudWidgetComponent', () => { describe('PeopleCloudWidgetComponent', () => {
let fixture: ComponentFixture<PeopleCloudWidgetComponent>; let fixture: ComponentFixture<PeopleCloudWidgetComponent>;
@ -174,12 +173,8 @@ describe('PeopleCloudWidgetComponent', () => {
value: mockSpaghetti value: mockSpaghetti
}); });
fixture.detectChanges(); const peopleChip = await loader.getHarness(MatChipRowHarness);
const formField = await loader.getHarness(MatFormFieldHarness);
expect(await formField.isDisabled()).toBeTrue();
const peopleChip = await loader.getHarness(MatChipHarness);
expect(await peopleChip.isDisabled()).toBeTrue(); expect(await peopleChip.isDisabled()).toBeTrue();
}); });
@ -194,11 +189,7 @@ describe('PeopleCloudWidgetComponent', () => {
value: mockSpaghetti value: mockSpaghetti
}); });
fixture.detectChanges(); const peopleChip = await loader.getAllHarnesses(MatChipRowHarness);
const formField = await loader.getHarness(MatFormFieldHarness);
expect(await formField.isDisabled()).toBeTrue();
const peopleChip = await loader.getAllHarnesses(MatChipHarness);
expect(await peopleChip[0].isDisabled()).toBeTrue(); expect(await peopleChip[0].isDisabled()).toBeTrue();
expect(await peopleChip[1].isDisabled()).toBeTrue(); expect(await peopleChip[1].isDisabled()).toBeTrue();
}); });

View File

@ -66,7 +66,9 @@ export class ContentCloudNodeSelectorService {
if (destinationFolderPath.alias && destinationFolderPath.path) { if (destinationFolderPath.alias && destinationFolderPath.path) {
try { try {
return await this.getNodeId(destinationFolderPath.alias, destinationFolderPath.path).toPromise(); return await this.getNodeId(destinationFolderPath.alias, destinationFolderPath.path).toPromise();
} catch {} } catch {
/*empty*/
}
} }
return this.getNodeId(destinationFolderPath.alias).toPromise(); return this.getNodeId(destinationFolderPath.alias).toPromise();
@ -82,7 +84,9 @@ export class ContentCloudNodeSelectorService {
if (nodeId) { if (nodeId) {
try { try {
isExistingNode = await this.getNodeId(nodeId).pipe(mapTo(true)).toPromise(); isExistingNode = await this.getNodeId(nodeId).pipe(mapTo(true)).toPromise();
} catch {} } catch {
/*empty*/
}
} }
return isExistingNode; return isExistingNode;
} }

View File

@ -1,12 +1,13 @@
<form> <form>
<mat-form-field class="adf-cloud-group" [class.adf-invalid]="hasError() && isDirty()"> <mat-form-field class="adf-cloud-group" [class.adf-invalid]="hasError() && isDirty()">
<ng-content select="[label]"></ng-content> <ng-content select="[label]"></ng-content>
<mat-chip-grid #groupChipList [disabled]="isReadonly() || isValidationLoading()" data-automation-id="adf-cloud-group-chip-list"> <mat-chip-grid #groupChipList data-automation-id="adf-cloud-group-chip-list">
<mat-chip-row <mat-chip-row
*ngFor="let group of selectedGroups" *ngFor="let group of selectedGroups"
[removable]="!(group.readonly)" [removable]="!(group.readonly)"
[attr.data-automation-id]="'adf-cloud-group-chip-' + group.name" [attr.data-automation-id]="'adf-cloud-group-chip-' + group.name"
(removed)="onRemove(group)" (removed)="onRemove(group)"
[disabled]="isReadonly() || isValidationLoading()"
title="{{ (group.readonly ? 'ADF_CLOUD_GROUPS.MANDATORY' : '') | translate }}"> title="{{ (group.readonly ? 'ADF_CLOUD_GROUPS.MANDATORY' : '') | translate }}">
{{group.name}} {{group.name}}
<mat-icon <mat-icon

View File

@ -26,7 +26,7 @@ import { IdentityGroupService } from '../services/identity-group.service';
import { mockFoodGroups, mockMeatChicken, mockVegetableAubergine } from '../mock/group-cloud.mock'; import { mockFoodGroups, mockMeatChicken, mockVegetableAubergine } from '../mock/group-cloud.mock';
import { HarnessLoader } from '@angular/cdk/testing'; import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { MatChipGridHarness, MatChipHarness } from '@angular/material/chips/testing'; import { MatChipHarness } from '@angular/material/chips/testing';
import { MatIconHarness } from '@angular/material/icon/testing'; import { MatIconHarness } from '@angular/material/icon/testing';
import { MatInputHarness } from '@angular/material/input/testing'; import { MatInputHarness } from '@angular/material/input/testing';
@ -357,9 +357,7 @@ describe('GroupCloudComponent', () => {
const chips = await loader.getAllHarnesses(MatChipHarness); const chips = await loader.getAllHarnesses(MatChipHarness);
expect(chips.length).toBe(1); expect(chips.length).toBe(1);
expect(await chips[0].isDisabled()).toBe(true);
const chipList = await loader.getHarness(MatChipGridHarness);
expect(await chipList.isDisabled()).toBe(true);
}); });
it('should chip list be disabled and show all the chips - multiple mode', async () => { it('should chip list be disabled and show all the chips - multiple mode', async () => {
@ -372,9 +370,8 @@ describe('GroupCloudComponent', () => {
const chips = await loader.getAllHarnesses(MatChipHarness); const chips = await loader.getAllHarnesses(MatChipHarness);
expect(chips.length).toBe(2); expect(chips.length).toBe(2);
expect(await chips[0].isDisabled()).toBe(true);
const chipList = await loader.getHarness(MatChipGridHarness); expect(await chips[1].isDisabled()).toBe(true);
expect(await chipList.isDisabled()).toBe(true);
}); });
}); });
}); });

View File

@ -8,12 +8,13 @@
> >
<ng-content *ngIf="!title" select="[label]"></ng-content> <ng-content *ngIf="!title" select="[label]"></ng-content>
<mat-label *ngIf="title">{{ title | translate }}</mat-label> <mat-label *ngIf="title">{{ title | translate }}</mat-label>
<mat-chip-grid #userMultipleChipList [disabled]="isReadonly() || isValidationLoading()" data-automation-id="adf-cloud-people-chip-list"> <mat-chip-grid #userMultipleChipList data-automation-id="adf-cloud-people-chip-list">
<mat-chip-row <mat-chip-row
*ngFor="let user of selectedUsers" *ngFor="let user of selectedUsers"
[removable]="!(user.readonly)" [removable]="!(user.readonly)"
[attr.data-automation-id]="'adf-people-cloud-chip-' + user.username" [attr.data-automation-id]="'adf-people-cloud-chip-' + user.username"
(removed)="onRemove(user)" (removed)="onRemove(user)"
[disabled]="isReadonly() || isValidationLoading()"
title="{{ (user.readonly ? 'ADF_CLOUD_GROUPS.MANDATORY' : '') | translate }}"> title="{{ (user.readonly ? 'ADF_CLOUD_GROUPS.MANDATORY' : '') | translate }}">
{{user | fullName}} {{user | fullName}}
<mat-icon <mat-icon
@ -38,7 +39,6 @@
> >
</mat-chip-grid> </mat-chip-grid>
<mat-autocomplete autoActiveFirstOption class="adf-people-cloud-list" <mat-autocomplete autoActiveFirstOption class="adf-people-cloud-list"
#auto="matAutocomplete" #auto="matAutocomplete"
(optionSelected)="onSelect($event.option.value)" (optionSelected)="onSelect($event.option.value)"

View File

@ -28,7 +28,7 @@ import { IDENTITY_USER_SERVICE_TOKEN } from '../services/identity-user-service.t
import { mockFoodUsers, mockKielbasaSausage, mockShepherdsPie, mockYorkshirePudding, mockPreselectedFoodUsers } from '../mock/people-cloud.mock'; import { mockFoodUsers, mockKielbasaSausage, mockShepherdsPie, mockYorkshirePudding, mockPreselectedFoodUsers } from '../mock/people-cloud.mock';
import { HarnessLoader } from '@angular/cdk/testing'; import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { MatChipGridHarness, MatChipHarness } from '@angular/material/chips/testing'; import { MatChipHarness } from '@angular/material/chips/testing';
import { MatInputHarness } from '@angular/material/input/testing'; import { MatInputHarness } from '@angular/material/input/testing';
import { MatFormFieldHarness } from '@angular/material/form-field/testing'; import { MatFormFieldHarness } from '@angular/material/form-field/testing';
@ -406,9 +406,7 @@ describe('PeopleCloudComponent', () => {
const chips = await loader.getAllHarnesses(MatChipHarness); const chips = await loader.getAllHarnesses(MatChipHarness);
expect(chips.length).toBe(1); expect(chips.length).toBe(1);
expect(await chips[0].isDisabled()).toBe(true);
const chipList = await loader.getHarness(MatChipGridHarness);
expect(await chipList.isDisabled()).toBe(true);
}); });
it('should chip list be disabled and show mat chips for all the preselected users - multiple mode', async () => { it('should chip list be disabled and show mat chips for all the preselected users - multiple mode', async () => {
@ -421,9 +419,8 @@ describe('PeopleCloudComponent', () => {
const chips = await loader.getAllHarnesses(MatChipHarness); const chips = await loader.getAllHarnesses(MatChipHarness);
expect(chips.length).toBe(2); expect(chips.length).toBe(2);
expect(await chips[0].isDisabled()).toBe(true);
const chipList = await loader.getHarness(MatChipGridHarness); expect(await chips[1].isDisabled()).toBe(true);
expect(await chipList.isDisabled()).toBe(true);
}); });
}); });
}); });

View File

@ -16,7 +16,7 @@
*/ */
import { AlfrescoApiService } from '@alfresco/adf-content-services'; import { AlfrescoApiService } from '@alfresco/adf-content-services';
import { ADF_DATE_FORMATS, FullNamePipe, NoopTranslateModule, UserPreferencesService } from '@alfresco/adf-core'; import { ADF_DATE_FORMATS, FullNamePipe, NoopAuthModule, NoopTranslateModule, UserPreferencesService } from '@alfresco/adf-core';
import { HarnessLoader } from '@angular/cdk/testing'; import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { SimpleChange } from '@angular/core'; import { SimpleChange } from '@angular/core';
@ -101,6 +101,7 @@ describe('EditProcessFilterCloudComponent', () => {
beforeEach(() => { beforeEach(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [ imports: [
NoopAuthModule,
MatIconTestingModule, MatIconTestingModule,
MatDialogModule, MatDialogModule,
NoopTranslateModule, NoopTranslateModule,

View File

@ -24,7 +24,9 @@ import {
TranslationService, TranslationService,
TranslationMock, TranslationMock,
CoreModule, CoreModule,
AuthModule AuthModule,
JWT_STORAGE_SERVICE,
StorageService
} from '@alfresco/adf-core'; } from '@alfresco/adf-core';
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services'; import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
@ -44,7 +46,8 @@ import { RouterTestingModule } from '@angular/router/testing';
providers: [ providers: [
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }, { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
{ provide: AppConfigService, useClass: AppConfigServiceMock }, { provide: AppConfigService, useClass: AppConfigServiceMock },
{ provide: TranslationService, useClass: TranslationMock } { provide: TranslationService, useClass: TranslationMock },
{ provide: JWT_STORAGE_SERVICE, useClass: StorageService }
], ],
exports: [NoopAnimationsModule, TranslateModule, CoreModule, ProcessServicesCloudModule] exports: [NoopAnimationsModule, TranslateModule, CoreModule, ProcessServicesCloudModule]
}) })

View File

@ -4,7 +4,7 @@
"overrides": [ "overrides": [
{ {
"files": ["*.ts"], "files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular"], "extends": ["plugin:@nx/angular"],
"parserOptions": { "parserOptions": {
"project": ["lib/process-services/tsconfig.lib.json", "lib/process-services/tsconfig.spec.json"], "project": ["lib/process-services/tsconfig.lib.json", "lib/process-services/tsconfig.spec.json"],
"createDefaultProgram": true "createDefaultProgram": true
@ -14,7 +14,12 @@
"@typescript-eslint/naming-convention": "warn", "@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/consistent-type-assertions": "warn", "@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/prefer-for-of": "warn", "@typescript-eslint/prefer-for-of": "warn",
"no-underscore-dangle": ["error", { "allowAfterThis": true }], "no-underscore-dangle": [
"error",
{
"allowAfterThis": true
}
],
"no-shadow": "warn", "no-shadow": "warn",
"quote-props": "warn", "quote-props": "warn",
"object-shorthand": "warn", "object-shorthand": "warn",
@ -22,7 +27,6 @@
"arrow-body-style": "warn", "arrow-body-style": "warn",
"@angular-eslint/no-output-native": "off", "@angular-eslint/no-output-native": "off",
"space-before-function-paren": "warn", "space-before-function-paren": "warn",
"@angular-eslint/component-selector": [ "@angular-eslint/component-selector": [
"error", "error",
{ {
@ -75,7 +79,7 @@
}, },
{ {
"files": ["*.html"], "files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"], "extends": ["plugin:@nx/angular-template"],
"parserOptions": { "parserOptions": {
"project": ["lib/process-services/tsconfig.lib.json", "lib/process-services/tsconfig.spec.json"], "project": ["lib/process-services/tsconfig.lib.json", "lib/process-services/tsconfig.spec.json"],
"createDefaultProgram": true "createDefaultProgram": true

View File

@ -20,6 +20,7 @@ adf-process-instance-filters {
.adf-filter-action-button__label { .adf-filter-action-button__label {
padding-left: 20px; padding-left: 20px;
margin: 0 8px; margin: 0 8px;
color: var(--theme-action-button-text-color);
} }
} }
} }

View File

@ -20,6 +20,7 @@ adf-task-filters {
.adf-filter-action-button__label { .adf-filter-action-button__label {
padding-left: 20px; padding-left: 20px;
margin: 0 8px; margin: 0 8px;
color: var(--theme-action-button-text-color);
} }
} }
} }

View File

@ -4,12 +4,14 @@ module.exports = {
...rootMain, ...rootMain,
framework: "@storybook/angular", framework: "@storybook/angular",
core: { ...rootMain.core, builder: 'webpack5' }, core: { ...rootMain.core, builder: 'webpack5' },
stories: [ stories: [
...rootMain.stories, ...rootMain.stories,
'../../core/**/*.stories.@(js|jsx|ts|tsx)', '../../core/**/*.stories.@(js|jsx|ts|tsx)',
'../../content-services/**/*.stories.@(js|jsx|ts|tsx)', '../../content-services/**/*.stories.@(js|jsx|ts|tsx)',
'../../process-services-cloud/**/*.stories.@(js|jsx|ts|tsx)' '../../process-services-cloud/**/*.stories.@(js|jsx|ts|tsx)'
], ],
staticDirs: [ staticDirs: [
...rootMain.staticDirs, ...rootMain.staticDirs,
{ from: '../../core/src/lib/i18n', to: 'assets/adf-core/i18n' }, { from: '../../core/src/lib/i18n', to: 'assets/adf-core/i18n' },
@ -17,5 +19,8 @@ module.exports = {
{ from: '../../content-services/src/lib/i18n', to: 'assets/adf-content-services/i18n' }, { from: '../../content-services/src/lib/i18n', to: 'assets/adf-content-services/i18n' },
{ from: '../../process-services-cloud/src/lib/i18n', to: 'assets/adf-process-services-cloud/i18n' } { from: '../../process-services-cloud/src/lib/i18n', to: 'assets/adf-process-services-cloud/i18n' }
], ],
addons: ['@storybook/addon-essentials', ...rootMain.addons]
addons: ['@storybook/addon-essentials', ...rootMain.addons],
docs: {}
}; };

View File

@ -2,3 +2,4 @@ export const parameters = {
docs: { inlineStories: true }, docs: { inlineStories: true },
controls: { expanded: true } controls: { expanded: true }
}; };
export const tags = ['autodocs', 'autodocs'];

View File

@ -4,7 +4,7 @@
"overrides": [ "overrides": [
{ {
"files": ["*.ts"], "files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular"], "extends": ["plugin:@nx/angular"],
"parserOptions": { "parserOptions": {
"project": ["lib/testing/tsconfig.lib.json"], "project": ["lib/testing/tsconfig.lib.json"],
"createDefaultProgram": true "createDefaultProgram": true
@ -67,7 +67,7 @@
"project": ["lib/testing/tsconfig.lib.json"], "project": ["lib/testing/tsconfig.lib.json"],
"createDefaultProgram": true "createDefaultProgram": true
}, },
"extends": ["plugin:@nrwl/nx/angular-template"], "extends": ["plugin:@nx/angular-template"],
"rules": {} "rules": {}
} }
] ]

View File

@ -22,7 +22,6 @@ import { Logger } from '../../utils/logger';
import { browser } from 'protractor'; import { browser } from 'protractor';
export class GroupIdentityService { export class GroupIdentityService {
api: ApiService; api: ApiService;
constructor(api: ApiService) { constructor(api: ApiService) {
@ -75,9 +74,11 @@ export class GroupIdentityService {
Logger.log(`Data ${JSON.stringify(data)}`); Logger.log(`Data ${JSON.stringify(data)}`);
return data[0]; Logger.error('Group not found'); return data[0];
Logger.error('Group not found');
} catch (error) { } catch (error) {
Logger.error('Group not found');
return null;
} }
}; };
@ -135,5 +136,4 @@ export class GroupIdentityService {
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody); const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data[0].id; return data[0].id;
} }
} }

View File

@ -388,7 +388,9 @@ export class DataTableComponentPage {
this.rootElement.element(by.tagName(materialLocators.Progress.spinner.root)), this.rootElement.element(by.tagName(materialLocators.Progress.spinner.root)),
MAX_LOADING_TIME MAX_LOADING_TIME
); );
} catch (error) {} } catch (error) {
Logger.error('Loading spinner is not present');
}
if (await this.isEmpty()) { if (await this.isEmpty()) {
Logger.log('empty page'); Logger.log('empty page');
@ -414,7 +416,9 @@ export class DataTableComponentPage {
try { try {
Logger.log('wait datatable loading spinner is present'); Logger.log('wait datatable loading spinner is present');
await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName(materialLocators.Progress.bar.root))); await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName(materialLocators.Progress.bar.root)));
} catch (error) {} } catch (error) {
Logger.error('Infinite pagination spinner is not present');
}
if (await this.isEmpty()) { if (await this.isEmpty()) {
Logger.log('empty page'); Logger.log('empty page');
} else { } else {

View File

@ -43,6 +43,7 @@ export class LoginPage {
try { try {
currentUrl = await browser.getCurrentUrl(); currentUrl = await browser.getCurrentUrl();
} catch (e) { } catch (e) {
/* do nothing */
} }
if (!currentUrl || currentUrl.indexOf(this.loginUrl) === -1) { if (!currentUrl || currentUrl.indexOf(this.loginUrl) === -1) {

View File

@ -212,7 +212,8 @@ export const materialLocators = {
class: '.mat-expansion-panel-header', class: '.mat-expansion-panel-header',
root: 'mat-expansion-panel-header' root: 'mat-expansion-panel-header'
}, },
title: '.mat-expansion-panel-header-title' title: '.mat-expansion-panel-header-title',
expanded: '.mat-expanded'
}, },
indicator: '.mat-expansion-indicator' indicator: '.mat-expansion-indicator'
}, },

View File

@ -75,7 +75,9 @@ export class ViewerPage {
Logger.log('wait spinner is present'); Logger.log('wait spinner is present');
await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName(materialLocators.Progress.spinner.root))); await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName(materialLocators.Progress.spinner.root)));
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName(materialLocators.Progress.spinner.root)), MAX_LOADING_TIME); await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName(materialLocators.Progress.spinner.root)), MAX_LOADING_TIME);
} catch (error) {} } catch (error) {
Logger.error('Spinner is not present');
}
} }
} }

View File

@ -22,7 +22,6 @@ import { ApiService } from '../../../shared/api/api.service';
import { ApiUtil } from '../../../shared/api/api.util'; import { ApiUtil } from '../../../shared/api/api.util';
export class Application { export class Application {
requestApiHelper: E2eRequestApiHelper; requestApiHelper: E2eRequestApiHelper;
endPoint = `/deployment-service/v1/applications/`; endPoint = `/deployment-service/v1/applications/`;
@ -57,6 +56,7 @@ export class Application {
return this.requestApiHelper.delete(`${this.endPoint}${applicationName}`); return this.requestApiHelper.delete(`${this.endPoint}${applicationName}`);
} catch (error) { } catch (error) {
Logger.error(`[Application] Undeploy application ${applicationName} failed with error: ${error.message}`); Logger.error(`[Application] Undeploy application ${applicationName} failed with error: ${error.message}`);
return null;
} }
}; };
return ApiUtil.waitForApi(apiCall, isApplicationUndeployed, 10, 3000); return ApiUtil.waitForApi(apiCall, isApplicationUndeployed, 10, 3000);

View File

@ -23,7 +23,6 @@ import { ApiUtil } from '../../../shared/api/api.util';
import { ApiService } from '../../../shared/api/api.service'; import { ApiService } from '../../../shared/api/api.service';
export class Descriptor { export class Descriptor {
requestApiHelper: E2eRequestApiHelper; requestApiHelper: E2eRequestApiHelper;
endPoint = `deployment-service/v1/descriptors/`; endPoint = `deployment-service/v1/descriptors/`;
@ -61,6 +60,7 @@ export class Descriptor {
return this.requestApiHelper.delete(`${this.endPoint}${name}`); return this.requestApiHelper.delete(`${this.endPoint}${name}`);
} catch (error) { } catch (error) {
Logger.error(`[Descriptor] Delete descriptor ${name} failed with error: ${error.message}`); Logger.error(`[Descriptor] Delete descriptor ${name} failed with error: ${error.message}`);
return null;
} }
}; };
return ApiUtil.waitForApi(apiCall, isDescriptorDeleted, 10, 15000); return ApiUtil.waitForApi(apiCall, isDescriptorDeleted, 10, 15000);

View File

@ -36,7 +36,6 @@ export interface FilterProps {
} }
export class EditProcessFilterCloudComponentPage { export class EditProcessFilterCloudComponentPage {
rootElement = $$('adf-cloud-edit-process-filter').first(); rootElement = $$('adf-cloud-edit-process-filter').first();
customiseFilter = $('#adf-edit-process-filter-sub-title-id'); customiseFilter = $('#adf-edit-process-filter-sub-title-id');
saveButton = $('button[data-automation-id="adf-filter-action-save"]'); saveButton = $('button[data-automation-id="adf-filter-action-save"]');
@ -48,17 +47,29 @@ export class EditProcessFilterCloudComponentPage {
statusDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-status']`)); statusDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-status']`));
sortDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-sort']`)); sortDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-sort']`));
orderDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-order']`)); orderDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-order']`));
processDefinitionNameDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-processDefinitionName']`)); processDefinitionNameDropdown = new DropdownPage(
suspendedDateRangeDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-suspendedDateRange']`)); $(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-processDefinitionName']`)
startedDateRangeDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-startedDateRange']`)); );
completedDateRangeDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-completedDateRange']`)); suspendedDateRangeDropdown = new DropdownPage(
suspendedDateRangeWithin = new DatePickerPage($(`${materialLocators.Datepicker.toggle.root}[data-automation-id='adf-cloud-edit-process-property-date-range-suspendedDateRange']`)); $(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-suspendedDateRange']`)
);
startedDateRangeDropdown = new DropdownPage(
$(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-startedDateRange']`)
);
completedDateRangeDropdown = new DropdownPage(
$(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-completedDateRange']`)
);
suspendedDateRangeWithin = new DatePickerPage(
$(`${materialLocators.Datepicker.toggle.root}[data-automation-id='adf-cloud-edit-process-property-date-range-suspendedDateRange']`)
);
peopleCloudComponent = new PeopleCloudComponentPage(); peopleCloudComponent = new PeopleCloudComponentPage();
editProcessFilterDialogPage = new EditProcessFilterDialogPage(); editProcessFilterDialogPage = new EditProcessFilterDialogPage();
private expansionPanelExtended = this.rootElement.$(`${materialLocators.Expansion.panel.header.root}${materialLocators.Expanded.class}`); private expansionPanelExtended = this.rootElement.$(`${materialLocators.Expansion.panel.header.root}${materialLocators.Expanded.class}`);
private content = TestElement.byCss(`adf-cloud-edit-process-filter ${materialLocators.Expansion.panel.root} [style*="visible"]`); private content = TestElement.byCss(
`adf-cloud-edit-process-filter ${materialLocators.Expansion.panel.root}${materialLocators.Expansion.panel.expanded} ${materialLocators.Expansion.panel.content.class}`
);
editProcessFilterDialog(): EditProcessFilterDialogPage { editProcessFilterDialog(): EditProcessFilterDialogPage {
return this.editProcessFilterDialogPage; return this.editProcessFilterDialogPage;

View File

@ -28,7 +28,6 @@ import { materialLocators } from '../../public-api';
export type StatusType = 'All' | 'Created' | 'Assigned' | 'Cancelled' | 'Suspended' | 'Completed'; export type StatusType = 'All' | 'Created' | 'Assigned' | 'Cancelled' | 'Suspended' | 'Completed';
export class EditTaskFilterCloudComponentPage { export class EditTaskFilterCloudComponentPage {
rootElement = $$('adf-cloud-edit-task-filter').first(); rootElement = $$('adf-cloud-edit-task-filter').first();
customiseFilter = $('#adf-edit-task-filter-sub-title-id'); customiseFilter = $('#adf-edit-task-filter-sub-title-id');
assignee = $('input[data-automation-id="adf-cloud-edit-task-property-assignee"]'); assignee = $('input[data-automation-id="adf-cloud-edit-task-property-assignee"]');
@ -51,13 +50,23 @@ export class EditTaskFilterCloudComponentPage {
sortDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-task-property-sort']`)); sortDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-task-property-sort']`));
priorityDropdown = new DropdownPage(this.priority); priorityDropdown = new DropdownPage(this.priority);
orderDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-task-property-order']`)); orderDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-task-property-order']`));
completedDateDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id="adf-cloud-edit-process-property-completedDateRange"]`)); completedDateDropdown = new DropdownPage(
$(`${materialLocators.Select.root}[data-automation-id="adf-cloud-edit-process-property-completedDateRange"]`)
);
assignmentDropdown = new DropdownPage($(`.adf-task-assignment-filter`)); assignmentDropdown = new DropdownPage($(`.adf-task-assignment-filter`));
processDefinitionNameDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id="adf-cloud-edit-task-property-processDefinitionName"]`)); processDefinitionNameDropdown = new DropdownPage(
createdDateRangeDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-createdDateRange']`)); $(`${materialLocators.Select.root}[data-automation-id="adf-cloud-edit-task-property-processDefinitionName"]`)
createdDateRangeWithin = new DatePickerPage($(`${materialLocators.Datepicker.toggle.root}[data-automation-id='adf-cloud-edit-process-property-date-range-createdDateRange']`)); );
createdDateRangeDropdown = new DropdownPage(
$(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-createdDateRange']`)
);
createdDateRangeWithin = new DatePickerPage(
$(`${materialLocators.Datepicker.toggle.root}[data-automation-id='adf-cloud-edit-process-property-date-range-createdDateRange']`)
);
dueDateRangeDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-dueDateRange']`)); dueDateRangeDropdown = new DropdownPage($(`${materialLocators.Select.root}[data-automation-id='adf-cloud-edit-process-property-dueDateRange']`));
dueDateRangeWithin = new DatePickerPage($(`${materialLocators.Datepicker.toggle.root}[data-automation-id='adf-cloud-edit-picker-date-range-dueDateRange']`)); dueDateRangeWithin = new DatePickerPage(
$(`${materialLocators.Datepicker.toggle.root}[data-automation-id='adf-cloud-edit-picker-date-range-dueDateRange']`)
);
peopleCloudComponent = new PeopleCloudComponentPage(); peopleCloudComponent = new PeopleCloudComponentPage();
groupCloudComponent = new GroupCloudComponentPage(); groupCloudComponent = new GroupCloudComponentPage();
@ -65,7 +74,9 @@ export class EditTaskFilterCloudComponentPage {
dataTable = new DataTableComponentPage($('adf-cloud-task-list')); dataTable = new DataTableComponentPage($('adf-cloud-task-list'));
private expansionPanelExtended = this.rootElement.$(`${materialLocators.Expansion.panel.header.root}${materialLocators.Expanded.class}`); private expansionPanelExtended = this.rootElement.$(`${materialLocators.Expansion.panel.header.root}${materialLocators.Expanded.class}`);
private content = this.rootElement.$(`div${materialLocators.Expansion.panel.content.class}[style*="visible"]`); private content = this.rootElement.$(
`${materialLocators.Expansion.panel.root}${materialLocators.Expansion.panel.expanded} ${materialLocators.Expansion.panel.content.class}`
);
async isFilterDisplayed(): Promise<boolean> { async isFilterDisplayed(): Promise<boolean> {
return BrowserVisibility.waitUntilElementIsVisible(this.filter); return BrowserVisibility.waitUntilElementIsVisible(this.filter);
@ -307,5 +318,4 @@ export class EditTaskFilterCloudComponentPage {
async getProcessInstanceId(): Promise<string> { async getProcessInstanceId(): Promise<string> {
return BrowserActions.getInputValue(this.processInstanceId); return BrowserActions.getInputValue(this.processInstanceId);
} }
} }

View File

@ -33,7 +33,7 @@ export class LogLevelsEnum extends Number {
static SILENT: number = 0; static SILENT: number = 0;
} }
export const logLevels: { level: LogLevelsEnum; name: LOG_LEVEL }[] = [ export const logLevels: { level: number; name: LOG_LEVEL }[] = [
{ level: LogLevelsEnum.TRACE, name: 'TRACE' }, { level: LogLevelsEnum.TRACE, name: 'TRACE' },
{ level: LogLevelsEnum.DEBUG, name: 'DEBUG' }, { level: LogLevelsEnum.DEBUG, name: 'DEBUG' },
{ level: LogLevelsEnum.INFO, name: 'INFO' }, { level: LogLevelsEnum.INFO, name: 'INFO' },
@ -51,8 +51,7 @@ export interface LoggerLike {
/* eslint-disable no-console */ /* eslint-disable no-console */
export class GenericLogger implements LoggerLike { export class GenericLogger implements LoggerLike {
private level: number;
private level: LogLevelsEnum;
constructor(logLevel: string) { constructor(logLevel: string) {
this.level = logLevels.find(({ name }) => name === logLevel)?.level || LogLevelsEnum.ERROR; this.level = logLevels.find(({ name }) => name === logLevel)?.level || LogLevelsEnum.ERROR;

21
nx.json
View File

@ -1,5 +1,6 @@
{ {
"npmScope": "adf", "npmScope": "adf",
"defaultProject": "demoshell",
"affected": { "affected": {
"defaultBase": "develop" "defaultBase": "develop"
}, },
@ -13,6 +14,14 @@
"production", "production",
"^production" "^production"
] ]
},
"build-storybook": {
"inputs": [
"default",
"^production",
"{projectRoot}/.storybook/**/*",
"{projectRoot}/tsconfig.storybook.json"
]
} }
}, },
"tasksRunnerOptions": { "tasksRunnerOptions": {
@ -34,7 +43,14 @@
}, },
"namedInputs": { "namedInputs": {
"default": [ "default": [
"{projectRoot}/**/*" "{projectRoot}/**/*",
"sharedGlobals"
],
"sharedGlobals": [
"{workspaceRoot}/angular.json",
"{workspaceRoot}/demo-shell/src/index.html",
"{workspaceRoot}/e2e/protractor.excludes.json",
"{workspaceRoot}/e2e/protractor.conf.js"
], ],
"production": [ "production": [
"default", "default",
@ -42,7 +58,8 @@
"!{projectRoot}/**/*.stories.@(js|jsx|ts|tsx|mdx)", "!{projectRoot}/**/*.stories.@(js|jsx|ts|tsx|mdx)",
"!{projectRoot}/**/*.spec.[jt]s", "!{projectRoot}/**/*.spec.[jt]s",
"!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/karma.conf.js" "!{projectRoot}/karma.conf.js",
"!{projectRoot}/tsconfig.storybook.json"
] ]
} }
} }

24099
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -29,28 +29,28 @@
"process services-cloud" "process services-cloud"
], ],
"dependencies": { "dependencies": {
"@angular/animations": "15.2.10", "@angular/animations": "16.2.9",
"@angular/cdk": "15.2.9", "@angular/cdk": "16.2.9",
"@angular/common": "15.2.10", "@angular/common": "16.2.9",
"@angular/compiler": "15.2.10", "@angular/compiler": "16.2.9",
"@angular/core": "15.2.10", "@angular/core": "16.2.9",
"@angular/forms": "15.2.10", "@angular/forms": "16.2.9",
"@angular/material": "15.2.9", "@angular/material": "16.2.9",
"@angular/material-date-fns-adapter": "15.2.9", "@angular/material-date-fns-adapter": "16.2.9",
"@angular/platform-browser": "15.2.10", "@angular/platform-browser": "16.2.9",
"@angular/platform-browser-dynamic": "15.2.10", "@angular/platform-browser-dynamic": "16.2.9",
"@angular/router": "15.2.10", "@angular/router": "16.2.9",
"@apollo/client": "^3.10.2", "@apollo/client": "3.11.4",
"@cspell/eslint-plugin": "^7.3.6", "@cspell/eslint-plugin": "^7.3.6",
"@mat-datetimepicker/core": "11.0.3", "@mat-datetimepicker/core": "12.0.1",
"@ngx-translate/core": "^14.0.0", "@ngx-translate/core": "^14.0.0",
"@storybook/core-server": "8.2.6", "@storybook/addon-interactions": "^8.2.9",
"@storybook/theming": "8.2.6", "@storybook/core-server": "^8.2.9",
"angular-oauth2-oidc": "^15.0.1", "@storybook/theming": "^8.2.9",
"angular-oauth2-oidc": "16.0.0",
"angular-oauth2-oidc-jwks": "^17.0.2", "angular-oauth2-oidc-jwks": "^17.0.2",
"apollo-angular": "^5.0.2", "apollo-angular": "^5.0.2",
"axios": "^1.7.4", "chart.js": "4.4.4",
"chart.js": "^4.3.0",
"cropperjs": "1.6.2", "cropperjs": "1.6.2",
"date-fns": "^2.30.0", "date-fns": "^2.30.0",
"dotenv-expand": "^5.1.0", "dotenv-expand": "^5.1.0",
@ -65,39 +65,42 @@
"superagent": "^9.0.1", "superagent": "^9.0.1",
"ts-morph": "^20.0.0", "ts-morph": "^20.0.0",
"tslib": "^2.6.2", "tslib": "^2.6.2",
"zone.js": "~0.11.4" "zone.js": "0.13.3"
}, },
"devDependencies": { "devDependencies": {
"@alfresco/eslint-plugin-eslint-angular": "file:lib/eslint-angular", "@alfresco/eslint-plugin-eslint-angular": "file:lib/eslint-angular",
"@angular-devkit/architect": "^0.1502.10", "@angular-devkit/architect": "0.1602.9",
"@angular-devkit/build-angular": "15.2.11", "@angular-devkit/build-angular": "16.2.9",
"@angular-devkit/core": "15.2.10", "@angular-devkit/core": "16.2.9",
"@angular-devkit/schematics": "15.2.10", "@angular-devkit/schematics": "16.2.9",
"@angular-eslint/eslint-plugin": "15.2.1", "@angular-eslint/eslint-plugin": "16.0.3",
"@angular-eslint/eslint-plugin-template": "16.0.2", "@angular-eslint/eslint-plugin-template": "16.0.3",
"@angular-eslint/template-parser": "16.2.0", "@angular-eslint/template-parser": "16.0.3",
"@angular/cli": "15.2.10", "@angular/cli": "~16.2.0",
"@angular/compiler-cli": "15.2.10", "@angular/compiler-cli": "16.2.9",
"@chromatic-com/storybook": "1.7.0",
"@editorjs/code": "2.9.0", "@editorjs/code": "2.9.0",
"@editorjs/editorjs": "^2.29.0", "@editorjs/editorjs": "2.30.5",
"@editorjs/header": "2.8.1", "@editorjs/header": "2.8.1",
"@editorjs/inline-code": "1.5.0", "@editorjs/inline-code": "1.5.0",
"@editorjs/list": "1.10.0", "@editorjs/list": "1.10.0",
"@editorjs/marker": "1.4.0", "@editorjs/marker": "1.4.0",
"@editorjs/paragraph": "^2.11.6", "@editorjs/paragraph": "^2.11.6",
"@editorjs/underline": "1.1.0", "@editorjs/underline": "1.1.0",
"@nrwl/angular": "15.9.3", "@nx/angular": "16.10.0",
"@nrwl/eslint-plugin-nx": "15.9.3", "@nx/eslint-plugin": "16.10.0",
"@nrwl/js": "^15.9.7", "@nx/js": "16.10.0",
"@nrwl/node": "15.9.3", "@nx/node": "16.10.0",
"@nrwl/storybook": "15.9.3", "@nx/storybook": "19.6.2",
"@nrwl/workspace": "15.9.3", "@nx/workspace": "16.10.0",
"@paperist/types-remark": "0.1.3", "@paperist/types-remark": "0.1.3",
"@playwright/test": "1.46.1",
"@quanzo/change-font-size": "1.0.0", "@quanzo/change-font-size": "1.0.0",
"@schematics/angular": "15.2.10", "@schematics/angular": "16.2.9",
"@storybook/addon-essentials": "8.2.6", "@storybook/addon-essentials": "^8.2.9",
"@storybook/angular": "8.2.6", "@storybook/angular": "^8.2.9",
"@storybook/core-server": "8.2.6", "@storybook/core-server": "^8.2.9",
"@storybook/manager-api": "^8.2.9",
"@types/ejs": "^3.1.5", "@types/ejs": "^3.1.5",
"@types/event-emitter": "^0.3.3", "@types/event-emitter": "^0.3.3",
"@types/jasmine": "4.0.3", "@types/jasmine": "4.0.3",
@ -105,7 +108,7 @@
"@types/jsdom": "^21.1.5", "@types/jsdom": "^21.1.5",
"@types/minimatch": "^3.0.3", "@types/minimatch": "^3.0.3",
"@types/mocha": "^10.0.6", "@types/mocha": "^10.0.6",
"@types/node": "^20.10.0", "@types/node": "20.16.1",
"@types/pdfjs-dist": "^2.10.378", "@types/pdfjs-dist": "^2.10.378",
"@types/shelljs": "^0.8.15", "@types/shelljs": "^0.8.15",
"@types/superagent": "^4.1.22", "@types/superagent": "^4.1.22",
@ -138,9 +141,10 @@
"jasmine-core": "4.6.0", "jasmine-core": "4.6.0",
"jasmine-marbles": "^0.9.2", "jasmine-marbles": "^0.9.2",
"jasmine-reporters": "^2.5.2", "jasmine-reporters": "^2.5.2",
"jasmine-spec-reporter": "7.0.0",
"js-yaml": "^4.0.0", "js-yaml": "^4.0.0",
"jsdom": "^24.0.0", "jsdom": "^24.0.0",
"karma": "^6.4.1", "karma": "6.4.4",
"karma-chrome-launcher": "~3.2.0", "karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0", "karma-coverage": "~2.2.0",
"karma-jasmine": "5.0.1", "karma-jasmine": "5.0.1",
@ -148,26 +152,30 @@
"karma-jasmine-html-reporter": "^2.1.0", "karma-jasmine-html-reporter": "^2.1.0",
"karma-mocha-reporter": "2.2.5", "karma-mocha-reporter": "2.2.5",
"license-checker": "^25.0.1", "license-checker": "^25.0.1",
"lint-staged": "^15.2.2", "lint-staged": "15.2.9",
"mini-css-extract-plugin": "^2.7.6", "mini-css-extract-plugin": "2.9.1",
"mocha": "^10.2.0", "mocha": "10.7.3",
"moment": "^2.29.4", "moment": "^2.29.4",
"ng-packagr": "15.2.2", "ng-packagr": "16.2.3",
"nock": "^13.3.8", "nock": "13.5.5",
"nx": "15.9.7", "npm-run-all": "^4.1.5",
"postcss": "^8.4.31", "nx": "16.10.0",
"postcss": "8.4.41",
"postcss-sass": "^0.5.0", "postcss-sass": "^0.5.0",
"prettier": "2.8.8", "prettier": "2.8.8",
"protractor": "^7.0.0", "protractor": "^7.0.0",
"rimraf": "^5.0.5", "rimraf": "5.0.10",
"sass-loader": "13.3.2", "sass-loader": "13.3.2",
"shelljs": "^0.8.5", "shelljs": "^0.8.5",
"spdx-license-list": "^6.9.0", "spdx-license-list": "^6.9.0",
"stylelint": "^16.3.1", "storybook": "^8.2.9",
"stylelint": "16.8.2",
"stylelint-config-standard-scss": "^13.1.0", "stylelint-config-standard-scss": "^13.1.0",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "4.9.5", "tsconfig-paths": "^4.1.1",
"webpack": "^5.94.0", "typescript": "5.1.6",
"webdriver-manager": "12.1.9",
"webpack": "5.94.0",
"webpack-cli": "^5.1.4" "webpack-cli": "^5.1.4"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",

View File

@ -11,7 +11,7 @@ if [ "${GITHUB_EVENT_NAME}" == "schedule" ]; then
exit 0 exit 0
fi fi
isAffected=false isAffected=false
AFFECTED_LIBS=$(npx nx print-affected --type=lib --select=projects ${NX_CALCULATION_FLAGS} --plain) AFFECTED_LIBS=$(npx nx show projects --affected ${NX_CALCULATION_FLAGS} --plain)
#echo "Verify if affected build contains $1" #echo "Verify if affected build contains $1"
#echo "Affected libs:$AFFECTED_LIBS" #echo "Affected libs:$AFFECTED_LIBS"
if [[ $AFFECTED_LIBS =~ $verifyLib ]]; then if [[ $AFFECTED_LIBS =~ $verifyLib ]]; then