[ARVADOS-WORKBENCH2] updated: 1.1.4-341-g355aa79
Git user
git at public.curoverse.com
Thu Jul 19 11:02:05 EDT 2018
Summary of changes:
src/common/formatters.ts | 4 +--
src/common/labels.ts | 2 +-
.../details-panel-factory/items/abstract-item.tsx | 1 -
.../items/collection-item.tsx | 10 +++---
.../details-panel-factory/items/process-item.tsx | 12 +++----
.../details-panel-factory/items/project-item.tsx | 10 +++---
.../project-panel/project-panel-middleware.ts | 4 +--
src/views/project-panel/project-panel.tsx | 38 +++++++++++-----------
8 files changed, 40 insertions(+), 41 deletions(-)
via 355aa79f1a2abb5e8142062d83f897d780cc8a8e (commit)
from 6a8c680d938820bc497d0a5b0e6aa99c108ede14 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 355aa79f1a2abb5e8142062d83f897d780cc8a8e
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date: Thu Jul 19 17:01:53 2018 +0200
back to previous naming
Feature #13797
Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>
diff --git a/src/common/formatters.ts b/src/common/formatters.ts
index 823536f..38ef022 100644
--- a/src/common/formatters.ts
+++ b/src/common/formatters.ts
@@ -2,13 +2,13 @@
//
// SPDX-License-Identifier: AGPL-3.0
-export const FORMAT_DATE = (isoDate: string) => {
+export const formatDate = (isoDate: string) => {
const date = new Date(isoDate);
const text = date.toLocaleString();
return text === 'Invalid Date' ? "" : text;
};
-export const FORMAT_FILE_SIZE = (size?: number) => {
+export const formatFileSize = (size?: number) => {
if (typeof size === "number") {
for (const { base, unit } of FILE_SIZES) {
if (size >= base) {
diff --git a/src/common/labels.ts b/src/common/labels.ts
index ecd7989..9567ce1 100644
--- a/src/common/labels.ts
+++ b/src/common/labels.ts
@@ -4,7 +4,7 @@
import { ResourceKind } from "../models/resource";
-export const RESOURCE_LABEL = (type: string) => {
+export const resourceLabel = (type: string) => {
switch (type) {
case ResourceKind.Collection:
return "Data collection";
diff --git a/src/components/details-panel-factory/items/abstract-item.tsx b/src/components/details-panel-factory/items/abstract-item.tsx
index d403870..d5e46a2 100644
--- a/src/components/details-panel-factory/items/abstract-item.tsx
+++ b/src/components/details-panel-factory/items/abstract-item.tsx
@@ -4,7 +4,6 @@
import * as React from 'react';
import { DetailsPanelResource } from '../../../views-components/details-panel/details-panel';
-import { IconType } from '../../icon/icon';
export default abstract class AbstractItem<T extends DetailsPanelResource = DetailsPanelResource> {
diff --git a/src/components/details-panel-factory/items/collection-item.tsx b/src/components/details-panel-factory/items/collection-item.tsx
index 401a15e..dab8101 100644
--- a/src/components/details-panel-factory/items/collection-item.tsx
+++ b/src/components/details-panel-factory/items/collection-item.tsx
@@ -7,8 +7,8 @@ import { CollectionIcon } from '../../icon/icon';
import Attribute from '../../attribute/attribute';
import AbstractItem from './abstract-item';
import { CollectionResource } from '../../../models/collection';
-import { FORMAT_DATE } from '../../../common/formatters';
-import { RESOURCE_LABEL } from '../../../common/labels';
+import { formatDate } from '../../../common/formatters';
+import { resourceLabel } from '../../../common/labels';
import { ResourceKind } from '../../../models/resource';
export default class CollectionItem extends AbstractItem<CollectionResource> {
@@ -19,11 +19,11 @@ export default class CollectionItem extends AbstractItem<CollectionResource> {
buildDetails() {
return <div>
- <Attribute label='Type' value={RESOURCE_LABEL(ResourceKind.Collection)} />
+ <Attribute label='Type' value={resourceLabel(ResourceKind.Collection)} />
<Attribute label='Size' value='---' />
<Attribute label='Owner' value={this.item.ownerUuid} />
- <Attribute label='Last modified' value={FORMAT_DATE(this.item.modifiedAt)} />
- <Attribute label='Created at' value={FORMAT_DATE(this.item.createdAt)} />
+ <Attribute label='Last modified' value={formatDate(this.item.modifiedAt)} />
+ <Attribute label='Created at' value={formatDate(this.item.createdAt)} />
{/* Links but we dont have view */}
<Attribute label='Collection UUID' link={this.item.uuid} value={this.item.uuid} />
<Attribute label='Content address' link={this.item.portableDataHash} value={this.item.portableDataHash} />
diff --git a/src/components/details-panel-factory/items/process-item.tsx b/src/components/details-panel-factory/items/process-item.tsx
index c2a7fe2..215c531 100644
--- a/src/components/details-panel-factory/items/process-item.tsx
+++ b/src/components/details-panel-factory/items/process-item.tsx
@@ -7,9 +7,9 @@ import { ProcessIcon } from '../../icon/icon';
import Attribute from '../../attribute/attribute';
import AbstractItem from './abstract-item';
import { ProcessResource } from '../../../models/process';
-import { FORMAT_DATE } from '../../../common/formatters';
+import { formatDate } from '../../../common/formatters';
import { ResourceKind } from '../../../models/resource';
-import { RESOURCE_LABEL } from '../../../common/labels';
+import { resourceLabel } from '../../../common/labels';
export default class ProcessItem extends AbstractItem<ProcessResource> {
@@ -19,17 +19,17 @@ export default class ProcessItem extends AbstractItem<ProcessResource> {
buildDetails() {
return <div>
- <Attribute label='Type' value={RESOURCE_LABEL(ResourceKind.Process)} />
+ <Attribute label='Type' value={resourceLabel(ResourceKind.Process)} />
<Attribute label='Size' value='---' />
<Attribute label='Owner' value={this.item.ownerUuid} />
{/* Missing attr */}
<Attribute label='Status' value={this.item.state} />
- <Attribute label='Last modified' value={FORMAT_DATE(this.item.modifiedAt)} />
+ <Attribute label='Last modified' value={formatDate(this.item.modifiedAt)} />
{/* Missing attrs */}
- <Attribute label='Started at' value={FORMAT_DATE(this.item.createdAt)} />
- <Attribute label='Finished at' value={FORMAT_DATE(this.item.expiresAt)} />
+ <Attribute label='Started at' value={formatDate(this.item.createdAt)} />
+ <Attribute label='Finished at' value={formatDate(this.item.expiresAt)} />
{/* Links but we dont have view */}
<Attribute label='Outputs' link={this.item.outputPath} value={this.item.outputPath} />
diff --git a/src/components/details-panel-factory/items/project-item.tsx b/src/components/details-panel-factory/items/project-item.tsx
index 73ceafe..ae694e5 100644
--- a/src/components/details-panel-factory/items/project-item.tsx
+++ b/src/components/details-panel-factory/items/project-item.tsx
@@ -7,9 +7,9 @@ import { ProjectIcon } from '../../icon/icon';
import Attribute from '../../attribute/attribute';
import AbstractItem from './abstract-item';
import { ProjectResource } from '../../../models/project';
-import { FORMAT_DATE } from '../../../common/formatters';
+import { formatDate } from '../../../common/formatters';
import { ResourceKind } from '../../../models/resource';
-import { RESOURCE_LABEL } from '../../../common/labels';
+import { resourceLabel } from '../../../common/labels';
export default class ProjectItem extends AbstractItem<ProjectResource> {
@@ -19,12 +19,12 @@ export default class ProjectItem extends AbstractItem<ProjectResource> {
buildDetails() {
return <div>
- <Attribute label='Type' value={RESOURCE_LABEL(ResourceKind.Project)} />
+ <Attribute label='Type' value={resourceLabel(ResourceKind.Project)} />
{/* Missing attr */}
<Attribute label='Size' value='---' />
<Attribute label='Owner' value={this.item.ownerUuid} />
- <Attribute label='Last modified' value={FORMAT_DATE(this.item.modifiedAt)} />
- <Attribute label='Created at' value={FORMAT_DATE(this.item.createdAt)} />
+ <Attribute label='Last modified' value={formatDate(this.item.modifiedAt)} />
+ <Attribute label='Created at' value={formatDate(this.item.createdAt)} />
{/* Missing attr */}
<Attribute label='File size' value='1.4 GB' />
<Attribute label='Description' value={this.item.description} />
diff --git a/src/store/project-panel/project-panel-middleware.ts b/src/store/project-panel/project-panel-middleware.ts
index 881c4f1..1ba2ba2 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, ProjectPanelColumnNames } 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";
@@ -17,7 +17,7 @@ import { GroupContentsResource, GroupContentsResourcePrefix } from "../../servic
import { SortDirection } from "../../components/data-table/data-column";
export const projectPanelMiddleware: Middleware = store => next => {
- next(actions.SET_COLUMNS({ id: PROJECT_PANEL_ID, columns: COLUMNS }));
+ next(actions.SET_COLUMNS({ id: PROJECT_PANEL_ID, columns }));
return action => {
diff --git a/src/views/project-panel/project-panel.tsx b/src/views/project-panel/project-panel.tsx
index 107542e..403c2b8 100644
--- a/src/views/project-panel/project-panel.tsx
+++ b/src/views/project-panel/project-panel.tsx
@@ -5,7 +5,7 @@
import * as React from 'react';
import { ProjectPanelItem } from './project-panel-item';
import { Grid, Typography, Button, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
-import { FORMAT_DATE, FORMAT_FILE_SIZE } from '../../common/formatters';
+import { formatDate, formatFileSize } from '../../common/formatters';
import DataExplorer from "../../views-components/data-explorer/data-explorer";
import { DispatchProp, connect } from 'react-redux';
import { DataColumns } from '../../components/data-table/data-table';
@@ -15,7 +15,7 @@ import { DataTableFilterItem } from '../../components/data-table-filters/data-ta
import { ContainerRequestState } from '../../models/container-request';
import { SortDirection } from '../../components/data-table/data-column';
import { ResourceKind } from '../../models/resource';
-import { RESOURCE_LABEL } from '../../common/labels';
+import { resourceLabel } from '../../common/labels';
import { ProjectIcon, CollectionIcon, ProcessIcon, DefaultIcon } from '../../components/icon/icon';
import { ArvadosTheme } from '../../common/custom-theme';
@@ -112,26 +112,26 @@ const RENDER_ICON = (item: ProjectPanelItem) => {
}
};
-const RENDER_DATE = (date: string) => {
- return <Typography noWrap>{FORMAT_DATE(date)}</Typography>;
+const renderDate = (date: string) => {
+ return <Typography noWrap>{formatDate(date)}</Typography>;
};
-const RENDER_FILE_SIZE = (fileSize?: number) =>
+const renderFileSize = (fileSize?: number) =>
<Typography noWrap>
- {FORMAT_FILE_SIZE(fileSize)}
+ {formatFileSize(fileSize)}
</Typography>;
-const RENDER_OWNER = (owner: string) =>
+const renderOwner = (owner: string) =>
<Typography noWrap color="primary" >
{owner}
</Typography>;
-const RENDER_TYPE = (type: string) =>
+const renderType = (type: string) =>
<Typography noWrap>
- {RESOURCE_LABEL(type)}
+ {resourceLabel(type)}
</Typography>;
-const RENDER_STATUS = (item: ProjectPanelItem) =>
+const renderStatus = (item: ProjectPanelItem) =>
<Typography noWrap align="center" >
{item.status || "-"}
</Typography>;
@@ -146,7 +146,7 @@ export enum ProjectPanelColumnNames {
}
-export const COLUMNS: DataColumns<ProjectPanelItem, ProjectPanelFilter> = [
+export const columns: DataColumns<ProjectPanelItem, ProjectPanelFilter> = [
{
name: ProjectPanelColumnNames.NAME,
selected: true,
@@ -174,7 +174,7 @@ export const COLUMNS: DataColumns<ProjectPanelItem, ProjectPanelFilter> = [
type: ContainerRequestState.Uncommitted
}
],
- render: RENDER_STATUS,
+ render: renderStatus,
width: "75px"
},
{
@@ -182,41 +182,41 @@ export const COLUMNS: DataColumns<ProjectPanelItem, ProjectPanelFilter> = [
selected: true,
filters: [
{
- name: RESOURCE_LABEL(ResourceKind.Collection),
+ name: resourceLabel(ResourceKind.Collection),
selected: true,
type: ResourceKind.Collection
},
{
- name: RESOURCE_LABEL(ResourceKind.Process),
+ name: resourceLabel(ResourceKind.Process),
selected: true,
type: ResourceKind.Process
},
{
- name: RESOURCE_LABEL(ResourceKind.Project),
+ name: resourceLabel(ResourceKind.Project),
selected: true,
type: ResourceKind.Project
}
],
- render: item => RENDER_TYPE(item.kind),
+ render: item => renderType(item.kind),
width: "125px"
},
{
name: ProjectPanelColumnNames.OWNER,
selected: true,
- render: item => RENDER_OWNER(item.owner),
+ render: item => renderOwner(item.owner),
width: "200px"
},
{
name: ProjectPanelColumnNames.FILE_SIZE,
selected: true,
- render: item => RENDER_FILE_SIZE(item.fileSize),
+ render: item => renderFileSize(item.fileSize),
width: "50px"
},
{
name: ProjectPanelColumnNames.LAST_MODIFIED,
selected: true,
sortDirection: SortDirection.None,
- render: item => RENDER_DATE(item.lastModified),
+ render: item => renderDate(item.lastModified),
width: "150px"
}
];
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list