mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ACS-7429] cleanup APS1 task-list before refactorings (#9650)
This commit is contained in:
@@ -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>
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user