Update projects list component
@@ -7,6 +7,7 @@ import { ProjectModel } from '../models/project';
import PaginatedList from '../components/paginatedList';
import { noObjectListComponent } from '../constants/templates';
import Breadcrumb from './breadcrumb';
+import ProjectHeader from './projectHeader';
export interface Props {
isCurrentUser: boolean;
@@ -24,13 +25,6 @@ export default class Projects extends React.Component<Props, Object> {
public render() {
const projects = this.props.projects;
const listProjects = () => {
- if (projects.length === 0) {
- return noObjectListComponent(
- this.props.isCurrentUser,
- 'project',
- 'project',
- 'polyaxon project create --help');
- }
return (
<ul>
{projects.filter(
@@ -40,18 +34,25 @@ export default class Projects extends React.Component<Props, Object> {
<Project project={project} onDelete={() => this.props.onDelete(project)}/></li>)}
</ul>
);
- };
+ }
+ ;
return (
<div className="row">
<div className="col-md-12">
<div className="entity-details">
- <Breadcrumb links={[{name: this.props.user}]}/>
+ <Breadcrumb links={[{name: this.props.user}, {name: 'projects'}]}/>
</div>
<RootModal hideModal={this.props.hideModal}/>
<PaginatedList
count={this.props.count}
componentList={listProjects()}
+ componentHeader={ProjectHeader()}
+ componentEmpty={noObjectListComponent(
+ this.props.isCurrentUser,
+ 'project',
+ 'project',
+ 'polyaxon project create --help')}
fetchData={this.props.fetchData}
/>
</div>
