15856: Merge branch 'master' into 15856-illegal-chars-warning
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Tue, 26 Nov 2019 21:01:45 +0000 (18:01 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Tue, 26 Nov 2019 21:01:45 +0000 (18:01 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

1  2 
src/views/collection-panel/collection-panel.tsx

index 4e3d5acd9aa37baa9c766660f2785333971fa8b2,99edc1a26912e8822d730d7291784b819ec2ab87..b92557f9de35b59557318ea6a4ba8b69f5f3c588
@@@ -21,12 -21,9 +21,10 @@@ import { getResource } from '~/store/re
  import { openContextMenu } from '~/store/context-menu/context-menu-actions';
  import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
  import { formatFileSize } from "~/common/formatters";
- import { getResourceData } from "~/store/resources-data/resources-data";
- import { ResourceData } from "~/store/resources-data/resources-data-reducer";
  import { openDetailsPanel } from '~/store/details-panel/details-panel-action';
  import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
  import { PropertyChipComponent } from '~/views-components/resource-properties-form/property-chip';
 +import { IllegalNamingWarning } from '~/components/warning/warning';
  
  type CssRules = 'card' | 'iconHeader' | 'tag' | 'label' | 'value' | 'link';
  
@@@ -60,22 -57,20 +58,20 @@@ const styles: StyleRulesCallback<CssRul
  
  interface CollectionPanelDataProps {
      item: CollectionResource;
-     data: ResourceData;
  }
  
  type CollectionPanelProps = CollectionPanelDataProps & DispatchProp
      & WithStyles<CssRules> & RouteComponentProps<{ id: string }>;
  
  export const CollectionPanel = withStyles(styles)(
-         connect((state: RootState, props: RouteComponentProps<{ id: string }>) => {
-             const item = getResource(props.match.params.id)(state.resources);
-             const data = getResourceData(props.match.params.id)(state.resourcesData);
-             return { item, data };
-         })(
+     connect((state: RootState, props: RouteComponentProps<{ id: string }>) => {
+         const item = getResource(props.match.params.id)(state.resources);
+         return { item };
+     })(
          class extends React.Component<CollectionPanelProps> {
  
              render() {
-                 const { classes, item, data, dispatch } = this.props;
+                 const { classes, item, dispatch } = this.props;
                  return item
                      ? <>
                          <Card className={classes.card}>
@@@ -94,7 -89,7 +90,7 @@@
                                          </IconButton>
                                      </Tooltip>
                                  }
 -                                title={item && item.name}
 +                                title={item && <span><IllegalNamingWarning name={item.name}/>{item.name}</span>}
                                  titleTypographyProps={this.titleProps}
                                  subheader={item && item.description}
                                  subheaderTypographyProps={this.titleProps} />
                                              label='Portable data hash'
                                              linkToUuid={item && item.portableDataHash} />
                                          <DetailsAttribute classLabel={classes.label} classValue={classes.value}
-                                             label='Number of files' value={data && data.fileCount} />
+                                             label='Number of files' value={item && item.fileCount} />
                                          <DetailsAttribute classLabel={classes.label} classValue={classes.value}
-                                             label='Content size' value={data && formatFileSize(data.fileSize)} />
+                                             label='Content size' value={item && formatFileSize(item.fileSizeTotal)} />
                                          <DetailsAttribute classLabel={classes.label} classValue={classes.value}
                                              label='Owner' linkToUuid={item && item.ownerUuid} />
                                          {(item.properties.container_request || item.properties.containerRequest) &&