👽 Angular 14 rebase 👽 (#7769)
* fix after rebase * new release strategy for ng next Signed-off-by: eromano <eugenioromano16@gmail.com> * peer dep Signed-off-by: eromano <eugenioromano16@gmail.com> * Angular 14 fix unit test and storybook Signed-off-by: eromano <eugenioromano16@gmail.com> fix after rebase Signed-off-by: eromano <eugenioromano16@gmail.com> update pkg.json Signed-off-by: eromano <eugenioromano16@gmail.com> missing dep Signed-off-by: eromano <eugenioromano16@gmail.com> Fix mistake and missing code Dream....build only affected libs Add utility run commands * Use nx command to run affected tests * Fix nx test core fix content tests Run unit with watch false core test fixes reduce test warnings Fix process cloud unit Fix adf unit test Fix lint process cloud Disable lint next line Use right core path Fix insights unit fix linting insights Fix process-services unit fix the extensions test report fix test warnings Fix content unit Fix bunch of content unit * Produce an adf alpha of 14 * hopefully fixing the content * Push back the npm publish * Remove flaky unit * Fix linting * Make the branch as root * Get rid of angualar13 * Remove the travis depth * Fixing version for npm * Enabling cache for unit and build * Fix scss for core and paths Copy i18 and asset by using ng-packager Export the theming alias and fix path Use ng-package to copy assets process-services-cloud Use ng-package to copy assets process-services Use ng-package to copy assets content-services Use ng-package to copy assets insights * feat: fix api secondary entry point * fix storybook rebase * Move dist under dist/libs from lib/dist * Fix the webstyle * Use only necessary nrwl deps and improve lint * Fix unit for libs * Convert lint.sh to targets - improve performance * Use latest of angular * Align alfresco-js-api Signed-off-by: eromano <eugenioromano16@gmail.com> Co-authored-by: eromano <eugenioromano16@gmail.com> Co-authored-by: Mikolaj Serwicki <mikolaj.serwicki@hyland.com> Co-authored-by: Tomasz <tomasz.gnyp@hyland.com>
@@ -1,23 +1,12 @@
|
||||
{
|
||||
"extends": "../../.eslintrc.json",
|
||||
"ignorePatterns": [
|
||||
"!**/*"
|
||||
],
|
||||
"extends": ["../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.ts"
|
||||
],
|
||||
"parserOptions": {
|
||||
"project": [
|
||||
"lib/core/tsconfig.lib.json",
|
||||
"lib/core/tsconfig.spec.json"
|
||||
],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"plugins": [
|
||||
"eslint-plugin-unicorn",
|
||||
"eslint-plugin-rxjs"
|
||||
"files": ["*.ts"],
|
||||
"extends": [
|
||||
"plugin:@nrwl/nx/angular",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"rules": {
|
||||
"jsdoc/newline-after-description": "warn",
|
||||
@@ -29,6 +18,7 @@
|
||||
"no-shadow": "warn",
|
||||
"quote-props": "warn",
|
||||
"object-shorthand": "warn",
|
||||
"no-restricted-syntax": "warn",
|
||||
"prefer-const": "warn",
|
||||
"arrow-body-style": "warn",
|
||||
"@angular-eslint/no-output-native": "off",
|
||||
@@ -99,9 +89,8 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"*.html"
|
||||
],
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@nrwl/nx/angular-template"],
|
||||
"rules": {
|
||||
"@angular-eslint/template/no-autofocus": "error",
|
||||
"@angular-eslint/template/no-positive-tabindex": "error",
|
||||
|
@@ -18,7 +18,7 @@ npm-debug.log
|
||||
|
||||
**/*.scss
|
||||
**/*.css
|
||||
!**/_theming.scss
|
||||
!**/lib/_theming.scss
|
||||
|
||||
coverage/
|
||||
demo/
|
||||
@@ -28,13 +28,13 @@ typings/
|
||||
fonts/
|
||||
i18n/
|
||||
assets/
|
||||
!/prebuilt-themes/
|
||||
!/prebuilt-themes/adf-indigo-pink.css
|
||||
!/prebuilt-themes/adf-cyan-purple.css
|
||||
!/prebuilt-themes/adf-green-purple.css
|
||||
!/prebuilt-themes/adf-cyan-orange.css
|
||||
!/prebuilt-themes/adf-green-orange.css
|
||||
!/prebuilt-themes/adf-blue-purple.css
|
||||
!/prebuilt-themes/adf-blue-orange.css
|
||||
!/prebuilt-themes/adf-pink-bluegrey.css
|
||||
!/prebuilt-themes/adf-purple-green.css
|
||||
!/lib/prebuilt-themes/
|
||||
!/lib/prebuilt-themes/adf-indigo-pink.css
|
||||
!/lib/prebuilt-themes/adf-cyan-purple.css
|
||||
!/lib/prebuilt-themes/adf-green-purple.css
|
||||
!/lib/prebuilt-themes/adf-cyan-orange.css
|
||||
!/lib/prebuilt-themes/adf-green-orange.css
|
||||
!/lib/prebuilt-themes/adf-blue-purple.css
|
||||
!/lib/prebuilt-themes/adf-blue-orange.css
|
||||
!/lib/prebuilt-themes/adf-pink-bluegrey.css
|
||||
!/lib/prebuilt-themes/adf-purple-green.css
|
||||
|
@@ -9,8 +9,8 @@ module.exports = {
|
||||
],
|
||||
staticDirs: [
|
||||
...rootMain.staticDirs,
|
||||
{ from: __dirname + '/../i18n', to: 'assets/adf-core/i18n' },
|
||||
{ from: __dirname + '/../assets/images', to: 'assets/images' }
|
||||
{ from: __dirname + '/../src/lib/i18n', to: 'assets/adf-core/i18n' },
|
||||
{ from: __dirname + '/../src/lib/assets/images', to: 'assets/images' }
|
||||
],
|
||||
addons: [...rootMain.addons ]
|
||||
};
|
||||
|
@@ -19,10 +19,22 @@ import { Inject, Injectable } from '@angular/core';
|
||||
import { ApiClientFactory, API_CLIENT_FACTORY_TOKEN } from './api-client.factory';
|
||||
import { Constructor, Dictionary } from './types';
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace AlfrescoCore {
|
||||
interface ApiRegistry {
|
||||
}
|
||||
}
|
||||
}
|
||||
/* eslint-enable */
|
||||
|
||||
@Injectable()
|
||||
export class ApiClientsService {
|
||||
|
||||
constructor(@Inject(API_CLIENT_FACTORY_TOKEN) private apiCreateFactory: ApiClientFactory) { }
|
||||
constructor(@Inject(API_CLIENT_FACTORY_TOKEN) private apiCreateFactory: ApiClientFactory) {
|
||||
}
|
||||
|
||||
private registry: Dictionary<Constructor<any>> = {};
|
||||
private instances: Partial<AlfrescoCore.ApiRegistry> = {};
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"$schema": "../../../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"lib": {
|
||||
"entryFile": "public-api.ts"
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
export * from './api-client.factory';
|
||||
export * from './api-clients.service';
|
||||
export * from './clients/index';
|
||||
export * from './clients';
|
||||
export * from './types';
|
||||
|
@@ -1,178 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DateCellComponent } from '../date-cell/date-cell.component';
|
||||
import { Subject } from 'rxjs';
|
||||
import { AppConfigService } from '../../../app-config/app-config.service';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '../../../testing';
|
||||
import { AlfrescoApiService } from '../../../services/alfresco-api.service';
|
||||
import { CoreModule } from '../../../core.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
describe('DataTableCellComponent', () => {
|
||||
let alfrescoApiService: AlfrescoApiService;
|
||||
let appConfigService: AppConfigService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
alfrescoApiService = TestBed.inject(AlfrescoApiService);
|
||||
appConfigService = TestBed.inject(AppConfigService);
|
||||
});
|
||||
|
||||
it('should use medium format by default', () => {
|
||||
const component = new DateCellComponent(null, null, appConfigService);
|
||||
expect(component.format).toBe('medium');
|
||||
});
|
||||
|
||||
it('should use column format', () => {
|
||||
const component = new DateCellComponent(null, {
|
||||
nodeUpdated: new Subject<any>()
|
||||
} as any, appConfigService);
|
||||
component.column = {
|
||||
key: 'created',
|
||||
type: 'date',
|
||||
format: 'longTime'
|
||||
};
|
||||
|
||||
component.ngOnInit();
|
||||
expect(component.format).toBe('longTime');
|
||||
});
|
||||
|
||||
it('should update cell data on alfrescoApiService.nodeUpdated event', () => {
|
||||
const component = new DateCellComponent(
|
||||
null,
|
||||
alfrescoApiService,
|
||||
appConfigService
|
||||
);
|
||||
|
||||
component.column = {
|
||||
key: 'name',
|
||||
type: 'text'
|
||||
};
|
||||
|
||||
component.row = {
|
||||
cache: {
|
||||
name: 'some-name'
|
||||
},
|
||||
node: {
|
||||
entry: {
|
||||
id: 'id',
|
||||
name: 'test-name'
|
||||
}
|
||||
}
|
||||
} as any;
|
||||
|
||||
component.ngOnInit();
|
||||
|
||||
alfrescoApiService.nodeUpdated.next({
|
||||
id: 'id',
|
||||
name: 'updated-name'
|
||||
} as Node);
|
||||
|
||||
expect(component.row['node'].entry.name).toBe('updated-name');
|
||||
expect(component.row['cache'].name).toBe('updated-name');
|
||||
});
|
||||
|
||||
it('not should update cell data if ids don`t match', () => {
|
||||
const component = new DateCellComponent(
|
||||
null,
|
||||
alfrescoApiService,
|
||||
appConfigService
|
||||
);
|
||||
|
||||
component.column = {
|
||||
key: 'name',
|
||||
type: 'text'
|
||||
};
|
||||
|
||||
component.row = {
|
||||
cache: {
|
||||
name: 'some-name'
|
||||
},
|
||||
node: {
|
||||
entry: {
|
||||
id: 'some-id',
|
||||
name: 'test-name'
|
||||
}
|
||||
}
|
||||
} as any;
|
||||
|
||||
component.ngOnInit();
|
||||
|
||||
alfrescoApiService.nodeUpdated.next({
|
||||
id: 'id',
|
||||
name: 'updated-name'
|
||||
} as Node);
|
||||
|
||||
expect(component.row['node'].entry.name).not.toBe('updated-name');
|
||||
expect(component.row['cache'].name).not.toBe('updated-name');
|
||||
});
|
||||
|
||||
it('not should throw error if key not found', () => {
|
||||
const component = new DateCellComponent(
|
||||
null,
|
||||
alfrescoApiService,
|
||||
appConfigService
|
||||
);
|
||||
|
||||
component.column = {
|
||||
key: 'contentSize.sizeInBytes',
|
||||
type: 'text'
|
||||
};
|
||||
|
||||
component.row = {
|
||||
cache: {
|
||||
name: 'some-name'
|
||||
},
|
||||
node: {
|
||||
entry: {
|
||||
id: 'id',
|
||||
name: 'some-name',
|
||||
contentSize: {
|
||||
sizeInBytes: '12Mb'
|
||||
}
|
||||
}
|
||||
}
|
||||
} as any;
|
||||
|
||||
component.ngOnInit();
|
||||
|
||||
alfrescoApiService.nodeUpdated.next({
|
||||
id: 'id',
|
||||
contentSize: { sizeInBytes: '11Mb' }
|
||||
} as any);
|
||||
|
||||
expect(component.row['node'].entry.contentSize.sizeInBytes).toBe('11Mb');
|
||||
expect(component.row['cache']['contentSize.sizeInBytes']).toBe('11Mb');
|
||||
|
||||
alfrescoApiService.nodeUpdated.next({
|
||||
id: 'id',
|
||||
name: 'updated-name'
|
||||
} as any);
|
||||
|
||||
expect(component.row['node'].entry.name).toBe('updated-name');
|
||||
expect(component.row['cache']['contentSize.sizeInBytes']).toBe('');
|
||||
});
|
||||
});
|
@@ -15,43 +15,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './about/index';
|
||||
export * from './viewer/index';
|
||||
export * from './userinfo/index';
|
||||
export * from './toolbar/index';
|
||||
export * from './settings/index';
|
||||
export * from './pagination/index';
|
||||
export * from './login/index';
|
||||
export * from './language-menu/index';
|
||||
export * from './info-drawer/index';
|
||||
export * from './data-column/index';
|
||||
export * from './datatable/index';
|
||||
export * from './rich-text-editor/index';
|
||||
export * from './context-menu/index';
|
||||
export * from './card-view/index';
|
||||
export * from './app-config/index';
|
||||
export * from './form/index';
|
||||
export * from './layout/index';
|
||||
export * from './comments/index';
|
||||
export * from './buttons-menu/index';
|
||||
export * from './sorting-picker/index';
|
||||
export * from './templates/index';
|
||||
export * from './pipes/index';
|
||||
export * from './services/index';
|
||||
export * from './directives/index';
|
||||
export * from './clipboard/index';
|
||||
export * from './dialogs/index';
|
||||
export * from './icon/index';
|
||||
export * from './notifications/index';
|
||||
export * from './search-text/index';
|
||||
export * from './blank-page/index';
|
||||
|
||||
export * from './utils/index';
|
||||
export * from './interface/index';
|
||||
export * from './models/index';
|
||||
export * from './events/index';
|
||||
export * from './mock/index';
|
||||
export * from './testing';
|
||||
|
||||
export * from './material.module';
|
||||
export * from './core.module';
|
||||
export * from './src/public-api';
|
||||
|
@@ -15,14 +15,14 @@ module.exports = function (config) {
|
||||
watched: false
|
||||
},
|
||||
{pattern: 'node_modules/moment/min/moment.min.js', included: true, watched: false},
|
||||
{pattern: 'lib/core/i18n/**/en.json', included: false, served: true, watched: false},
|
||||
{pattern: 'lib/core/src/lib/i18n/**/en.json', included: false, served: true, watched: false},
|
||||
{pattern: 'lib/core/**/*.ts', included: false, served: true, watched: false},
|
||||
{pattern: 'lib/core/assets/**/*.svg', included: false, served: true, watched: false},
|
||||
{pattern: 'lib/core/assets/**/*.png', included: false, served: true, watched: false},
|
||||
{pattern: 'lib/core/src/lib/assets/**/*.svg', included: false, served: true, watched: false},
|
||||
{pattern: 'lib/core/src/lib/assets/**/*.png', included: false, served: true, watched: false},
|
||||
{pattern: 'lib/config/app.config.json', included: false, served: true, watched: false},
|
||||
{pattern: 'lib/core/viewer/assets/fake-test-file.pdf', included: false, served: true, watched: false},
|
||||
{pattern: 'lib/core/viewer/assets/fake-test-file.txt', included: false, served: true, watched: false},
|
||||
{pattern: 'lib/core/viewer/assets/fake-test-video.mp4', included: false, served: true, watched: false},
|
||||
{pattern: 'lib/core/src/lib/viewer/assets/fake-test-file.pdf', included: false, served: true, watched: false},
|
||||
{pattern: 'lib/core/src/lib/viewer/assets/fake-test-file.txt', included: false, served: true, watched: false},
|
||||
{pattern: 'lib/core/src/lib/viewer/assets/fake-test-video.mp4', included: false, served: true, watched: false},
|
||||
{
|
||||
pattern: 'lib/core//viewer/assets/fake-test-password-file.pdf',
|
||||
included: false,
|
||||
@@ -36,27 +36,27 @@ module.exports = function (config) {
|
||||
proxies: {
|
||||
'/pdf.worker.min.js' :'/base/node_modules/pdfjs-dist/build/pdf.worker.min.js',
|
||||
'/pdf.worker.js' :'/base/node_modules/pdfjs-dist/build/pdf.worker.js',
|
||||
'/fake-url-file.png' :'/base/lib/core/assets/images/logo.png',
|
||||
'/logo.png' :'/base/lib/core/assets/images/logo.png',
|
||||
'/alfresco-logo.svg' :'/base/lib/core/assets/images/alfresco-logo.svg',
|
||||
'/assets/images/': '/base/lib/core/assets/images/',
|
||||
'/assets/images/ecm-background.png': '/base/lib/core/assets/images/ecm-background.png',
|
||||
'/assets/images/bpm-background.png': '/base/lib/core/assets/images/bpm-background.png',
|
||||
'/content.bin': '/base/lib/core/viewer/assets/fake-test-file.pdf',
|
||||
'/base/assets/' :'/base/lib/core/assets/',
|
||||
'/assets/adf-core/i18n/en.json': '/base/lib/core/i18n/en.json',
|
||||
'/assets/adf-core/i18n/en-GB.json': '/base/lib/core/i18n/en.json',
|
||||
'/assets/adf-core/i18n/en-US.json': '/base/lib/core/i18n/en.json',
|
||||
'/fake-content-img' : '/base/lib/core/assets/images/logo.png',
|
||||
'/fake-content-img.bin' : '/base/lib/core/assets/images/logo.png',
|
||||
'/fake-test-file.pdf': '/base/lib/core/viewer/assets/fake-test-file.pdf',
|
||||
'/fake-content-pdf': '/base/lib/core/viewer/assets/fake-test-file.pdf',
|
||||
'/fake-content-pdf.bin': '/base/lib/core/viewer/assets/fake-test-file.pdf',
|
||||
'/fake-test-file.txt': '/base/lib/core/viewer/assets/fake-test-file.txt',
|
||||
'/fake-content-video.bin': '/base/lib/core/viewer/assets/fake-test-video.mp4',
|
||||
'/fake-content-video': '/base/lib/core/viewer/assets/fake-test-video.mp4',
|
||||
'/fake-content-txt.bin': '/base/lib/core/viewer/assets/fake-test-file.txt',
|
||||
'/fake-test-password-file.pdf': '/base/lib/core/viewer/assets/fake-test-password-file.pdf'
|
||||
'/fake-url-file.png' :'/base/lib/core/src/lib/assets/images/logo.png',
|
||||
'/logo.png' :'/base/lib/core/src/lib/assets/images/logo.png',
|
||||
'/alfresco-logo.svg' :'/base/lib/core/src/lib/assets/images/alfresco-logo.svg',
|
||||
'/assets/images/': '/base/lib/core/src/lib/assets/images/',
|
||||
'/assets/images/ecm-background.png': '/base/lib/core/src/lib/assets/images/ecm-background.png',
|
||||
'/assets/images/bpm-background.png': '/base/lib/core/src/lib/assets/images/bpm-background.png',
|
||||
'/content.bin': '/base/lib/core/src/lib/viewer/assets/fake-test-file.pdf',
|
||||
'/base/assets/' :'/base/lib/core/src/lib/assets/',
|
||||
'/assets/adf-core/i18n/en.json': '/base/lib/core/src/lib/i18n/en.json',
|
||||
'/assets/adf-core/i18n/en-GB.json': '/base/lib/core/src/lib/i18n/en.json',
|
||||
'/assets/adf-core/i18n/en-US.json': '/base/lib/core/src/lib/i18n/en.json',
|
||||
'/fake-content-img' : '/base/lib/core/src/lib/assets/images/logo.png',
|
||||
'/fake-content-img.bin' : '/base/lib/core/src/lib/assets/images/logo.png',
|
||||
'/fake-test-file.pdf': '/base/lib/core/src/lib/viewer/assets/fake-test-file.pdf',
|
||||
'/fake-content-pdf': '/base/lib/core/src/lib/viewer/assets/fake-test-file.pdf',
|
||||
'/fake-content-pdf.bin': '/base/lib/core/src/lib/viewer/assets/fake-test-file.pdf',
|
||||
'/fake-test-file.txt': '/base/lib/core/src/lib/viewer/assets/fake-test-file.txt',
|
||||
'/fake-content-video.bin': '/base/lib/core/src/lib/viewer/assets/fake-test-video.mp4',
|
||||
'/fake-content-video': '/base/lib/core/src/lib/viewer/assets/fake-test-video.mp4',
|
||||
'/fake-content-txt.bin': '/base/lib/core/src/lib/viewer/assets/fake-test-file.txt',
|
||||
'/fake-test-password-file.pdf': '/base/lib/core/src/lib/viewer/assets/fake-test-password-file.pdf'
|
||||
},
|
||||
|
||||
plugins: [
|
||||
@@ -102,7 +102,7 @@ module.exports = function (config) {
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['Chrome'],
|
||||
singleRun: false
|
||||
singleRun: true
|
||||
});
|
||||
process.env.TZ = 'UTC';
|
||||
};
|
||||
|
@@ -1,13 +1,30 @@
|
||||
{
|
||||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"dest": "../dist/core/",
|
||||
"dest": "../../dist/libs/core",
|
||||
"assets": [
|
||||
"./styles/**/*.scss",
|
||||
"./theming/**/*.scss",
|
||||
"./**/*.theme.scss"
|
||||
{
|
||||
"glob": "assets/**/*",
|
||||
"input": "./src/lib",
|
||||
"output": "/bundles/"
|
||||
},
|
||||
{
|
||||
"glob": "i18n/*.json",
|
||||
"input": "./src/lib",
|
||||
"output": "/bundles/assets/adf-core/"
|
||||
},
|
||||
{
|
||||
"glob": "schema.json",
|
||||
"input": "./src/lib/app-config",
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*.scss",
|
||||
"input": "./src/lib",
|
||||
"output": "/lib"
|
||||
}
|
||||
],
|
||||
"lib": {
|
||||
"entryFile": "./public-api.ts",
|
||||
"entryFile": "./src/public-api.ts",
|
||||
"flatModuleFile": "adf-core"
|
||||
},
|
||||
"allowedNonPeerDependencies": [
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@alfresco/adf-core",
|
||||
"description": "Alfresco ADF core",
|
||||
"version": "5.0.0-angular.13.2",
|
||||
"version": "4.11.0",
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -10,6 +10,11 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||
},
|
||||
"exports": {
|
||||
"./theming": {
|
||||
"sass": "./lib/theming/_index.scss"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"cropperjs": "1.5.11",
|
||||
"@editorjs/editorjs": "2.25.0",
|
||||
@@ -25,26 +30,23 @@
|
||||
"editorjs-paragraph-with-alignment": "3.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/animations": ">=13.3.11",
|
||||
"@angular/cdk": ">=13.3.9",
|
||||
"@angular/common": ">=13.3.11",
|
||||
"@angular/compiler": ">=13.3.11",
|
||||
"@angular/core": ">=13.3.11",
|
||||
"@angular/flex-layout": ">=13.0.0-beta.38",
|
||||
"@angular/forms": ">=13.3.11",
|
||||
"@angular/material": ">=13.3.9",
|
||||
"@angular/material-moment-adapter": ">=13.3.9",
|
||||
"@angular/platform-browser": ">=13.3.11",
|
||||
"@angular/platform-browser-dynamic": ">=13.3.11",
|
||||
"@angular/router": ">=13.3.11",
|
||||
"@mat-datetimepicker/core": ">=9.0.68",
|
||||
"@mat-datetimepicker/moment": ">=9.0.68",
|
||||
"@angular/animations": ">=10.0.2",
|
||||
"@angular/cdk": ">=10.0.1",
|
||||
"@angular/common": ">=10.0.2",
|
||||
"@angular/core": ">=10.0.2",
|
||||
"@angular/flex-layout": ">=10.0.0-beta.32",
|
||||
"@angular/forms": ">=10.0.2",
|
||||
"@angular/material": ">=10.0.1",
|
||||
"@angular/material-moment-adapter": ">=10.0.1",
|
||||
"@angular/router": ">=10.0.2",
|
||||
"@mat-datetimepicker/core": ">=4.1.0",
|
||||
"@mat-datetimepicker/moment": ">=4.1.0",
|
||||
"@alfresco/js-api": "4.12.0-244",
|
||||
"@alfresco/adf-extensions": "5.0.0-angular.13.2",
|
||||
"@alfresco/adf-extensions": "4.11.0",
|
||||
"@ngx-translate/core": ">=13.0.0",
|
||||
"minimatch-browser": ">=1.0.0",
|
||||
"moment": ">=2.22.2",
|
||||
"pdfjs-dist": ">=2.5.207"
|
||||
"pdfjs-dist": ">=2.3.200"
|
||||
},
|
||||
"keywords": [
|
||||
"core",
|
||||
|
@@ -1,18 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './index';
|
@@ -1,388 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { HostSettingsComponent } from './host-settings.component';
|
||||
import { setupTestBed } from '../testing/setup-test-bed';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
describe('HostSettingsComponent', () => {
|
||||
|
||||
let fixture: ComponentFixture<HostSettingsComponent>;
|
||||
let component: HostSettingsComponent;
|
||||
let appConfigService: AppConfigService;
|
||||
let element: any;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(HostSettingsComponent);
|
||||
component = fixture.componentInstance;
|
||||
appConfigService = TestBed.inject(AppConfigService);
|
||||
element = fixture.nativeElement;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
describe('Providers', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
appConfigService.config.providers = 'ECM';
|
||||
appConfigService.config.authType = 'OAUTH';
|
||||
appConfigService.config.oauth2 = {
|
||||
host: 'http://localhost:6543',
|
||||
redirectUri: '/',
|
||||
silentLogin: false,
|
||||
implicitFlow: true,
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: ''
|
||||
};
|
||||
|
||||
appConfigService.load();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
it('should not show the providers select box if you have any provider', (done) => {
|
||||
component.providers = ['BPM'];
|
||||
component.ngOnInit();
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
expect(element.querySelector('#adf-provider-selector')).toBeNull();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should show the providers select box if you have any provider', (done) => {
|
||||
component.providers = ['BPM', 'ECM'];
|
||||
component.ngOnInit();
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
expect(element.querySelector('#adf-provider-selector')).not.toBeNull();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('BPM ', () => {
|
||||
|
||||
let ecmUrlInput;
|
||||
let bpmUrlInput;
|
||||
|
||||
beforeEach(() => {
|
||||
appConfigService.config.providers = 'BPM';
|
||||
appConfigService.config.authType = 'BASIC';
|
||||
appConfigService.load();
|
||||
fixture.detectChanges();
|
||||
bpmUrlInput = element.querySelector('#bpmHost');
|
||||
ecmUrlInput = element.querySelector('#ecmHost');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
it('should have a valid form when the url inserted is correct', (done) => {
|
||||
const url = 'http://localhost:9999/bpm';
|
||||
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('VALID');
|
||||
done();
|
||||
});
|
||||
|
||||
component.form.valueChanges.subscribe((values) => {
|
||||
expect(values.bpmHost).toEqual(url);
|
||||
});
|
||||
|
||||
bpmUrlInput.value = url;
|
||||
bpmUrlInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
|
||||
it('should have an invalid form when the inserted url is wrong', (done) => {
|
||||
const url = 'wrong';
|
||||
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('INVALID');
|
||||
expect(component.bpmHost.hasError('pattern')).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
|
||||
bpmUrlInput.value = url;
|
||||
bpmUrlInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
|
||||
it('should not render the ECM url config if setting provider is BPM', () => {
|
||||
expect(ecmUrlInput).toEqual(null);
|
||||
expect(bpmUrlInput).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('ECM ', () => {
|
||||
|
||||
let ecmUrlInput;
|
||||
let bpmUrlInput;
|
||||
|
||||
beforeEach(() => {
|
||||
appConfigService.config.providers = 'ECM';
|
||||
appConfigService.config.authType = 'BASIC';
|
||||
appConfigService.load();
|
||||
fixture.detectChanges();
|
||||
bpmUrlInput = element.querySelector('#bpmHost');
|
||||
ecmUrlInput = element.querySelector('#ecmHost');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
it('should have a valid form when the url inserted is correct', (done) => {
|
||||
const url = 'http://localhost:9999/ecm';
|
||||
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('VALID');
|
||||
done();
|
||||
});
|
||||
|
||||
ecmUrlInput.value = url;
|
||||
ecmUrlInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
|
||||
it('should have an invalid form when the url inserted is wrong', (done) => {
|
||||
const url = 'wrong';
|
||||
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('INVALID');
|
||||
expect(component.ecmHost.hasError('pattern')).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
|
||||
ecmUrlInput.value = url;
|
||||
ecmUrlInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
|
||||
it('should not render the BPM url config if setting provider is BPM', () => {
|
||||
expect(bpmUrlInput).toEqual(null);
|
||||
expect(ecmUrlInput).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('ALL ', () => {
|
||||
|
||||
let ecmUrlInput;
|
||||
let bpmUrlInput;
|
||||
|
||||
beforeEach(() => {
|
||||
appConfigService.config.providers = 'ALL';
|
||||
appConfigService.config.authType = 'BASIC';
|
||||
appConfigService.load();
|
||||
fixture.detectChanges();
|
||||
bpmUrlInput = element.querySelector('#bpmHost');
|
||||
ecmUrlInput = element.querySelector('#ecmHost');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
it('should have a valid form when the BPM and ECM url inserted are correct', (done) => {
|
||||
const urlEcm = 'http://localhost:9999/ecm';
|
||||
const urlBpm = 'http://localhost:9999/bpm';
|
||||
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('VALID');
|
||||
done();
|
||||
});
|
||||
|
||||
ecmUrlInput.value = urlEcm;
|
||||
bpmUrlInput.value = urlBpm;
|
||||
ecmUrlInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
|
||||
it('should have an invalid form when one of the ECM url inserted is wrong', (done) => {
|
||||
const url = 'wrong';
|
||||
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('INVALID');
|
||||
expect(component.ecmHost.hasError('pattern')).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
|
||||
ecmUrlInput.value = url;
|
||||
ecmUrlInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
|
||||
it('should have an invalid form when one of the BPM url inserted is wrong', (done) => {
|
||||
const url = 'wrong';
|
||||
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('INVALID');
|
||||
expect(component.bpmHost.hasError('pattern')).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
|
||||
bpmUrlInput.value = url;
|
||||
bpmUrlInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
|
||||
it('should have an invalid form when both BPM and ECM url inserted are wrong', (done) => {
|
||||
const url = 'wrong';
|
||||
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('INVALID');
|
||||
expect(component.bpmHost.hasError('pattern')).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
|
||||
bpmUrlInput.value = url;
|
||||
ecmUrlInput.value = url;
|
||||
bpmUrlInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
});
|
||||
|
||||
describe('OAUTH ', () => {
|
||||
|
||||
let bpmUrlInput;
|
||||
let ecmUrlInput;
|
||||
let identityUrlInput;
|
||||
let oauthHostUrlInput;
|
||||
let clientIdInput;
|
||||
|
||||
beforeEach(() => {
|
||||
appConfigService.config.identityHost = 'http://localhost:123';
|
||||
appConfigService.config.providers = 'ALL';
|
||||
appConfigService.config.authType = 'OAUTH';
|
||||
appConfigService.config.oauth2 = {
|
||||
host: 'http://localhost:6543',
|
||||
redirectUri: '/',
|
||||
silentLogin: false,
|
||||
implicitFlow: true,
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: ''
|
||||
};
|
||||
appConfigService.load();
|
||||
fixture.detectChanges();
|
||||
bpmUrlInput = element.querySelector('#bpmHost');
|
||||
ecmUrlInput = element.querySelector('#ecmHost');
|
||||
identityUrlInput = element.querySelector('#identityHost');
|
||||
oauthHostUrlInput = element.querySelector('#oauthHost');
|
||||
clientIdInput = element.querySelector('#clientId');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
it('should have a valid form when the urls are correct', (done) => {
|
||||
const urlBpm = 'http://localhost:9999/bpm';
|
||||
const urlEcm = 'http://localhost:9999/bpm';
|
||||
const urlIdentity = 'http://localhost:9999/identity';
|
||||
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('VALID');
|
||||
done();
|
||||
});
|
||||
|
||||
ecmUrlInput.value = urlEcm;
|
||||
ecmUrlInput.dispatchEvent(new Event('input'));
|
||||
|
||||
bpmUrlInput.value = urlBpm;
|
||||
bpmUrlInput.dispatchEvent(new Event('input'));
|
||||
|
||||
identityUrlInput.value = urlIdentity;
|
||||
identityUrlInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
|
||||
it('should have an invalid form when the url inserted is wrong', (done) => {
|
||||
const url = 'wrong';
|
||||
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('INVALID');
|
||||
expect(component.bpmHost.hasError('pattern')).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
|
||||
bpmUrlInput.value = url;
|
||||
bpmUrlInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
|
||||
it('should have a required identityUrl and invalid form when the identityUrl is missing', (done) => {
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('INVALID');
|
||||
expect(component.identityHost.hasError('required')).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
|
||||
identityUrlInput.value = '';
|
||||
identityUrlInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
|
||||
it('should have an invalid form when the identity url inserted is wrong', (done) => {
|
||||
const url = 'wrong';
|
||||
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('INVALID');
|
||||
expect(component.identityHost.hasError('pattern')).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
|
||||
identityUrlInput.value = url;
|
||||
identityUrlInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
|
||||
it('should have an invalid form when the host is wrong', (done) => {
|
||||
const hostUrl = 'wrong';
|
||||
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('INVALID');
|
||||
expect(component.host.hasError('pattern')).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
|
||||
oauthHostUrlInput.value = hostUrl;
|
||||
oauthHostUrlInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
|
||||
it('should have a required clientId an invalid form when the clientId is missing', (done) => {
|
||||
component.form.statusChanges.subscribe((status: string) => {
|
||||
expect(status).toEqual('INVALID');
|
||||
expect(component.clientId.hasError('required')).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
|
||||
clientIdInput.value = '';
|
||||
clientIdInput.dispatchEvent(new Event('input'));
|
||||
});
|
||||
});
|
||||
});
|
@@ -89,7 +89,7 @@ describe('AppConfigService', () => {
|
||||
expect(appConfigService.get('application.name')).toEqual('custom name');
|
||||
});
|
||||
|
||||
it('should merge the configs upon new data loaded', async (done) => {
|
||||
it('should merge the configs upon new data loaded', async () => {
|
||||
appConfigService.config = {
|
||||
application: {
|
||||
name: 'application name'
|
||||
@@ -109,7 +109,6 @@ describe('AppConfigService', () => {
|
||||
await appConfigService.load();
|
||||
|
||||
expect(appConfigService.get('application.name')).toEqual('custom name');
|
||||
done();
|
||||
});
|
||||
|
||||
it('should stream only the selected attribute changes when using select', fakeAsync(() => {
|
@@ -18,7 +18,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { StorageService } from '../services/storage.service';
|
||||
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
|
||||
import { AppConfigService, AppConfigValues } from './app-config.service';
|
||||
import { ExtensionService } from '@alfresco/adf-extensions';
|
||||
|
||||
@Injectable()
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 881 B After Width: | Height: | Size: 881 B |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 456 B After Width: | Height: | Size: 456 B |
Before Width: | Height: | Size: 772 B After Width: | Height: | Size: 772 B |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 579 B After Width: | Height: | Size: 579 B |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 861 B After Width: | Height: | Size: 861 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 267 B After Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 666 B After Width: | Height: | Size: 666 B |
Before Width: | Height: | Size: 434 B After Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 367 B |