[ACS-7429] cleanup APS1 task-list before refactorings (#9650)

This commit is contained in:
Denys Vuika
2024-05-07 14:51:56 -04:00
committed by GitHub
parent e749473a32
commit 20ee286902
42 changed files with 266 additions and 992 deletions

View File

@@ -1,53 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 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.
*/
/* eslint-disable */
import { Component, NgModule } from '@angular/core';
import { WidgetComponent } from '@alfresco/adf-core';
@Component({
selector: 'custom-editor',
template: `
<div style="color: red">Look, I'm a custom editor!</div>
`
})
export class CustomEditorComponent extends WidgetComponent {
constructor() {
super();
}
}
@Component({
selector: 'custom-stencil-01',
template: `<div style="color: green">ADF version of custom ProcessService stencil</div>`
})
export class CustomStencil01 extends WidgetComponent {
constructor() {
super();
}
}
@NgModule({
declarations: [ CustomEditorComponent, CustomStencil01 ],
exports: [ CustomEditorComponent, CustomStencil01 ]
})
export class CustomEditorsModule {
}

View File

@@ -50,17 +50,16 @@
class="app-grid-item app-tasks-details"
*ngIf="!isStartTaskMode()"
data-automation-id="app-tasks-details">
<adf-task-details #activitiDetails
[debugMode]="true"
[taskId]="currentTaskId"
[showFormTitle]="true"
[fieldValidators]="fieldValidators"
[showHeaderContent]="true"
(formCompleted)="onFormCompleted()"
(formContentClicked)="onContentClick($event)"
(taskCreated)="onTaskCreated($event)"
(assignTask)="onAssignTask()"
(taskDeleted)="onTaskDeleted()">
<adf-task-details
[taskId]="currentTaskId"
[showFormTitle]="true"
[fieldValidators]="fieldValidators"
[showHeaderContent]="true"
(formCompleted)="onFormCompleted()"
(formContentClicked)="onContentClick($event)"
(taskCreated)="onTaskCreated($event)"
(assignTask)="onAssignTask()"
(taskDeleted)="onTaskDeleted()">
</adf-task-details>
<div *ngIf="currentTaskId">
@@ -129,14 +128,12 @@
<adf-pagination
*ngIf="processList"
[target]="processList"
(changePageSize)="onChangePageSize($event)"
#processListPagination>
(changePageSize)="onChangePageSize($event)">
</adf-pagination>
</div>
<div class="app-grid-item app-processes-details" *ngIf="!isStartProcessMode()">
<adf-process-instance-details
#activitiProcessDetails
[processInstanceId]="currentProcessInstanceId"
(processCancelled)="processCancelled()"
(showProcessDiagram)="onShowProcessDiagram($event)"

View File

@@ -16,32 +16,26 @@
*/
// eslint-disable-next-line
import {
AfterViewInit,
Component,
ElementRef,
Input,
OnDestroy,
OnInit,
ViewChild,
ViewEncapsulation,
EventEmitter,
Output
} from '@angular/core';
import { AfterViewInit, Component, ElementRef, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation, EventEmitter, Output } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Pagination, UserProcessInstanceFilterRepresentation, ScriptFilesApi } from '@alfresco/js-api';
import {
FORM_FIELD_VALIDATORS, FormRenderingService, FormService, AppConfigService, PaginationComponent, UserPreferenceValues,
AlfrescoApiService, UserPreferencesService, NotificationService
FORM_FIELD_VALIDATORS,
FormRenderingService,
FormService,
AppConfigService,
PaginationComponent,
UserPreferenceValues,
AlfrescoApiService,
UserPreferencesService,
NotificationService
} from '@alfresco/adf-core';
import {
ProcessFiltersComponent,
ProcessInstance,
ProcessInstanceDetailsComponent,
ProcessInstanceListComponent,
StartProcessInstanceComponent,
FilterRepresentationModel,
TaskDetailsComponent,
TaskDetailsEvent,
TaskFiltersComponent,
TaskListComponent,
@@ -51,7 +45,6 @@ import {
DynamicTableRow
} from '@alfresco/adf-process-services';
import { Subject } from 'rxjs';
import { CustomStencil01 } from './custom-editor/custom-editor.component';
import { DemoFieldValidator } from './demo-field-validator';
import { PreviewService } from '../../services/preview.service';
import { Location } from '@angular/common';
@@ -69,18 +62,12 @@ const REPORT_ROUTE = 2;
templateUrl: './process-service.component.html',
styleUrls: ['./process-service.component.scss'],
encapsulation: ViewEncapsulation.None,
providers: [
{ provide: FormRenderingService, useClass: ProcessFormRenderingService }
]
providers: [{ provide: FormRenderingService, useClass: ProcessFormRenderingService }]
})
export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit {
@ViewChild('activitiFilter')
activitiFilter: TaskFiltersComponent;
@ViewChild('processListPagination')
processListPagination: PaginationComponent;
@ViewChild('taskListPagination')
taskListPagination: PaginationComponent;
@@ -93,12 +80,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
@ViewChild('processList')
processList: ProcessInstanceListComponent;
@ViewChild('activitiProcessDetails')
activitiProcessDetails: ProcessInstanceDetailsComponent;
@ViewChild('activitiDetails')
activitiDetails: TaskDetailsComponent;
@ViewChild('activitiStartProcess')
activitiStartProcess: StartProcessInstanceComponent;
@@ -133,40 +114,31 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
presetColumn = 'default';
showApplications: boolean;
applicationId: number;
processDefinitionName: string;
fieldValidators = [
...FORM_FIELD_VALIDATORS,
new DemoFieldValidator()
];
fieldValidators = [...FORM_FIELD_VALIDATORS, new DemoFieldValidator()];
private onDestroy$ = new Subject<boolean>();
private scriptFileApi: ScriptFilesApi;
constructor(private elementRef: ElementRef,
private route: ActivatedRoute,
private router: Router,
private apiService: AlfrescoApiService,
private appConfig: AppConfigService,
private preview: PreviewService,
formRenderingService: FormRenderingService,
formService: FormService,
private location: Location,
private notificationService: NotificationService,
private preferenceService: UserPreferencesService) {
constructor(
private elementRef: ElementRef,
private route: ActivatedRoute,
private router: Router,
private apiService: AlfrescoApiService,
private appConfig: AppConfigService,
private preview: PreviewService,
formService: FormService,
private location: Location,
private notificationService: NotificationService,
private preferenceService: UserPreferencesService
) {
this.scriptFileApi = new ScriptFilesApi(this.apiService.getInstance());
this.defaultProcessName = this.appConfig.get<string>('adf-start-process.name');
this.defaultProcessDefinitionName = this.appConfig.get<string>('adf-start-process.processDefinitionName');
this.defaultTaskName = this.appConfig.get<string>('adf-start-task.name');
this.processDefinitionName = this.defaultProcessDefinitionName;
// Uncomment this line to replace all 'text' field editors with custom component
// formRenderingService.setComponentTypeResolver('text', () => CustomEditorComponent, true);
// Uncomment this line to map 'custom_stencil_01' to local editor component
formRenderingService.setComponentTypeResolver('custom_stencil_01', () => CustomStencil01, true);
this.preferenceService
.select(UserPreferenceValues.PaginationSize)
@@ -177,22 +149,18 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
formService.validateDynamicTableRow
.pipe(takeUntil(this.onDestroy$))
.subscribe(
(validateDynamicTableRowEvent: ValidateDynamicTableRowEvent) => {
const row: DynamicTableRow = validateDynamicTableRowEvent.row;
if (row?.value && row.value.name === 'admin') {
validateDynamicTableRowEvent.summary.isValid = false;
validateDynamicTableRowEvent.summary.message = 'Sorry, wrong value. You cannot use "admin".';
validateDynamicTableRowEvent.preventDefault();
}
.subscribe((validateDynamicTableRowEvent: ValidateDynamicTableRowEvent) => {
const row: DynamicTableRow = validateDynamicTableRowEvent.row;
if (row?.value && row.value.name === 'admin') {
validateDynamicTableRowEvent.summary.isValid = false;
validateDynamicTableRowEvent.summary.message = 'Sorry, wrong value. You cannot use "admin".';
validateDynamicTableRowEvent.preventDefault();
}
);
formService.formContentClicked
.pipe(takeUntil(this.onDestroy$))
.subscribe((content) => {
this.showContentPreview(content);
});
formService.formContentClicked.pipe(takeUntil(this.onDestroy$)).subscribe((content) => {
this.showContentPreview(content);
});
}
ngOnInit() {