19690: description hover hacked in
authorLisa Knox <lisaknox83@gmail.com>
Wed, 23 Nov 2022 22:59:56 +0000 (17:59 -0500)
committerLisa Knox <lisaknox83@gmail.com>
Mon, 28 Nov 2022 16:43:19 +0000 (11:43 -0500)
Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox@curii.com>

src/views-components/data-explorer/renderers.tsx
src/views/groups-panel/groups-panel.tsx
src/views/project-panel/project-panel.tsx

index 47e5b287ae7acb3fce265916da02964286b68748..ea4b85124af21fff19a30abd4e9c8a4f1e6f4ff6 100644 (file)
@@ -664,16 +664,16 @@ export const ResourceWorkflowStatus = connect(
         };
     })((props: { ownerUuid?: string, uuidPrefix: string }) => renderWorkflowStatus(props.uuidPrefix, props.ownerUuid));
 
-export const ResourceLastModifiedDate = connect(
+export const ResourceCreatedAtDate = connect(
     (state: RootState, props: { uuid: string }) => {
         const resource = getResource<GroupContentsResource>(props.uuid)(state.resources);
-        return { date: resource ? resource.modifiedAt : '' };
+        return { date: resource ? resource.createdAt : '' };
     })((props: { date: string }) => renderDate(props.date));
-
-export const ResourceCreatedAtDate = connect(
+    
+export const ResourceLastModifiedDate = connect(
     (state: RootState, props: { uuid: string }) => {
         const resource = getResource<GroupContentsResource>(props.uuid)(state.resources);
-        return { date: resource ? resource.createdAt : '' };
+        return { date: resource ? resource.modifiedAt : '' };
     })((props: { date: string }) => renderDate(props.date));
 
 export const ResourceTrashDate = connect(
@@ -723,6 +723,21 @@ export const ResourceOwnerName = connect(
         return { owner: ownerName ? ownerName!.name : resource!.ownerUuid };
     })((props: { owner: string }) => renderOwner(props.owner));
 
+    
+const renderDescription = (description: string)=>{
+    const truncatedDescription = description.slice(0, 18) + '...'
+    return <Typography title={description}>{truncatedDescription}</Typography>;
+}
+    
+export const ResourceDescription = connect(
+    (state: RootState, props: { uuid: string }) => {
+        const resource = getResource<GroupContentsResource>(props.uuid)(state.resources);
+        //testing
+        const containerRequestDescription = "This is a description for a Container Request, also known as a 'Process'. I'm still not 100% sure why one term is used over the other in practice, but I'm new here so I expect it will become clear to me when it's appropriate. This long bit of text is for testing purposes. -LK"
+        if (resource && !resource.description && resource.kind === ResourceKind.PROCESS) resource.description = containerRequestDescription
+        return { description: resource ? resource.description : '' };
+    })((props: { description: string }) => renderDescription(props.description));
+
 const userFromID =
     connect(
         (state: RootState, props: { uuid: string }) => {
index 3251c729eee32d6df8d75a4c298d38d9bb0e8c4b..f6f5048dec7f944479c24402b4b444db37981ae7 100644 (file)
@@ -85,6 +85,7 @@ export const GroupsPanel = withStyles(styles)(connect(
     class GroupsPanel extends React.Component<GroupsPanelProps & WithStyles<CssRules>> {
 
         render() {
+            console.log('GROUPSPANEL', this)
             return (
                 <div className={this.props.classes.root}><DataExplorer
                     id={GROUPS_PANEL_ID}
index c2cc8f3c4b6ea17b40318c1936d720c16c905980..bf7ab85af973d6df0f07eeaf2f4ac9eb03802d3c 100644 (file)
@@ -17,10 +17,12 @@ import { SortDirection } from 'components/data-table/data-column';
 import { ResourceKind, Resource } from 'models/resource';
 import {
     ResourceFileSize,
-    ResourceLastModifiedDate,
     ResourceCreatedAtDate,
+    ResourceLastModifiedDate,
+    ResourceDeleteDate,
     ProcessStatus,
     ResourceType,
+    ResourceDescription,
     ResourceOwnerWithName
 } from 'views-components/data-explorer/renderers';
 import { ProjectIcon } from 'components/icon/icon';
@@ -65,9 +67,11 @@ export enum ProjectPanelColumnNames {
     TYPE = "Type",
     OWNER = "Owner",
     FILE_SIZE = "File size",
-    LAST_MODIFIED = "Last modified",
     UUID = "UUID",
-    CREATED_AT = "Created"
+    CREATED_AT = "Date created",
+    LAST_MODIFIED = "Last modified",
+    DELETE_AT = "Delete At",
+    DESCRIPTION = "Description"
 }
 
 export interface ProjectPanelFilter extends DataTableFilterItem {
@@ -112,6 +116,21 @@ export const projectPanelColumns: DataColumns<string> = [
         filters: createTree(),
         render: uuid => <ResourceFileSize uuid={uuid} />
     },
+    
+    {
+        name: ProjectPanelColumnNames.UUID,
+        selected: false,
+        configurable: true,
+        filters: createTree(),
+        render: uuid =><>{uuid}</>
+    },
+    {
+        name: ProjectPanelColumnNames.CREATED_AT,
+        selected: false,
+        configurable: true,
+        filters: createTree(),
+        render: uuid =><ResourceCreatedAtDate uuid={uuid}/>
+    },
     {
         name: ProjectPanelColumnNames.LAST_MODIFIED,
         selected: true,
@@ -121,18 +140,19 @@ export const projectPanelColumns: DataColumns<string> = [
         render: uuid => <ResourceLastModifiedDate uuid={uuid} />
     },
     {
-        name: ProjectPanelColumnNames.UUID,
+        name: ProjectPanelColumnNames.DELETE_AT,
         selected: true,
         configurable: true,
+        sortDirection: SortDirection.DESC,
         filters: createTree(),
-        render: uuid =><>{uuid}</>
+        render: uuid => <ResourceDeleteDate uuid={uuid} />
     },
     {
-        name: ProjectPanelColumnNames.CREATED_AT,
+        name: ProjectPanelColumnNames.DESCRIPTION,
         selected: true,
         configurable: true,
         filters: createTree(),
-        render: uuid =><ResourceCreatedAtDate uuid={uuid}/>
+        render: uuid =><ResourceDescription uuid={uuid}/>
     }
 ];