Revert "Ivan - OS-18 - Create dashboard pages placeholders [skip ci]" [skip ci]
This commit is contained in:
parent
47571ec068
commit
96ff008104
|
@ -1,23 +1,13 @@
|
||||||
const React = require('react');
|
import React from 'react';
|
||||||
const {Router, Route, IndexRoute, browserHistory} = require('react-router');
|
import {Router, Route, IndexRoute, browserHistory} from 'react-router';
|
||||||
|
|
||||||
const App = require('app/App');
|
import App from 'app/App';
|
||||||
const DemoPage = require('app/demo/components-demo-page');
|
import DemoPage from 'app/demo/components-demo-page';
|
||||||
|
|
||||||
const MainLayout = require('app/main/main-layout');
|
import MainLayout from 'app/main/main-layout';
|
||||||
const MainHomePage = require('app/main/main-home/main-home-page');
|
import MainHomePage from 'app/main/main-home/main-home-page';
|
||||||
const MainSignUpPage = require('app/main/main-signup/main-signup-page');
|
import MainSignUpPage from 'app/main/main-signup/main-signup-page';
|
||||||
|
|
||||||
const DashboardLayout = require('app/main/dashboard/dashboard-layout');
|
|
||||||
|
|
||||||
const DashboardListTicketsPage = require('app/main/dashboard/dashboard-list-tickets/dashboard-list-tickets-page');
|
|
||||||
const DashboardListArticlesPage = require('app/main/dashboard/dashboard-list-articles/dashboard-list-articles-page');
|
|
||||||
|
|
||||||
const DashboardCreateTicketPage = require('app/main/dashboard/dashboard-create-ticket/dashboard-create-ticket-page');
|
|
||||||
const DashboardEditProfilePage = require('app/main/dashboard/dashboard-edit-profile/dashboard-edit-profile-page');
|
|
||||||
|
|
||||||
const DashboardArticlePage = require('app/main/dashboard/dashboard-article/dashboard-article-page');
|
|
||||||
const DashboardTicketPage = require('app/main/dashboard/dashboard-ticket/dashboard-ticket-page');
|
|
||||||
|
|
||||||
export default (
|
export default (
|
||||||
<Router history={browserHistory}>
|
<Router history={browserHistory}>
|
||||||
|
@ -25,16 +15,6 @@ export default (
|
||||||
<Route path='/app' component={MainLayout}>
|
<Route path='/app' component={MainLayout}>
|
||||||
<IndexRoute component={MainHomePage} />
|
<IndexRoute component={MainHomePage} />
|
||||||
<Route path='signup' component={MainSignUpPage}/>
|
<Route path='signup' component={MainSignUpPage}/>
|
||||||
<Route path='dashboard' component={DashboardLayout}>
|
|
||||||
<IndexRoute component={DashboardListTicketsPage} />
|
|
||||||
<Route path='articles' component={DashboardListArticlesPage}/>
|
|
||||||
|
|
||||||
<Route path='create-ticket' component={DashboardCreateTicketPage}/>
|
|
||||||
<Route path='edit-profile' component={DashboardEditProfilePage}/>
|
|
||||||
|
|
||||||
<Route path='article' component={DashboardArticlePage}/>
|
|
||||||
<Route path='ticket' component={DashboardTicketPage}/>
|
|
||||||
</Route>
|
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
<Route name='Demo' path='demo' component={DemoPage} />
|
<Route name='Demo' path='demo' component={DemoPage} />
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
const DashboardArticlePage = React.createClass({
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
DASHBOARD ARTICLE
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default DashboardArticlePage;
|
|
|
@ -1,14 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
const DashboardCreateTicketPage = React.createClass({
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
DASHBOARD CREATE TICKET
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default DashboardCreateTicketPage;
|
|
|
@ -1,14 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
const DashboardEditProfilePage = React.createClass({
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
DASHBOARD EDIT PROFILE
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default DashboardEditProfilePage;
|
|
|
@ -1,16 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import DashboardMenu from 'app/main/dashboard/dashboard-menu';
|
|
||||||
|
|
||||||
const DashboardLayout = React.createClass({
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div><DashboardMenu location={this.props.location} /></div>
|
|
||||||
<div>{this.props.children}</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default DashboardLayout;
|
|
|
@ -1,14 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
const DashboardListArticlesPage = React.createClass({
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
DASHBOARD ARTICLES LIST
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default DashboardListArticlesPage;
|
|
|
@ -1,14 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
const DashboardListTicketsPage = React.createClass({
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
DASHBOARD TICKET LIST
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default DashboardListTicketsPage;
|
|
|
@ -1,57 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import _ from 'lodash';
|
|
||||||
|
|
||||||
import Menu from 'core-components/menu';
|
|
||||||
|
|
||||||
let dashboardRoutes = [
|
|
||||||
{ path: '/app/dashboard', text: 'Ticket List' },
|
|
||||||
{ path: '/app/dashboard/create-ticket', text: 'Create Ticket' },
|
|
||||||
{ path: '/app/dashboard/articles', text: 'View Articles' },
|
|
||||||
{ path: '/app/dashboard/edit-profile', text: 'Edit Profile' }
|
|
||||||
];
|
|
||||||
|
|
||||||
const DashboardMenu = React.createClass({
|
|
||||||
contextTypes: {
|
|
||||||
router: React.PropTypes.object
|
|
||||||
},
|
|
||||||
|
|
||||||
propTypes: {
|
|
||||||
location: React.PropTypes.object
|
|
||||||
},
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<Menu {...this.getProps()} />
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
getProps() {
|
|
||||||
return {
|
|
||||||
items: this.getMenuItems(),
|
|
||||||
selectedIndex: this.getSelectedIndex(),
|
|
||||||
onItemClick: this.goToPathByIndex
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
getMenuItems: function () {
|
|
||||||
return dashboardRoutes.map(this.getMenuItem);
|
|
||||||
},
|
|
||||||
|
|
||||||
getMenuItem(item) {
|
|
||||||
return {
|
|
||||||
content: item.text
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
getSelectedIndex() {
|
|
||||||
let pathname = this.props.location.pathname;
|
|
||||||
|
|
||||||
return _.findIndex(dashboardRoutes, {path: pathname});
|
|
||||||
},
|
|
||||||
|
|
||||||
goToPathByIndex(itemIndex) {
|
|
||||||
this.context.router.push(dashboardRoutes[itemIndex].path);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default DashboardMenu;
|
|
|
@ -1,14 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
const DashboardTicketPage = React.createClass({
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
DASHBOARD TICKET PAGE
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default DashboardTicketPage;
|
|
|
@ -26,7 +26,7 @@ const Icon = React.createClass({
|
||||||
|
|
||||||
renderFlag() {
|
renderFlag() {
|
||||||
return (
|
return (
|
||||||
<img className={this.props.className} src={`/images/icons/${this.props.name}.png`} aria-hidden="true" />
|
<img className={this.props.className} src={`../images/icons/${this.props.name}.png`} aria-hidden="true" />
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
&__list-item {
|
&__list-item {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
|
||||||
&_selected,
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: $primary-red;
|
background-color: $primary-red;
|
||||||
color: white;
|
color: white;
|
||||||
|
@ -24,7 +23,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&_secondary {
|
&_secondary {
|
||||||
.menu__list-item_selected,
|
|
||||||
.menu__list-item:hover {
|
.menu__list-item:hover {
|
||||||
background-color: $secondary-blue;
|
background-color: $secondary-blue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue