From 6a8c680d938820bc497d0a5b0e6aa99c108ede14 Mon Sep 17 00:00:00 2001 From: Janicki Artur Date: Thu, 19 Jul 2018 16:36:53 +0200 Subject: [PATCH] back to name - ProjectPanelColumnNames Feature #13797 Arvados-DCO-1.1-Signed-off-by: Janicki Artur --- src/store/project-panel/project-panel-middleware.ts | 8 ++++---- src/views/project-panel/project-panel.tsx | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/store/project-panel/project-panel-middleware.ts b/src/store/project-panel/project-panel-middleware.ts index 3ac3cc8f..881c4f17 100644 --- a/src/store/project-panel/project-panel-middleware.ts +++ b/src/store/project-panel/project-panel-middleware.ts @@ -4,7 +4,7 @@ import { Middleware } from "redux"; import actions from "../data-explorer/data-explorer-action"; -import { PROJECT_PANEL_ID, ProjectPanelFilter, COLUMNS, ColumnNames } from "../../views/project-panel/project-panel"; +import { PROJECT_PANEL_ID, ProjectPanelFilter, COLUMNS, ProjectPanelColumnNames } from "../../views/project-panel/project-panel"; import { groupsService } from "../../services/services"; import { RootState } from "../store"; import { getDataExplorer } from "../data-explorer/data-explorer-reducer"; @@ -51,8 +51,8 @@ export const projectPanelMiddleware: Middleware = store => next => { const state = store.getState() as RootState; const dataExplorer = getDataExplorer(state.dataExplorer, PROJECT_PANEL_ID); const columns = dataExplorer.columns as DataColumns; - const typeFilters = getColumnFilters(columns, ColumnNames.TYPE); - const statusFilters = getColumnFilters(columns, ColumnNames.STATUS); + const typeFilters = getColumnFilters(columns, ProjectPanelColumnNames.TYPE); + const statusFilters = getColumnFilters(columns, ProjectPanelColumnNames.STATUS); const sortColumn = dataExplorer.columns.find(({ sortDirection }) => Boolean(sortDirection && sortDirection !== "none")); const sortDirection = sortColumn && sortColumn.sortDirection === SortDirection.Asc ? SortDirection.Asc : SortDirection.Desc; if (typeFilters.length > 0) { @@ -61,7 +61,7 @@ export const projectPanelMiddleware: Middleware = store => next => { limit: dataExplorer.rowsPerPage, offset: dataExplorer.page * dataExplorer.rowsPerPage, order: sortColumn - ? sortColumn.name === ColumnNames.NAME + ? sortColumn.name === ProjectPanelColumnNames.NAME ? getOrder("name", sortDirection) : getOrder("createdAt", sortDirection) : OrderBuilder.create(), diff --git a/src/views/project-panel/project-panel.tsx b/src/views/project-panel/project-panel.tsx index fbafdbe0..107542eb 100644 --- a/src/views/project-panel/project-panel.tsx +++ b/src/views/project-panel/project-panel.tsx @@ -136,7 +136,7 @@ const RENDER_STATUS = (item: ProjectPanelItem) => {item.status || "-"} ; -export enum ColumnNames { +export enum ProjectPanelColumnNames { NAME = "Name", STATUS = "Status", TYPE = "Type", @@ -148,7 +148,7 @@ export enum ColumnNames { export const COLUMNS: DataColumns = [ { - name: ColumnNames.NAME, + name: ProjectPanelColumnNames.NAME, selected: true, sortDirection: SortDirection.Asc, render: RENDER_NAME, @@ -178,7 +178,7 @@ export const COLUMNS: DataColumns = [ width: "75px" }, { - name: ColumnNames.TYPE, + name: ProjectPanelColumnNames.TYPE, selected: true, filters: [ { @@ -201,19 +201,19 @@ export const COLUMNS: DataColumns = [ width: "125px" }, { - name: ColumnNames.OWNER, + name: ProjectPanelColumnNames.OWNER, selected: true, render: item => RENDER_OWNER(item.owner), width: "200px" }, { - name: ColumnNames.FILE_SIZE, + name: ProjectPanelColumnNames.FILE_SIZE, selected: true, render: item => RENDER_FILE_SIZE(item.fileSize), width: "50px" }, { - name: ColumnNames.LAST_MODIFIED, + name: ProjectPanelColumnNames.LAST_MODIFIED, selected: true, sortDirection: SortDirection.None, render: item => RENDER_DATE(item.lastModified), -- 2.30.2