import { SortDirection } from '../../components/data-table/data-column';
import { ResourceKind } from '../../models/resource';
import { resourceLabel } from '../../common/labels';
-import { ProjectIcon, CollectionIcon, ProcessIcon, DefaultIcon } from '../../components/icon/icon';
+import { ProjectIcon, CollectionIcon, ProcessIcon, DefaultIcon, FavoriteIcon } from '../../components/icon/icon';
import { ArvadosTheme } from '../../common/custom-theme';
+import { FavoriteStar } from '../../views-components/favorite-star/favorite-star';
type CssRules = "toolbar" | "button";
{renderIcon(item)}
</Grid>
<Grid item>
- <Typography color="primary">
+ <Typography color="default">
{item.name}
</Typography>
</Grid>
+ <Grid item>
+ <Typography variant="caption">
+ <FavoriteStar resourceUuid={item.uuid} />
+ </Typography>
+ </Grid>
</Grid>;
const renderIcon = (item: ProjectPanelItem) => {
switch (item.kind) {
- case ResourceKind.Project:
+ case ResourceKind.PROJECT:
return <ProjectIcon />;
- case ResourceKind.Collection:
+ case ResourceKind.COLLECTION:
return <CollectionIcon />;
- case ResourceKind.Process:
+ case ResourceKind.PROCESS:
return <ProcessIcon />;
default:
return <DefaultIcon />;
{
name: ProjectPanelColumnNames.NAME,
selected: true,
- sortDirection: SortDirection.Asc,
+ sortDirection: SortDirection.ASC,
render: renderName,
width: "450px"
},
selected: true,
filters: [
{
- name: ContainerRequestState.Committed,
+ name: ContainerRequestState.COMMITTED,
selected: true,
- type: ContainerRequestState.Committed
+ type: ContainerRequestState.COMMITTED
},
{
- name: ContainerRequestState.Final,
+ name: ContainerRequestState.FINAL,
selected: true,
- type: ContainerRequestState.Final
+ type: ContainerRequestState.FINAL
},
{
- name: ContainerRequestState.Uncommitted,
+ name: ContainerRequestState.UNCOMMITTED,
selected: true,
- type: ContainerRequestState.Uncommitted
+ type: ContainerRequestState.UNCOMMITTED
}
],
render: renderStatus,
selected: true,
filters: [
{
- name: resourceLabel(ResourceKind.Collection),
+ name: resourceLabel(ResourceKind.COLLECTION),
selected: true,
- type: ResourceKind.Collection
+ type: ResourceKind.COLLECTION
},
{
- name: resourceLabel(ResourceKind.Process),
+ name: resourceLabel(ResourceKind.PROCESS),
selected: true,
- type: ResourceKind.Process
+ type: ResourceKind.PROCESS
},
{
- name: resourceLabel(ResourceKind.Project),
+ name: resourceLabel(ResourceKind.PROJECT),
selected: true,
- type: ResourceKind.Project
+ type: ResourceKind.PROJECT
}
],
render: item => renderType(item.kind),
{
name: ProjectPanelColumnNames.LAST_MODIFIED,
selected: true,
- sortDirection: SortDirection.None,
+ sortDirection: SortDirection.NONE,
render: item => renderDate(item.lastModified),
width: "150px"
}
}
type ProjectPanelProps = ProjectPanelDataProps & ProjectPanelActionProps & DispatchProp
- & WithStyles<CssRules> & RouteComponentProps<{ id: string }>;
+ & WithStyles<CssRules> & RouteComponentProps<{ id: string }>;
export const ProjectPanel = withStyles(styles)(
connect((state: RootState) => ({ currentItemId: state.projects.currentItemId }))(