+};
+
+const renderDate = (date: string) =>
+ <Typography noWrap>
+ {formatDate(date)}
+ </Typography>;
+
+const renderFileSize = (fileSize?: number) =>
+ <Typography noWrap>
+ {formatFileSize(fileSize)}
+ </Typography>;
+
+const renderOwner = (owner: string) =>
+ <Typography noWrap color="primary">
+ {owner}
+ </Typography>;
+
+
+
+const typeToLabel = (type: string) => {
+ switch (type) {
+ case ResourceKind.Collection:
+ return "Data collection";
+ case ResourceKind.Project:
+ return "Project";
+ case ResourceKind.Process:
+ return "Process";
+ default:
+ return "Unknown";
+ }
+};
+
+const renderType = (type: string) => {
+ return <Typography noWrap>
+ {typeToLabel(type)}
+ </Typography>;
+};
+
+const renderStatus = (item: ProjectPanelItem) =>
+ <Typography noWrap align="center">
+ {item.status || "-"}
+ </Typography>;
+
+export enum ProjectPanelColumnNames {
+ Name = "Name",
+ Status = "Status",
+ Type = "Type",
+ Owner = "Owner",
+ FileSize = "File size",
+ LastModified = "Last modified"
+
+}
+
+export const columns: DataColumns<ProjectPanelItem, ProjectPanelFilter> = [{
+ name: ProjectPanelColumnNames.Name,
+ selected: true,
+ sortDirection: SortDirection.Asc,
+ render: renderName,
+ width: "450px"
+}, {
+ name: "Status",
+ selected: true,
+ filters: [{
+ name: ContainerRequestState.Committed,
+ selected: true,
+ type: ContainerRequestState.Committed
+ }, {
+ name: ContainerRequestState.Final,
+ selected: true,
+ type: ContainerRequestState.Final
+ }, {
+ name: ContainerRequestState.Uncommitted,
+ selected: true,
+ type: ContainerRequestState.Uncommitted
+ }],
+ render: renderStatus,
+ width: "75px"
+}, {
+ name: ProjectPanelColumnNames.Type,
+ selected: true,
+ filters: [{
+ name: typeToLabel(ResourceKind.Collection),
+ selected: true,
+ type: ResourceKind.Collection
+ }, {
+ name: typeToLabel(ResourceKind.Process),
+ selected: true,
+ type: ResourceKind.Process
+ }, {
+ name: typeToLabel(ResourceKind.Project),
+ selected: true,
+ type: ResourceKind.Project
+ }],
+ render: item => renderType(item.kind),
+ width: "125px"
+}, {
+ name: ProjectPanelColumnNames.Owner,
+ selected: true,
+ render: item => renderOwner(item.owner),
+ width: "200px"
+}, {
+ name: ProjectPanelColumnNames.FileSize,
+ selected: true,
+ render: item => renderFileSize(item.fileSize),
+ width: "50px"
+}, {
+ name: ProjectPanelColumnNames.LastModified,
+ selected: true,
+ sortDirection: SortDirection.None,
+ render: item => renderDate(item.lastModified),
+ width: "150px"
+}];
+
+const contextMenuActions = [[{
+ icon: "fas fa-users fa-fw",
+ name: "Share"
+}, {
+ icon: "fas fa-sign-out-alt fa-fw",
+ name: "Move to"
+}, {
+ icon: "fas fa-star fa-fw",
+ name: "Add to favourite"
+}, {
+ icon: "fas fa-edit fa-fw",
+ name: "Rename"
+}, {
+ icon: "fas fa-copy fa-fw",
+ name: "Make a copy"
+}, {
+ icon: "fas fa-download fa-fw",
+ name: "Download"
+}], [{
+ icon: "fas fa-trash-alt fa-fw",
+ name: "Remove"