1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { Dispatch } from 'redux';
7 import { RootStore, RootState } from '~/store/store';
8 import { ResourcesState } from '~/store/resources/resources';
9 import { Location } from 'history';
11 export type ElementListReducer = (startingList: React.ReactElement[], itemClass?: string) => React.ReactElement[];
12 export type CategoriesListReducer = (startingList: string[]) => string[];
13 export type NavigateMatcher = (dispatch: Dispatch, getState: () => RootState, uuid: string) => boolean;
14 export type LocationChangeMatcher = (store: RootStore, pathname: string) => boolean;
15 export type EnableNew = (location: Location, currentItemId: string, currentUserUUID: string | undefined, resources: ResourcesState) => boolean;
17 export interface PluginConfig {
18 // Customize the list of possible center panels by adding or removing Route components.
19 centerPanelList: ElementListReducer[];
21 // Customize the list of side panel categories
22 sidePanelCategories: CategoriesListReducer[];
24 // Add to the list of possible dialogs by adding dialog components.
25 dialogs: React.ReactElement[];
27 // Add navigation actions for identifiers
28 navigateToHandlers: NavigateMatcher[];
30 // Add handlers for navigation actions
31 locationChangeHandlers: LocationChangeMatcher[];
33 appBarLeft?: React.ReactElement;
35 appBarMiddle?: React.ReactElement;
37 appBarRight?: React.ReactElement;
39 // Customize the list menu items in the account menu
40 accountMenuList: ElementListReducer[];
42 enableNewButtonMatchers: EnableNew[];
44 newButtonMenuList: ElementListReducer[];