);
renderMain = () => {
- return (
- <DeferredSpinner loading={this.state.loading}>
- {this.getView() === 'visualizations' ? (
- <div className="layout-page-main-inner">
- {this.state.projects && (
- <Visualizations
- displayOrganizations={!this.props.organization && isSonarCloud()}
- projects={this.state.projects}
- sort={this.state.query.sort}
- total={this.state.total}
- visualization={this.getVisualization()}
- />
- )}
- </div>
- ) : (
- <div className="layout-page-main-inner">
- {this.state.projects && (
- <ProjectsList
- cardType={this.getView()}
- currentUser={this.props.currentUser}
- handleFavorite={this.handleFavorite}
- isFavorite={this.props.isFavorite}
- isFiltered={hasFilterParams(this.state.query)}
- organization={this.props.organization}
- projects={this.state.projects}
- query={this.state.query}
- />
- )}
- <ListFooter
- count={this.state.projects !== undefined ? this.state.projects.length : 0}
- loadMore={this.fetchMoreProjects}
- ready={!this.state.loading}
- total={this.state.total !== undefined ? this.state.total : 0}
- />
- </div>
+ if (this.state.loading && this.state.projects === undefined) {
+ return <DeferredSpinner />;
+ }
+
+ return this.getView() === 'visualizations' ? (
+ <div className="layout-page-main-inner">
+ {this.state.projects && (
+ <Visualizations
+ displayOrganizations={!this.props.organization && isSonarCloud()}
+ projects={this.state.projects}
+ sort={this.state.query.sort}
+ total={this.state.total}
+ visualization={this.getVisualization()}
+ />
+ )}
+ </div>
+ ) : (
+ <div className="layout-page-main-inner">
+ {this.state.projects && (
+ <ProjectsList
+ cardType={this.getView()}
+ currentUser={this.props.currentUser}
+ handleFavorite={this.handleFavorite}
+ isFavorite={this.props.isFavorite}
+ isFiltered={hasFilterParams(this.state.query)}
+ organization={this.props.organization}
+ projects={this.state.projects}
+ query={this.state.query}
+ />
)}
- </DeferredSpinner>
+ <ListFooter
+ count={this.state.projects !== undefined ? this.state.projects.length : 0}
+ loading={this.state.loading}
+ loadMore={this.fetchMoreProjects}
+ ready={!this.state.loading}
+ total={this.state.total !== undefined ? this.state.total : 0}
+ />
+ </div>
);
};
</div>
</div>
</div>
- <DeferredSpinner
- loading={false}
- timeout={100}
+ <div
+ className="layout-page-main-inner"
>
- <div
- className="layout-page-main-inner"
- >
- <ProjectsList
- cardType="overall"
- currentUser={
- Object {
- "isLoggedIn": true,
- }
- }
- handleFavorite={[Function]}
- isFavorite={false}
- isFiltered={false}
- projects={
- Array [
- Object {
- "key": "foo",
- "measures": Object {},
- "name": "Foo",
- "tags": Array [],
- "visibility": "public",
- },
- ]
+ <ProjectsList
+ cardType="overall"
+ currentUser={
+ Object {
+ "isLoggedIn": true,
}
- query={
+ }
+ handleFavorite={[Function]}
+ isFavorite={false}
+ isFiltered={false}
+ projects={
+ Array [
Object {
- "coverage": undefined,
- "duplications": undefined,
- "gate": undefined,
- "languages": undefined,
- "maintainability": undefined,
- "new_coverage": undefined,
- "new_duplications": undefined,
- "new_lines": undefined,
- "new_maintainability": undefined,
- "new_reliability": undefined,
- "new_security": undefined,
- "reliability": undefined,
- "search": undefined,
- "security": undefined,
- "size": undefined,
- "sort": undefined,
- "tags": undefined,
- "view": undefined,
- "visualization": undefined,
- }
+ "key": "foo",
+ "measures": Object {},
+ "name": "Foo",
+ "tags": Array [],
+ "visibility": "public",
+ },
+ ]
+ }
+ query={
+ Object {
+ "coverage": undefined,
+ "duplications": undefined,
+ "gate": undefined,
+ "languages": undefined,
+ "maintainability": undefined,
+ "new_coverage": undefined,
+ "new_duplications": undefined,
+ "new_lines": undefined,
+ "new_maintainability": undefined,
+ "new_reliability": undefined,
+ "new_security": undefined,
+ "reliability": undefined,
+ "search": undefined,
+ "security": undefined,
+ "size": undefined,
+ "sort": undefined,
+ "tags": undefined,
+ "view": undefined,
+ "visualization": undefined,
}
- />
- <ListFooter
- count={1}
- loadMore={[Function]}
- ready={true}
- total={0}
- />
- </div>
- </DeferredSpinner>
+ }
+ />
+ <ListFooter
+ count={1}
+ loadMore={[Function]}
+ loading={false}
+ ready={true}
+ total={0}
+ />
+ </div>
</div>
</div>
`;
</div>
</div>
</div>
- <DeferredSpinner
- loading={false}
- timeout={100}
+ <div
+ className="layout-page-main-inner"
>
- <div
- className="layout-page-main-inner"
- >
- <Visualizations
- displayOrganizations={false}
- projects={
- Array [
- Object {
- "key": "foo",
- "measures": Object {},
- "name": "Foo",
- "tags": Array [],
- "visibility": "public",
- },
- ]
- }
- total={0}
- visualization="risk"
- />
- </div>
- </DeferredSpinner>
+ <Visualizations
+ displayOrganizations={false}
+ projects={
+ Array [
+ Object {
+ "key": "foo",
+ "measures": Object {},
+ "name": "Foo",
+ "tags": Array [],
+ "visibility": "public",
+ },
+ ]
+ }
+ total={0}
+ visualization="risk"
+ />
+ </div>
</div>
</div>
`;
</div>
</div>
</div>
- <DeferredSpinner
- loading={false}
- timeout={100}
+ <div
+ className="layout-page-main-inner"
>
- <div
- className="layout-page-main-inner"
- >
- <ProjectsList
- cardType="overall"
- currentUser={
- Object {
- "isLoggedIn": true,
- }
+ <ProjectsList
+ cardType="overall"
+ currentUser={
+ Object {
+ "isLoggedIn": true,
+ }
+ }
+ handleFavorite={[Function]}
+ isFavorite={false}
+ isFiltered={false}
+ organization={
+ Object {
+ "key": "foo",
+ "name": "Foo",
}
- handleFavorite={[Function]}
- isFavorite={false}
- isFiltered={false}
- organization={
+ }
+ projects={
+ Array [
Object {
"key": "foo",
+ "measures": Object {},
"name": "Foo",
- }
- }
- projects={
- Array [
- Object {
- "key": "foo",
- "measures": Object {},
- "name": "Foo",
- },
- ]
- }
- query={
- Object {
- "coverage": undefined,
- "duplications": undefined,
- "gate": undefined,
- "languages": undefined,
- "maintainability": undefined,
- "new_coverage": undefined,
- "new_duplications": undefined,
- "new_lines": undefined,
- "new_maintainability": undefined,
- "new_reliability": undefined,
- "new_security": undefined,
- "reliability": undefined,
- "search": undefined,
- "security": undefined,
- "size": undefined,
- "sort": undefined,
- "tags": undefined,
- "view": undefined,
- "visualization": undefined,
- }
+ },
+ ]
+ }
+ query={
+ Object {
+ "coverage": undefined,
+ "duplications": undefined,
+ "gate": undefined,
+ "languages": undefined,
+ "maintainability": undefined,
+ "new_coverage": undefined,
+ "new_duplications": undefined,
+ "new_lines": undefined,
+ "new_maintainability": undefined,
+ "new_reliability": undefined,
+ "new_security": undefined,
+ "reliability": undefined,
+ "search": undefined,
+ "security": undefined,
+ "size": undefined,
+ "sort": undefined,
+ "tags": undefined,
+ "view": undefined,
+ "visualization": undefined,
}
- />
- <ListFooter
- count={1}
- loadMore={[Function]}
- ready={true}
- total={0}
- />
- </div>
- </DeferredSpinner>
+ }
+ />
+ <ListFooter
+ count={1}
+ loadMore={[Function]}
+ loading={false}
+ ready={true}
+ total={0}
+ />
+ </div>
</div>
</div>
`;