[ARVADOS-WORKBENCH2] updated: 1.3.0-117-g8c9cf2d
Git user
git at public.curoverse.com
Wed Dec 12 06:58:08 EST 2018
Summary of changes:
src/common/labels.ts | 2 ++
src/store/navigation/navigation-action.ts | 2 ++
src/views-components/data-explorer/renderers.tsx | 24 ++++++++++++++++++------
src/views/link-panel/link-panel-root.tsx | 4 ----
4 files changed, 22 insertions(+), 10 deletions(-)
via 8c9cf2d12a513379d13db279b076314b292c037e (commit)
from 454ef1c106b3d738526d65ecfae8db98ad7bebc2 (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 8c9cf2d12a513379d13db279b076314b292c037e
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date: Wed Dec 12 12:57:55 2018 +0100
change code after CR, clean code and add vm to nav action
Feature #14512_admin_links
Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>
diff --git a/src/common/labels.ts b/src/common/labels.ts
index 133a0e4..c3c4fcd 100644
--- a/src/common/labels.ts
+++ b/src/common/labels.ts
@@ -16,6 +16,8 @@ export const resourceLabel = (type: string) => {
return "User";
case ResourceKind.GROUP:
return "Group";
+ case ResourceKind.VIRTUAL_MACHINE:
+ return "Virtual Machine";
default:
return "Unknown";
}
diff --git a/src/store/navigation/navigation-action.ts b/src/store/navigation/navigation-action.ts
index cbd983a..92443c0 100644
--- a/src/store/navigation/navigation-action.ts
+++ b/src/store/navigation/navigation-action.ts
@@ -21,6 +21,8 @@ export const navigateTo = (uuid: string) =>
dispatch<any>(navigateToCollection(uuid));
} else if (kind === ResourceKind.CONTAINER_REQUEST) {
dispatch<any>(navigateToProcess(uuid));
+ } else if (kind === ResourceKind.VIRTUAL_MACHINE) {
+ dispatch<any>(navigateToAdminVirtualMachines);
}
if (uuid === SidePanelTreeCategory.FAVORITES) {
dispatch<any>(navigateToFavorites);
diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx
index 1be47be..a4713c8 100644
--- a/src/views-components/data-explorer/renderers.tsx
+++ b/src/views-components/data-explorer/renderers.tsx
@@ -210,9 +210,23 @@ export const ResourceLinkClass = connect(
return resource || { linkClass: '' };
})(renderLinkClass);
-const renderLinkTail = (dispatch: Dispatch, item: { uuid: string, tailUuid: string, tailKind: string }) =>
- <Typography noWrap color="primary" onClick={() => dispatch<any>(navigateTo(item.uuid))}>
- {resourceLabel(item.tailKind)}: {item.tailUuid}
+const renderLinkTail = (dispatch: Dispatch, item: { uuid: string, tailUuid: string, tailKind: string }) => {
+ const currentLabel = resourceLabel(item.tailKind);
+ const isUnknow = currentLabel === "Unknown";
+ return (<div>
+ { !isUnknow ? (
+ renderLink(dispatch, item.tailUuid, currentLabel)
+ ) : (
+ <Typography noWrap color="default">
+ {item.tailUuid}
+ </Typography>
+ )}
+ </div>);
+};
+
+const renderLink = (dispatch: Dispatch, uuid: string, label: string) =>
+ <Typography noWrap color="primary" style={{ 'cursor': 'pointer' }} onClick={() => dispatch<any>(navigateTo(uuid))}>
+ {label}: {uuid}
</Typography>;
export const ResourceLinkTail = connect(
@@ -225,9 +239,7 @@ export const ResourceLinkTail = connect(
renderLinkTail(props.dispatch, props.item));
const renderLinkHead = (dispatch: Dispatch, item: { uuid: string, headUuid: string, headKind: ResourceKind }) =>
- <Typography noWrap color="primary" onClick={() => dispatch<any>(navigateTo(item.uuid))}>
- {resourceLabel(item.headKind)}: {item.headUuid}
- </Typography>;
+ renderLink(dispatch, item.headUuid, resourceLabel(item.headKind));
export const ResourceLinkHead = connect(
(state: RootState, props: { uuid: string }) => {
diff --git a/src/views/link-panel/link-panel-root.tsx b/src/views/link-panel/link-panel-root.tsx
index 73b53fc..d5ba79b 100644
--- a/src/views/link-panel/link-panel-root.tsx
+++ b/src/views/link-panel/link-panel-root.tsx
@@ -37,7 +37,6 @@ export const linkPanelColumns: DataColumns<string> = [
name: LinkPanelColumnNames.LINK_CLASS,
selected: true,
configurable: true,
- // sortDirection: SortDirection.NONE,
filters: createTree(),
render: uuid => <ResourceLinkClass uuid={uuid} />
},
@@ -45,7 +44,6 @@ export const linkPanelColumns: DataColumns<string> = [
name: LinkPanelColumnNames.TAIL,
selected: true,
configurable: true,
- // sortDirection: SortDirection.NONE,
filters: createTree(),
render: uuid => <ResourceLinkTail uuid={uuid} />
},
@@ -53,7 +51,6 @@ export const linkPanelColumns: DataColumns<string> = [
name: LinkPanelColumnNames.HEAD,
selected: true,
configurable: true,
- // sortDirection: SortDirection.NONE,
filters: createTree(),
render: uuid => <ResourceLinkHead uuid={uuid} />
},
@@ -61,7 +58,6 @@ export const linkPanelColumns: DataColumns<string> = [
name: LinkPanelColumnNames.UUID,
selected: true,
configurable: true,
- // sortDirection: SortDirection.NONE,
filters: createTree(),
render: uuid => <ResourceLinkUuid uuid={uuid} />
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list