[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

@@ -10,7 +10,7 @@
</adf-form>
</div>
<div class="app-console" #console>
<div class="app-console">
<h3>Error log:</h3>
<p *ngFor="let error of errorFields">Error {{ error.name }} {{error.validationSummary.message | translate}}</p>
</div>

View File

@@ -15,8 +15,16 @@
* limitations under the License.
*/
import { Component, Inject, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { FormModel, FormFieldModel, FormService, FormOutcomeEvent, NotificationService, CoreAutomationService, FormRenderingService } from '@alfresco/adf-core';
import { Component, inject, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import {
FormModel,
FormFieldModel,
FormService,
FormOutcomeEvent,
NotificationService,
CoreAutomationService,
FormRenderingService
} from '@alfresco/adf-core';
import { ProcessFormRenderingService } from '@alfresco/adf-process-services';
import { InMemoryFormService } from '../../services/in-memory-form.service';
import { Subject } from 'rxjs';
@@ -33,6 +41,10 @@ import { takeUntil } from 'rxjs/operators';
encapsulation: ViewEncapsulation.None
})
export class FormComponent implements OnInit, OnDestroy {
private formService = inject(FormService);
private notificationService = inject(NotificationService);
private automationService = inject(CoreAutomationService);
form: FormModel;
errorFields: FormFieldModel[] = [];
formConfig: string;
@@ -49,25 +61,16 @@ export class FormComponent implements OnInit, OnDestroy {
private onDestroy$ = new Subject<boolean>();
constructor(@Inject(FormService) private formService: InMemoryFormService,
private notificationService: NotificationService,
private automationService: CoreAutomationService) {
}
logErrors(errorFields: FormFieldModel[]) {
this.errorFields = errorFields;
}
ngOnInit() {
this.formService.executeOutcome
.pipe(takeUntil(this.onDestroy$))
.subscribe((formOutcomeEvent: FormOutcomeEvent) => {
formOutcomeEvent.preventDefault();
});
this.formService.executeOutcome.pipe(takeUntil(this.onDestroy$)).subscribe((formOutcomeEvent: FormOutcomeEvent) => {
formOutcomeEvent.preventDefault();
});
this.formConfig = JSON.stringify(
this.automationService.forms.getFormDefinition()
);
this.formConfig = JSON.stringify(this.automationService.forms.getFormDefinition());
this.parseForm();
}