mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
AAE-36664 additional linting rules, cleanup (#11084)
This commit is contained in:
+1
-1
@@ -213,7 +213,7 @@ describe('AppListCloudComponent', () => {
|
||||
customFixture.detectChanges();
|
||||
await customFixture.whenStable();
|
||||
|
||||
const title: any = customFixture.nativeElement.querySelector('#custom-id');
|
||||
const title = customFixture.nativeElement.querySelector('#custom-id');
|
||||
expect(title.innerText).toBe('No Apps Found');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -28,7 +28,10 @@ import { RequestOptions } from '@alfresco/js-api';
|
||||
export class AppsProcessCloudService {
|
||||
deployedApps: ApplicationInstanceModel[];
|
||||
|
||||
constructor(private adfHttpClient: AdfHttpClient, private appConfigService: AppConfigService) {
|
||||
constructor(
|
||||
private readonly adfHttpClient: AdfHttpClient,
|
||||
private readonly appConfigService: AppConfigService
|
||||
) {
|
||||
this.loadApps();
|
||||
}
|
||||
|
||||
@@ -48,11 +51,12 @@ export class AppsProcessCloudService {
|
||||
}
|
||||
|
||||
loadApps() {
|
||||
const apps = this.appConfigService.get<any>('alfresco-deployed-apps', []);
|
||||
apps.map((app) => {
|
||||
app.theme = app.theme ? app.theme : 'theme-1';
|
||||
app.icon = app.icon ? app.icon : 'favorite';
|
||||
});
|
||||
const apps = this.appConfigService.get<{ theme: string; icon: string }[]>('alfresco-deployed-apps', []);
|
||||
for (const app of apps) {
|
||||
app.theme = app.theme ?? 'theme-1';
|
||||
app.icon = app.icon ?? 'favorite';
|
||||
}
|
||||
|
||||
this.deployedApps = apps;
|
||||
}
|
||||
|
||||
|
||||
@@ -363,8 +363,8 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
|
||||
}),
|
||||
takeUntilDestroyed(this.destroyRef)
|
||||
)
|
||||
.subscribe(
|
||||
(form) => {
|
||||
.subscribe({
|
||||
next: (form) => {
|
||||
this.formCloudRepresentationJSON = form;
|
||||
this.formCloudRepresentationJSON.processVariables = this.data || [];
|
||||
const parsedForm = this.parseForm(form);
|
||||
@@ -374,10 +374,10 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
|
||||
this.form.nodeId = '-my-';
|
||||
this.onFormLoaded(this.form);
|
||||
},
|
||||
(error) => {
|
||||
error: (error) => {
|
||||
this.handleError(error);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
saveTaskForm() {
|
||||
@@ -385,12 +385,12 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
|
||||
this.formCloudService
|
||||
.saveTaskForm(this.appName, this.taskId, this.processInstanceId, `${this.form.id}`, this.form.values)
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe(
|
||||
() => {
|
||||
.subscribe({
|
||||
next: () => {
|
||||
this.onTaskSaved(this.form);
|
||||
},
|
||||
(error) => this.onTaskSavedError(error)
|
||||
);
|
||||
error: (error) => this.onTaskSavedError(error)
|
||||
});
|
||||
this.displayModeService.onSaveTask(this.id, this.displayMode, this.displayModeConfigurations);
|
||||
}
|
||||
}
|
||||
@@ -420,12 +420,12 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
|
||||
this.formCloudService
|
||||
.completeTaskForm(this.appName, this.taskId, this.processInstanceId, `${this.form.id}`, this.form.values, outcome, this.appVersion)
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe(
|
||||
() => {
|
||||
.subscribe({
|
||||
next: () => {
|
||||
this.onTaskCompleted(this.form);
|
||||
},
|
||||
(error) => this.onTaskCompletedError(error)
|
||||
);
|
||||
error: (error) => this.onTaskCompletedError(error)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
|
||||
}
|
||||
|
||||
loadInjectedFieldValidators(injectedFieldValidators: FormFieldValidator[]): void {
|
||||
if (injectedFieldValidators && injectedFieldValidators?.length) {
|
||||
if (Array.isArray(injectedFieldValidators) && injectedFieldValidators.length) {
|
||||
this.fieldValidators = [...this.fieldValidators, ...injectedFieldValidators];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ export class GroupCloudComponent implements OnInit, OnChanges {
|
||||
if (this.isPreselectedGroupInvalid(group, validationResult)) {
|
||||
this.invalidGroups.push(group);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
this.invalidGroups.push(group);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ export class PeopleCloudComponent implements OnInit, OnChanges, AfterViewInit {
|
||||
if (!this.equalsUsers(user, validationResult)) {
|
||||
this.invalidUsers.push(user);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
this.invalidUsers.push(user);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,13 +39,14 @@ export const PROCESS_SERVICES_CLOUD_DIRECTIVES = [
|
||||
* @deprecated this module is deprecated and will be removed in the future versions
|
||||
*
|
||||
* Instead, import the standalone components directly, or use the following provider API to replicate the behaviour:
|
||||
*
|
||||
* ```
|
||||
* providers: [
|
||||
* provideTranslations('adf-process-services-cloud', 'assets/adf-process-services-cloud')
|
||||
* provideCloudPreferences()
|
||||
* provideCloudFormRenderer(),
|
||||
* { provide: TASK_LIST_CLOUD_TOKEN, useClass: TaskListCloudService }
|
||||
* ]
|
||||
* ```
|
||||
*/
|
||||
@NgModule({
|
||||
imports: [ProcessCloudModule, TaskCloudModule, GroupCloudComponent, ...PROCESS_SERVICES_CLOUD_DIRECTIVES],
|
||||
|
||||
+1
-1
@@ -26,7 +26,6 @@ import {
|
||||
DataColumnComponent,
|
||||
DataColumnListComponent,
|
||||
DataRowEvent,
|
||||
getDataColumnMock,
|
||||
ObjectDataColumn,
|
||||
ObjectDataRow,
|
||||
User,
|
||||
@@ -46,6 +45,7 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatProgressSpinnerHarness } from '@angular/material/progress-spinner/testing';
|
||||
import { provideCloudPreferences } from '../../../providers';
|
||||
import { getDataColumnMock } from '../../../testing/data-column.mock';
|
||||
|
||||
const fakeCustomSchema = [
|
||||
new ObjectDataColumn<ProcessListDataColumnCustomData>({
|
||||
|
||||
+2
-1
@@ -15,11 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DataColumn, DataRow, getDataColumnMock } from '@alfresco/adf-core';
|
||||
import { DataColumn, DataRow } from '@alfresco/adf-core';
|
||||
import { getProcessInstanceVariableMock } from '../../../mock/process-instance-variable.mock';
|
||||
import { ProcessListDataColumnCustomData, PROCESS_LIST_CUSTOM_VARIABLE_COLUMN } from '../../../models/data-column-custom-data';
|
||||
import { ProcessInstanceCloudListViewModel } from '../models/perocess-instance-cloud-view.model';
|
||||
import { ProcessListDatatableAdapter } from './process-list-datatable-adapter';
|
||||
import { getDataColumnMock } from '../../../testing/data-column.mock';
|
||||
|
||||
describe('ProcessListDatatableAdapter', () => {
|
||||
it('should get proepr type for column', () => {
|
||||
|
||||
-11
@@ -15,21 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FormFieldModel, FormFieldValidator } from '@alfresco/adf-core';
|
||||
import { ProcessDefinitionCloud } from '../../../models/process-definition-cloud.model';
|
||||
import { ProcessInstanceCloud } from '../models/process-instance-cloud.model';
|
||||
import { ProcessPayloadCloud } from '../models/process-payload-cloud.model';
|
||||
|
||||
export class MockFormFieldValidator implements FormFieldValidator {
|
||||
isSupported(_field: FormFieldModel): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
validate(_field: FormFieldModel): boolean {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export const fakeProcessInstance: ProcessInstanceCloud = {
|
||||
appName: 'simple-app',
|
||||
appVersion: '1',
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
|
||||
import { getProcessInstanceVariableMock } from '../mock/process-instance-variable.mock';
|
||||
|
||||
import { ProcessListDataColumnCustomData } from '../models/data-column-custom-data';
|
||||
import { ProcessInstanceVariable } from '../models/process-instance-variable.model';
|
||||
import { VariableMapperService } from './variable-mapper.sevice';
|
||||
import { DataColumn, getDataColumnMock } from '@alfresco/adf-core';
|
||||
import { DataColumn } from '@alfresco/adf-core';
|
||||
import { getDataColumnMock } from '../testing/data-column.mock';
|
||||
|
||||
describe('VariableMapperService', () => {
|
||||
let service: VariableMapperService;
|
||||
|
||||
+2
-1
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DataColumn, DataRow, getDataColumnMock } from '@alfresco/adf-core';
|
||||
import { DataColumn, DataRow } from '@alfresco/adf-core';
|
||||
import { getDataColumnMock } from '../../../../../testing/data-column.mock';
|
||||
import { ProcessListDataColumnCustomData, PROCESS_LIST_CUSTOM_VARIABLE_COLUMN } from '../../../../../models/data-column-custom-data';
|
||||
import { TasksListDatatableAdapter } from './task-list-datatable-adapter';
|
||||
import { TaskInstanceCloudListViewModel } from '../../../models/task-cloud-view.model';
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* 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 { DataColumn } from '@alfresco/adf-core';
|
||||
|
||||
export const getDataColumnMock = <T = unknown>(column: Partial<DataColumn<T>> = {}): DataColumn<T> => ({
|
||||
id: 'columnId',
|
||||
key: 'key',
|
||||
type: 'text',
|
||||
format: 'format',
|
||||
sortable: false,
|
||||
title: 'title',
|
||||
srTitle: 'srTitle',
|
||||
cssClass: 'cssClass',
|
||||
template: undefined,
|
||||
copyContent: false,
|
||||
editable: false,
|
||||
focus: false,
|
||||
sortingKey: 'sortingKey',
|
||||
header: undefined,
|
||||
draggable: false,
|
||||
resizable: true,
|
||||
isHidden: false,
|
||||
customData: undefined,
|
||||
...column
|
||||
});
|
||||
Reference in New Issue
Block a user