[ADF-5247] always enabled language picker (via extensions) (#1730)

* always enabled language picker

* fix tests

* update e2e tests

* fix aos plugin
This commit is contained in:
Denys Vuika
2020-10-15 08:57:04 +01:00
committed by GitHub
parent cfffde603c
commit 20f1752b48
25 changed files with 49 additions and 238 deletions

View File

@@ -483,24 +483,6 @@ describe('app.evaluators', () => {
});
});
describe('canShowLanguagePicker', () => {
it('should return true when property is true', () => {
const context: any = {
languagePicker: true
};
expect(app.canShowLanguagePicker(context)).toBe(true);
});
it('should return false when property is false', () => {
const context: any = {
languagePicker: false
};
expect(app.canShowLanguagePicker(context)).toBe(false);
});
});
describe('canShowLogout', () => {
it('should return false when `withCredentials` property is true', () => {
const context: any = {

View File

@@ -28,7 +28,6 @@ import * as navigation from './navigation.rules';
import * as repository from './repository.rules';
export interface AcaRuleContext extends RuleContext {
languagePicker: boolean;
withCredentials: boolean;
}
@@ -457,15 +456,6 @@ export function canToggleFavorite(context: RuleContext): boolean {
].every(Boolean);
}
/**
* Checks if application should render language picker menu.
* JSON ref: `canShowLanguagePicker`
* @param context Rule execution context
*/
export function canShowLanguagePicker(context: AcaRuleContext): boolean {
return context.languagePicker;
}
/**
* Checks if application should render logout option.
* JSON ref: `canShowLogout`

View File

@@ -27,7 +27,7 @@ import { Injectable } from '@angular/core';
import { Store } from '@ngrx/store';
import { MatIconRegistry } from '@angular/material/icon';
import { DomSanitizer } from '@angular/platform-browser';
import { AppStore, getRuleContext, getLanguagePickerState } from '@alfresco/aca-shared/store';
import { AppStore, getRuleContext } from '@alfresco/aca-shared/store';
import {
SelectionState,
NavigationState,
@@ -102,7 +102,6 @@ export class AppExtensionService implements RuleContext {
profile: ProfileState;
repository: RepositoryInfo;
withCredentials: boolean;
languagePicker: boolean;
references$: Observable<ExtensionRef[]>;
@@ -125,10 +124,6 @@ export class AppExtensionService implements RuleContext {
this.profile = result.profile;
this.repository = result.repository;
});
this.store.select(getLanguagePickerState).subscribe((result) => {
this.languagePicker = result;
});
}
async load() {

View File

@@ -47,7 +47,6 @@ export const initialState = {
headerColor: '#ffffff',
logoPath: 'assets/images/alfresco-logo-white.svg',
headerImagePath: 'assets/images/mastHead-bg-shapesPattern.svg',
languagePicker: false,
sharedUrl: '',
user: {
isAdmin: null,

View File

@@ -32,7 +32,6 @@ export const getHeaderColor = createSelector(selectApp, (state) => state.headerC
export const getAppName = createSelector(selectApp, (state) => state.appName);
export const getLogoPath = createSelector(selectApp, (state) => state.logoPath);
export const getHeaderImagePath = createSelector(selectApp, (state) => state.headerImagePath);
export const getLanguagePickerState = createSelector(selectApp, (state) => state.languagePicker);
export const getUserProfile = createSelector(selectApp, (state) => state.user);
export const getCurrentFolder = createSelector(selectApp, (state) => state.navigation.currentFolder);
export const getCurrentVersion = createSelector(selectApp, (state) => state.currentNodeVersion);

View File

@@ -31,7 +31,6 @@ export interface AppState {
headerColor: string;
logoPath: string;
headerImagePath: string;
languagePicker: boolean;
sharedUrl: string;
currentNodeVersion: VersionEntry;
selection: SelectionState;