return <CollectionIcon className={className} />;
}
- getDetails() {
+ getTabLabels() {
+ return ['Details', 'Versions'];
+ }
+
+ getDetails(tabNumber: number) {
+ switch (tabNumber) {
+ case 0:
+ return this.getCollectionInfo();
+ case 1:
+ return this.getVersionBrowser();
+ default:
+ return <div />;
+ }
+ }
+
+ private getCollectionInfo() {
return <CollectionDetailsAttributes item={this.item} />;
}
+
+ private getVersionBrowser() {
+ return <div />;
+ }
}
return this.item.name || 'Projects';
}
- abstract getIcon(className?: string): React.ReactElement<any>;
- abstract getDetails(): React.ReactElement<any>;
-
- getActivity(): React.ReactElement<any> {
- return <div />;
+ getTabLabels(): string[] {
+ return ['Details'];
}
+
+ abstract getIcon(className?: string): React.ReactElement<any>;
+ abstract getDetails(tabNr?: number): React.ReactElement<any>;
}
</Grid>
<Grid item>
<Tabs value={tabsValue} onChange={this.handleChange}>
- <Tab disableRipple label="Details" />
- <Tab disableRipple label="Activity" disabled />
+ { item.getTabLabels().map((tabLabel, idx) =>
+ <Tab key={`tab-label-${idx}`} disableRipple label={tabLabel} />)
+ }
</Tabs>
</Grid>
<Grid item xs className={this.props.classes.tabContainer} >
- {tabsValue === 0
- ? item.getDetails()
- : null}
+ {tabsValue !== undefined
+ ? item.getDetails(tabsValue)
+ : null}
</Grid>
</Grid >;
}
getDetails() {
return <div>
<DetailsAttribute label='Type' value={resourceLabel(ResourceKind.PROCESS)} />
- <DetailsAttribute label='Size' value='---' />
<DetailsAttribute label='Owner' linkToUuid={this.item.ownerUuid} value={this.item.ownerUuid} />
- {/* Missing attr */}
<DetailsAttribute label='Status' value={this.item.state} />
<DetailsAttribute label='Last modified' value={formatDate(this.item.modifiedAt)} />
- {/* Missing attrs */}
<DetailsAttribute label='Started at' value={formatDate(this.item.createdAt)} />
<DetailsAttribute label='Finished at' value={formatDate(this.item.expiresAt)} />
withStyles(styles)(
({ classes, project, onClick }: ProjectDetailsComponentProps) => <div>
<DetailsAttribute label='Type' value={resourceLabel(ResourceKind.PROJECT)} />
- {/* Missing attr */}
- <DetailsAttribute label='Size' value='---' />
<DetailsAttribute label='Owner' linkToUuid={project.ownerUuid} lowercaseValue={true} />
<DetailsAttribute label='Last modified' value={formatDate(project.modifiedAt)} />
<DetailsAttribute label='Created at' value={formatDate(project.createdAt)} />
<DetailsAttribute label='Project UUID' linkToUuid={project.uuid} value={project.uuid} />
- {/* Missing attr */}
- {/*<DetailsAttribute label='File size' value='1.4 GB' />*/}
<DetailsAttribute label='Description'>
{project.description ?
<RichTextEditorLink