17426: Comment out plugins
[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, Middleware } from 'redux';
7 import { RootStore, RootState } from '~/store/store';
8 import { ResourcesState } from '~/store/resources/resources';
9 import { Location } from 'history';
10 import { ServiceRepository } from "~/services/services";
11
12 export type ElementListReducer = (startingList: React.ReactElement[], itemClass?: string) => React.ReactElement[];
13 export type CategoriesListReducer = (startingList: string[]) => string[];
14 export type NavigateMatcher = (dispatch: Dispatch, getState: () => RootState, uuid: string) => boolean;
15 export type LocationChangeMatcher = (store: RootStore, pathname: string) => boolean;
16 export type EnableNew = (location: Location, currentItemId: string, currentUserUUID: string | undefined, resources: ResourcesState) => boolean;
17 export type MiddlewareListReducer = (startingList: Middleware[], services: ServiceRepository) => Middleware[];
18
19 export interface PluginConfig {
20     // Customize the list of possible center panels by adding or removing Route components.
21     centerPanelList: ElementListReducer[];
22
23     // Customize the list of side panel categories
24     sidePanelCategories: CategoriesListReducer[];
25
26     // Add to the list of possible dialogs by adding dialog components.
27     dialogs: React.ReactElement[];
28
29     // Add navigation actions for identifiers
30     navigateToHandlers: NavigateMatcher[];
31
32     // Add handlers for navigation actions
33     locationChangeHandlers: LocationChangeMatcher[];
34
35     appBarLeft?: React.ReactElement;
36
37     appBarMiddle?: React.ReactElement;
38
39     appBarRight?: React.ReactElement;
40
41     // Customize the list menu items in the account menu
42     accountMenuList: ElementListReducer[];
43
44     enableNewButtonMatchers: EnableNew[];
45
46     newButtonMenuList: ElementListReducer[];
47
48     middlewares: MiddlewareListReducer[];
49 }