1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { getDataExplorerColumnFilters } from "store/data-explorer/data-explorer-middleware-service";
6 import { RootState } from "../store";
7 import { ServiceRepository } from "services/services";
8 import { joinFilters } from "services/api/filter-builder";
9 import { allProcessesPanelActions } from "./all-processes-panel-action";
10 import { Dispatch, MiddlewareAPI } from "redux";
11 import { DataExplorer } from "store/data-explorer/data-explorer-reducer";
12 import { DataColumns } from "components/data-table/data-table";
14 serializeOnlyProcessTypeFilters
15 } from "../resource-type-filters/resource-type-filters";
16 import { AllProcessesPanelColumnNames } from "views/all-processes-panel/all-processes-panel";
17 import { ProcessesMiddlewareService } from "store/processes/processes-middleware-service";
18 import { ContainerRequestResource } from 'models/container-request';
20 export class AllProcessesPanelMiddlewareService extends ProcessesMiddlewareService {
21 constructor(services: ServiceRepository, id: string) {
22 super(services, allProcessesPanelActions, id);
25 getFilters(api: MiddlewareAPI<Dispatch, RootState>, dataExplorer: DataExplorer): string | null {
26 const sup = super.getFilters(api, dataExplorer);
27 if (sup === null) { return null; }
28 const columns = dataExplorer.columns as DataColumns<string, ContainerRequestResource>;
30 const typeFilters = serializeOnlyProcessTypeFilters(getDataExplorerColumnFilters(columns, AllProcessesPanelColumnNames.TYPE));
31 return joinFilters(sup, typeFilters);