Skip to content

Commit bf426b5

Browse files
committed
Added OrderList Page
1 parent f1b498f commit bf426b5

File tree

7 files changed

+70
-3
lines changed

7 files changed

+70
-3
lines changed

src/_nav.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ export default {
99
text: 'NEW',
1010
},
1111
},
12+
{
13+
url: '/orders',
14+
name: 'Orders',
15+
class: '' // optional class names space delimited list for title item ex: "text-center"
16+
},
1217
{
1318
title: true,
1419
name: 'Testing React-Table',

src/routes.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
Tooltips,
3232
Typography,
3333
Widgets,
34-
ReactTableExample
34+
OrderList
3535
} from './views';
3636
import Full from './containers/Full';
3737

@@ -75,7 +75,8 @@ const routes = [
7575
{ path: '/notifications/modals', name: 'Modals', component: Modals },
7676
{ path: '/widgets', name: 'Widgets', component: Widgets },
7777
{ path: '/charts', name: 'Charts', component: Charts },
78-
{ path: '/exampletables', name: 'Sample Core UI Tables', component: Tables }
78+
{ path: '/exampletables', name: 'Sample Core UI Tables', component: Tables },
79+
{ path: '/orders', name: 'Orders', component: OrderList}
7980
];
8081

8182
export default routes;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React, { Component } from 'react';
2+
3+
class OrderList extends Component {
4+
constructor(props){
5+
super(props);
6+
this.state = {
7+
'dealerId': null
8+
}
9+
}
10+
11+
componentDidMount(){
12+
this.props.auth.getProfile((error,user)=>{
13+
if(user["http://localhost:3013/user_metadata"].dealerIds){
14+
this.setState({
15+
'dealerIds': user["http://localhost:3013/user_metadata"].dealerIds
16+
});
17+
}
18+
});
19+
}
20+
render(){
21+
return (
22+
<div>
23+
<div>
24+
This is the OrderList component
25+
</div>
26+
<div>
27+
28+
</div>
29+
</div>
30+
)
31+
}
32+
}
33+
34+
export default OrderList;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import OrderList from './OrderList';
4+
5+
jest.mock('react-chartjs-2', () => ({
6+
Line: () => null,
7+
Bar: () => null,
8+
}));
9+
10+
it('renders without crashing', () => {
11+
const div = document.createElement('div');
12+
ReactDOM.render(<OrderList />, div);
13+
ReactDOM.unmountComponentAtNode(div);
14+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "OrderList",
3+
"version": "0.0.0",
4+
"private": true,
5+
"main": "./OrderList.js"
6+
}

src/views/AppPages/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import OrderList from './Orders';
2+
3+
export {
4+
OrderList
5+
};

src/views/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { Alerts, Badges, Modals } from './Notifications';
2626
import { Login, Page404, Page500, Register } from './Pages';
2727
import { Colors, Typography } from './Theme';
2828
import Widgets from './Widgets';
29+
import { OrderList } from './AppPages';
2930

3031
export {
3132
Badges,
@@ -63,6 +64,7 @@ export {
6364
Carousels,
6465
Cards,
6566
Breadcrumbs,
66-
Paginations
67+
Paginations,
68+
OrderList
6769
};
6870

0 commit comments

Comments
 (0)