mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
improved setup wizard redirection
This commit is contained in:
parent
8081b60146
commit
d3512b499a
15 changed files with 670 additions and 661 deletions
|
@ -12,14 +12,23 @@
|
|||
import Ember from 'ember';
|
||||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
||||
|
||||
const {
|
||||
inject: { service }
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
||||
folderService: Ember.inject.service('folder'),
|
||||
appMeta: service(),
|
||||
folderService: service('folder'),
|
||||
localStorage: service(),
|
||||
|
||||
beforeModel() {
|
||||
if (this.get('appMeta.setupMode')) {
|
||||
this.get('localStorage').clearAll();
|
||||
this.transitionTo('setup');
|
||||
}
|
||||
},
|
||||
|
||||
model() {
|
||||
// if (this.get('appMeta.setupMode')) {
|
||||
// localStorage.clearAll();
|
||||
// return;
|
||||
// }
|
||||
return this.get('folderService').getAll();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
|
@ -36,6 +36,6 @@ export default Ember.Route.extend({
|
|||
},
|
||||
|
||||
activate() {
|
||||
document.title = "Setup Documize database '" + document.head.querySelector("[property=dbname]").content + "'";
|
||||
document.title = "Documize Setup";
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -31,19 +31,15 @@ export default Ember.Route.extend(ApplicationRouteMixin, TooltipMixin, {
|
|||
|
||||
return this.get('appMeta').boot(transition.targetName, window.location.href).then(data => {
|
||||
if (sa !== "authenticator:documize" && sa !== "authenticator:keycloak" && data.allowAnonymousAccess) {
|
||||
if (!this.get('appMeta.setupMode')) {
|
||||
if (!this.get('appMeta.setupMode') && !this.get('appMeta.secureMode')) {
|
||||
return this.get('session').authenticate('authenticator:anonymous', data);
|
||||
// } else {
|
||||
// this.get('localStorage').clearAll();
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
});
|
||||
},
|
||||
|
||||
sessionAuthenticated() {
|
||||
if (this.get('appMeta.setupMode')) {
|
||||
if (this.get('appMeta.setupMode') || this.get('appMeta.secureMode')) {
|
||||
this.get('localStorage').clearAll();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ export default Ember.Service.extend({
|
|||
authProvider: constants.AuthProvider.Documize,
|
||||
authConfig: null,
|
||||
setupMode: false,
|
||||
secureMode: false,
|
||||
|
||||
invalidLicense() {
|
||||
return this.valid === false;
|
||||
|
@ -68,7 +69,7 @@ export default Ember.Service.extend({
|
|||
this.setProperties({
|
||||
title: htmlSafe("Secure document viewing"),
|
||||
allowAnonymousAccess: true,
|
||||
setupMode: true
|
||||
secureMode: true
|
||||
});
|
||||
|
||||
this.get('localStorage').clearAll();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="form-bordered">
|
||||
<div class="form-header">
|
||||
<div class="title">Let's setup Documize</div>
|
||||
<div class="tip">Database name is <em>{{model.dbname}}</em></div>
|
||||
<div class="tip">Database: <b>{{model.dbname}}</b></div>
|
||||
</div>
|
||||
<div class="input-control input-transparent">
|
||||
<label>Team</label>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "documize",
|
||||
"version": "1.53.1",
|
||||
"version": "1.53.2",
|
||||
"description": "The Document IDE",
|
||||
"private": true,
|
||||
"repository": "",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue