mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
Ivan - Fix installation in subfolder and file permissions
This commit is contained in:
parent
491fc901a8
commit
892e1536a2
@ -24,6 +24,9 @@ function buildScript(file, watch) {
|
|||||||
entries: [config.sourceDir + file],
|
entries: [config.sourceDir + file],
|
||||||
debug: !global.isProd,
|
debug: !global.isProd,
|
||||||
insertGlobalVars: {
|
insertGlobalVars: {
|
||||||
|
isProd: function () {
|
||||||
|
return (global.isProd) ? "'enabled'" : "'disabled'";
|
||||||
|
},
|
||||||
noFixtures: function() {
|
noFixtures: function() {
|
||||||
return (util.env['api']) ? "'enabled'" : "'disabled'";
|
return (util.env['api']) ? "'enabled'" : "'disabled'";
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
"classnames": "^2.2.5",
|
"classnames": "^2.2.5",
|
||||||
"draft-js": "^0.10.0",
|
"draft-js": "^0.10.0",
|
||||||
"draft-js-export-html": "^0.5.2",
|
"draft-js-export-html": "^0.5.2",
|
||||||
|
"history": "^3.0.0",
|
||||||
"jquery": "^2.1.4",
|
"jquery": "^2.1.4",
|
||||||
"keycode": "^2.1.4",
|
"keycode": "^2.1.4",
|
||||||
"localStorage": "^1.0.3",
|
"localStorage": "^1.0.3",
|
||||||
@ -71,8 +72,8 @@
|
|||||||
"react-google-recaptcha": "^0.5.2",
|
"react-google-recaptcha": "^0.5.2",
|
||||||
"react-motion": "^0.4.7",
|
"react-motion": "^0.4.7",
|
||||||
"react-redux": "^4.4.5",
|
"react-redux": "^4.4.5",
|
||||||
"react-router": "^2.4.0",
|
"react-router": "^3.0.2",
|
||||||
"react-router-redux": "^4.0.5",
|
"react-router-redux": "^4.0.7",
|
||||||
"redux": "^3.5.2",
|
"redux": "^3.5.2",
|
||||||
"redux-promise-middleware": "^3.3.2"
|
"redux-promise-middleware": "^3.3.2"
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,9 @@ import React from 'react';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { connect } from 'react-redux'
|
import { connect } from 'react-redux'
|
||||||
import { browserHistory } from 'react-router';
|
|
||||||
import DocumentTitle from 'react-document-title';
|
import DocumentTitle from 'react-document-title';
|
||||||
|
|
||||||
|
import history from 'lib-app/history';
|
||||||
import ModalContainer from 'app-components/modal-container';
|
import ModalContainer from 'app-components/modal-container';
|
||||||
|
|
||||||
const level2Paths = [
|
const level2Paths = [
|
||||||
@ -66,11 +66,11 @@ class App extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(props.config['maintenance-mode'] === '1' && !_.includes(props.location.pathname, '/admin') && !_.includes(props.location.pathname, '/maintenance')) {
|
if(props.config['maintenance-mode'] === '1' && !_.includes(props.location.pathname, '/admin') && !_.includes(props.location.pathname, '/maintenance')) {
|
||||||
browserHistory.push('/maintenance');
|
history.push('/maintenance');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(props.config['maintenance-mode'] === '0' && _.includes(props.location.pathname, '/maintenance')) {
|
if(props.config['maintenance-mode'] === '0' && _.includes(props.location.pathname, '/maintenance')) {
|
||||||
browserHistory.push('/');
|
history.push('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validations.languageChanged) {
|
if (validations.languageChanged) {
|
||||||
@ -78,37 +78,41 @@ class App extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (validations.loggedOut) {
|
if (validations.loggedOut) {
|
||||||
browserHistory.push('/');
|
history.push('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validations.loggedOutStaff) {
|
if (validations.loggedOutStaff) {
|
||||||
browserHistory.push('/admin');
|
history.push('/admin');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validations.loggedIn && !props.session.staff) {
|
if (validations.loggedIn && !props.session.staff) {
|
||||||
browserHistory.push('/dashboard');
|
history.push('/dashboard');
|
||||||
} else if(validations.loggedInStaff) {
|
} else if(validations.loggedInStaff) {
|
||||||
browserHistory.push('/admin/panel');
|
history.push('/admin/panel');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.session.userLevel && !this.isPathAvailableForStaff(props)) {
|
if (props.session.userLevel && !this.isPathAvailableForStaff(props)) {
|
||||||
browserHistory.push('/admin/panel');
|
history.push('/admin/panel');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!props.config.registration && _.includes(props.location.pathname, 'signup')) {
|
if (!props.config.registration && _.includes(props.location.pathname, 'signup')) {
|
||||||
browserHistory.push('/');
|
history.push('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(props.config['user-system-enabled'] && _.includes(props.location.pathname, '/check-ticket')) {
|
if(props.config['user-system-enabled'] && _.includes(props.location.pathname, '/check-ticket')) {
|
||||||
browserHistory.push('/');
|
history.push('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(props.config.installedDone && !props.config.installed && !_.includes(props.location.pathname, '/install')) {
|
if(props.config.installedDone && !props.config.installed && !_.includes(props.location.pathname, '/install')) {
|
||||||
browserHistory.push('/install');
|
history.push('/install');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(props.config.installedDone && props.config.installed && _.includes(props.location.pathname, '/install')) {
|
if(props.config.installedDone && props.config.installed && _.includes(props.location.pathname, '/install')) {
|
||||||
browserHistory.push('/');
|
history.push('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isProd && _.includes(props.location.pathname, '/components-demo')) {
|
||||||
|
history.push('/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Router, Route, IndexRoute, IndexRedirect, browserHistory} from 'react-router';
|
import {Router, Route, IndexRoute, IndexRedirect} from 'react-router';
|
||||||
import { syncHistoryWithStore } from 'react-router-redux';
|
|
||||||
|
|
||||||
import store from 'app/store';
|
|
||||||
|
|
||||||
import App from 'app/App';
|
import App from 'app/App';
|
||||||
import DemoPage from 'app/demo/components-demo-page';
|
import DemoPage from 'app/demo/components-demo-page';
|
||||||
|
import history from 'lib-app/history';
|
||||||
|
|
||||||
import MainLayout from 'app/main/main-layout';
|
import MainLayout from 'app/main/main-layout';
|
||||||
import MainHomePage from 'app/main/main-home/main-home-page';
|
import MainHomePage from 'app/main/main-home/main-home-page';
|
||||||
@ -62,8 +60,6 @@ import InstallStep4UserSystem from 'app/install/install-step-4-user-system';
|
|||||||
import InstallStep5Admin from 'app/install/install-step-5-admin';
|
import InstallStep5Admin from 'app/install/install-step-5-admin';
|
||||||
import InstallStep6Completed from 'app/install/install-step-6-completed';
|
import InstallStep6Completed from 'app/install/install-step-6-completed';
|
||||||
|
|
||||||
const history = syncHistoryWithStore(browserHistory, store);
|
|
||||||
|
|
||||||
export default (
|
export default (
|
||||||
<Router history={history}>
|
<Router history={history}>
|
||||||
<Route component={App}>
|
<Route component={App}>
|
||||||
@ -146,7 +142,7 @@ export default (
|
|||||||
</Route>
|
</Route>
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
<Route name='Demo' path='demo' component={DemoPage} />
|
<Route name='Demo' path='components-demo' component={DemoPage} />
|
||||||
</Route>
|
</Route>
|
||||||
</Router>
|
</Router>
|
||||||
);
|
);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import {browserHistory} from 'react-router';
|
import history from 'lib-app/history';
|
||||||
|
|
||||||
import ArticlesActions from 'actions/articles-actions';
|
import ArticlesActions from 'actions/articles-actions';
|
||||||
import SessionStore from 'lib-app/session-store';
|
import SessionStore from 'lib-app/session-store';
|
||||||
@ -156,7 +156,7 @@ class AdminPanelViewArticle extends React.Component {
|
|||||||
data: {
|
data: {
|
||||||
articleId: article.id
|
articleId: article.id
|
||||||
}
|
}
|
||||||
}).then(() => browserHistory.push('/admin/panel/articles/list-articles'));
|
}).then(() => history.push('/admin/panel/articles/list-articles'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {browserHistory} from 'react-router';
|
import history from 'lib-app/history';
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ class AdminPanelViewStaff extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onDelete() {
|
onDelete() {
|
||||||
browserHistory.push('/admin/panel/staff/staff-members');
|
history.push('/admin/panel/staff/staff-members');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import {browserHistory} from 'react-router';
|
import history from 'lib-app/history';
|
||||||
|
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
import API from 'lib-app/api-call';
|
import API from 'lib-app/api-call';
|
||||||
@ -124,7 +124,7 @@ class AdminPanelViewUser extends React.Component {
|
|||||||
data: {
|
data: {
|
||||||
email: this.state.email
|
email: this.state.email
|
||||||
}
|
}
|
||||||
}).then(() => browserHistory.push('/admin/panel/users/list-users'));
|
}).then(() => history.push('/admin/panel/users/list-users'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import {browserHistory} from 'react-router';
|
|
||||||
import DocumentTitle from 'react-document-title';
|
import DocumentTitle from 'react-document-title';
|
||||||
|
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
@ -27,7 +26,7 @@ class InstallLayout extends React.Component {
|
|||||||
<Widget className="install-layout">
|
<Widget className="install-layout">
|
||||||
<div className="install-layout__header">
|
<div className="install-layout__header">
|
||||||
<div className="install-layout__header-logo">
|
<div className="install-layout__header-logo">
|
||||||
<img width="100%" src="../../images/logo.png" alt="OpenSupports Installation"/>
|
<img width="100%" src={API.getURL() + '/images/logo.png'} alt="OpenSupports Installation"/>
|
||||||
</div>
|
</div>
|
||||||
<div className="install-layout__header-text">
|
<div className="install-layout__header-text">
|
||||||
<div className="install-layout__header-title">
|
<div className="install-layout__header-title">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import {browserHistory} from 'react-router';
|
|
||||||
|
|
||||||
|
import history from 'lib-app/history';
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
import ConfigActions from 'actions/config-actions';
|
import ConfigActions from 'actions/config-actions';
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ class InstallStep1Language extends React.Component {
|
|||||||
<Header title={i18n('STEP_TITLE', {title: i18n('SELECT_LANGUAGE'), current: 1, total: 6})} description={i18n('STEP_1_DESCRIPTION')}/>
|
<Header title={i18n('STEP_TITLE', {title: i18n('SELECT_LANGUAGE'), current: 1, total: 6})} description={i18n('STEP_1_DESCRIPTION')}/>
|
||||||
<LanguageSelector {...this.getLanguageSelectorProps()} />
|
<LanguageSelector {...this.getLanguageSelectorProps()} />
|
||||||
<div className="install-step-1__button">
|
<div className="install-step-1__button">
|
||||||
<Button size="medium" type="secondary" onClick={() => browserHistory.push('/install/step-2')}>
|
<Button size="medium" type="secondary" onClick={() => history.push('/install/step-2')}>
|
||||||
{i18n('NEXT')}
|
{i18n('NEXT')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import {browserHistory} from 'react-router';
|
|
||||||
|
|
||||||
|
import history from 'lib-app/history';
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
import API from 'lib-app/api-call';
|
import API from 'lib-app/api-call';
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ class InstallStep2Requirements extends React.Component {
|
|||||||
<Table {...this.getTableProps()} />
|
<Table {...this.getTableProps()} />
|
||||||
<div className="install-step-2__buttons">
|
<div className="install-step-2__buttons">
|
||||||
<div className="install-step-2__next">
|
<div className="install-step-2__next">
|
||||||
<Button disabled={!this.isAllOk()} size="medium" type="secondary" onClick={() => browserHistory.push('/install/step-3')}>
|
<Button disabled={!this.isAllOk()} size="medium" type="secondary" onClick={() => history.push('/install/step-3')}>
|
||||||
{i18n('NEXT')}
|
{i18n('NEXT')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@ -90,7 +90,7 @@ class InstallStep2Requirements extends React.Component {
|
|||||||
|
|
||||||
onPreviousClick(event) {
|
onPreviousClick(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
browserHistory.push('/install/step-1');
|
history.push('/install/step-1');
|
||||||
}
|
}
|
||||||
|
|
||||||
isAllOk() {
|
isAllOk() {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {browserHistory} from 'react-router';
|
|
||||||
|
|
||||||
|
import history from 'lib-app/history';
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
import API from 'lib-app/api-call';
|
import API from 'lib-app/api-call';
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ class InstallStep3Database extends React.Component {
|
|||||||
|
|
||||||
onPreviousClick(event) {
|
onPreviousClick(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
browserHistory.push('/install/step-2');
|
history.push('/install/step-2');
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit(form) {
|
onSubmit(form) {
|
||||||
@ -65,7 +65,7 @@ class InstallStep3Database extends React.Component {
|
|||||||
path: '/system/init-database',
|
path: '/system/init-database',
|
||||||
data: form
|
data: form
|
||||||
})
|
})
|
||||||
.then(() => browserHistory.push('/install/step-4'))
|
.then(() => history.push('/install/step-4'))
|
||||||
.catch(({message}) => this.setState({
|
.catch(({message}) => this.setState({
|
||||||
loading: false,
|
loading: false,
|
||||||
error: true,
|
error: true,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {browserHistory} from 'react-router';
|
|
||||||
import { connect } from 'react-redux'
|
import { connect } from 'react-redux'
|
||||||
|
|
||||||
|
import history from 'lib-app/history';
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
import API from 'lib-app/api-call';
|
import API from 'lib-app/api-call';
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ class InstallStep4UserSystem extends React.Component {
|
|||||||
|
|
||||||
onPreviousClick(event) {
|
onPreviousClick(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
browserHistory.push('/install/step-3');
|
history.push('/install/step-3');
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit(form) {
|
onSubmit(form) {
|
||||||
@ -64,7 +64,7 @@ class InstallStep4UserSystem extends React.Component {
|
|||||||
}
|
}
|
||||||
}).then(() => this.setState({
|
}).then(() => this.setState({
|
||||||
loading: false
|
loading: false
|
||||||
}, () => browserHistory.push('/install/step-5'))));
|
}, () => history.push('/install/step-5'))));
|
||||||
}
|
}
|
||||||
|
|
||||||
isDisabled() {
|
isDisabled() {
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {browserHistory} from 'react-router';
|
|
||||||
|
|
||||||
|
import history from 'lib-app/history';
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
import API from 'lib-app/api-call';
|
import API from 'lib-app/api-call';
|
||||||
|
|
||||||
import Button from 'core-components/button';
|
|
||||||
import Header from 'core-components/header';
|
import Header from 'core-components/header';
|
||||||
import Form from 'core-components/form';
|
import Form from 'core-components/form';
|
||||||
import FormField from 'core-components/form-field';
|
import FormField from 'core-components/form-field';
|
||||||
@ -58,7 +57,7 @@ class InstallStep5Admin extends React.Component {
|
|||||||
path: '/system/init-admin',
|
path: '/system/init-admin',
|
||||||
data: form
|
data: form
|
||||||
})
|
})
|
||||||
.then(() => browserHistory.push('/install/step-6'))
|
.then(() => history.push('/install/step-6'))
|
||||||
.catch(({message}) => this.setState({
|
.catch(({message}) => this.setState({
|
||||||
loading: false,
|
loading: false,
|
||||||
error: true,
|
error: true,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {browserHistory} from 'react-router';
|
|
||||||
|
|
||||||
|
import store from 'app/store';
|
||||||
|
import ConfigActions from 'actions/config-actions';
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
|
|
||||||
import Header from 'core-components/header';
|
import Header from 'core-components/header';
|
||||||
@ -9,7 +10,9 @@ import Message from 'core-components/message';
|
|||||||
class InstallStep6Completed extends React.Component {
|
class InstallStep6Completed extends React.Component {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
setTimeout(() => browserHistory.push('/admin'), 5000);
|
setTimeout(() => {
|
||||||
|
store.dispatch(ConfigActions.checkInstallation());
|
||||||
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { browserHistory } from 'react-router';
|
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import {EditorState, convertToRaw} from 'draft-js';
|
import {EditorState, convertToRaw} from 'draft-js';
|
||||||
|
|
||||||
|
import history from 'lib-app/history';
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
import API from 'lib-app/api-call';
|
import API from 'lib-app/api-call';
|
||||||
import SessionStore from 'lib-app/session-store';
|
import SessionStore from 'lib-app/session-store';
|
||||||
@ -142,9 +142,9 @@ class CreateTicketForm extends React.Component {
|
|||||||
|
|
||||||
if(this.props.userLogged) {
|
if(this.props.userLogged) {
|
||||||
store.dispatch(SessionActions.getUserData());
|
store.dispatch(SessionActions.getUserData());
|
||||||
setTimeout(() => {browserHistory.push('/dashboard')}, 2000);
|
setTimeout(() => {history.push('/dashboard')}, 2000);
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => {browserHistory.push('/check-ticket/' + result.data.ticketNumber + '/' + email)}, 1000);
|
setTimeout(() => {history.push('/check-ticket/' + result.data.ticketNumber + '/' + email)}, 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import {browserHistory} from 'react-router';
|
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
|
|
||||||
|
import history from 'lib-app/history';
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
import API from 'lib-app/api-call';
|
import API from 'lib-app/api-call';
|
||||||
import SessionStore from 'lib-app/session-store';
|
import SessionStore from 'lib-app/session-store';
|
||||||
@ -99,7 +99,7 @@ class MainCheckTicketPage extends React.Component {
|
|||||||
|
|
||||||
onTicketGetSuccess(result) {
|
onTicketGetSuccess(result) {
|
||||||
SessionStore.setItem('token', result.data.token);
|
SessionStore.setItem('token', result.data.token);
|
||||||
setTimeout(() => {browserHistory.push('/view-ticket/' + this.state.form.ticketNumber)}, 2000);
|
setTimeout(() => {history.push('/view-ticket/' + this.state.form.ticketNumber)}, 2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import {browserHistory} from 'react-router';
|
|
||||||
import {connect} from 'react-redux'
|
import {connect} from 'react-redux'
|
||||||
|
|
||||||
|
import history from 'lib-app/history';
|
||||||
import Widget from 'core-components/widget';
|
import Widget from 'core-components/widget';
|
||||||
import Card from 'core-components/card';
|
import Card from 'core-components/card';
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
@ -41,7 +41,7 @@ class MainHomePagePortal extends React.Component {
|
|||||||
icon: 'ticket',
|
icon: 'ticket',
|
||||||
color: 'red',
|
color: 'red',
|
||||||
buttonText: (this.props.type === 'complete') ? i18n('CREATE_TICKET') : null,
|
buttonText: (this.props.type === 'complete') ? i18n('CREATE_TICKET') : null,
|
||||||
onButtonClick: () => browserHistory.push('/create-ticket')
|
onButtonClick: () => history.push('/create-ticket')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ class MainHomePagePortal extends React.Component {
|
|||||||
icon: 'book',
|
icon: 'book',
|
||||||
color: 'blue',
|
color: 'blue',
|
||||||
buttonText: (this.props.type === 'complete') ? i18n('VIEW_ARTICLES') : null,
|
buttonText: (this.props.type === 'complete') ? i18n('VIEW_ARTICLES') : null,
|
||||||
onButtonClick: () => browserHistory.push('/articles')
|
onButtonClick: () => history.push('/articles')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ class MainHomePagePortal extends React.Component {
|
|||||||
icon: 'check-square-o',
|
icon: 'check-square-o',
|
||||||
color: 'green',
|
color: 'green',
|
||||||
buttonText: (this.props.type === 'complete') ? i18n('CHECK_TICKET') : null,
|
buttonText: (this.props.type === 'complete') ? i18n('CHECK_TICKET') : null,
|
||||||
onButtonClick: () => browserHistory.push('/check-ticket')
|
onButtonClick: () => history.push('/check-ticket')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {connect} from 'react-redux'
|
import {connect} from 'react-redux'
|
||||||
import {browserHistory} from 'react-router';
|
|
||||||
|
|
||||||
import SessionActions from 'actions/session-actions'
|
import SessionActions from 'actions/session-actions'
|
||||||
|
import history from 'lib-app/history';
|
||||||
import API from 'lib-app/api-call';
|
import API from 'lib-app/api-call';
|
||||||
|
|
||||||
import Message from 'core-components/message';
|
import Message from 'core-components/message';
|
||||||
@ -18,10 +18,10 @@ class MainVerifyTokenPage extends React.Component {
|
|||||||
}
|
}
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.props.dispatch(SessionActions.verify(true));
|
this.props.dispatch(SessionActions.verify(true));
|
||||||
browserHistory.push('/');
|
history.push('/');
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.props.dispatch(SessionActions.verify(false));
|
this.props.dispatch(SessionActions.verify(false));
|
||||||
browserHistory.push('/');
|
history.push('/');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {browserHistory} from 'react-router';
|
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
|
|
||||||
|
import history from 'lib-app/history';
|
||||||
import AdminPanelViewTicket from 'app/admin/panel/tickets/admin-panel-view-ticket'
|
import AdminPanelViewTicket from 'app/admin/panel/tickets/admin-panel-view-ticket'
|
||||||
|
|
||||||
import Widget from 'core-components/widget';
|
import Widget from 'core-components/widget';
|
||||||
@ -20,7 +20,7 @@ class MainViewTicketPage extends React.Component {
|
|||||||
|
|
||||||
onRetrieveFail() {
|
onRetrieveFail() {
|
||||||
if (!this.props.config['user-system-enabled']) {
|
if (!this.props.config['user-system-enabled']) {
|
||||||
setTimeout(() => {browserHistory.push('/check-ticket')}, 2000);
|
setTimeout(() => {history.push('/check-ticket')}, 2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
root = 'http://localhost:3000';
|
root = 'http://localhost:3000';
|
||||||
apiRoot = 'http://localhost:3000/api';
|
apiRoot = 'http://localhost:3000/api';
|
||||||
|
globalIndexPath = '';
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
import API from 'lib-app/api-call';
|
||||||
|
|
||||||
class Icon extends React.Component {
|
class Icon extends React.Component {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@ -25,7 +27,7 @@ class Icon extends React.Component {
|
|||||||
|
|
||||||
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={`${API.getURL()}/images/icons/${this.props.name}.png`} aria-hidden="true" />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
0
client/src/index.html
Normal file → Executable file
0
client/src/index.html
Normal file → Executable file
@ -14,7 +14,7 @@ Array.prototype.swap = function (x,y) {
|
|||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( process.env.NODE_ENV !== 'production' ) {
|
if (isProd === 'disabled') {
|
||||||
// Enable React devtools
|
// Enable React devtools
|
||||||
window.React = React;
|
window.React = React;
|
||||||
}
|
}
|
||||||
|
15
client/src/index.php
Normal file → Executable file
15
client/src/index.php
Normal file → Executable file
@ -1,3 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
$url = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
|
||||||
|
$path = dirname($_SERVER['PHP_SELF']);
|
||||||
|
?>
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html class="no-js" lang="">
|
<html class="no-js" lang="">
|
||||||
<head>
|
<head>
|
||||||
@ -8,16 +12,17 @@
|
|||||||
|
|
||||||
<title>OpenSupports</title>
|
<title>OpenSupports</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/main.css">
|
<link rel="stylesheet" href="<?=$url ?>/css/main.css">
|
||||||
<link rel="icon" type="image/x-icon" href="/images/icon.png">
|
<link rel="icon" type="image/x-icon" href="<?=$url ?>/images/icon.png">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
root = "<?php echo ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); ?>";
|
root = "<?=$url ?>";
|
||||||
apiRoot = "<?php echo ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); ?>" + 'api';
|
apiRoot = '<?=$url ?>/api';
|
||||||
|
globalIndexPath = "<?=$path ?>";
|
||||||
</script>
|
</script>
|
||||||
<script src="/js/main.js"></script>
|
<script src="<?=$url ?>/js/main.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
8
client/src/lib-app/history.js
Normal file
8
client/src/lib-app/history.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import {browserHistory} from 'react-router';
|
||||||
|
import {syncHistoryWithStore} from 'react-router-redux';
|
||||||
|
import {useBasename} from 'history';
|
||||||
|
import store from 'app/store';
|
||||||
|
|
||||||
|
const history = syncHistoryWithStore(browserHistory, store);
|
||||||
|
|
||||||
|
export default useBasename(() => history)({basename: globalIndexPath});
|
0
server/composer.json
Normal file → Executable file
0
server/composer.json
Normal file → Executable file
0
server/controllers/article.php
Normal file → Executable file
0
server/controllers/article.php
Normal file → Executable file
0
server/controllers/article/add-topic.php
Normal file → Executable file
0
server/controllers/article/add-topic.php
Normal file → Executable file
0
server/controllers/article/add.php
Normal file → Executable file
0
server/controllers/article/add.php
Normal file → Executable file
0
server/controllers/article/delete-topic.php
Normal file → Executable file
0
server/controllers/article/delete-topic.php
Normal file → Executable file
0
server/controllers/article/delete.php
Normal file → Executable file
0
server/controllers/article/delete.php
Normal file → Executable file
0
server/controllers/article/edit-topic.php
Normal file → Executable file
0
server/controllers/article/edit-topic.php
Normal file → Executable file
0
server/controllers/article/edit.php
Normal file → Executable file
0
server/controllers/article/edit.php
Normal file → Executable file
0
server/controllers/article/get-all.php
Normal file → Executable file
0
server/controllers/article/get-all.php
Normal file → Executable file
0
server/controllers/staff.php
Normal file → Executable file
0
server/controllers/staff.php
Normal file → Executable file
0
server/controllers/staff/add.php
Normal file → Executable file
0
server/controllers/staff/add.php
Normal file → Executable file
0
server/controllers/staff/assign-ticket.php
Normal file → Executable file
0
server/controllers/staff/assign-ticket.php
Normal file → Executable file
0
server/controllers/staff/delete.php
Normal file → Executable file
0
server/controllers/staff/delete.php
Normal file → Executable file
0
server/controllers/staff/edit.php
Normal file → Executable file
0
server/controllers/staff/edit.php
Normal file → Executable file
0
server/controllers/staff/get-all-tickets.php
Normal file → Executable file
0
server/controllers/staff/get-all-tickets.php
Normal file → Executable file
0
server/controllers/staff/get-all.php
Normal file → Executable file
0
server/controllers/staff/get-all.php
Normal file → Executable file
0
server/controllers/staff/get-new-tickets.php
Normal file → Executable file
0
server/controllers/staff/get-new-tickets.php
Normal file → Executable file
0
server/controllers/staff/get-tickets.php
Normal file → Executable file
0
server/controllers/staff/get-tickets.php
Normal file → Executable file
0
server/controllers/staff/get.php
Normal file → Executable file
0
server/controllers/staff/get.php
Normal file → Executable file
0
server/controllers/staff/last-events.php
Normal file → Executable file
0
server/controllers/staff/last-events.php
Normal file → Executable file
0
server/controllers/staff/search-tickets.php
Normal file → Executable file
0
server/controllers/staff/search-tickets.php
Normal file → Executable file
0
server/controllers/staff/un-assign-ticket.php
Normal file → Executable file
0
server/controllers/staff/un-assign-ticket.php
Normal file → Executable file
0
server/controllers/system.php
Normal file → Executable file
0
server/controllers/system.php
Normal file → Executable file
0
server/controllers/system/add-api-key.php
Normal file → Executable file
0
server/controllers/system/add-api-key.php
Normal file → Executable file
0
server/controllers/system/add-department.php
Normal file → Executable file
0
server/controllers/system/add-department.php
Normal file → Executable file
0
server/controllers/system/backup-database.php
Normal file → Executable file
0
server/controllers/system/backup-database.php
Normal file → Executable file
0
server/controllers/system/check-requirements.php
Normal file → Executable file
0
server/controllers/system/check-requirements.php
Normal file → Executable file
0
server/controllers/system/csv-import.php
Normal file → Executable file
0
server/controllers/system/csv-import.php
Normal file → Executable file
0
server/controllers/system/delete-all-users.php
Normal file → Executable file
0
server/controllers/system/delete-all-users.php
Normal file → Executable file
0
server/controllers/system/delete-api-key.php
Normal file → Executable file
0
server/controllers/system/delete-api-key.php
Normal file → Executable file
0
server/controllers/system/delete-department.php
Normal file → Executable file
0
server/controllers/system/delete-department.php
Normal file → Executable file
0
server/controllers/system/disable-registration.php
Normal file → Executable file
0
server/controllers/system/disable-registration.php
Normal file → Executable file
0
server/controllers/system/disable-user-system.php
Normal file → Executable file
0
server/controllers/system/disable-user-system.php
Normal file → Executable file
0
server/controllers/system/download.php
Normal file → Executable file
0
server/controllers/system/download.php
Normal file → Executable file
0
server/controllers/system/edit-department.php
Normal file → Executable file
0
server/controllers/system/edit-department.php
Normal file → Executable file
0
server/controllers/system/edit-mail-template.php
Normal file → Executable file
0
server/controllers/system/edit-mail-template.php
Normal file → Executable file
0
server/controllers/system/edit-settings.php
Normal file → Executable file
0
server/controllers/system/edit-settings.php
Normal file → Executable file
0
server/controllers/system/enable-registration.php
Normal file → Executable file
0
server/controllers/system/enable-registration.php
Normal file → Executable file
0
server/controllers/system/enable-user-system.php
Normal file → Executable file
0
server/controllers/system/enable-user-system.php
Normal file → Executable file
0
server/controllers/system/get-api-keys.php
Normal file → Executable file
0
server/controllers/system/get-api-keys.php
Normal file → Executable file
0
server/controllers/system/get-logs.php
Normal file → Executable file
0
server/controllers/system/get-logs.php
Normal file → Executable file
0
server/controllers/system/get-mail-templates.php
Normal file → Executable file
0
server/controllers/system/get-mail-templates.php
Normal file → Executable file
0
server/controllers/system/get-settings.php
Normal file → Executable file
0
server/controllers/system/get-settings.php
Normal file → Executable file
0
server/controllers/system/get-stats.php
Normal file → Executable file
0
server/controllers/system/get-stats.php
Normal file → Executable file
0
server/controllers/system/init-admin.php
Normal file → Executable file
0
server/controllers/system/init-admin.php
Normal file → Executable file
0
server/controllers/system/init-database.php
Normal file → Executable file
0
server/controllers/system/init-database.php
Normal file → Executable file
0
server/controllers/system/init-settings.php
Normal file → Executable file
0
server/controllers/system/init-settings.php
Normal file → Executable file
0
server/controllers/system/installation-done.php
Normal file → Executable file
0
server/controllers/system/installation-done.php
Normal file → Executable file
0
server/controllers/system/recover-mail-template.php
Normal file → Executable file
0
server/controllers/system/recover-mail-template.php
Normal file → Executable file
0
server/controllers/ticket.php
Normal file → Executable file
0
server/controllers/ticket.php
Normal file → Executable file
0
server/controllers/ticket/add-custom-response.php
Normal file → Executable file
0
server/controllers/ticket/add-custom-response.php
Normal file → Executable file
0
server/controllers/ticket/change-department.php
Normal file → Executable file
0
server/controllers/ticket/change-department.php
Normal file → Executable file
0
server/controllers/ticket/change-priority.php
Normal file → Executable file
0
server/controllers/ticket/change-priority.php
Normal file → Executable file
0
server/controllers/ticket/check.php
Normal file → Executable file
0
server/controllers/ticket/check.php
Normal file → Executable file
0
server/controllers/ticket/close.php
Normal file → Executable file
0
server/controllers/ticket/close.php
Normal file → Executable file
0
server/controllers/ticket/comment.php
Normal file → Executable file
0
server/controllers/ticket/comment.php
Normal file → Executable file
0
server/controllers/ticket/create.php
Normal file → Executable file
0
server/controllers/ticket/create.php
Normal file → Executable file
0
server/controllers/ticket/delete-custom-response.php
Normal file → Executable file
0
server/controllers/ticket/delete-custom-response.php
Normal file → Executable file
0
server/controllers/ticket/edit-custom-response.php
Normal file → Executable file
0
server/controllers/ticket/edit-custom-response.php
Normal file → Executable file
0
server/controllers/ticket/get-custom-responses.php
Normal file → Executable file
0
server/controllers/ticket/get-custom-responses.php
Normal file → Executable file
0
server/controllers/ticket/get.php
Normal file → Executable file
0
server/controllers/ticket/get.php
Normal file → Executable file
0
server/controllers/ticket/re-open.php
Normal file → Executable file
0
server/controllers/ticket/re-open.php
Normal file → Executable file
0
server/controllers/ticket/seen.php
Normal file → Executable file
0
server/controllers/ticket/seen.php
Normal file → Executable file
0
server/controllers/user.php
Normal file → Executable file
0
server/controllers/user.php
Normal file → Executable file
0
server/controllers/user/ban.php
Normal file → Executable file
0
server/controllers/user/ban.php
Normal file → Executable file
0
server/controllers/user/check-session.php
Normal file → Executable file
0
server/controllers/user/check-session.php
Normal file → Executable file
0
server/controllers/user/delete.php
Normal file → Executable file
0
server/controllers/user/delete.php
Normal file → Executable file
0
server/controllers/user/edit-email.php
Normal file → Executable file
0
server/controllers/user/edit-email.php
Normal file → Executable file
0
server/controllers/user/edit-password.php
Normal file → Executable file
0
server/controllers/user/edit-password.php
Normal file → Executable file
0
server/controllers/user/get-user.php
Normal file → Executable file
0
server/controllers/user/get-user.php
Normal file → Executable file
0
server/controllers/user/get-users.php
Normal file → Executable file
0
server/controllers/user/get-users.php
Normal file → Executable file
0
server/controllers/user/get.php
Normal file → Executable file
0
server/controllers/user/get.php
Normal file → Executable file
0
server/controllers/user/list-ban.php
Normal file → Executable file
0
server/controllers/user/list-ban.php
Normal file → Executable file
0
server/controllers/user/login.php
Normal file → Executable file
0
server/controllers/user/login.php
Normal file → Executable file
0
server/controllers/user/logout.php
Normal file → Executable file
0
server/controllers/user/logout.php
Normal file → Executable file
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user