Ivan - Fix installation issues [skip ci]

This commit is contained in:
ivan 2017-03-30 20:37:55 -03:00
parent 199921b213
commit d10de13626
9 changed files with 48 additions and 37 deletions

View File

@ -6,5 +6,7 @@ var config = require('../config');
gulp.task('copyIndex', function() {
gulp.src(config.sourceDir + 'index.html').pipe(gulp.dest(config.buildDir));
gulp.src(config.sourceDir + 'index.php').pipe(gulp.dest(config.buildDir));
gulp.src(config.sourceDir + '.htaccess').pipe(gulp.dest(config.buildDir));
});

5
client/src/.htaccess Normal file
View File

@ -0,0 +1,5 @@
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/?(api)/
RewriteRule .* index.php [PT,L]

View File

@ -102,6 +102,14 @@ class App extends React.Component {
if(props.config['user-system-enabled'] && _.includes(props.location.pathname, '/check-ticket')) {
browserHistory.push('/');
}
if(props.config.installedDone && !props.config.installed && !_.includes(props.location.pathname, '/install')) {
browserHistory.push('/install');
}
if(props.config.installedDone && props.config.installed && _.includes(props.location.pathname, '/install')) {
browserHistory.push('/');
}
}
isPathAvailableForStaff(props) {

View File

@ -2,6 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import _ from 'lodash';
import {browserHistory} from 'react-router';
import DocumentTitle from 'react-document-title';
import i18n from 'lib-app/i18n';
import API from 'lib-app/api-call';
@ -33,6 +34,7 @@ class InstallLayout extends React.Component {
render() {
return (
<DocumentTitle title="OpenSupports Installation">
<Widget className="install-layout">
<div className="install-layout__header">
<div className="install-layout__header-logo">
@ -59,6 +61,7 @@ class InstallLayout extends React.Component {
</div>
</div>
</Widget>
</DocumentTitle>
);
}

View File

@ -9,6 +9,7 @@
&__next {
float: left;
position: absolute;
margin-left: 286px;
margin-left: 230px;
min-width: 70px;
}
}

View File

@ -30,7 +30,6 @@ class InstallStep5Admin extends React.Component {
<FormField name="password" validation="PASSWORD" label={i18n('ADMIN_PASSWORD')} infoMessage={i18n('ADMIN_PASSWORD_DESCRIPTION')} fieldProps={{size: 'large', autoComplete: 'off'}} required/>
<div className="install-step-5__buttons">
<SubmitButton className="install-step-5__next" size="medium" type="secondary">{i18n('NEXT')}</SubmitButton>
<Button className="install-step-5__previous" size="medium" onClick={this.onPreviousClick.bind(this)}>{i18n('PREVIOUS')}</Button>
</div>
</Form>
</div>
@ -51,11 +50,6 @@ class InstallStep5Admin extends React.Component {
return message;
}
onPreviousClick(event) {
event.preventDefault();
browserHistory.push('/install/step-4');
}
onSubmit(form) {
this.setState({
loading: true

View File

@ -6,13 +6,7 @@
margin-bottom: 20px;
}
&__previous {
margin-right: 20px;
}
&__next {
float: left;
position: absolute;
margin-left: 286px;
min-width: 70px;
}
}

4
server/.htaccess Normal file
View File

@ -0,0 +1,4 @@
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [PT,L]

View File

@ -14,7 +14,7 @@ class InitDatabaseController extends Controller {
}
public function handler() {
if(InstallationDoneController::isInstallationDone()) {
if(defined('MYSQL_HOST')) {
throw new Exception(ERRORS::INIT_SETTINGS_DONE);
}