18874: Add 'services/workbench2/' from commit 'f6f88d9ca9cdeeeebfadcfe999789bfb9f69e5c6'
[arvados.git] / services / workbench2 / src / components / data-table / static / git-logo.png
diff --git a/src/components/data-table/data-column.ts b/src/components/data-table/data-column.ts
deleted file mode 100644 (file)
index 35655fb..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import React from "react";
-import { DataTableFilters } from "../data-table-filters/data-table-filters-tree";
-import { createTree } from 'models/tree';
-
-/**
- *
- * @template I Type of dataexplorer item reference
- * @template R Type of resource to use to restrict values of column sort.field
- */
-export interface DataColumn<I, R> {
-    key?: React.Key;
-    name: string;
-    selected: boolean;
-    configurable: boolean;
-
-    /**
-     * If set to true, filters on this column will be displayed in a
-     * radio group and only one filter can be selected at a time.
-     */
-    mutuallyExclusiveFilters?: boolean;
-    sort?: {direction: SortDirection, field: keyof R};
-    filters: DataTableFilters;
-    render: (item: I) => React.ReactElement<any>;
-    renderHeader?: () => React.ReactElement<any>;
-}
-
-export enum SortDirection {
-    ASC = "asc",
-    DESC = "desc",
-    NONE = "none"
-}
-
-export const toggleSortDirection = <I, R>(column: DataColumn<I, R>): DataColumn<I, R> => {
-    return column.sort
-        ? column.sort.direction === SortDirection.ASC
-            ? { ...column, sort: {...column.sort, direction: SortDirection.DESC} }
-            : { ...column, sort: {...column.sort, direction: SortDirection.ASC} }
-        : column;
-};
-
-export const resetSortDirection = <I, R>(column: DataColumn<I, R>): DataColumn<I, R> => {
-    return column.sort ? { ...column, sort: {...column.sort, direction: SortDirection.NONE} } : column;
-};
-
-export const createDataColumn = <I, R>(dataColumn: Partial<DataColumn<I, R>>): DataColumn<I, R> => ({
-    key: '',
-    name: '',
-    selected: true,
-    configurable: true,
-    filters: createTree(),
-    render: () => React.createElement('span'),
-    ...dataColumn,
-});