Remove unwanted console logs

feature/appm-store/pbac
Jayasanka 5 years ago
parent 2c6d8eb993
commit bd318d9af8

@ -18,7 +18,7 @@
import React from "react"; import React from "react";
import AppCard from "./AppCard"; import AppCard from "./AppCard";
import {Col, Row, Result, Pagination} from "antd"; import {Col, Row, Result} from "antd";
import axios from "axios"; import axios from "axios";
import {withConfigContext} from "../../context/ConfigContext"; import {withConfigContext} from "../../context/ConfigContext";
import {handleApiError} from "../../js/Utils"; import {handleApiError} from "../../js/Utils";
@ -89,7 +89,6 @@ class AppList extends React.Component {
} }
}).catch((error) => { }).catch((error) => {
console.log(error);
handleApiError(error, "Error occurred while trying to load apps.", true); handleApiError(error, "Error occurred while trying to load apps.", true);
if (error.hasOwnProperty("response") && error.response.status === 403) { if (error.hasOwnProperty("response") && error.response.status === 403) {
const {forbiddenErrors} = this.state; const {forbiddenErrors} = this.state;
@ -106,10 +105,6 @@ class AppList extends React.Component {
}); });
}; };
handlePaginationChange = (page, pageSize) => {
this.fetchData(page, pageSize);
};
handleInfiniteOnLoad = (count) => { handleInfiniteOnLoad = (count) => {
const offset = count * limit; const offset = count * limit;
let apps = this.state.apps; let apps = this.state.apps;
@ -134,7 +129,7 @@ class AppList extends React.Component {
}; };
render() { render() {
const {apps, loading, forbiddenErrors, totalAppCount, hasMore} = this.state; const {apps, loading, forbiddenErrors, hasMore} = this.state;
return ( return (
<div> <div>
@ -144,31 +139,29 @@ class AppList extends React.Component {
loadMore={this.handleInfiniteOnLoad} loadMore={this.handleInfiniteOnLoad}
hasMore={!loading && hasMore} hasMore={!loading && hasMore}
useWindow={true}> useWindow={true}>
<Row gutter={16}> <Row gutter={16}>
{(forbiddenErrors.apps) && ( {(forbiddenErrors.apps) && (
<Result <Result
status="403" status="403"
title="403" title="403"
subTitle="You don't have permission to view apps." subTitle="You don't have permission to view apps."
// extra={<Button type="primary">Back Home</Button>} />
/> )}
)} {!(forbiddenErrors.apps) && apps.length === 0 && (
{!((forbiddenErrors.apps)) && apps.length === 0 && ( <Result
<Result status="404"
status="404" title="No apps, yet."
title="No apps, yet." subTitle="No apps available, yet! When the administration uploads, apps will show up here."
subTitle="No apps available, yet! When the administration uploads, apps will show up here." />
// extra={<Button type="primary">Back Home</Button>} )}
{apps.map(app => (
<Col key={app.id} xs={12} sm={6} md={6} lg={4} xl={3}>
<AppCard key={app.id}
app={app}
/> />
)} </Col>
{apps.map(app => ( ))}
<Col key={app.id} xs={12} sm={6} md={6} lg={4} xl={3}> </Row>
<AppCard key={app.id}
app={app}
/>
</Col>
))}
</Row>
</InfiniteScroll> </InfiniteScroll>
</div> </div>
); );

Loading…
Cancel
Save