Ivan - Table Component - Remove /app path [skip ci]

This commit is contained in:
ivan 2016-08-16 20:03:56 -03:00
parent c9c9d7c80c
commit fc11eb8cb1
7 changed files with 25 additions and 15 deletions

View File

@ -21,7 +21,7 @@ var util = require('gulp-util');
function buildScript(file, watch) {
var bundler = browserify({
entries: [config.sourceDir + 'app/' + file],
entries: [config.sourceDir + '/' + file],
debug: !global.isProd,
insertGlobalVars: {
noFixtures: function() {

View File

@ -28,8 +28,8 @@ class App extends React.Component {
redirectIfPathIsNotValid(props) {
const validations = {
languageChanged: props.config.language !== this.props.config.language,
loggedIn: !_.includes(props.location.pathname, '/app/dashboard') && props.session.logged,
loggedOut: _.includes(props.location.pathname, '/app/dashboard') && !props.session.logged
loggedIn: !_.includes(props.location.pathname, '/dashboard') && props.session.logged,
loggedOut: _.includes(props.location.pathname, '/dashboard') && !props.session.logged
};
if (validations.languageChanged) {
@ -37,11 +37,11 @@ class App extends React.Component {
}
if (validations.loggedOut) {
browserHistory.push('/app');
browserHistory.push('/');
}
if (validations.loggedIn) {
browserHistory.push('/app/dashboard');
browserHistory.push('/dashboard');
}
}
}

View File

@ -27,8 +27,8 @@ const history = syncHistoryWithStore(browserHistory, store);
export default (
<Router history={history}>
<Route component={App} path='/'>
<Route path='/app' component={MainLayout}>
<Route component={App}>
<Route path='/' component={MainLayout}>
<IndexRoute component={MainHomePage} />
<Route path='signup' component={MainSignUpPage}/>
<Route path='recover-password' component={MainRecoverPasswordPage}/>
@ -40,7 +40,7 @@ export default (
<Route path='edit-profile' component={DashboardEditProfilePage}/>
<Route path='article' component={DashboardArticlePage}/>
<Route path='ticket' component={DashboardTicketPage}/>
<Route path='ticket/:ticketNumber' component={DashboardTicketPage}/>
</Route>
</Route>

View File

@ -130,7 +130,11 @@ class DashboardListTicketsPage extends React.Component {
return {
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,
date: ticket.date,
highlighted: ticket.unread

View File

@ -23,4 +23,10 @@
&__date {
text-align: right;
}
&__title-link:hover,
&__title-link:focus {
outline: none;
text-decoration: underline;
}
}

View File

@ -4,10 +4,10 @@ import _ from 'lodash';
import Menu from 'core-components/menu';
let dashboardRoutes = [
{ path: '/app/dashboard', text: 'Ticket List', icon: 'file-text-o' },
{ path: '/app/dashboard/create-ticket', text: 'Create Ticket', icon: 'plus' },
{ path: '/app/dashboard/articles', text: 'View Articles', icon: 'book' },
{ path: '/app/dashboard/edit-profile', text: 'Edit Profile', icon: 'pencil' }
{ path: '/dashboard', text: 'Ticket List', icon: 'file-text-o' },
{ path: '/dashboard/create-ticket', text: 'Create Ticket', icon: 'plus' },
{ path: '/dashboard/articles', text: 'View Articles', icon: 'book' },
{ path: '/dashboard/edit-profile', text: 'Edit Profile', icon: 'pencil' }
];
class DashboardMenu extends React.Component {

View File

@ -42,8 +42,8 @@ class MainLayoutHeader extends React.Component {
} else {
result = (
<div className="main-layout-header--login-links">
<Button type="clean" route={{to:'/app'}}>{i18n('LOG_IN')}</Button>
<Button type="clean" route={{to:'/app/signup'}}>Sign up</Button>
<Button type="clean" route={{to:'/'}}>{i18n('LOG_IN')}</Button>
<Button type="clean" route={{to:'/signup'}}>Sign up</Button>
</div>
);
}