projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
15610: Shows status indicator while loading collection's file data.
[arvados-workbench2.git]
/
src
/
views
/
collection-panel
/
collection-panel.tsx
diff --git
a/src/views/collection-panel/collection-panel.tsx
b/src/views/collection-panel/collection-panel.tsx
index be2afc721bf7238135522dee01f23c708fd947ac..27a685410116fb238e44c50f7a2808aef142b1d2 100644
(file)
--- a/
src/views/collection-panel/collection-panel.tsx
+++ b/
src/views/collection-panel/collection-panel.tsx
@@
-5,7
+5,7
@@
import * as React from 'react';
import {
StyleRulesCallback, WithStyles, withStyles, Card,
import * as React from 'react';
import {
StyleRulesCallback, WithStyles, withStyles, Card,
- CardHeader, IconButton, CardContent, Grid, Tooltip
, Chip
+ CardHeader, IconButton, CardContent, Grid, Tooltip
} from '@material-ui/core';
import { connect, DispatchProp } from "react-redux";
import { RouteComponentProps } from 'react-router';
} from '@material-ui/core';
import { connect, DispatchProp } from "react-redux";
import { RouteComponentProps } from 'react-router';
@@
-28,8
+28,10
@@
import { IllegalNamingWarning } from '~/components/warning/warning';
import { GroupResource } from '~/models/group';
import { UserResource } from '~/models/user';
import { getUserUuid } from '~/common/getuser';
import { GroupResource } from '~/models/group';
import { UserResource } from '~/models/user';
import { getUserUuid } from '~/common/getuser';
+import { getProgressIndicator } from '~/store/progress-indicator/progress-indicator-reducer';
+import { COLLECTION_PANEL_LOAD_FILES } from '~/store/collection-panel/collection-panel-files/collection-panel-files-actions';
-type CssRules = 'card' | 'iconHeader' | 'tag' | 'label' | 'value' | 'link' | 'centeredLabel';
+type CssRules = 'card' | 'iconHeader' | 'tag' | 'label' | 'value' | 'link' | 'centeredLabel'
| 'readOnlyIcon'
;
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
card: {
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
card: {
@@
-60,12
+62,17
@@
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
'&:hover': {
cursor: 'pointer'
}
'&:hover': {
cursor: 'pointer'
}
+ },
+ readOnlyIcon: {
+ marginLeft: theme.spacing.unit,
+ fontSize: 'small',
}
});
interface CollectionPanelDataProps {
item: CollectionResource;
isWritable: boolean;
}
});
interface CollectionPanelDataProps {
item: CollectionResource;
isWritable: boolean;
+ isLoadingFiles: boolean;
}
type CollectionPanelProps = CollectionPanelDataProps & DispatchProp
}
type CollectionPanelProps = CollectionPanelDataProps & DispatchProp
@@
-84,11
+91,13
@@
export const CollectionPanel = withStyles(styles)(
isWritable = itemOwner.writableBy.indexOf(currentUserUUID || '') >= 0;
}
}
isWritable = itemOwner.writableBy.indexOf(currentUserUUID || '') >= 0;
}
}
- return { item, isWritable };
+ const loadingFilesIndicator = getProgressIndicator(COLLECTION_PANEL_LOAD_FILES)(state.progressIndicator);
+ const isLoadingFiles = loadingFilesIndicator && loadingFilesIndicator!.working || false;
+ return { item, isWritable, isLoadingFiles };
})(
class extends React.Component<CollectionPanelProps> {
render() {
})(
class extends React.Component<CollectionPanelProps> {
render() {
- const { classes, item, dispatch, isWritable } = this.props;
+ const { classes, item, dispatch, isWritable
, isLoadingFiles
} = this.props;
return item
? <>
<Card data-cy='collection-info-panel' className={classes.card}>
return item
? <>
<Card data-cy='collection-info-panel' className={classes.card}>
@@
-101,6
+110,7
@@
export const CollectionPanel = withStyles(styles)(
action={
<Tooltip title="More options" disableFocusListener>
<IconButton
action={
<Tooltip title="More options" disableFocusListener>
<IconButton
+ data-cy='collection-panel-options-btn'
aria-label="More options"
onClick={this.handleContextMenu}>
<MoreOptionsIcon />
aria-label="More options"
onClick={this.handleContextMenu}>
<MoreOptionsIcon />
@@
-111,7
+121,11
@@
export const CollectionPanel = withStyles(styles)(
<span>
<IllegalNamingWarning name={item.name}/>
{item.name}
<span>
<IllegalNamingWarning name={item.name}/>
{item.name}
- {isWritable || <Chip variant="outlined" icon={<ReadOnlyIcon />} label="Read-only"/>}
+ {isWritable ||
+ <Tooltip title="Read-only">
+ <ReadOnlyIcon data-cy="read-only-icon" className={classes.readOnlyIcon} />
+ </Tooltip>
+ }
</span>
}
titleTypographyProps={this.titleProps}
</span>
}
titleTypographyProps={this.titleProps}
@@
-142,7
+156,7
@@
export const CollectionPanel = withStyles(styles)(
</CardContent>
</Card>
</CardContent>
</Card>
- <Card className={classes.card}>
+ <Card
data-cy='collection-properties-panel'
className={classes.card}>
<CardHeader title="Properties" />
<CardContent>
<Grid container direction="column">
<CardHeader title="Properties" />
<CardContent>
<Grid container direction="column">
@@
-173,8
+187,8
@@
export const CollectionPanel = withStyles(styles)(
</Grid>
</CardContent>
</Card>
</Grid>
</CardContent>
</Card>
- <div className={classes.card}
data-cy="collection-files-panel"
>
- <CollectionPanelFiles isWritable={isWritable} />
+ <div className={classes.card}>
+ <CollectionPanelFiles isWritable={isWritable}
isLoading={isLoadingFiles}
/>
</div>
</>
: null;
</div>
</>
: null;