relinkified outputUuid and logUuid for processes, removed public/config.json Arvados...
authorLisa Knox <lisaknox83@gmail.com>
Mon, 5 Dec 2022 22:10:00 +0000 (17:10 -0500)
committerLisa Knox <lisaknox83@gmail.com>
Mon, 5 Dec 2022 22:10:00 +0000 (17:10 -0500)
public/config.json [deleted file]
src/models/container-request.ts
src/views-components/data-explorer/renderers.tsx

diff --git a/public/config.json b/public/config.json
deleted file mode 100644 (file)
index 01af6d6..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-  "API_HOST":"tordo.arvadosapi.com"
-}
\ No newline at end of file
index 90e7dea9a90dbc8286c08b804a3a68fc82208612..2a0e60ba9a4ae86c9d628359801f04c2dd1f71f1 100644 (file)
@@ -16,29 +16,29 @@ export enum ContainerRequestState {
 export interface ContainerRequestResource
   extends Resource,
     ResourceWithProperties {
-  kind: ResourceKind.CONTAINER_REQUEST;
-  name: string;
-  description: string;
-  state: ContainerRequestState;
-  requestingContainerUuid: string | null;
-  cumulativeCost: number;
-  containerUuid: string | null;
+  command: string[];
   containerCountMax: number;
-  mounts: { [path: string]: MountType };
-  runtimeConstraints: RuntimeConstraints;
-  schedulingParameters: SchedulingParameters;
+  containerCount: number;
   containerImage: string;
-  environment: any;
+  containerUuid: string | null;
+  cumulativeCost: number;
   cwd: string;
-  command: string[];
-  outputPath: string;
+  description: string;
+  environment: any;
+  expiresAt: string;
+  filters: string;
+  kind: ResourceKind.CONTAINER_REQUEST;
+  logUuid: string | null;
+  mounts: { [path: string]: MountType };
+  name: string;
   outputName: string;
+  outputPath: string;
   outputTtl: number;
+  outputUuid: string | null;
   priority: number | null;
-  expiresAt: string;
+  requestingContainerUuid: string | null;
+  runtimeConstraints: RuntimeConstraints;
+  schedulingParameters: SchedulingParameters;
+  state: ContainerRequestState;
   useExisting: boolean;
-  logUuid: string | null;
-  outputUuid: string | null;
-  filters: string;
-  containerCount: number;
 }
index db2425ab8032bdf16bf81ad2e69a3ddac941cdde..7bfdf2eceb41157365190b5f56ff9bedaf42e278 100644 (file)
@@ -61,9 +61,10 @@ import { getUserUuid } from 'common/getuser';
 import { VirtualMachinesResource } from 'models/virtual-machines';
 import { CopyToClipboardSnackbar } from 'components/copy-to-clipboard-snackbar/copy-to-clipboard-snackbar';
 import { ProjectResource } from 'models/project';
+import { ProcessResource } from 'models/process';
 
-const renderName = (dispatch: Dispatch, item: GroupContentsResource) => {
 
+const renderName = (dispatch: Dispatch, item: GroupContentsResource) => {
     const navFunc = ("groupClass" in item && item.groupClass === GroupClass.ROLE ? navigateToGroupDetails : navigateTo);
     return <Grid container alignItems="center" wrap="nowrap" spacing={16}>
         <Grid item>
@@ -89,6 +90,7 @@ const renderName = (dispatch: Dispatch, item: GroupContentsResource) => {
     </Grid>;
 };
 
+
 const FrozenProject = (props: {item: ProjectResource}) => {
     const [fullUsername, setFullusername] = React.useState<any>(null);
     const getFullName = React.useCallback(() => {
@@ -113,6 +115,7 @@ export const ResourceName = connect(
         return resource;
     })((resource: GroupContentsResource & DispatchProp<any>) => renderName(resource.dispatch, resource));
 
+    
 const renderIcon = (item: GroupContentsResource) => {
     switch (item.kind) {
         case ResourceKind.PROJECT:
@@ -230,6 +233,11 @@ const renderUuid = (item: { uuid: string }) =>
         {(item.uuid && <CopyToClipboardSnackbar value={item.uuid} />) || '-' }
     </Typography>;
 
+const renderUuidCopyIcon = (item: { uuid: string }) =>
+    <Typography data-cy="uuid" noWrap>
+        {(item.uuid && <CopyToClipboardSnackbar value={item.uuid} />) || '-' }
+    </Typography>;
+
 export const ResourceUuid = connect((state: RootState, props: { uuid: string }) => (
     getResource<UserResource>(props.uuid)(state.resources) || { uuid: '' }
 ))(renderUuid);
@@ -670,17 +678,39 @@ export const ResourceContainerUuid = connect(
         return { uuid: process?.container?.uuid ? process?.container?.uuid : '' };
     })((props: { uuid: string }) => renderUuid({ uuid: props.uuid }));
 
+enum ColumnSelection {
+    OUTPUT_UUID = 'outputUuid',
+    LOG_UUID = 'logUuid'
+}
+
+const renderUuidLinkWithCopyIcon = (dispatch: Dispatch, item: ProcessResource, column: string) => {
+    const selectedColumnUuid = item[column]
+    return <Grid container alignItems="center" wrap="nowrap" >
+        <Grid item>
+            {selectedColumnUuid ? 
+                <Typography color="primary" style={{ width: 'auto', cursor: 'pointer' }} noWrap 
+                    onClick={() => dispatch<any>(navigateTo(selectedColumnUuid))}>
+                    {selectedColumnUuid} 
+                </Typography> 
+            : '-' }
+        </Grid>
+        <Grid item>
+            {selectedColumnUuid && renderUuidCopyIcon({ uuid: selectedColumnUuid })}
+        </Grid>
+    </Grid>;
+};
+
 export const ResourceOutputUuid = connect(
     (state: RootState, props: { uuid: string }) => {
-        const process = getProcess(props.uuid)(state.resources)
-        return { uuid: process?.containerRequest.outputUuid || '' };
-    })((props: { uuid: string }) => renderUuid({ uuid: props.uuid }));
+        const resource = getResource<ProcessResource>(props.uuid)(state.resources);
+        return resource;
+    })((process: ProcessResource & DispatchProp<any>) => renderUuidLinkWithCopyIcon(process.dispatch, process, ColumnSelection.OUTPUT_UUID));
 
 export const ResourceLogUuid = connect(
     (state: RootState, props: { uuid: string }) => {
-        const process = getProcess(props.uuid)(state.resources)
-        return { uuid: process?.containerRequest.logUuid || '' };
-    })((props: { uuid: string }) => renderUuid({ uuid: props.uuid }));
+        const resource = getResource<ProcessResource>(props.uuid)(state.resources);
+        return resource;
+    })((process: ProcessResource & DispatchProp<any>) => renderUuidLinkWithCopyIcon(process.dispatch, process, ColumnSelection.LOG_UUID));
 
 export const ResourceParentProcess = connect(
     (state: RootState, props: { uuid: string }) => {
@@ -824,11 +854,14 @@ const ownerFromResourceId =
         userFromID
     );
 
+
+
+
+
 const _resourceWithName =
     withStyles({}, { withTheme: true })
         ((props: { uuid: string, userFullname: string, dispatch: Dispatch, theme: ArvadosTheme }) => {
             const { uuid, userFullname, dispatch, theme } = props;
-
             if (userFullname === '') {
                 dispatch<any>(loadResource(uuid, false));
                 return <Typography style={{ color: theme.palette.primary.main }} inline noWrap>
@@ -845,6 +878,8 @@ export const ResourceOwnerWithName = ownerFromResourceId(_resourceWithName);
 
 export const ResourceWithName = userFromID(_resourceWithName);
 
+
+
 export const UserNameFromID =
     compose(userFromID)(
         (props: { uuid: string, displayAsText?: string, userFullname: string, dispatch: Dispatch }) => {