Ivan - Table Component - Remove /app path [skip ci]
This commit is contained in:
parent
c9c9d7c80c
commit
fc11eb8cb1
|
@ -21,7 +21,7 @@ var util = require('gulp-util');
|
||||||
function buildScript(file, watch) {
|
function buildScript(file, watch) {
|
||||||
|
|
||||||
var bundler = browserify({
|
var bundler = browserify({
|
||||||
entries: [config.sourceDir + 'app/' + file],
|
entries: [config.sourceDir + '/' + file],
|
||||||
debug: !global.isProd,
|
debug: !global.isProd,
|
||||||
insertGlobalVars: {
|
insertGlobalVars: {
|
||||||
noFixtures: function() {
|
noFixtures: function() {
|
||||||
|
|
|
@ -28,8 +28,8 @@ class App extends React.Component {
|
||||||
redirectIfPathIsNotValid(props) {
|
redirectIfPathIsNotValid(props) {
|
||||||
const validations = {
|
const validations = {
|
||||||
languageChanged: props.config.language !== this.props.config.language,
|
languageChanged: props.config.language !== this.props.config.language,
|
||||||
loggedIn: !_.includes(props.location.pathname, '/app/dashboard') && props.session.logged,
|
loggedIn: !_.includes(props.location.pathname, '/dashboard') && props.session.logged,
|
||||||
loggedOut: _.includes(props.location.pathname, '/app/dashboard') && !props.session.logged
|
loggedOut: _.includes(props.location.pathname, '/dashboard') && !props.session.logged
|
||||||
};
|
};
|
||||||
|
|
||||||
if (validations.languageChanged) {
|
if (validations.languageChanged) {
|
||||||
|
@ -37,11 +37,11 @@ class App extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validations.loggedOut) {
|
if (validations.loggedOut) {
|
||||||
browserHistory.push('/app');
|
browserHistory.push('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validations.loggedIn) {
|
if (validations.loggedIn) {
|
||||||
browserHistory.push('/app/dashboard');
|
browserHistory.push('/dashboard');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,8 @@ const history = syncHistoryWithStore(browserHistory, store);
|
||||||
|
|
||||||
export default (
|
export default (
|
||||||
<Router history={history}>
|
<Router history={history}>
|
||||||
<Route component={App} path='/'>
|
<Route component={App}>
|
||||||
<Route path='/app' component={MainLayout}>
|
<Route path='/' component={MainLayout}>
|
||||||
<IndexRoute component={MainHomePage} />
|
<IndexRoute component={MainHomePage} />
|
||||||
<Route path='signup' component={MainSignUpPage}/>
|
<Route path='signup' component={MainSignUpPage}/>
|
||||||
<Route path='recover-password' component={MainRecoverPasswordPage}/>
|
<Route path='recover-password' component={MainRecoverPasswordPage}/>
|
||||||
|
@ -40,7 +40,7 @@ export default (
|
||||||
<Route path='edit-profile' component={DashboardEditProfilePage}/>
|
<Route path='edit-profile' component={DashboardEditProfilePage}/>
|
||||||
|
|
||||||
<Route path='article' component={DashboardArticlePage}/>
|
<Route path='article' component={DashboardArticlePage}/>
|
||||||
<Route path='ticket' component={DashboardTicketPage}/>
|
<Route path='ticket/:ticketNumber' component={DashboardTicketPage}/>
|
||||||
</Route>
|
</Route>
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,11 @@ class DashboardListTicketsPage extends React.Component {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
number: '#' + ticket.ticketNumber,
|
number: '#' + ticket.ticketNumber,
|
||||||
title: <Button type="clean" route={{to: '/app/dashboard/view-ticket/' + ticket.ticketNumber}}>{titleText}</Button>,
|
title: (
|
||||||
|
<Button className="dashboard-ticket-list__title-link" type="clean" route={{to: '/dashboard/ticket/' + ticket.ticketNumber}}>
|
||||||
|
{titleText}
|
||||||
|
</Button>
|
||||||
|
),
|
||||||
department: ticket.department,
|
department: ticket.department,
|
||||||
date: ticket.date,
|
date: ticket.date,
|
||||||
highlighted: ticket.unread
|
highlighted: ticket.unread
|
||||||
|
|
|
@ -23,4 +23,10 @@
|
||||||
&__date {
|
&__date {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__title-link:hover,
|
||||||
|
&__title-link:focus {
|
||||||
|
outline: none;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -4,10 +4,10 @@ import _ from 'lodash';
|
||||||
import Menu from 'core-components/menu';
|
import Menu from 'core-components/menu';
|
||||||
|
|
||||||
let dashboardRoutes = [
|
let dashboardRoutes = [
|
||||||
{ path: '/app/dashboard', text: 'Ticket List', icon: 'file-text-o' },
|
{ path: '/dashboard', text: 'Ticket List', icon: 'file-text-o' },
|
||||||
{ path: '/app/dashboard/create-ticket', text: 'Create Ticket', icon: 'plus' },
|
{ path: '/dashboard/create-ticket', text: 'Create Ticket', icon: 'plus' },
|
||||||
{ path: '/app/dashboard/articles', text: 'View Articles', icon: 'book' },
|
{ path: '/dashboard/articles', text: 'View Articles', icon: 'book' },
|
||||||
{ path: '/app/dashboard/edit-profile', text: 'Edit Profile', icon: 'pencil' }
|
{ path: '/dashboard/edit-profile', text: 'Edit Profile', icon: 'pencil' }
|
||||||
];
|
];
|
||||||
|
|
||||||
class DashboardMenu extends React.Component {
|
class DashboardMenu extends React.Component {
|
||||||
|
|
|
@ -42,8 +42,8 @@ class MainLayoutHeader extends React.Component {
|
||||||
} else {
|
} else {
|
||||||
result = (
|
result = (
|
||||||
<div className="main-layout-header--login-links">
|
<div className="main-layout-header--login-links">
|
||||||
<Button type="clean" route={{to:'/app'}}>{i18n('LOG_IN')}</Button>
|
<Button type="clean" route={{to:'/'}}>{i18n('LOG_IN')}</Button>
|
||||||
<Button type="clean" route={{to:'/app/signup'}}>Sign up</Button>
|
<Button type="clean" route={{to:'/signup'}}>Sign up</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue