|
|
@ -19,13 +19,9 @@
|
|
|
|
import Theme from '../../theme';
|
|
|
|
import Theme from '../../theme';
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
import {withRouter} from 'react-router-dom';
|
|
|
|
import {withRouter} from 'react-router-dom';
|
|
|
|
import AuthHandler from "../../api/authHandler";
|
|
|
|
import {Button, Col, Row, Table} from 'reactstrap';
|
|
|
|
import ApplicationMgtApi from '../../api/applicationMgtApi';
|
|
|
|
|
|
|
|
import {Button, Row, Table} from 'reactstrap';
|
|
|
|
|
|
|
|
import Drawer from '../UIComponents/Drawer/Drawer';
|
|
|
|
import Drawer from '../UIComponents/Drawer/Drawer';
|
|
|
|
import ApplicationView from './View/ApplicationView';
|
|
|
|
import ApplicationView from './View/ApplicationView';
|
|
|
|
import NotificationView from "../UIComponents/Notifications/NotificationView";
|
|
|
|
|
|
|
|
import AppImage from "../UIComponents/AppImage/AppImage";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* The App Create Component.
|
|
|
|
* The App Create Component.
|
|
|
@ -53,7 +49,10 @@ class ApplicationListing extends Component {
|
|
|
|
drawer: {},
|
|
|
|
drawer: {},
|
|
|
|
appListStyle: {},
|
|
|
|
appListStyle: {},
|
|
|
|
image: [{id: "1", src: "https://www.greenfoot.org/images/logos/macos.png"},
|
|
|
|
image: [{id: "1", src: "https://www.greenfoot.org/images/logos/macos.png"},
|
|
|
|
{id: "2", src:"http://dl1.cbsistatic.com/i/r/2016/08/08/0e67e43a-5a45-41ab-b81d-acfba8708044/resize/736x552/0c0ee669677b5060a0fa1bfb0c7873b4/android-logo-promo-470.png"}]
|
|
|
|
{
|
|
|
|
|
|
|
|
id: "2",
|
|
|
|
|
|
|
|
src: "http://dl1.cbsistatic.com/i/r/2016/08/08/0e67e43a-5a45-41ab-b81d-acfba8708044/resize/736x552/0c0ee669677b5060a0fa1bfb0c7873b4/android-logo-promo-470.png"
|
|
|
|
|
|
|
|
}]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.scriptId = "application-listing";
|
|
|
|
this.scriptId = "application-listing";
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -131,15 +130,15 @@ class ApplicationListing extends Component {
|
|
|
|
*Loading the theme files based on the the user-preference.
|
|
|
|
*Loading the theme files based on the the user-preference.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Theme.insertThemingScripts(this.scriptId);
|
|
|
|
Theme.insertThemingScripts(this.scriptId);
|
|
|
|
let getApps = ApplicationMgtApi.getApplications();
|
|
|
|
// let getApps = ApplicationMgtApi.getApplications();
|
|
|
|
getApps.then(response => {
|
|
|
|
// getApps.then(response => {
|
|
|
|
let apps = this.setData(response.data.applications);
|
|
|
|
// let apps = this.setData(response.data.applications);
|
|
|
|
console.log(apps); //TODO: Remove this.
|
|
|
|
// console.log(apps); //TODO: Remove this.
|
|
|
|
this.setState({searchedApplications: apps});
|
|
|
|
// this.setState({searchedApplications: apps});
|
|
|
|
// console.log(this.setState({data: response.data}), console.log(this.state));
|
|
|
|
// // console.log(this.setState({data: response.data}), console.log(this.state));
|
|
|
|
}).catch(err => {
|
|
|
|
// }).catch(err => {
|
|
|
|
AuthHandler.unauthorizedErrorHandler(err);
|
|
|
|
// AuthHandler.unauthorizedErrorHandler(err);
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -248,12 +247,24 @@ class ApplicationListing extends Component {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
|
|
|
|
|
|
|
|
<div id="application-list" style={this.state.appListStyle}>
|
|
|
|
<div id="application-list" style={this.state.appListStyle}>
|
|
|
|
|
|
|
|
<Row>
|
|
|
|
|
|
|
|
<Col xs="3 offset-9">
|
|
|
|
|
|
|
|
<div className="platform-link-placeholder">
|
|
|
|
|
|
|
|
<Button><i className="fw fw-settings"></i> Platforms</Button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
<Row>
|
|
|
|
|
|
|
|
<Col>
|
|
|
|
<Table striped hover>
|
|
|
|
<Table striped hover>
|
|
|
|
<thead>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th></th>
|
|
|
|
{/* TODO: Remove console.log and add sort method. */}
|
|
|
|
{/* TODO: Remove console.log and add sort method. */}
|
|
|
|
<th onClick={() => {console.log("sort")}}>Application Name</th>
|
|
|
|
<th onClick={() => {
|
|
|
|
|
|
|
|
console.log("sort")
|
|
|
|
|
|
|
|
}}>Application Name
|
|
|
|
|
|
|
|
</th>
|
|
|
|
<th>Category</th>
|
|
|
|
<th>Category</th>
|
|
|
|
<th>Platform</th>
|
|
|
|
<th>Platform</th>
|
|
|
|
<th>Status</th>
|
|
|
|
<th>Status</th>
|
|
|
@ -278,14 +289,19 @@ class ApplicationListing extends Component {
|
|
|
|
<td>{application.category}</td>
|
|
|
|
<td>{application.category}</td>
|
|
|
|
<td>{application.platform}</td>
|
|
|
|
<td>{application.platform}</td>
|
|
|
|
<td>{application.status}</td>
|
|
|
|
<td>{application.status}</td>
|
|
|
|
<td><Button onClick={this.handleButtonClick}>Edit</Button></td>
|
|
|
|
<td>
|
|
|
|
|
|
|
|
<Button onClick={this.handleButtonClick}>
|
|
|
|
|
|
|
|
<i className="fw fw-edit"></i>
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
|
</Table>
|
|
|
|
</Table>
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
<Drawer onClose={this.closeDrawer.bind(this)} style={this.state.drawer}>
|
|
|
|
<Drawer onClose={this.closeDrawer.bind(this)} style={this.state.drawer}>
|
|
|
|
<ApplicationView/>
|
|
|
|
<ApplicationView/>
|
|
|
|
</Drawer>
|
|
|
|
</Drawer>
|
|
|
|