[ACA-1743] extension settings (#1399)

* upgrade tslib

* initial settings skeleton

* migrate language picker setting

* support string parameters

* remove process extensions workaround

* update extensions schema

* update docs

* unit tests

* fix unit test
This commit is contained in:
Denys Vuika
2020-04-06 18:58:41 +01:00
committed by GitHub
parent 2b910d5a15
commit 5a88c8c852
23 changed files with 425 additions and 127 deletions

View File

@@ -30,7 +30,6 @@ import * as repository from './repository.rules';
export interface AcaRuleContext extends RuleContext {
languagePicker: boolean;
withCredentials: boolean;
processServices: boolean;
}
/**
@@ -554,5 +553,5 @@ export function canShowLogout(context: AcaRuleContext): boolean {
* @param context Rule execution context
*/
export function canShowProcessServices(context: AcaRuleContext): boolean {
return context.processServices;
return localStorage && localStorage.getItem('processServices') === 'true';
}

View File

@@ -28,8 +28,8 @@ import { Node, Person, Group, RepositoryInfo } from '@alfresco/js-api';
import { AppState } from '../states/app.state';
export enum AppActionTypes {
SetSettingsParameter = 'SET_SETTINGS_PARAMETER',
SetInitialState = 'SET_INITIAL_STATE',
SetLanguagePicker = 'SET_LANGUAGE_PICKER',
SetCurrentFolder = 'SET_CURRENT_FOLDER',
SetCurrentUrl = 'SET_CURRENT_URL',
SetUserProfile = 'SET_USER_PROFILE',
@@ -41,8 +41,13 @@ export enum AppActionTypes {
ResetSelection = 'RESET_SELECTION',
SetInfoDrawerState = 'SET_INFO_DRAWER_STATE',
SetInfoDrawerMetadataAspect = 'SET_INFO_DRAWER_METADATA_ASPECT',
CloseModalDialogs = 'CLOSE_MODAL_DIALOGS',
ToggleProcessServices = 'TOGGLE_PROCESS_SERVICES'
CloseModalDialogs = 'CLOSE_MODAL_DIALOGS'
}
export class SetSettingsParameterAction implements Action {
readonly type = AppActionTypes.SetSettingsParameter;
constructor(public payload: { name: string; value: any }) {}
}
export class SetInitialStateAction implements Action {
@@ -51,12 +56,6 @@ export class SetInitialStateAction implements Action {
constructor(public payload: AppState) {}
}
export class SetLanguagePickerAction implements Action {
readonly type = AppActionTypes.SetLanguagePicker;
constructor(public payload: boolean) {}
}
export class SetCurrentFolderAction implements Action {
readonly type = AppActionTypes.SetCurrentFolder;
@@ -114,9 +113,3 @@ export class SetRepositoryInfoAction implements Action {
constructor(public payload: RepositoryInfo) {}
}
export class ToggleProcessServicesAction implements Action {
readonly type = AppActionTypes.ToggleProcessServices;
constructor(public payload: boolean) {}
}

View File

@@ -133,8 +133,3 @@ export const infoDrawerMetadataAspect = createSelector(
selectApp,
state => state.infoDrawerMetadataAspect
);
export const getProcessServicesState = createSelector(
selectApp,
state => state.processServices
);

View File

@@ -44,7 +44,6 @@ export interface AppState {
showFacetFilter: boolean;
documentDisplayMode: string;
repository: RepositoryInfo;
processServices: boolean;
}
export interface AppStore {