[AAE-10103] language-menu storybook (#7732)

This commit is contained in:
Robert Duda
2022-08-02 13:24:02 +02:00
committed by GitHub
parent 16e19ca7c6
commit c8e74699d5
8 changed files with 247 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
* Copyright 2022 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.
@@ -15,6 +15,7 @@
* limitations under the License.
*/
import { LanguageServiceInterface } from './language.service.interface';
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
@@ -22,7 +23,7 @@ import { LanguageItem } from './language-item.interface';
import { UserPreferencesService } from './user-preferences.service';
@Injectable({providedIn: 'root'})
export class LanguageService {
export class LanguageService implements LanguageServiceInterface {
private languages = new BehaviorSubject<LanguageItem[]>([
{key: 'de', label: 'Deutsch'},
@@ -60,7 +61,7 @@ export class LanguageService {
}
setLanguages(items: LanguageItem[]) {
if (items && items.length > 0) {
if (items?.length > 0) {
this.languages.next(items);
}
}