mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1873] Remove all deprecated code from ADF (#4145)
* remove deprecated code part 1 * remove deprecation step 2 * fix spellcheck * fix * fix lint * fix not used import * remove deprecation * fix test first part after remove deprecation * fix test * fix sidebar demo shell
This commit is contained in:
@@ -158,10 +158,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
/**
|
||||
* Emitted when any error occurs.
|
||||
* @deprecated in 2.4.0, will be renamed as "error" in 3.x.x
|
||||
*/
|
||||
@Output()
|
||||
onError: EventEmitter<any> = new EventEmitter<any>();
|
||||
error: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
debugMode: boolean = false;
|
||||
|
||||
@@ -458,7 +457,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
|
||||
}
|
||||
|
||||
handleError(err: any): any {
|
||||
this.onError.emit(err);
|
||||
this.error.emit(err);
|
||||
}
|
||||
|
||||
parseForm(json: any): FormModel {
|
||||
|
@@ -23,7 +23,7 @@ import { DatetimeAdapter, MAT_DATETIME_FORMATS } from '@mat-datetimepicker/core'
|
||||
import { MomentDatetimeAdapter, MAT_MOMENT_DATETIME_FORMATS } from '@mat-datetimepicker/moment';
|
||||
import moment from 'moment-es6';
|
||||
import { Moment } from 'moment';
|
||||
import { UserPreferencesService } from '../../../../services/user-preferences.service';
|
||||
import { UserPreferencesService, UserPreferenceValues } from '../../../../services/user-preferences.service';
|
||||
import { MomentDateAdapter } from '../../../../utils/momentDateAdapter';
|
||||
import { MOMENT_DATE_FORMATS } from '../../../../utils/moment-date-formats.model';
|
||||
import { FormService } from './../../../services/form.service';
|
||||
@@ -49,14 +49,15 @@ export class DateTimeWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
constructor(public formService: FormService,
|
||||
private dateAdapter: DateAdapter<Moment>,
|
||||
private preferences: UserPreferencesService) {
|
||||
private userPreferencesService: UserPreferencesService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.preferences.locale$.subscribe((locale) => {
|
||||
this.userPreferencesService.select(UserPreferenceValues.Locale).subscribe((locale) => {
|
||||
this.dateAdapter.setLocale(locale);
|
||||
});
|
||||
|
||||
let momentDateAdapter = <MomentDateAdapter> this.dateAdapter;
|
||||
momentDateAdapter.overrideDisplayFormat = this.field.dateDisplayFormat;
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
/* tslint:disable:component-selector */
|
||||
|
||||
import { UserPreferencesService } from '../../../../services/user-preferences.service';
|
||||
import { UserPreferencesService, UserPreferenceValues } from '../../../../services/user-preferences.service';
|
||||
import { MomentDateAdapter } from '../../../../utils/momentDateAdapter';
|
||||
import { MOMENT_DATE_FORMATS } from '../../../../utils/moment-date-formats.model';
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
@@ -46,14 +46,15 @@ export class DateWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
constructor(public formService: FormService,
|
||||
private dateAdapter: DateAdapter<Moment>,
|
||||
private preferences: UserPreferencesService) {
|
||||
private userPreferencesService: UserPreferencesService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.preferences.locale$.subscribe((locale) => {
|
||||
this.userPreferencesService.select(UserPreferenceValues.Locale).subscribe((locale) => {
|
||||
this.dateAdapter.setLocale(locale);
|
||||
});
|
||||
|
||||
let momentDateAdapter = <MomentDateAdapter> this.dateAdapter;
|
||||
momentDateAdapter.overrideDisplayFormat = this.field.dateDisplayFormat;
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
/* tslint:disable:component-selector */
|
||||
|
||||
import { UserPreferencesService } from '../../../../../../services/user-preferences.service';
|
||||
import { UserPreferencesService, UserPreferenceValues } from '../../../../../../services/user-preferences.service';
|
||||
import { MomentDateAdapter } from '../../../../../../utils/momentDateAdapter';
|
||||
import { MOMENT_DATE_FORMATS } from '../../../../../../utils/moment-date-formats.model';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
@@ -55,13 +55,14 @@ export class DateEditorComponent implements OnInit {
|
||||
maxDate: Moment;
|
||||
|
||||
constructor(private dateAdapter: DateAdapter<Moment>,
|
||||
private preferences: UserPreferencesService) {
|
||||
private userPreferencesService: UserPreferencesService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.preferences.locale$.subscribe((locale) => {
|
||||
this.userPreferencesService.select(UserPreferenceValues.Locale).subscribe((locale) => {
|
||||
this.dateAdapter.setLocale(locale);
|
||||
});
|
||||
|
||||
let momentDateAdapter = <MomentDateAdapter> this.dateAdapter;
|
||||
momentDateAdapter.overrideDisplayFormat = this.DATE_FORMAT;
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
/* tslint:disable:component-selector */
|
||||
|
||||
import { UserPreferencesService } from '../../../../../../services/user-preferences.service';
|
||||
import { UserPreferencesService, UserPreferenceValues } from '../../../../../../services/user-preferences.service';
|
||||
import { MomentDateAdapter } from '../../../../../../utils/momentDateAdapter';
|
||||
import { MOMENT_DATE_FORMATS } from '../../../../../../utils/moment-date-formats.model';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
@@ -60,13 +60,14 @@ export class DateTimeEditorComponent implements OnInit {
|
||||
maxDate: Moment;
|
||||
|
||||
constructor(private dateAdapter: DateAdapter<Moment>,
|
||||
private preferences: UserPreferencesService) {
|
||||
private userPreferencesService: UserPreferencesService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.preferences.locale$.subscribe((locale) => {
|
||||
this.userPreferencesService.select(UserPreferenceValues.Locale).subscribe((locale) => {
|
||||
this.dateAdapter.setLocale(locale);
|
||||
});
|
||||
|
||||
let momentDateAdapter = <MomentDateAdapter> this.dateAdapter;
|
||||
momentDateAdapter.overrideDisplayFormat = this.DATE_FORMAT;
|
||||
|
||||
|
@@ -57,7 +57,6 @@ export class WidgetComponent implements AfterViewInit {
|
||||
|
||||
/**
|
||||
* Emitted when a field value changes.
|
||||
* @deprecated Used only to trigger visibility engine; components should do that internally if needed.
|
||||
*/
|
||||
@Output()
|
||||
fieldChanged: EventEmitter<FormFieldModel> = new EventEmitter<FormFieldModel>();
|
||||
@@ -96,12 +95,10 @@ export class WidgetComponent implements AfterViewInit {
|
||||
this.fieldChanged.emit(this.field);
|
||||
}
|
||||
|
||||
/** @deprecated used only to trigger visibility engine, components should do that internally if needed */
|
||||
checkVisibility(field: FormFieldModel) {
|
||||
this.fieldChanged.emit(field);
|
||||
}
|
||||
|
||||
/** @deprecated used only to trigger visibility engine, components should do that internally if needed */
|
||||
onFieldChanged(field: FormFieldModel) {
|
||||
this.fieldChanged.emit(field);
|
||||
}
|
||||
|
Reference in New Issue
Block a user