add missing color header action (#1403)

This commit is contained in:
Denys Vuika 2020-04-07 14:55:41 +01:00 committed by GitHub
parent 2816e5fe11
commit 5c98930520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View File

@ -127,3 +127,4 @@ Below is the list of public actions types you can use in the plugin definitions
| 1.10.0 | FILE_FROM_TEMPLATE | n/a | Invoke dialogs flow for creating a file from a template into current folder |
| 1.10.0 | FOLDER_FROM_TEMPLATE | n/a | Invoke dialogs flow for creating a folder structure from a template into current folder |
| 1.10.0 | CONTEXT_MENU | MouseEvent | Invoke context menu for [DocumentListComponent](https://www.alfresco.com/abn/adf/docs/content-services/components/document-list.component) |
| 1.11.0 | SET_HEADER_COLOR | string | Set the header color at runtime |

View File

@ -30,6 +30,7 @@ import { AppState } from '../states/app.state';
export enum AppActionTypes {
SetSettingsParameter = 'SET_SETTINGS_PARAMETER',
SetInitialState = 'SET_INITIAL_STATE',
SetHeaderColor = 'SET_HEADER_COLOR',
SetCurrentFolder = 'SET_CURRENT_FOLDER',
SetCurrentUrl = 'SET_CURRENT_URL',
SetUserProfile = 'SET_USER_PROFILE',
@ -56,6 +57,12 @@ export class SetInitialStateAction implements Action {
constructor(public payload: AppState) {}
}
export class SetHeaderColorAction implements Action {
readonly type = AppActionTypes.SetHeaderColor;
constructor(public color: string) {}
}
export class SetCurrentFolderAction implements Action {
readonly type = AppActionTypes.SetCurrentFolder;

View File

@ -37,7 +37,8 @@ import {
SetRepositoryInfoAction,
SetInfoDrawerStateAction,
SetInfoDrawerMetadataAspectAction,
SetSettingsParameterAction
SetSettingsParameterAction,
SetHeaderColorAction
} from '@alfresco/aca-shared/store';
import { INITIAL_APP_STATE } from '../initial-state';
@ -57,6 +58,12 @@ export function appReducer(
action as SetSettingsParameterAction
);
break;
case AppActionTypes.SetHeaderColor:
newState = {
...state,
headerColor: (action as SetHeaderColorAction).color
};
break;
case NodeActionTypes.SetSelection:
newState = updateSelectedNodes(state, <SetSelectedNodesAction>action);
break;