From c2f1ce854f45c400fe9b72faccbe41e23a5f3eaf Mon Sep 17 00:00:00 2001
From: Zamil Majdy <z.majdy1996@gmail.com>
Date: Tue, 18 Apr 2017 14:29:14 +0700
Subject: [PATCH] [Install] add moment.js

---
 assets/js/index.jsx | 22 +++++++---------------
 karma.conf.js       |  2 +-
 package.json        |  5 ++++-
 3 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/assets/js/index.jsx b/assets/js/index.jsx
index b46851b8..0636c719 100644
--- a/assets/js/index.jsx
+++ b/assets/js/index.jsx
@@ -1,20 +1,14 @@
 import React from 'react';
 import ReactDOM from 'react-dom';
 import { Router, Route, browserHistory, Redirect } from 'react-router';
-import { Segment } from 'semantic-ui-react';
 import Dashboard from './Dashboard';
 import Login from './Login';
 import VacancyPage from './VacancyPage';
+import HomeCompany from './HomeCompany';
+import CreateVacancy from './CreateVacancy';
 import Server from './lib/Server';
 import Storage from './lib/Storage';
 
-export const Profile = () => (
-  <Segment>
-    <img src="http://semantic-ui.com/images/wireframe/media-paragraph.png" alt="wire-frame" />
-  </Segment>
-);
-
-
 export default class App extends React.Component {
 
   constructor(props) {
@@ -31,22 +25,20 @@ export default class App extends React.Component {
 
   handleHome= (nextState, replace, cb) => {
     if (Server.isLoggedIn()) {
-      Storage.getUserData().then((data) => {
-        const next = data.student ? '/lowongan' : '/profile';
-        replace({ pathname: next }); cb();
+      Storage.getUserData().then(() => {
+        replace({ pathname: '/lowongan' }); cb();
       });
-    } else {
-      replace({ pathname: '/login' });
     }
+    return replace({ pathname: '/login' });
   };
 
   render = () => (
     <Router history={browserHistory}>
       <Route path="/login" component={Login} />
       <Route component={Dashboard} onEnter={this.handleAuth}>
-        <Route path="/profile" component={Profile} />
         <Route path="/lowongan" component={VacancyPage} />
-        <Route path="/users" component={Profile} />
+        <Route path="/perusahaan" component={HomeCompany} />
+        <Route path="/buat-lowongan" component={CreateVacancy} />
       </Route>
       <Route path="/home" onEnter={this.handleHome} />
       <Redirect from="*" to="/home" />
diff --git a/karma.conf.js b/karma.conf.js
index b3bb0e5a..8f79c51c 100755
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -10,7 +10,7 @@ module.exports = function (config) {
         flags: ['--no-sandbox', '--disable-web-security', '--headless', '--disable-gpu', '--remote-debugging-port=9222']
       }
     },
-    singleRun: true, //  just run once by default
+    singleRun: false, //  just run once by default
     frameworks: [ 'mocha', 'chai' ], //  use the mocha test framework
     files: [
       'tests.webpack.js' //  just load this file
diff --git a/package.json b/package.json
index b8171efd..100dd809 100755
--- a/package.json
+++ b/package.json
@@ -8,7 +8,8 @@
     "build-production": "webpack -p --config webpack.prod.config.js --progress --colors",
     "webpack": "webpack --progress --display-error-details --config webpack.config.js --watch",
     "watch": "node server.js",
-    "karma": "karma start"
+    "karma": "karma start --single-run",
+    "test": "karma start --auto-watch"
   },
   "author": "",
   "license": "ISC",
@@ -46,6 +47,7 @@
     "karma-webpack": "^2.0.3",
     "mocha": "^3.2.0",
     "mock-cookie": "^0.3.2",
+    "moment": "^2.18.1",
     "react-hot-loader": "^3.0.0-beta.5",
     "react-test-utils": "0.0.1",
     "webpack": "^1.13.2",
@@ -59,6 +61,7 @@
     "object-assign": "^4.1.1",
     "react": "^15.4.2",
     "react-addons-test-utils": "^15.4.2",
+    "react-datepicker": "^0.44.0",
     "react-dom": "^15.4.2",
     "react-router": "^3.0.2",
     "react-tap-event-plugin": "^2.0.1",
-- 
GitLab