-
-
diff --git a/projects/aca-settings/src/lib/settings.component.scss b/projects/aca-settings/src/lib/settings.component.scss
deleted file mode 100644
index e0208728b..000000000
--- a/projects/aca-settings/src/lib/settings.component.scss
+++ /dev/null
@@ -1,77 +0,0 @@
-$app-menu-height: 64px;
-
-.aca-settings-parameter-list {
- display: flex;
- flex-direction: column;
-}
-
-.aca-settings {
- &-extensions-list {
- display: flex;
- flex-direction: column;
- }
-
- .settings-input {
- width: 50%;
- }
-
- .settings-buttons {
- text-align: right;
-
- .mat-button {
- text-transform: uppercase;
- }
- }
-
- .app-menu {
- height: $app-menu-height;
-
- &.adf-toolbar {
- .mat-toolbar {
- background-color: inherit;
- font-family: inherit;
- min-height: $app-menu-height;
- height: $app-menu-height;
-
- .mat-toolbar-layout {
- height: $app-menu-height;
-
- .mat-toolbar-row {
- height: $app-menu-height;
- }
- }
- }
-
- .adf-toolbar-divider {
- margin-left: 5px;
- margin-right: 5px;
-
- & > div {
- background-color: var(--theme-card-background-color);
- }
- }
-
- .adf-toolbar-title {
- color: var(--theme-card-background-color);
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- }
- }
-
- .app-menu__title {
- width: 100px;
- height: 50px;
- margin-left: 40px;
- display: flex;
- justify-content: center;
- align-items: stretch;
-
- & > img {
- width: 100%;
- object-fit: contain;
- }
- }
- }
-}
diff --git a/projects/aca-settings/src/lib/settings.component.spec.ts b/projects/aca-settings/src/lib/settings.component.spec.ts
deleted file mode 100644
index 52efc2066..000000000
--- a/projects/aca-settings/src/lib/settings.component.spec.ts
+++ /dev/null
@@ -1,138 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { SettingsComponent } from './settings.component';
-import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { CoreModule, setupTestBed, StorageService } from '@alfresco/adf-core';
-import { AcaSettingsModule } from './settings.module';
-import { By } from '@angular/platform-browser';
-import { AppExtensionService, initialState, LibTestingModule, SettingsParameterRef } from '@alfresco/aca-shared';
-import { provideMockStore } from '@ngrx/store/testing';
-
-describe('SettingsComponent', () => {
- let fixture: ComponentFixture;
- let component: SettingsComponent;
- let storage: StorageService;
- let appExtensions: AppExtensionService;
-
- let stringParam: SettingsParameterRef;
- let boolParam: SettingsParameterRef;
-
- setupTestBed({
- imports: [CoreModule.forRoot(), AcaSettingsModule, LibTestingModule],
- providers: [provideMockStore({ initialState })]
- });
-
- beforeEach(() => {
- fixture = TestBed.createComponent(SettingsComponent);
- component = fixture.componentInstance;
-
- storage = TestBed.inject(StorageService);
- appExtensions = TestBed.inject(AppExtensionService);
-
- stringParam = {
- key: 'key',
- name: 'param1',
- type: 'string',
- value: 'paramValue'
- };
-
- boolParam = {
- key: 'key',
- name: 'param2',
- type: 'boolean',
- value: true
- };
- });
-
- it('should retrieve string param value from storage', () => {
- spyOn(storage, 'getItem').and.returnValue('storageValue');
-
- const value = component.getStringParamValue(stringParam);
- expect(value).toBe('storageValue');
- });
-
- it('should use param value as fallback when storage is empty', () => {
- spyOn(storage, 'getItem').and.returnValue(null);
-
- const value = component.getStringParamValue(stringParam);
- expect(value).toBe('paramValue');
- });
-
- it('should save param value', () => {
- spyOn(storage, 'setItem').and.stub();
-
- component.setParamValue(stringParam, 'test');
-
- expect(stringParam.value).toBe('test');
- expect(storage.setItem).toHaveBeenCalledWith(stringParam.key, stringParam.value);
- });
-
- it('should save param value only if changed', () => {
- spyOn(storage, 'setItem').and.stub();
-
- component.setParamValue(stringParam, 'test');
- component.setParamValue(stringParam, 'test');
- component.setParamValue(stringParam, 'test');
-
- expect(storage.setItem).toHaveBeenCalledTimes(1);
- });
-
- it('should retrieve boolean param value', () => {
- const getItemSpy = spyOn(storage, 'getItem').and.returnValue('true');
- expect(component.getBooleanParamValue(boolParam)).toBe(true);
-
- getItemSpy.and.returnValue('false');
- expect(component.getBooleanParamValue(boolParam)).toBe(false);
- });
-
- it('should fallback to boolean param value when storage is empty', () => {
- spyOn(storage, 'getItem').and.returnValue(null);
- expect(component.getBooleanParamValue(boolParam)).toBe(true);
- });
-
- it('should render categories as expansion panels', async () => {
- spyOn(component, 'reset').and.stub();
-
- appExtensions.settingGroups = [
- {
- id: 'group1',
- name: 'Group 1',
- parameters: []
- },
- {
- id: 'group2',
- name: 'Group 2',
- parameters: []
- }
- ];
-
- fixture.detectChanges();
- await fixture.whenStable();
-
- const panels = fixture.debugElement.queryAll(By.css('.mat-expansion-panel'));
- expect(panels.length).toBe(3);
- });
-});
diff --git a/projects/aca-settings/src/lib/settings.component.ts b/projects/aca-settings/src/lib/settings.component.ts
deleted file mode 100644
index 27d754a2f..000000000
--- a/projects/aca-settings/src/lib/settings.component.ts
+++ /dev/null
@@ -1,141 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { Component, ViewEncapsulation, OnInit } from '@angular/core';
-import { AppConfigService, StorageService, OauthConfigModel } from '@alfresco/adf-core';
-import { Validators, UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';
-import { Observable } from 'rxjs';
-import { Store } from '@ngrx/store';
-import { AppStore, getHeaderColor, getAppName, getUserProfile, SetSettingsParameterAction } from '@alfresco/aca-shared/store';
-import { ProfileState } from '@alfresco/adf-extensions';
-import { AppExtensionService, SettingsGroupRef, SettingsParameterRef } from '@alfresco/aca-shared';
-
-interface RepositoryConfig {
- ecmHost: string;
- authType: string;
- aisHost: string;
-}
-
-@Component({
- selector: 'aca-settings',
- templateUrl: './settings.component.html',
- styleUrls: ['./settings.component.scss'],
- encapsulation: ViewEncapsulation.None,
- host: { class: 'aca-settings' }
-})
-export class SettingsComponent implements OnInit {
- private defaultPath = '/assets/images/alfresco-logo-white.svg';
-
- form: UntypedFormGroup;
-
- profile$: Observable;
- appName$: Observable;
- headerColor$: Observable;
-
- get settingGroups(): SettingsGroupRef[] {
- return this.appExtensions.getSettingsGroups();
- }
-
- constructor(
- private appExtensions: AppExtensionService,
- private store: Store,
- private appConfig: AppConfigService,
- private storage: StorageService,
- private fb: UntypedFormBuilder
- ) {
- this.profile$ = store.select(getUserProfile);
- this.appName$ = store.select(getAppName);
- this.headerColor$ = store.select(getHeaderColor);
- }
-
- get logo(): string {
- return this.appConfig.get('application.logo', this.defaultPath);
- }
-
- ngOnInit() {
- this.form = this.fb.group({
- ecmHost: ['', [Validators.required, Validators.pattern('^(http|https)://.*[^/]$')]],
- aisHost: ['', [Validators.required, Validators.pattern('^(http|https)://.*[^/]$')]],
- authType: ['']
- });
-
- this.reset();
- }
-
- apply(model: RepositoryConfig, isValid: boolean) {
- if (isValid) {
- this.storage.setItem('ecmHost', model.ecmHost);
- this.storage.setItem('authType', model.authType);
-
- const config: OauthConfigModel = this.appConfig.get('oauth2', null);
- config.host = model.aisHost;
- this.storage.setItem('oauth2', JSON.stringify(config));
-
- // window.location.reload(true);
- }
- }
-
- reset() {
- const config: OauthConfigModel = this.appConfig.get('oauth2', null);
-
- this.form.reset({
- ecmHost: this.storage.getItem('ecmHost') || this.appConfig.get('ecmHost'),
- aisHost: config.host,
- authType: this.appConfig.get('authType')
- });
- }
-
- getStringParamValue(param: SettingsParameterRef): string {
- return this.storage.getItem(param.key) || param.value;
- }
-
- setParamValue(param: SettingsParameterRef, value: any) {
- const currentValue = this.getStringParamValue(param);
-
- if (currentValue !== value.toString()) {
- param.value = value;
- this.saveToStorage(param);
- }
- }
-
- onParamValueChanged(event: Event, param: SettingsParameterRef) {
- const target = event.target as HTMLInputElement;
- this.setParamValue(param, target.value);
- }
-
- getBooleanParamValue(param: SettingsParameterRef): boolean {
- const result = this.storage.getItem(param.key);
- if (result) {
- return result === 'true';
- } else {
- return !!param.value;
- }
- }
-
- private saveToStorage(param: SettingsParameterRef) {
- this.storage.setItem(param.key, param.value ? param.value.toString() : param.value);
- this.store.dispatch(new SetSettingsParameterAction({ name: param.key, value: param.value }));
- }
-}
diff --git a/projects/aca-settings/src/lib/settings.module.ts b/projects/aca-settings/src/lib/settings.module.ts
deleted file mode 100644
index af89a33f9..000000000
--- a/projects/aca-settings/src/lib/settings.module.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { NgModule } from '@angular/core';
-import { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensions';
-import { CommonModule } from '@angular/common';
-import { CoreModule } from '@alfresco/adf-core';
-
-import { SettingsComponent } from './settings.component';
-import { RouterModule } from '@angular/router';
-
-@NgModule({
- imports: [CommonModule, RouterModule, CoreModule.forChild()],
- declarations: [SettingsComponent],
- providers: [provideExtensionConfig(['settings.plugin.json'])]
-})
-export class AcaSettingsModule {
- constructor(extensions: ExtensionService) {
- extensions.setComponents({
- 'app.settings.component': SettingsComponent
- });
- }
-}
diff --git a/projects/aca-settings/src/public-api.ts b/projects/aca-settings/src/public-api.ts
deleted file mode 100644
index 5843aa880..000000000
--- a/projects/aca-settings/src/public-api.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-export * from './lib/settings.component';
-export * from './lib/settings.module';
diff --git a/projects/aca-settings/src/test.ts b/projects/aca-settings/src/test.ts
deleted file mode 100644
index d090901c7..000000000
--- a/projects/aca-settings/src/test.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-// This file is required by karma.conf.js and loads recursively all the .spec and framework files
-
-import 'zone.js';
-import 'zone.js/testing';
-import { getTestBed } from '@angular/core/testing';
-import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
-
-declare const require: {
- context(
- path: string,
- deep?: boolean,
- filter?: RegExp
- ): {
- keys(): string[];
- (id: string): T;
- };
-};
-
-// First, initialize the Angular testing environment.
-getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
- teardown: { destroyAfterEach: false }
-});
-// Then we find all the tests.
-const context = require.context('./', true, /\.spec\.ts$/);
-// And load the modules.
-context.keys().map(context);
diff --git a/projects/aca-settings/tsconfig.lib.json b/projects/aca-settings/tsconfig.lib.json
deleted file mode 100644
index 94f919996..000000000
--- a/projects/aca-settings/tsconfig.lib.json
+++ /dev/null
@@ -1,25 +0,0 @@
-/* To learn more about this file see: https://angular.io/config/tsconfig. */
-{
- "extends": "../../tsconfig.json",
- "compilerOptions": {
- "outDir": "../../out-tsc/lib",
- "declarationMap": true,
- "target": "es2020",
- "declaration": true,
- "inlineSources": true,
- "types": [],
- "lib": [
- "dom",
- "es2018"
- ]
- },
- "angularCompilerOptions": {
- "skipTemplateCodegen": true,
- "strictMetadataEmit": true,
- "enableResourceInlining": true
- },
- "exclude": [
- "src/test.ts",
- "**/*.spec.ts"
- ]
-}
diff --git a/projects/aca-settings/tsconfig.lib.prod.json b/projects/aca-settings/tsconfig.lib.prod.json
deleted file mode 100644
index 1715cbee8..000000000
--- a/projects/aca-settings/tsconfig.lib.prod.json
+++ /dev/null
@@ -1,15 +0,0 @@
-/* To learn more about this file see: https://angular.io/config/tsconfig. */
-{
- "extends": "./tsconfig.lib.json",
- "compilerOptions": {
- "declarationMap": false,
- "paths": {
- "@alfresco/aca-shared": ["dist/@alfresco/aca-shared"],
- "@alfresco/aca-shared/store": ["dist/@alfresco/aca-shared/store"],
- "@alfresco/aca-shared/rules": ["dist/@alfresco/aca-shared/rules"]
- }
- },
- "angularCompilerOptions": {
- "compilationMode": "partial"
- }
-}
diff --git a/projects/aca-settings/tsconfig.spec.adf.json b/projects/aca-settings/tsconfig.spec.adf.json
deleted file mode 100644
index 04a6994be..000000000
--- a/projects/aca-settings/tsconfig.spec.adf.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "extends": "../../tsconfig.adf.json",
- "compilerOptions": {
- "outDir": "../../out-tsc/spec",
- "types": [
- "jasmine"
- ]
- },
- "files": [
- "src/test.ts"
- ],
- "include": [
- "**/*.spec.ts",
- "**/*.d.ts"
- ]
-}
diff --git a/projects/aca-settings/tsconfig.spec.json b/projects/aca-settings/tsconfig.spec.json
deleted file mode 100644
index 715dd0a5d..000000000
--- a/projects/aca-settings/tsconfig.spec.json
+++ /dev/null
@@ -1,17 +0,0 @@
-/* To learn more about this file see: https://angular.io/config/tsconfig. */
-{
- "extends": "../../tsconfig.json",
- "compilerOptions": {
- "outDir": "../../out-tsc/spec",
- "types": [
- "jasmine"
- ]
- },
- "files": [
- "src/test.ts"
- ],
- "include": [
- "**/*.spec.ts",
- "**/*.d.ts"
- ]
-}
diff --git a/projects/aca-viewer/karma.conf.js b/projects/aca-viewer/karma.conf.js
index 0e1dfce09..06a243039 100644
--- a/projects/aca-viewer/karma.conf.js
+++ b/projects/aca-viewer/karma.conf.js
@@ -16,7 +16,7 @@ module.exports = function (config) {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
- dir: require('path').join(__dirname, '../../coverage/aca-settings'),
+ dir: require('path').join(__dirname, '../../coverage/aca-viewer'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
diff --git a/scripts/ci/npm/publish-libs.sh b/scripts/ci/npm/publish-libs.sh
index 66c9e051a..5dfbed521 100755
--- a/scripts/ci/npm/publish-libs.sh
+++ b/scripts/ci/npm/publish-libs.sh
@@ -42,7 +42,6 @@ PROJECTS=(
'aca-shared'
'aca-folder-rules'
'adf-office-services-ext'
- 'aca-settings'
'aca-about'
'aca-preview'
'aca-viewer'
diff --git a/tsconfig.adf.json b/tsconfig.adf.json
index 785732cc0..82a368a4c 100644
--- a/tsconfig.adf.json
+++ b/tsconfig.adf.json
@@ -36,7 +36,6 @@
"@alfresco/adf-office-services-ext": ["projects/adf-office-services-ext/src/public-api.ts"],
"@alfresco/aca-testing-shared": ["projects/aca-testing-shared"],
"@alfresco/aca-about": ["projects/aca-about/src/public-api.ts"],
- "@alfresco/aca-settings": ["projects/aca-settings/src/public-api.ts"],
"@alfresco/aca-folder-rules": ["projects/aca-folder-rules/src/public-api.ts"],
"@alfresco/aca-content": ["projects/aca-content/src/public-api.ts"],
"@alfresco/aca-viewer": ["projects/aca-viewer/src/public-api.ts"],
diff --git a/tsconfig.json b/tsconfig.json
index 4a23d1bf7..589860c63 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -26,7 +26,6 @@
"@alfresco/adf-office-services-ext": ["projects/adf-office-services-ext/src/public-api.ts"],
"@alfresco/aca-testing-shared": ["projects/aca-testing-shared"],
"@alfresco/aca-about": ["projects/aca-about/src/public-api.ts"],
- "@alfresco/aca-settings": ["projects/aca-settings/src/public-api.ts"],
"@alfresco/aca-folder-rules": ["projects/aca-folder-rules/src/public-api.ts"],
"@alfresco/aca-content": ["projects/aca-content/src/public-api.ts"],
"@alfresco/aca-viewer": ["projects/aca-viewer/src/public-api.ts"],