17426: Pass through menu styling. Make example a card.
[arvados-workbench2.git] / src / common / plugintypes.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
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';
10
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;
16
17 export interface PluginConfig {
18     // Customize the list of possible center panels by adding or removing Route components.
19     centerPanelList: ElementListReducer[];
20
21     // Customize the list of side panel categories
22     sidePanelCategories: CategoriesListReducer[];
23
24     // Add to the list of possible dialogs by adding dialog components.
25     dialogs: React.ReactElement[];
26
27     // Add navigation actions for identifiers
28     navigateToHandlers: NavigateMatcher[];
29
30     // Add handlers for navigation actions
31     locationChangeHandlers: LocationChangeMatcher[];
32
33     appBarLeft?: React.ReactElement;
34
35     appBarMiddle?: React.ReactElement;
36
37     appBarRight?: React.ReactElement;
38
39     // Customize the list menu items in the account menu
40     accountMenuList: ElementListReducer[];
41
42     enableNewButtonMatchers: EnableNew[];
43
44     newButtonMenuList: ElementListReducer[];
45 }