diff --git a/README.md b/README.md index 06fd7e5aa..2a3200258 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The mission is to bring software dev inspired features (refactoring, testing, li ## Latest version -v1.46.1 +v1.46.2 ## OS Support diff --git a/app/app/components/customize/global-settings.js b/app/app/components/customize/global-settings.js index cadea72f2..9af8f70e5 100644 --- a/app/app/components/customize/global-settings.js +++ b/app/app/components/customize/global-settings.js @@ -51,6 +51,7 @@ export default Ember.Component.extend({ saveLicense() { this.get('saveLicense')().then(() => { + window.location.reload(); }); } } diff --git a/app/app/routes/application.js b/app/app/routes/application.js index c772a1c15..1f7c06367 100644 --- a/app/app/routes/application.js +++ b/app/app/routes/application.js @@ -22,14 +22,15 @@ export default Ember.Route.extend(ApplicationRouteMixin, TooltipMixin, { appMeta: service(), session: service(), pinned: service(), + localStorage: service(), beforeModel(transition) { this._super(...arguments); - - return this.get('appMeta').boot(transition.targetName).then(data => { - if (this.get('session.session.authenticator') !== "authenticator:documize" && - this.get('session.session.authenticator') !== "authenticator:keycloak" && - data.allowAnonymousAccess) { + + let sa = this.get('session.session.authenticator'); + + return this.get('appMeta').boot(transition.targetName, window.location.href).then(data => { + if (sa !== "authenticator:documize" && sa !== "authenticator:keycloak" && data.allowAnonymousAccess) { return this.get('session').authenticate('authenticator:anonymous', data); } @@ -37,6 +38,17 @@ export default Ember.Route.extend(ApplicationRouteMixin, TooltipMixin, { }); }, + sessionAuthenticated() { + let next = this.get('localStorage').getSessionItem('entryUrl'); + if (is.not.null(next) && is.not.undefined(next)) { + this.get('localStorage').clearSessionItem('entryUrl') + + if (is.not.include(next, '/auth/')) { + window.location.href= next; + } + } + }, + actions: { willTransition: function( /*transition*/ ) { Mousetrap.reset(); diff --git a/app/app/services/app-meta.js b/app/app/services/app-meta.js index ba1016d23..30d8e51f6 100644 --- a/app/app/services/app-meta.js +++ b/app/app/services/app-meta.js @@ -44,7 +44,7 @@ export default Ember.Service.extend({ return [this.get('endpoint'), endpoint].join('/'); }, - boot(requestedUrl) { // eslint-disable-line no-unused-vars + boot(requestedRoute, requestedUrl) { // eslint-disable-line no-unused-vars let dbhash; if (is.not.null(document.head.querySelector("[property=dbhash]"))) { dbhash = document.head.querySelector("[property=dbhash]").content; @@ -63,7 +63,7 @@ export default Ember.Service.extend({ return resolve(this); } - if (requestedUrl === 'secure') { + if (requestedRoute === 'secure') { this.setProperties({ title: htmlSafe("Secure document viewing"), allowAnonymousAccess: true, @@ -77,6 +77,7 @@ export default Ember.Service.extend({ return this.get('ajax').request('public/meta').then((response) => { this.setProperties(response); + this.get('localStorage').storeSessionItem('entryUrl', requestedUrl); return response; }); } diff --git a/app/app/services/folder.js b/app/app/services/folder.js index 0f5372674..a85716fa3 100644 --- a/app/app/services/folder.js +++ b/app/app/services/folder.js @@ -46,6 +46,9 @@ export default BaseService.extend({ }).then((folder) => { let data = this.get('store').normalize('folder', folder); return this.get('store').push(data); + }).catch((error) => { + this.get('router').transitionTo('/not-found'); + return error; }); }, diff --git a/app/package.json b/app/package.json index 14404f0e6..b68599a22 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "documize", - "version": "1.46.1", + "version": "1.46.2", "description": "The Document IDE", "private": true, "repository": "", diff --git a/core/api/endpoint/server.go b/core/api/endpoint/server.go index d054ef613..aa8cd872b 100644 --- a/core/api/endpoint/server.go +++ b/core/api/endpoint/server.go @@ -35,7 +35,7 @@ var Product core.ProdInfo func init() { Product.Major = "1" Product.Minor = "46" - Product.Patch = "1" + Product.Patch = "2" Product.Version = fmt.Sprintf("%s.%s.%s", Product.Major, Product.Minor, Product.Patch) Product.Edition = "Community" Product.Title = fmt.Sprintf("%s Edition", Product.Edition)