return null;
}
- const favoriteAndNoFilters = this.props.isFavorite &&
- !Object.keys(this.state.query).some(key => this.state.query[key] != null);
+ const isFiltered = Object.keys(this.state.query).some(key => this.state.query[key] != null);
return (
<div className="page-with-sidebar page-with-left-sidebar projects-page">
<PageSidebar query={this.state.query} isFavorite={this.props.isFavorite}/>
</aside>
<div className="page-main">
- <ProjectsListContainer favoriteAndNoFilters={favoriteAndNoFilters}/>
+ <ProjectsListContainer isFavorite={this.props.isFavorite} isFiltered={isFiltered}/>
<ProjectsListFooterContainer query={this.state.query} isFavorite={this.props.isFavorite}/>
</div>
</div>
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import React from 'react';
+import { translate } from '../../../helpers/l10n';
+
+export default class EmptyInstance extends React.Component {
+ render () {
+ return (
+ <div className="projects-empty-list">
+ <h3>{translate('projects.no_projects.1')}</h3>
+ <p className="big-spacer-top">{translate('projects.no_projects.empty_instance')}</p>
+ </div>
+ );
+ }
+}
import ProjectCardContainer from './ProjectCardContainer';
import NoProjects from './NoProjects';
import NoFavoriteProjects from './NoFavoriteProjects';
+import EmptyInstance from './EmptyInstance';
export default class ProjectsList extends React.Component {
static propTypes = {
projects: React.PropTypes.arrayOf(React.PropTypes.string),
- favoriteAndNoFilters: React.PropTypes.bool.isRequired
+ isFavorite: React.PropTypes.bool.isRequired,
+ isFiltered: React.PropTypes.bool.isRequired
};
renderNoProjects () {
- return this.props.favoriteAndNoFilters ? (
- <NoFavoriteProjects/>
- ) : (
- <NoProjects/>
- );
+ if (this.props.isFavorite && !this.props.isFiltered) {
+ return <NoFavoriteProjects/>;
+ } else if (!this.props.isFiltered) {
+ return <EmptyInstance/>;
+ } else {
+ return <NoProjects/>;
+ }
}
render () {
projects._projects=projects
projects.no_projects.1=We couldn't find any projects matching selected criteria.
projects.no_projects.2=Try to change filters to get some results.
+projects.no_projects.empty_instance=Once you analyze some projects, they will show up here.
projects.clear_all_filters=Clear All Filters
projects.no_favorite_projects=You don't have any favorite projects yet.
projects.no_favorite_projects.engagement=Discover and mark as favorites projects you are interested in to have a quick access to them.