mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
AAE-41225 update typescript target to es2022 and fix FormService propagation (#11508)
* update targets * update targets * fixed FormService propagation [ci:force] * fixed FormService propagation [ci:force]
This commit is contained in:
-5
@@ -19,7 +19,6 @@
|
||||
|
||||
import { Component, EventEmitter, inject, OnDestroy, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
||||
import {
|
||||
FormService,
|
||||
FormValues,
|
||||
ContentLinkModel,
|
||||
AppConfigService,
|
||||
@@ -80,10 +79,6 @@ export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent i
|
||||
}
|
||||
displayedColumns = ['icon', 'fileName', 'title', 'action'];
|
||||
|
||||
constructor(formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
if (this.hasFile && this.field.value.length > 0) {
|
||||
|
||||
+2
-6
@@ -17,10 +17,9 @@
|
||||
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { Component, inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import {
|
||||
WidgetComponent,
|
||||
FormService,
|
||||
FormBaseModule,
|
||||
DataRow,
|
||||
DataColumn,
|
||||
@@ -64,10 +63,7 @@ export class DataTableWidgetComponent extends WidgetComponent implements OnInit
|
||||
private variableName: string;
|
||||
private defaultResponseProperty = 'data';
|
||||
private pathParserHelper = new DataTablePathParserHelper();
|
||||
|
||||
constructor(public formService: FormService, private formCloudService: FormCloudService) {
|
||||
super(formService);
|
||||
}
|
||||
private formCloudService = inject(FormCloudService);
|
||||
|
||||
ngOnInit(): void {
|
||||
this.init();
|
||||
|
||||
+3
-5
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ChangeDetectionStrategy, Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { WidgetComponent, FormService, FormBaseModule } from '@alfresco/adf-core';
|
||||
import { ChangeDetectionStrategy, Component, inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { WidgetComponent, FormBaseModule } from '@alfresco/adf-core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { FormCloudService } from '../../../services/form-cloud.service';
|
||||
@@ -49,9 +49,7 @@ export class DisplayExternalPropertyWidgetComponent extends WidgetComponent impl
|
||||
previewState = false;
|
||||
propertyControl: FormControl;
|
||||
|
||||
constructor(public readonly formService: FormService, private readonly formCloudService: FormCloudService) {
|
||||
super(formService);
|
||||
}
|
||||
private readonly formCloudService = inject(FormCloudService);
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initFormControl();
|
||||
|
||||
+1
-5
@@ -18,7 +18,7 @@
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { Component, inject, InjectionToken, OnInit, SecurityContext, ViewEncapsulation } from '@angular/core';
|
||||
import { WidgetComponent, FormService } from '@alfresco/adf-core';
|
||||
import { WidgetComponent } from '@alfresco/adf-core';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { RichTextParserService } from '../../../services/rich-text-parser.service';
|
||||
|
||||
@@ -49,10 +49,6 @@ export class DisplayRichTextWidgetComponent extends WidgetComponent implements O
|
||||
private readonly richTextParserService = inject(RICH_TEXT_PARSER_TOKEN);
|
||||
private readonly sanitizer = inject(DomSanitizer);
|
||||
|
||||
constructor(formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.parsedHTML = this.richTextParserService.parse(this.field.value);
|
||||
|
||||
|
||||
+2
-6
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { FormService, BaseViewerWidgetComponent, ErrorWidgetComponent } from '@alfresco/adf-core';
|
||||
import { BaseViewerWidgetComponent, ErrorWidgetComponent } from '@alfresco/adf-core';
|
||||
import { AlfrescoViewerComponent } from '@alfresco/adf-content-services';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
|
||||
@@ -29,8 +29,4 @@ import { TranslatePipe } from '@ngx-translate/core';
|
||||
styleUrls: ['./file-viewer.widget.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class FileViewerWidgetComponent extends BaseViewerWidgetComponent {
|
||||
constructor(formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
}
|
||||
export class FileViewerWidgetComponent extends BaseViewerWidgetComponent {}
|
||||
|
||||
+1
-5
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, DestroyRef, inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { ErrorWidgetComponent, FormService, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { ErrorWidgetComponent, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
import { filter } from 'rxjs/operators';
|
||||
import { ComponentSelectionMode } from '../../../../types';
|
||||
@@ -56,10 +56,6 @@ export class GroupCloudWidgetComponent extends WidgetComponent implements OnInit
|
||||
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
|
||||
constructor(formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field) {
|
||||
this.roles = this.field.roles;
|
||||
|
||||
+1
-5
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, DestroyRef, inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { ErrorWidgetComponent, FormService, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { ErrorWidgetComponent, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
import { filter } from 'rxjs/operators';
|
||||
import { ComponentSelectionMode } from '../../../../types';
|
||||
@@ -62,10 +62,6 @@ export class PeopleCloudWidgetComponent extends WidgetComponent implements OnIni
|
||||
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
|
||||
constructor(formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field) {
|
||||
this.roles = this.field.roles;
|
||||
|
||||
+1
-5
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Output, ViewEncapsulation } from '@angular/core';
|
||||
import { BaseViewerWidgetComponent, ErrorWidgetComponent, FormService } from '@alfresco/adf-core';
|
||||
import { BaseViewerWidgetComponent, ErrorWidgetComponent } from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { PropertiesViewerWrapperComponent } from './properties-viewer-wrapper/properties-viewer-wrapper.component';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
@@ -35,10 +35,6 @@ export class PropertiesViewerWidgetComponent extends BaseViewerWidgetComponent {
|
||||
@Output()
|
||||
nodeContentLoaded: EventEmitter<Node> = new EventEmitter();
|
||||
|
||||
constructor(formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
onNodeContentLoaded(node: Node) {
|
||||
this.nodeContentLoaded.emit(node);
|
||||
}
|
||||
|
||||
+4
-2
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { FormFieldModel, FormFieldOption, FormFieldTypes, FormModel } from '@alfresco/adf-core';
|
||||
import { FormFieldModel, FormFieldOption, FormFieldTypes, FormModel, FormService } from '@alfresco/adf-core';
|
||||
import { FormCloudService } from '../../../services/form-cloud.service';
|
||||
import { RadioButtonsCloudWidgetComponent } from './radio-buttons-cloud.widget';
|
||||
import { of, throwError } from 'rxjs';
|
||||
@@ -29,6 +29,7 @@ describe('RadioButtonsCloudWidgetComponent', () => {
|
||||
let fixture: ComponentFixture<RadioButtonsCloudWidgetComponent>;
|
||||
let widget: RadioButtonsCloudWidgetComponent;
|
||||
let formCloudService: FormCloudService;
|
||||
let formService: FormService;
|
||||
let formUtilsService: FormUtilsService;
|
||||
let element: HTMLElement;
|
||||
let loader: HarnessLoader;
|
||||
@@ -50,6 +51,7 @@ describe('RadioButtonsCloudWidgetComponent', () => {
|
||||
formCloudService = TestBed.inject(FormCloudService);
|
||||
formUtilsService = TestBed.inject(FormUtilsService);
|
||||
fixture = TestBed.createComponent(RadioButtonsCloudWidgetComponent);
|
||||
formService = fixture.debugElement.injector.get(FormService);
|
||||
widget = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
loader = TestbedHarnessEnvironment.loader(fixture);
|
||||
@@ -291,7 +293,7 @@ describe('RadioButtonsCloudWidgetComponent', () => {
|
||||
options: restOption
|
||||
});
|
||||
fixture.detectChanges();
|
||||
const formValueSpy = spyOn(widget.formService.formRulesEvent, 'next');
|
||||
const formValueSpy = spyOn(formService.formRulesEvent, 'next');
|
||||
const radioButton = await loader.getHarness(MatRadioButtonHarness.with({ label: 'opt-name-1' }));
|
||||
await radioButton.check();
|
||||
|
||||
|
||||
+1
-5
@@ -18,7 +18,7 @@
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { Component, DestroyRef, inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { ErrorMessageModel, ErrorWidgetComponent, FormFieldOption, FormService, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { ErrorMessageModel, ErrorWidgetComponent, FormFieldOption, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { FormCloudService } from '../../../services/form-cloud.service';
|
||||
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
@@ -55,10 +55,6 @@ export class RadioButtonsCloudWidgetComponent extends WidgetComponent implements
|
||||
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
|
||||
constructor(formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.isValidRestConfig() && !this.isReadOnlyForm()) {
|
||||
this.getValuesFromRestApi();
|
||||
|
||||
+1
-5
@@ -21,7 +21,7 @@ import { Component, ElementRef, EventEmitter, inject, OnInit, Output, ViewChild,
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import { mergeMap } from 'rxjs/operators';
|
||||
import { WidgetComponent, FormService, ThumbnailService, NotificationService, ErrorWidgetComponent, IconModule } from '@alfresco/adf-core';
|
||||
import { WidgetComponent, ThumbnailService, NotificationService, ErrorWidgetComponent, IconModule } from '@alfresco/adf-core';
|
||||
import { ProcessCloudContentService } from '../../../services/process-cloud-content.service';
|
||||
import { FileSourceTypes, DestinationFolderPathType } from '../../../models/form-cloud-representation.model';
|
||||
import { VersionManagerUploadData } from '@alfresco/adf-content-services';
|
||||
@@ -65,10 +65,6 @@ export class UploadCloudWidgetComponent extends WidgetComponent implements OnIni
|
||||
@ViewChild('uploadFiles')
|
||||
fileInput: ElementRef;
|
||||
|
||||
constructor(formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field?.value?.length > 0) {
|
||||
this.hasFile = true;
|
||||
|
||||
Reference in New Issue
Block a user