From 3aa629d4be9865bb84fd13c045c6c1488fa41c6a Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Fri, 28 Jan 2022 14:14:42 +0000 Subject: [PATCH] [AAE-7119] Fix circular dependencies (#7472) * fix language item dependency * fix public-api export * dependency fixes * fix circular deps * fix circular deps * fix circular deps * fix circular deps * fix circular dependency * workaround for circular deps * fix lint --- .../src/lib/content-type/index.ts | 1 - .../src/lib/content-type/public-api.ts | 2 +- .../widgets/core/container-column.model.ts | 4 +-- .../widgets/core/form-field-utils.ts | 24 +++++++++++++++++ .../widgets/core/form-field-validator.ts | 7 ++--- .../widgets/core/form-field.model.ts | 12 ++++----- .../widgets/core/form-outcome.model.ts | 3 +-- .../widgets/core/form-widget.model.ts | 4 +-- .../components/widgets/core/form.model.ts | 7 ++--- .../form/components/widgets/core/index.ts | 2 ++ .../core/process-form-model.interface.ts | 20 ++++++++++++++ .../form/components/widgets/core/tab.model.ts | 3 +-- .../dynamic-row-validation-summary.model.ts | 4 +-- lib/core/form/events/form-error.event.ts | 2 +- lib/core/form/events/form-field.event.ts | 4 +-- lib/core/form/events/form.event.ts | 6 ++--- .../validate-dynamic-table-row.event.ts | 4 +-- .../form/events/validate-form-field.event.ts | 4 +-- lib/core/form/events/validate-form.event.ts | 3 +-- lib/core/form/public-api.ts | 1 + .../form-validation-service.interface.ts | 27 +++++++++++++++++++ lib/core/form/services/form.service.ts | 18 ++++++++----- .../language-menu/language-menu.component.ts | 3 ++- lib/core/services/language-item.interface.ts | 24 +++++++++++++++++ lib/core/services/language.service.ts | 8 +----- lib/core/services/public-api.ts | 1 + lib/core/services/user-preferences.service.ts | 2 +- 27 files changed, 144 insertions(+), 56 deletions(-) create mode 100644 lib/core/form/components/widgets/core/form-field-utils.ts create mode 100644 lib/core/form/components/widgets/core/process-form-model.interface.ts create mode 100644 lib/core/form/services/form-validation-service.interface.ts create mode 100644 lib/core/services/language-item.interface.ts diff --git a/lib/content-services/src/lib/content-type/index.ts b/lib/content-services/src/lib/content-type/index.ts index 73861a7535..2e9baa4fdb 100644 --- a/lib/content-services/src/lib/content-type/index.ts +++ b/lib/content-services/src/lib/content-type/index.ts @@ -16,7 +16,6 @@ */ export * from './content-type.service'; -// export * from './content-type.model'; export * from './content-type-metadata.interface'; export * from './content-type-dialog.component'; diff --git a/lib/content-services/src/lib/content-type/public-api.ts b/lib/content-services/src/lib/content-type/public-api.ts index a7e30cc675..afcc926ddc 100644 --- a/lib/content-services/src/lib/content-type/public-api.ts +++ b/lib/content-services/src/lib/content-type/public-api.ts @@ -15,4 +15,4 @@ * limitations under the License. */ -export * from './public-api'; +export * from './index'; diff --git a/lib/core/form/components/widgets/core/container-column.model.ts b/lib/core/form/components/widgets/core/container-column.model.ts index 4761e117fc..6bbd78c5b5 100644 --- a/lib/core/form/components/widgets/core/container-column.model.ts +++ b/lib/core/form/components/widgets/core/container-column.model.ts @@ -17,12 +17,10 @@ /* tslint:disable:component-selector */ -import { FormFieldModel } from './form-field.model'; - export class ContainerColumnModel { size: number = 12; - fields: FormFieldModel[] = []; + fields: any[] = []; colspan: number = 1; rowspan: number = 1; diff --git a/lib/core/form/components/widgets/core/form-field-utils.ts b/lib/core/form/components/widgets/core/form-field-utils.ts new file mode 100644 index 0000000000..af43b1b707 --- /dev/null +++ b/lib/core/form/components/widgets/core/form-field-utils.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright 2019 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const isNumberValue = (value: any): boolean => { + if (value === null || value === undefined || value === '') { + return false; + } + + return !isNaN(+value); +}; diff --git a/lib/core/form/components/widgets/core/form-field-validator.ts b/lib/core/form/components/widgets/core/form-field-validator.ts index a0890d66e9..a00082d7c8 100644 --- a/lib/core/form/components/widgets/core/form-field-validator.ts +++ b/lib/core/form/components/widgets/core/form-field-validator.ts @@ -19,6 +19,7 @@ import moment from 'moment-es6'; import { FormFieldTypes } from './form-field-types'; +import { isNumberValue } from './form-field-utils'; import { FormFieldModel } from './form-field.model'; export interface FormFieldValidator { @@ -104,11 +105,7 @@ export class NumberFieldValidator implements FormFieldValidator { ]; static isNumber(value: any): boolean { - if (value === null || value === undefined || value === '') { - return false; - } - - return !isNaN(+value); + return isNumberValue(value); } isSupported(field: FormFieldModel): boolean { diff --git a/lib/core/form/components/widgets/core/form-field.model.ts b/lib/core/form/components/widgets/core/form-field.model.ts index e498e6defc..300f9b192c 100644 --- a/lib/core/form/components/widgets/core/form-field.model.ts +++ b/lib/core/form/components/widgets/core/form-field.model.ts @@ -23,10 +23,10 @@ import { ErrorMessageModel } from './error-message.model'; import { FormFieldMetadata } from './form-field-metadata'; import { FormFieldOption } from './form-field-option'; import { FormFieldTypes } from './form-field-types'; -import { NumberFieldValidator } from './form-field-validator'; import { FormWidgetModel } from './form-widget.model'; -import { FormModel } from './form.model'; import { FormFieldRule } from './form-field-rule'; +import { ProcessFormModel } from './process-form-model.interface'; +import { isNumberValue } from './form-field-utils'; // Maps to FormFieldRepresentation export class FormFieldModel extends FormWidgetModel { @@ -143,7 +143,7 @@ export class FormFieldModel extends FormWidgetModel { return this._isValid; } - constructor(form: FormModel, json?: any) { + constructor(form: any, json?: any) { super(form, json); if (json) { this.fieldType = json.fieldType; @@ -247,7 +247,7 @@ export class FormFieldModel extends FormWidgetModel { return name + '_LABEL'; } - private getProcessVariableValue(field: any, form: FormModel): any { + private getProcessVariableValue(field: any, form: ProcessFormModel): any { let fieldName = field.name; if (this.isTypeaheadFieldType(field.type)) { fieldName = this.getFieldNameWithLabel(field.id); @@ -255,7 +255,7 @@ export class FormFieldModel extends FormWidgetModel { return form.getProcessVariableValue(fieldName); } - private containerFactory(json: any, form: FormModel): void { + private containerFactory(json: any, form: any): void { this.numberOfColumns = json.numberOfColumns || 1; this.fields = json.fields; @@ -332,7 +332,7 @@ export class FormFieldModel extends FormWidgetModel { if (this.isDateField(json) || this.isDateTimeField(json)) { if (value) { let dateValue; - if (NumberFieldValidator.isNumber(value)) { + if (isNumberValue(value)) { dateValue = moment(value); } else { dateValue = this.isDateTimeField(json) ? moment.utc(value, 'YYYY-MM-DD hh:mm A') : moment.utc(value.split('T')[0], 'YYYY-M-D'); diff --git a/lib/core/form/components/widgets/core/form-outcome.model.ts b/lib/core/form/components/widgets/core/form-outcome.model.ts index 4ed629adf3..b9c4779514 100644 --- a/lib/core/form/components/widgets/core/form-outcome.model.ts +++ b/lib/core/form/components/widgets/core/form-outcome.model.ts @@ -18,7 +18,6 @@ /* tslint:disable:component-selector */ import { FormWidgetModel } from './form-widget.model'; -import { FormModel } from './form.model'; import { WidgetVisibilityModel } from './../../../models/widget-visibility.model'; export class FormOutcomeModel extends FormWidgetModel { @@ -32,7 +31,7 @@ export class FormOutcomeModel extends FormWidgetModel { isVisible: boolean = true; visibilityCondition: WidgetVisibilityModel; - constructor(form: FormModel, json?: any) { + constructor(form: any, json?: any) { super(form, json); if (json) { diff --git a/lib/core/form/components/widgets/core/form-widget.model.ts b/lib/core/form/components/widgets/core/form-widget.model.ts index f99c12d418..b6de6b651f 100644 --- a/lib/core/form/components/widgets/core/form-widget.model.ts +++ b/lib/core/form/components/widgets/core/form-widget.model.ts @@ -17,8 +17,6 @@ /* tslint:disable:component-selector */ -import { FormModel } from './form.model'; - export abstract class FormWidgetModel { readonly fieldType: string; @@ -31,7 +29,7 @@ export abstract class FormWidgetModel { readonly json: any; readonly field: any; - protected constructor(form: FormModel, json: any) { + protected constructor(form: any, json: any) { this.form = form; this.json = json; diff --git a/lib/core/form/components/widgets/core/form.model.ts b/lib/core/form/components/widgets/core/form.model.ts index 41afa6ad7e..63ed3b59ed 100644 --- a/lib/core/form/components/widgets/core/form.model.ts +++ b/lib/core/form/components/widgets/core/form.model.ts @@ -18,7 +18,6 @@ import { FormFieldEvent } from './../../../events/form-field.event'; import { ValidateFormFieldEvent } from './../../../events/validate-form-field.event'; import { ValidateFormEvent } from './../../../events/validate-form.event'; -import { FormService } from './../../../services/form.service'; import { ContainerModel } from './container.model'; import { FormFieldTypes } from './form-field-types'; import { FormFieldModel } from './form-field.model'; @@ -32,6 +31,8 @@ import { FormOutcomeModel } from './form-outcome.model'; import { FormFieldValidator, FORM_FIELD_VALIDATORS } from './form-field-validator'; import { FormFieldTemplates } from './form-field-templates'; import { UploadWidgetContentLinkModel } from './upload-widget-content-link.model'; +import { FormValidationService } from '../../../services/form-validation-service.interface'; +import { ProcessFormModel } from './process-form-model.interface'; export interface FormRepresentationModel { [key: string]: any; @@ -54,7 +55,7 @@ export interface FormRepresentationModel { }; } -export class FormModel { +export class FormModel implements ProcessFormModel { static UNSET_TASK_NAME: string = 'Nameless task'; static SAVE_OUTCOME: string = '$save'; @@ -84,7 +85,7 @@ export class FormModel { processVariables: ProcessVariableModel[] = []; variables: FormVariableModel[] = []; - constructor(json?: any, formValues?: FormValues, readOnly: boolean = false, protected formService?: FormService, enableFixedSpace?: boolean) { + constructor(json?: any, formValues?: FormValues, readOnly: boolean = false, protected formService?: FormValidationService, enableFixedSpace?: boolean) { this.readOnly = readOnly; this.json = json; diff --git a/lib/core/form/components/widgets/core/index.ts b/lib/core/form/components/widgets/core/index.ts index 5075159f16..11ec5348a0 100644 --- a/lib/core/form/components/widgets/core/index.ts +++ b/lib/core/form/components/widgets/core/index.ts @@ -25,6 +25,7 @@ export * from './form-field-templates'; export * from './form-widget.model'; export * from './form-field.model'; export * from './form.model'; +export * from './process-form-model.interface'; export * from './container.model'; export * from './container-column.model'; export * from './tab.model'; @@ -41,3 +42,4 @@ export * from './process-variable.model'; export * from './upload-widget-content-link.model'; export * from './form-field-file-source'; export * from './form-field-rule'; +export * from './form-field-utils'; diff --git a/lib/core/form/components/widgets/core/process-form-model.interface.ts b/lib/core/form/components/widgets/core/process-form-model.interface.ts new file mode 100644 index 0000000000..94f6880918 --- /dev/null +++ b/lib/core/form/components/widgets/core/process-form-model.interface.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright 2019 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ProcessFormModel { + getProcessVariableValue(name: string): any; +} diff --git a/lib/core/form/components/widgets/core/tab.model.ts b/lib/core/form/components/widgets/core/tab.model.ts index 9baa584602..04a2e4354d 100644 --- a/lib/core/form/components/widgets/core/tab.model.ts +++ b/lib/core/form/components/widgets/core/tab.model.ts @@ -19,7 +19,6 @@ import { WidgetVisibilityModel } from '../../../models/widget-visibility.model'; import { FormWidgetModel } from './form-widget.model'; -import { FormModel } from './form.model'; export class TabModel extends FormWidgetModel { @@ -33,7 +32,7 @@ export class TabModel extends FormWidgetModel { return this.fields && this.fields.length > 0; } - constructor(form: FormModel, json?: any) { + constructor(form: any, json?: any) { super(form, json); if (json) { diff --git a/lib/core/form/components/widgets/dynamic-table/dynamic-row-validation-summary.model.ts b/lib/core/form/components/widgets/dynamic-table/dynamic-row-validation-summary.model.ts index 153811c1d5..86681b0167 100644 --- a/lib/core/form/components/widgets/dynamic-table/dynamic-row-validation-summary.model.ts +++ b/lib/core/form/components/widgets/dynamic-table/dynamic-row-validation-summary.model.ts @@ -15,9 +15,9 @@ * limitations under the License. */ -/* tslint:disable:component-selector */ +import { ErrorMessageModel } from '../core/error-message.model'; -import { ErrorMessageModel } from '../core/index'; +/* tslint:disable:component-selector */ export class DynamicRowValidationSummary extends ErrorMessageModel { diff --git a/lib/core/form/events/form-error.event.ts b/lib/core/form/events/form-error.event.ts index 6d8bd0aa8a..934aca2c8f 100644 --- a/lib/core/form/events/form-error.event.ts +++ b/lib/core/form/events/form-error.event.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { FormModel } from './../components/widgets/core/index'; +import { FormModel } from '../components/widgets/core/form.model'; import { FormEvent } from './form.event'; export class FormErrorEvent extends FormEvent { diff --git a/lib/core/form/events/form-field.event.ts b/lib/core/form/events/form-field.event.ts index d2cb6eaf6c..c19ee17e83 100644 --- a/lib/core/form/events/form-field.event.ts +++ b/lib/core/form/events/form-field.event.ts @@ -15,14 +15,14 @@ * limitations under the License. */ -import { FormFieldModel, FormModel } from './../components/widgets/core/index'; +import { FormFieldModel } from '../components/widgets/core/form-field.model'; import { FormEvent } from './form.event'; export class FormFieldEvent extends FormEvent { readonly field: FormFieldModel; - constructor(form: FormModel, field: FormFieldModel) { + constructor(form: any, field: FormFieldModel) { super(form); this.field = field; } diff --git a/lib/core/form/events/form.event.ts b/lib/core/form/events/form.event.ts index c9c4d8a98d..3b228827e1 100644 --- a/lib/core/form/events/form.event.ts +++ b/lib/core/form/events/form.event.ts @@ -15,15 +15,13 @@ * limitations under the License. */ -import { FormModel } from './../components/widgets/core/index'; - export class FormEvent { private isDefaultPrevented: boolean = false; - readonly form: FormModel; + readonly form: any; - constructor(form: FormModel) { + constructor(form: any) { this.form = form; } diff --git a/lib/core/form/events/validate-dynamic-table-row.event.ts b/lib/core/form/events/validate-dynamic-table-row.event.ts index 7d63a3095f..d6b592d4a0 100644 --- a/lib/core/form/events/validate-dynamic-table-row.event.ts +++ b/lib/core/form/events/validate-dynamic-table-row.event.ts @@ -15,10 +15,10 @@ * limitations under the License. */ +import { FormFieldModel } from '../components/widgets/core/form-field.model'; +import { FormModel } from '../components/widgets/core/form.model'; import { DynamicRowValidationSummary } from '../components/widgets/dynamic-table/dynamic-row-validation-summary.model'; import { DynamicTableRow } from '../components/widgets/dynamic-table/dynamic-table-row.model'; - -import { FormFieldModel, FormModel } from './../components/widgets/core/index'; import { FormFieldEvent } from './form-field.event'; export class ValidateDynamicTableRowEvent extends FormFieldEvent { diff --git a/lib/core/form/events/validate-form-field.event.ts b/lib/core/form/events/validate-form-field.event.ts index 52803e9855..db57e2f4dd 100644 --- a/lib/core/form/events/validate-form-field.event.ts +++ b/lib/core/form/events/validate-form-field.event.ts @@ -15,14 +15,14 @@ * limitations under the License. */ -import { FormFieldModel, FormModel } from './../components/widgets/core/index'; +import { FormFieldModel } from '../components/widgets/core/form-field.model'; import { FormFieldEvent } from './form-field.event'; export class ValidateFormFieldEvent extends FormFieldEvent { isValid = true; - constructor(form: FormModel, field: FormFieldModel) { + constructor(form: any, field: FormFieldModel) { super(form, field); } diff --git a/lib/core/form/events/validate-form.event.ts b/lib/core/form/events/validate-form.event.ts index 668639a04e..5dd7d83fb2 100644 --- a/lib/core/form/events/validate-form.event.ts +++ b/lib/core/form/events/validate-form.event.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import { FormModel } from './../components/widgets/core/index'; import { FormEvent } from './form.event'; import { FormFieldModel } from '../components/widgets/core/form-field.model'; @@ -24,7 +23,7 @@ export class ValidateFormEvent extends FormEvent { isValid = true; errorsField: FormFieldModel[] = []; - constructor(form: FormModel) { + constructor(form: any) { super(form); } } diff --git a/lib/core/form/public-api.ts b/lib/core/form/public-api.ts index 77ab016979..e911256624 100644 --- a/lib/core/form/public-api.ts +++ b/lib/core/form/public-api.ts @@ -28,6 +28,7 @@ export * from './services/activiti-alfresco.service'; export * from './services/ecm-model.service'; export * from './services/form-rendering.service'; export * from './services/form.service'; +export * from './services/form-validation-service.interface'; export * from './services/node.service'; export * from './services/process-content.service'; export * from './services/widget-visibility.service'; diff --git a/lib/core/form/services/form-validation-service.interface.ts b/lib/core/form/services/form-validation-service.interface.ts new file mode 100644 index 0000000000..ab3c59bf08 --- /dev/null +++ b/lib/core/form/services/form-validation-service.interface.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright 2019 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Subject } from 'rxjs'; +import { FormFieldEvent } from '../events/form-field.event'; +import { ValidateFormFieldEvent } from '../events/validate-form-field.event'; +import { ValidateFormEvent } from '../events/validate-form.event'; + +export interface FormValidationService { + formFieldValueChanged: Subject; + validateForm: Subject; + validateFormField: Subject; +} diff --git a/lib/core/form/services/form.service.ts b/lib/core/form/services/form.service.ts index c08c649cd8..2cb0eca73d 100644 --- a/lib/core/form/services/form.service.ts +++ b/lib/core/form/services/form.service.ts @@ -23,11 +23,6 @@ import { Observable, Subject, from, of, throwError } from 'rxjs'; import { FormDefinitionModel } from '../models/form-definition.model'; import { ContentLinkModel } from './../components/widgets/core/content-link.model'; import { GroupModel } from './../components/widgets/core/group.model'; -import { FormModel, FormOutcomeEvent, FormOutcomeModel, FormValues } from './../components/widgets/core/index'; -import { - FormErrorEvent, FormEvent, FormFieldEvent, - ValidateDynamicTableRowEvent, ValidateFormEvent, ValidateFormFieldEvent -} from './../events/index'; import { EcmModelService } from './ecm-model.service'; import { map, catchError, switchMap, combineAll, defaultIfEmpty } from 'rxjs/operators'; import { @@ -43,11 +38,22 @@ import { UsersApi, ActivitiGroupsApi } from '@alfresco/js-api'; +import { FormOutcomeEvent } from '../components/widgets/core/form-outcome-event.model'; +import { FormValues } from '../components/widgets/core/form-values'; +import { FormModel } from '../components/widgets/core/form.model'; +import { FormOutcomeModel } from '../components/widgets/core/form-outcome.model'; +import { FormEvent } from '../events/form.event'; +import { FormFieldEvent } from '../events/form-field.event'; +import { FormErrorEvent } from '../events/form-error.event'; +import { ValidateFormEvent } from '../events/validate-form.event'; +import { ValidateFormFieldEvent } from '../events/validate-form-field.event'; +import { ValidateDynamicTableRowEvent } from '../events/validate-dynamic-table-row.event'; +import { FormValidationService } from './form-validation-service.interface'; @Injectable({ providedIn: 'root' }) -export class FormService { +export class FormService implements FormValidationService { static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error'; static GENERIC_ERROR_MESSAGE: string = 'Server error'; diff --git a/lib/core/language-menu/language-menu.component.ts b/lib/core/language-menu/language-menu.component.ts index 5b98f3bc42..b21b4afd09 100644 --- a/lib/core/language-menu/language-menu.component.ts +++ b/lib/core/language-menu/language-menu.component.ts @@ -16,8 +16,9 @@ */ import { Component } from '@angular/core'; -import { LanguageItem, LanguageService } from '../services/language.service'; +import { LanguageService } from '../services/language.service'; import { Observable } from 'rxjs'; +import { LanguageItem } from '../services/language-item.interface'; @Component({ selector: 'adf-language-menu', diff --git a/lib/core/services/language-item.interface.ts b/lib/core/services/language-item.interface.ts new file mode 100644 index 0000000000..c0fc03bf0d --- /dev/null +++ b/lib/core/services/language-item.interface.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright 2019 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Direction } from '@angular/cdk/bidi'; + +export interface LanguageItem { + key: string; + label: string; + direction?: Direction; +} diff --git a/lib/core/services/language.service.ts b/lib/core/services/language.service.ts index 1e0cb1ead9..4e12210c02 100644 --- a/lib/core/services/language.service.ts +++ b/lib/core/services/language.service.ts @@ -16,17 +16,11 @@ */ import { Injectable } from '@angular/core'; -import { Direction } from '@angular/cdk/bidi'; import { BehaviorSubject } from 'rxjs'; import { AppConfigService, AppConfigValues } from '../app-config/app-config.service'; +import { LanguageItem } from './language-item.interface'; import { UserPreferencesService } from './user-preferences.service'; -export interface LanguageItem { - key: string; - label: string; - direction?: Direction; -} - @Injectable({providedIn: 'root'}) export class LanguageService { diff --git a/lib/core/services/public-api.ts b/lib/core/services/public-api.ts index 7dd2f25e8a..2bae07293e 100644 --- a/lib/core/services/public-api.ts +++ b/lib/core/services/public-api.ts @@ -67,3 +67,4 @@ export * from './oauth2.service'; export * from './language.service'; export * from './identity-user.service.interface'; export * from './identity-group.interface'; +export * from './language-item.interface'; diff --git a/lib/core/services/user-preferences.service.ts b/lib/core/services/user-preferences.service.ts index 0b08446e75..cd98548c4d 100644 --- a/lib/core/services/user-preferences.service.ts +++ b/lib/core/services/user-preferences.service.ts @@ -19,10 +19,10 @@ import { Injectable } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Observable, BehaviorSubject } from 'rxjs'; import { AppConfigService, AppConfigValues } from '../app-config/app-config.service'; -import { LanguageItem } from './language.service'; import { StorageService } from './storage.service'; import { distinctUntilChanged, map, filter } from 'rxjs/operators'; import { AlfrescoApiService } from './alfresco-api.service'; +import { LanguageItem } from './language-item.interface'; export enum UserPreferenceValues { PaginationSize = 'paginationSize',