// Check that name & uuid are correct.
cy.get('[data-cy=collection-info-panel]')
.should('contain', this.testCollection.name)
- .and(`${isWritable ? 'not.': ''}contain`, 'Read-only')
.and('contain', this.testCollection.uuid);
+ // Check for the read-only icon
+ cy.get('[data-cy=read-only-icon]').should(`${isWritable ? 'not.' : ''}exist`);
// Check that both read and write operations are available on
// the 'More options' menu.
cy.get('[data-cy=collection-panel-options-btn]')
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';
import { UserResource } from '~/models/user';
import { getUserUuid } from '~/common/getuser';
-type CssRules = 'card' | 'iconHeader' | 'tag' | 'label' | 'value' | 'link' | 'centeredLabel' | 'readOnlyChip';
+type CssRules = 'card' | 'iconHeader' | 'tag' | 'label' | 'value' | 'link' | 'centeredLabel' | 'readOnlyIcon';
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
card: {
cursor: 'pointer'
}
},
- readOnlyChip: {
- marginLeft: theme.spacing.unit
+ readOnlyIcon: {
+ marginLeft: theme.spacing.unit,
+ fontSize: 'small',
}
});
<span>
<IllegalNamingWarning name={item.name}/>
{item.name}
- {isWritable || <Chip variant="outlined" icon={<ReadOnlyIcon className={classes.readOnlyChip}/>} label="Read-only" className={classes.readOnlyChip} />}
+ {isWritable ||
+ <Tooltip title="Read-only">
+ <ReadOnlyIcon data-cy="read-only-icon" className={classes.readOnlyIcon} />
+ </Tooltip>
+ }
</span>
}
titleTypographyProps={this.titleProps}