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:
@@ -16,8 +16,8 @@
|
||||
"rootDir": ".",
|
||||
"skipLibCheck": true,
|
||||
"strictNullChecks": false,
|
||||
"target": "es2018",
|
||||
"lib": ["es2018", "dom"],
|
||||
"target": "es2022",
|
||||
"lib": ["es2022", "dom"],
|
||||
"baseUrl": ".",
|
||||
"typeRoots": ["node_modules/@types", "../../node_modules/@types"],
|
||||
"types": ["node"],
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
],
|
||||
"compilerOptions": {
|
||||
"baseUrl": "src",
|
||||
"target": "es2020"
|
||||
"target": "es2022"
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"skipTemplateCodegen": true,
|
||||
|
||||
@@ -23,7 +23,6 @@ import { FormsModule } from '@angular/forms';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { ErrorWidgetComponent } from '../error/error.component';
|
||||
import { WidgetComponent } from '../widget.component';
|
||||
import { filter, isObservable, Observable } from 'rxjs';
|
||||
@@ -87,12 +86,11 @@ export class AmountWidgetComponent extends WidgetComponent implements OnInit {
|
||||
}
|
||||
|
||||
constructor(
|
||||
public formService: FormService,
|
||||
@Optional() @Inject(ADF_AMOUNT_SETTINGS) settings: Observable<AmountWidgetSettings> | AmountWidgetSettings,
|
||||
private currencyPipe: CurrencyPipe,
|
||||
private translationService: TranslationService
|
||||
) {
|
||||
super(formService);
|
||||
super();
|
||||
if (isObservable(settings)) {
|
||||
settings.pipe(takeUntilDestroyed()).subscribe((data: AmountWidgetSettings) => {
|
||||
this.updateSettingsBasedProperties(data);
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { ViewerComponent } from '../../../../viewer';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { ErrorWidgetComponent } from '../error/error.component';
|
||||
import { WidgetComponent } from '../widget.component';
|
||||
|
||||
@@ -35,10 +34,6 @@ import { WidgetComponent } from '../widget.component';
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class BaseViewerWidgetComponent extends WidgetComponent implements OnInit {
|
||||
constructor(formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.field?.value) {
|
||||
if (Array.isArray(this.field.value) && this.field.value.length > 0) {
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { WidgetComponent } from '../widget.component';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
@@ -37,10 +36,6 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
export class ButtonWidgetComponent extends WidgetComponent {
|
||||
readonly tooltipShowDelay: number = 500;
|
||||
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
get hostClasses(): string {
|
||||
return `adf-button-widget ${this.field?.className || ''}`;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { ErrorWidgetComponent } from '../error/error.component';
|
||||
import { WidgetComponent } from '../widget.component';
|
||||
|
||||
@@ -51,10 +50,4 @@ import { WidgetComponent } from '../widget.component';
|
||||
imports: [NgClass, MatCheckboxModule, FormsModule, TranslatePipe, ErrorWidgetComponent, NgIf],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class CheckboxWidgetComponent extends WidgetComponent {
|
||||
checkboxValue: boolean;
|
||||
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
}
|
||||
export class CheckboxWidgetComponent extends WidgetComponent {}
|
||||
|
||||
@@ -21,7 +21,6 @@ import { FormsModule } from '@angular/forms';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { ErrorWidgetComponent } from '../error/error.component';
|
||||
import { WidgetComponent } from '../widget.component';
|
||||
|
||||
@@ -43,8 +42,4 @@ import { WidgetComponent } from '../widget.component';
|
||||
imports: [NgIf, TranslatePipe, MatFormFieldModule, MatInputModule, FormsModule, ErrorWidgetComponent],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class DecimalWidgetComponent extends WidgetComponent {
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
}
|
||||
export class DecimalWidgetComponent extends WidgetComponent {}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { WidgetComponent } from '../widget.component';
|
||||
|
||||
@Component({
|
||||
@@ -40,8 +39,4 @@ import { WidgetComponent } from '../widget.component';
|
||||
imports: [TranslatePipe],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class DisplayTextWidgetComponent extends WidgetComponent {
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
}
|
||||
export class DisplayTextWidgetComponent extends WidgetComponent {}
|
||||
|
||||
@@ -21,7 +21,6 @@ import { animate, state, style, transition, trigger } from '@angular/animations'
|
||||
import { NgIf } from '@angular/common';
|
||||
import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { ErrorMessageModel } from '../core';
|
||||
import { WidgetComponent } from '../widget.component';
|
||||
import { IconModule } from '../../../../icon/icon.module';
|
||||
@@ -64,13 +63,8 @@ export class ErrorWidgetComponent extends WidgetComponent implements OnChanges {
|
||||
required: string;
|
||||
|
||||
translateParameters: any = null;
|
||||
|
||||
subscriptAnimationState: string = '';
|
||||
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
if (changes['required']) {
|
||||
this.required = changes.required.currentValue;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { FormFieldModel } from '../core';
|
||||
import { WidgetComponent } from '../widget.component';
|
||||
|
||||
@@ -48,10 +47,6 @@ export class HyperlinkWidgetComponent extends WidgetComponent implements OnInit
|
||||
linkUrl: string = '#';
|
||||
linkText: string = null;
|
||||
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field) {
|
||||
this.linkUrl = this.getHyperlinkUrl(this.field);
|
||||
|
||||
@@ -15,11 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { Component, inject, ViewEncapsulation } from '@angular/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { EditJsonDialogSettings, EditJsonDialogComponent } from '../../../../dialogs/edit-json/edit-json.dialog';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { WidgetComponent } from '../widget.component';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
@@ -42,9 +41,7 @@ import { TranslatePipe } from '@ngx-translate/core';
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class JsonWidgetComponent extends WidgetComponent {
|
||||
constructor(public formService: FormService, private dialog: MatDialog) {
|
||||
super(formService);
|
||||
}
|
||||
private dialog = inject(MatDialog);
|
||||
|
||||
view() {
|
||||
const rawValue = this.field.value;
|
||||
|
||||
@@ -23,7 +23,6 @@ import { FormsModule } from '@angular/forms';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { ErrorWidgetComponent } from '../error/error.component';
|
||||
import { WidgetComponent } from '../widget.component';
|
||||
|
||||
@@ -45,8 +44,4 @@ import { WidgetComponent } from '../widget.component';
|
||||
imports: [MatFormFieldModule, NgIf, TranslatePipe, MatInputModule, FormsModule, ErrorWidgetComponent],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class MultilineTextWidgetComponentComponent extends WidgetComponent {
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
}
|
||||
export class MultilineTextWidgetComponentComponent extends WidgetComponent {}
|
||||
|
||||
@@ -18,13 +18,12 @@
|
||||
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/no-input-rename */
|
||||
|
||||
import { NgIf } from '@angular/common';
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { Component, inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { DecimalNumberPipe } from '../../../../pipes';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { ErrorWidgetComponent } from '../error/error.component';
|
||||
import { WidgetComponent } from '../widget.component';
|
||||
|
||||
@@ -50,9 +49,7 @@ import { WidgetComponent } from '../widget.component';
|
||||
export class NumberWidgetComponent extends WidgetComponent implements OnInit {
|
||||
displayValue: number;
|
||||
|
||||
constructor(public formService: FormService, private decimalNumberPipe: DecimalNumberPipe) {
|
||||
super(formService);
|
||||
}
|
||||
private decimalNumberPipe = inject(DecimalNumberPipe);
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field.readOnly) {
|
||||
|
||||
@@ -23,7 +23,6 @@ import { FormsModule } from '@angular/forms';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { ErrorWidgetComponent } from '../error/error.component';
|
||||
import { WidgetComponent } from '../widget.component';
|
||||
import { InputMaskDirective } from './text-mask.component';
|
||||
@@ -51,10 +50,6 @@ export class TextWidgetComponent extends WidgetComponent implements OnInit {
|
||||
placeholder: string;
|
||||
isMaskReversed: boolean;
|
||||
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field.params) {
|
||||
this.mask = this.field.params['inputMask'];
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { MatListModule } from '@angular/material/list';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { WidgetComponent } from '../widget.component';
|
||||
import { IconModule } from '../../../../icon/icon.module';
|
||||
|
||||
@@ -48,8 +47,4 @@ import { IconModule } from '../../../../icon/icon.module';
|
||||
imports: [MatListModule, IconModule],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class UnknownWidgetComponent extends WidgetComponent {
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
}
|
||||
export class UnknownWidgetComponent extends WidgetComponent {}
|
||||
|
||||
@@ -20,17 +20,20 @@ import { filter } from 'rxjs/operators';
|
||||
import { FormRulesEvent } from '../../events';
|
||||
import { FormFieldModel, FormModel } from './core';
|
||||
import { WidgetComponent } from './widget.component';
|
||||
import { FormService } from '@alfresco/adf-core';
|
||||
|
||||
describe('WidgetComponent', () => {
|
||||
let widget: WidgetComponent;
|
||||
let fixture: ComponentFixture<WidgetComponent>;
|
||||
let element: HTMLElement;
|
||||
let formService: FormService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [WidgetComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(WidgetComponent);
|
||||
formService = fixture.debugElement.injector.get(FormService);
|
||||
|
||||
element = fixture.nativeElement;
|
||||
widget = fixture.componentInstance;
|
||||
@@ -40,7 +43,7 @@ describe('WidgetComponent', () => {
|
||||
|
||||
describe('Events', () => {
|
||||
it('should click event be redirect on the form event service', fakeAsync(() => {
|
||||
widget.formService.formEvents.subscribe((event) => {
|
||||
formService.formEvents.subscribe((event) => {
|
||||
expect(event).toBeTruthy();
|
||||
});
|
||||
|
||||
@@ -48,7 +51,7 @@ describe('WidgetComponent', () => {
|
||||
}));
|
||||
|
||||
it('should click event be redirect on the form rules event service', fakeAsync(() => {
|
||||
widget.formService.formRulesEvent.pipe(filter((event) => event.type === 'click')).subscribe((event) => {
|
||||
formService.formRulesEvent.pipe(filter((event) => event.type === 'click')).subscribe((event) => {
|
||||
expect(event).toBeTruthy();
|
||||
});
|
||||
|
||||
@@ -95,7 +98,7 @@ describe('WidgetComponent', () => {
|
||||
const fakeField = new FormFieldModel(fakeForm, { id: 'fakeField', value: 'fakeValue' });
|
||||
|
||||
let lastValue: FormRulesEvent;
|
||||
widget.formService.formRulesEvent.subscribe((event) => (lastValue = event));
|
||||
formService.formRulesEvent.subscribe((event) => (lastValue = event));
|
||||
|
||||
widget.onFieldChanged(fakeField);
|
||||
expect(lastValue.type).toEqual('fieldValueChanged');
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { AfterViewInit, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
|
||||
import { AfterViewInit, Component, EventEmitter, Input, Output, ViewEncapsulation, inject } from '@angular/core';
|
||||
import { FormFieldEvent, FormRulesEvent } from '../../events';
|
||||
import { FormService } from '../../services/form.service';
|
||||
import { FormFieldModel } from './core';
|
||||
@@ -60,7 +60,7 @@ export class WidgetComponent implements AfterViewInit {
|
||||
|
||||
touched: boolean = false;
|
||||
|
||||
constructor(public formService?: FormService) {}
|
||||
protected formService = inject(FormService);
|
||||
|
||||
hasField(): boolean {
|
||||
return !!this.field;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
],
|
||||
"compilerOptions": {
|
||||
"baseUrl": "src",
|
||||
"target": "es2020"
|
||||
"target": "es2022"
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"skipTemplateCodegen": true,
|
||||
|
||||
@@ -1,32 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"lib": [
|
||||
"es2018",
|
||||
"dom"
|
||||
],
|
||||
"declaration": true,
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"noEmitOnError": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"noUnusedParameters": true,
|
||||
"noUnusedLocals": true,
|
||||
"rootDir": "./migrations",
|
||||
"outDir": "../../dist/libs/core/migrations",
|
||||
"skipDefaultLibCheck": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strictNullChecks": true,
|
||||
"target": "es2015",
|
||||
"typeRoots": ["node_modules/@types"],
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": [
|
||||
"migrations/**/*"
|
||||
],
|
||||
"files": ["schematics/migrations/7_0_0/index.ts"]
|
||||
}
|
||||
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"lib": ["es2022", "dom"],
|
||||
"declaration": true,
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"noEmitOnError": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"noUnusedParameters": true,
|
||||
"noUnusedLocals": true,
|
||||
"rootDir": "./migrations",
|
||||
"outDir": "../../dist/libs/core/migrations",
|
||||
"skipDefaultLibCheck": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strictNullChecks": true,
|
||||
"target": "es2022",
|
||||
"typeRoots": ["node_modules/@types"],
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["migrations/**/*"],
|
||||
"files": ["schematics/migrations/7_0_0/index.ts"]
|
||||
}
|
||||
|
||||
@@ -1,29 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"lib": [
|
||||
"es2018",
|
||||
"dom"
|
||||
],
|
||||
"declaration": true,
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"noEmitOnError": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitThis": true,
|
||||
"noUnusedParameters": true,
|
||||
"noUnusedLocals": true,
|
||||
"rootDir": "./schematics",
|
||||
"outDir": "../../dist/libs/core/schematics",
|
||||
"skipDefaultLibCheck": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strictNullChecks": true,
|
||||
"target": "es2015",
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": [
|
||||
"schematics/**/*"
|
||||
]
|
||||
}
|
||||
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"lib": ["es2022", "dom"],
|
||||
"declaration": true,
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"noEmitOnError": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitThis": true,
|
||||
"noUnusedParameters": true,
|
||||
"noUnusedLocals": true,
|
||||
"rootDir": "./schematics",
|
||||
"outDir": "../../dist/libs/core/schematics",
|
||||
"skipDefaultLibCheck": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strictNullChecks": true,
|
||||
"target": "es2022",
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["schematics/**/*"]
|
||||
}
|
||||
|
||||
@@ -1,24 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2019",
|
||||
"module": "commonjs",
|
||||
"sourceMap": false,
|
||||
"outDir": "dist",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"skipLibCheck": true,
|
||||
"baseUrl": "src",
|
||||
"types": [
|
||||
"node", "@typescript-eslint/utils"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"tests"
|
||||
]
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "commonjs",
|
||||
"sourceMap": false,
|
||||
"outDir": "dist",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"skipLibCheck": true,
|
||||
"baseUrl": "src",
|
||||
"types": ["node", "@typescript-eslint/utils"]
|
||||
},
|
||||
"include": ["**/*"],
|
||||
"exclude": ["node_modules", "tests"]
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
],
|
||||
"compilerOptions": {
|
||||
"baseUrl": "src",
|
||||
"target": "es2020"
|
||||
"target": "es2022"
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"skipTemplateCodegen": true,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
],
|
||||
"compilerOptions": {
|
||||
"baseUrl": "src",
|
||||
"target": "es2020"
|
||||
"target": "es2022"
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"skipTemplateCodegen": true,
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"moduleResolution": "node",
|
||||
"stripInternal": false,
|
||||
"target": "es2015",
|
||||
"target": "es2022",
|
||||
"outDir": "./.out",
|
||||
"lib": ["es2018", "dom"],
|
||||
"lib": ["es2022", "dom"],
|
||||
"typeRoots": ["node_modules/@types"],
|
||||
"types": []
|
||||
},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "es2015",
|
||||
"target": "esnext",
|
||||
"removeComments": false,
|
||||
"declaration": true,
|
||||
"declarationDir": "../../../dist/libs/js-api/typings",
|
||||
"emitDeclarationOnly": true
|
||||
}
|
||||
"extends": "./tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "es2022",
|
||||
"target": "esnext",
|
||||
"removeComments": false,
|
||||
"declaration": true,
|
||||
"declarationDir": "../../../dist/libs/js-api/typings",
|
||||
"emitDeclarationOnly": true
|
||||
}
|
||||
}
|
||||
|
||||
-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;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
],
|
||||
"compilerOptions": {
|
||||
"baseUrl": "src",
|
||||
"target": "es2020"
|
||||
"target": "es2022"
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"skipTemplateCodegen": true,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"target": "ES2021",
|
||||
"target": "ES2022",
|
||||
"useDefineForClassFields": false
|
||||
},
|
||||
"files": ["src/test.ts"],
|
||||
|
||||
+8
-8
@@ -189,7 +189,7 @@ describe('AttachFileWidgetComponent', () => {
|
||||
processContentService = TestBed.inject(ProcessContentService);
|
||||
downloadService = TestBed.inject(DownloadService);
|
||||
appConfigService = TestBed.inject(AppConfigService);
|
||||
formService = TestBed.inject(FormService);
|
||||
formService = fixture.debugElement.injector.get(FormService);
|
||||
attachFileWidgetDialogService = TestBed.inject(AttachFileWidgetDialogService);
|
||||
});
|
||||
|
||||
@@ -845,7 +845,7 @@ describe('AttachFileWidgetComponent', () => {
|
||||
value: []
|
||||
});
|
||||
|
||||
spyOn(widget.formService.formContentClicked, 'next');
|
||||
spyOn(formService.formContentClicked, 'next');
|
||||
});
|
||||
|
||||
it('should call formContentClicked when file clicked and it has sourceId', () => {
|
||||
@@ -853,7 +853,7 @@ describe('AttachFileWidgetComponent', () => {
|
||||
|
||||
widget.onAttachFileClicked(fileWithSourceId);
|
||||
|
||||
expect(widget.formService.formContentClicked.next).toHaveBeenCalledWith(fileWithSourceId);
|
||||
expect(formService.formContentClicked.next).toHaveBeenCalledWith(fileWithSourceId);
|
||||
});
|
||||
|
||||
it('should call formContentClicked when file is temporary', () => {
|
||||
@@ -864,7 +864,7 @@ describe('AttachFileWidgetComponent', () => {
|
||||
|
||||
widget.onAttachFileClicked(regularFile);
|
||||
|
||||
expect(widget.formService.formContentClicked.next).toHaveBeenCalledWith(regularFile);
|
||||
expect(formService.formContentClicked.next).toHaveBeenCalledWith(regularFile);
|
||||
});
|
||||
|
||||
it('should fetch getContentPreview when file is neither temporary nor has sourceId', () => {
|
||||
@@ -874,7 +874,7 @@ describe('AttachFileWidgetComponent', () => {
|
||||
widget.onAttachFileClicked(regularFile);
|
||||
|
||||
expect(processContentService.getContentPreview).toHaveBeenCalledWith(123);
|
||||
expect(widget.formService.formContentClicked.next).toHaveBeenCalled();
|
||||
expect(formService.formContentClicked.next).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should not emit formContentClicked when file has no sourceId and contentAvailable is false', () => {
|
||||
@@ -882,7 +882,7 @@ describe('AttachFileWidgetComponent', () => {
|
||||
|
||||
widget.onAttachFileClicked(fileWithoutContent);
|
||||
|
||||
expect(widget.formService.formContentClicked.next).not.toHaveBeenCalled();
|
||||
expect(formService.formContentClicked.next).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should not emit formContentClicked when file is external', () => {
|
||||
@@ -890,7 +890,7 @@ describe('AttachFileWidgetComponent', () => {
|
||||
|
||||
widget.onAttachFileClicked(externalFile);
|
||||
|
||||
expect(widget.formService.formContentClicked.next).not.toHaveBeenCalled();
|
||||
expect(formService.formContentClicked.next).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should not emit formContentClicked when file has no sourceId and isStartProcessPage is true', () => {
|
||||
@@ -899,7 +899,7 @@ describe('AttachFileWidgetComponent', () => {
|
||||
|
||||
widget.onAttachFileClicked(fileWithoutContent);
|
||||
|
||||
expect(widget.formService.formContentClicked.next).not.toHaveBeenCalled();
|
||||
expect(formService.formContentClicked.next).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
+2
-6
@@ -18,14 +18,13 @@
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { Component, DestroyRef, inject, isDevMode, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { AppConfigService, AppConfigValues, DownloadService, ErrorWidgetComponent, FormService, ThumbnailService } from '@alfresco/adf-core';
|
||||
import { AppConfigService, AppConfigValues, DownloadService, ErrorWidgetComponent } from '@alfresco/adf-core';
|
||||
import { AlfrescoIconComponent, ContentNodeDialogService, ContentService } from '@alfresco/adf-content-services';
|
||||
import { AlfrescoEndpointRepresentation, Node, NodeChildAssociation, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
import { from, of, zip } from 'rxjs';
|
||||
import { mergeMap } from 'rxjs/operators';
|
||||
import { AttachFileWidgetDialogService } from './attach-file-widget-dialog.service';
|
||||
import { UploadWidgetComponent } from '../upload/upload.widget';
|
||||
import { ProcessContentService } from '../../services/process-content.service';
|
||||
import { ActivitiContentService } from '../../services/activiti-alfresco.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
@@ -53,9 +52,6 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
|
||||
constructor(
|
||||
public formService: FormService,
|
||||
public thumbnails: ThumbnailService,
|
||||
public processContentService: ProcessContentService,
|
||||
private activitiContentService: ActivitiContentService,
|
||||
private contentService: ContentService,
|
||||
private contentDialog: ContentNodeDialogService,
|
||||
@@ -65,7 +61,7 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private attachDialogService: AttachFileWidgetDialogService
|
||||
) {
|
||||
super(formService, thumbnails, processContentService);
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { FormService, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { WidgetComponent } from '@alfresco/adf-core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ContentWidgetComponent } from './content.widget';
|
||||
|
||||
@@ -41,10 +41,6 @@ export class DocumentWidgetComponent extends WidgetComponent implements OnInit {
|
||||
fileId: string = null;
|
||||
hasFile: boolean = false;
|
||||
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field) {
|
||||
const file = this.field.value;
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { WidgetVisibilityService, WidgetComponent, FormService, ErrorWidgetComponent } from '@alfresco/adf-core';
|
||||
import { ChangeDetectorRef, Component, ElementRef, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { WidgetVisibilityService, WidgetComponent, ErrorWidgetComponent } from '@alfresco/adf-core';
|
||||
import { ChangeDetectorRef, Component, ElementRef, inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { DynamicTableColumn } from './editors/models/dynamic-table-column.model';
|
||||
import { DynamicTableRow } from './editors/models/dynamic-table-row.model';
|
||||
import { DynamicTableModel } from './editors/models/dynamic-table.widget.model';
|
||||
@@ -55,14 +55,9 @@ export class DynamicTableWidgetComponent extends WidgetComponent implements OnIn
|
||||
|
||||
private selectArrayCode = [32, 0, 13];
|
||||
|
||||
constructor(
|
||||
public formService: FormService,
|
||||
public elementRef: ElementRef,
|
||||
private visibilityService: WidgetVisibilityService,
|
||||
private cd: ChangeDetectorRef
|
||||
) {
|
||||
super(formService);
|
||||
}
|
||||
public elementRef = inject(ElementRef);
|
||||
private visibilityService = inject(WidgetVisibilityService);
|
||||
private cd = inject(ChangeDetectorRef);
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BaseViewerWidgetComponent, ErrorWidgetComponent, FormService } from '@alfresco/adf-core';
|
||||
import { BaseViewerWidgetComponent, ErrorWidgetComponent } from '@alfresco/adf-core';
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
@@ -30,8 +30,4 @@ import { AlfrescoViewerComponent } from '@alfresco/adf-content-services';
|
||||
styleUrls: ['./file-viewer.widget.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class FileViewerWidgetComponent extends BaseViewerWidgetComponent {
|
||||
constructor(formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
}
|
||||
export class FileViewerWidgetComponent extends BaseViewerWidgetComponent {}
|
||||
|
||||
+4
-5
@@ -17,8 +17,8 @@
|
||||
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { Component, ElementRef, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { ErrorWidgetComponent, FormService, GroupModel, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { Component, ElementRef, inject, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { ErrorWidgetComponent, GroupModel, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { catchError, debounceTime, distinctUntilChanged, switchMap, tap } from 'rxjs/operators';
|
||||
import { merge, of } from 'rxjs';
|
||||
import { ReactiveFormsModule, UntypedFormControl } from '@angular/forms';
|
||||
@@ -84,9 +84,8 @@ export class FunctionalGroupWidgetComponent extends WidgetComponent implements O
|
||||
@ViewChild('inputValue', { static: true })
|
||||
input: ElementRef;
|
||||
|
||||
constructor(public peopleProcessService: PeopleProcessService, public formService: FormService, public elementRef: ElementRef) {
|
||||
super(formService);
|
||||
}
|
||||
public peopleProcessService = inject(PeopleProcessService);
|
||||
public elementRef = inject(ElementRef);
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field) {
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { ErrorWidgetComponent, FormService, InitialUsernamePipe, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { ErrorWidgetComponent, InitialUsernamePipe, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { Component, ElementRef, EventEmitter, inject, OnInit, Output, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { ReactiveFormsModule, UntypedFormControl } from '@angular/forms';
|
||||
import { MatChipsModule } from '@angular/material/chips';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
@@ -91,13 +91,7 @@ export class PeopleWidgetComponent extends WidgetComponent implements OnInit {
|
||||
return list;
|
||||
})
|
||||
);
|
||||
|
||||
constructor(
|
||||
public formService: FormService,
|
||||
public peopleProcessService: PeopleProcessService
|
||||
) {
|
||||
super(formService);
|
||||
}
|
||||
public peopleProcessService = inject(PeopleProcessService);
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field) {
|
||||
|
||||
+1
-4
@@ -18,7 +18,6 @@
|
||||
import { ComponentFixture, fakeAsync, getTestBed } from '@angular/core/testing';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import {
|
||||
FormService,
|
||||
ContainerModel,
|
||||
FormFieldTypes,
|
||||
FormFieldOption,
|
||||
@@ -36,7 +35,6 @@ import { MatRadioButtonHarness, MatRadioGroupHarness } from '@angular/material/r
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
|
||||
describe('RadioButtonsWidgetComponent', () => {
|
||||
let formService: FormService;
|
||||
let widget: RadioButtonsWidgetComponent;
|
||||
let taskFormService: TaskFormService;
|
||||
let processDefinitionService: ProcessDefinitionService;
|
||||
@@ -52,8 +50,7 @@ describe('RadioButtonsWidgetComponent', () => {
|
||||
taskFormService = getTestBed().inject(TaskFormService);
|
||||
processDefinitionService = getTestBed().inject(ProcessDefinitionService);
|
||||
|
||||
formService = new FormService();
|
||||
widget = new RadioButtonsWidgetComponent(formService, taskFormService, processDefinitionService);
|
||||
widget = getTestBed().createComponent(RadioButtonsWidgetComponent).componentInstance;
|
||||
widget.field = new FormFieldModel(new FormModel(), { restUrl: '<url>', optionType: 'rest' });
|
||||
});
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { ErrorWidgetComponent, FormService, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { ErrorWidgetComponent, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { Component, inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { TaskFormService } from '../../services/task-form.service';
|
||||
import { ProcessDefinitionService } from '../../services/process-definition.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
@@ -45,13 +45,8 @@ import { FormsModule } from '@angular/forms';
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class RadioButtonsWidgetComponent extends WidgetComponent implements OnInit {
|
||||
constructor(
|
||||
public formService: FormService,
|
||||
private taskFormService: TaskFormService,
|
||||
private processDefinitionService: ProcessDefinitionService
|
||||
) {
|
||||
super(formService);
|
||||
}
|
||||
private taskFormService = inject(TaskFormService);
|
||||
private processDefinitionService = inject(ProcessDefinitionService);
|
||||
|
||||
ngOnInit() {
|
||||
if (this.isValidRestConfig() && !this.isReadOnlyForm()) {
|
||||
|
||||
@@ -18,18 +18,16 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { FormService, FormFieldOption, FormFieldTypes, FormFieldModel, FormModel } from '@alfresco/adf-core';
|
||||
import { FormFieldOption, FormFieldTypes, FormFieldModel, FormModel } from '@alfresco/adf-core';
|
||||
import { TypeaheadWidgetComponent } from './typeahead.widget';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { TaskFormService } from '../../services/task-form.service';
|
||||
import { ProcessDefinitionService } from '../../services/process-definition.service';
|
||||
|
||||
describe('TypeaheadWidgetComponent', () => {
|
||||
let formService: FormService;
|
||||
let widget: TypeaheadWidgetComponent;
|
||||
let translationService: TranslateService;
|
||||
let taskFormService: TaskFormService;
|
||||
let processDefinitionService: ProcessDefinitionService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -37,12 +35,10 @@ describe('TypeaheadWidgetComponent', () => {
|
||||
});
|
||||
translationService = TestBed.inject(TranslateService);
|
||||
taskFormService = TestBed.inject(TaskFormService);
|
||||
processDefinitionService = TestBed.inject(ProcessDefinitionService);
|
||||
spyOn(translationService, 'instant').and.callFake((key) => key);
|
||||
spyOn(translationService, 'get').and.callFake((key) => of(key));
|
||||
|
||||
formService = new FormService();
|
||||
widget = new TypeaheadWidgetComponent(formService, taskFormService, processDefinitionService);
|
||||
widget = TestBed.createComponent(TypeaheadWidgetComponent).componentInstance;
|
||||
widget.field = new FormFieldModel(new FormModel({ taskId: 'task-id' }));
|
||||
widget.field.restUrl = 'whateverURL';
|
||||
});
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { FormService, FormFieldOption, WidgetComponent, ErrorWidgetComponent } from '@alfresco/adf-core';
|
||||
import { FormFieldOption, WidgetComponent, ErrorWidgetComponent } from '@alfresco/adf-core';
|
||||
import { ENTER, ESCAPE } from '@angular/cdk/keycodes';
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { Component, inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { TaskFormService } from '../../services/task-form.service';
|
||||
import { ProcessDefinitionService } from '../../services/process-definition.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
@@ -53,13 +53,8 @@ export class TypeaheadWidgetComponent extends WidgetComponent implements OnInit
|
||||
oldValue: string;
|
||||
options: FormFieldOption[] = [];
|
||||
|
||||
constructor(
|
||||
public formService: FormService,
|
||||
private taskFormService: TaskFormService,
|
||||
private processDefinitionService: ProcessDefinitionService
|
||||
) {
|
||||
super(formService);
|
||||
}
|
||||
private taskFormService = inject(TaskFormService);
|
||||
private processDefinitionService = inject(ProcessDefinitionService);
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field.form.taskId && this.field.restUrl) {
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { ThumbnailService, FormService, ContentLinkModel, WidgetComponent, ErrorWidgetComponent } from '@alfresco/adf-core';
|
||||
import { Component, ElementRef, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { ThumbnailService, ContentLinkModel, WidgetComponent, ErrorWidgetComponent } from '@alfresco/adf-core';
|
||||
import { Component, ElementRef, inject, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import { ProcessContentService } from '../../services/process-content.service';
|
||||
import { mergeMap, map } from 'rxjs/operators';
|
||||
@@ -55,9 +55,8 @@ export class UploadWidgetComponent extends WidgetComponent implements OnInit {
|
||||
@ViewChild('uploadFiles')
|
||||
fileInput: ElementRef;
|
||||
|
||||
constructor(public formService: FormService, private thumbnailService: ThumbnailService, public processContentService: ProcessContentService) {
|
||||
super(formService);
|
||||
}
|
||||
protected thumbnailService = inject(ThumbnailService);
|
||||
protected processContentService = inject(ProcessContentService);
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field?.value?.length > 0) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
],
|
||||
"compilerOptions": {
|
||||
"baseUrl": "src",
|
||||
"target": "es2020"
|
||||
"target": "es2022"
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"skipTemplateCodegen": true,
|
||||
|
||||
Reference in New Issue
Block a user