From d570497b1623a9b5558a8a94c7f6aa47abd31657 Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Thu, 26 Feb 2015 21:17:40 -0500 Subject: [PATCH] fixed some bugs in whitelist rendering and saving --- .../src/main/webapp/resources/js/admin.js | 8 +++++--- .../src/main/webapp/resources/js/whitelist.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js b/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js index 2e83f1622..cf710eead 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js @@ -738,9 +738,7 @@ var AppRouter = Backbone.Router.extend({ this.updateSidebar('admin/whitelists'); - //// - var whiteList = this.whiteListList.get(id); - whiteList = new WhiteListModel({id: id}); + var whiteList = new WhiteListModel(); var client = this.clientList.get(cid); if (!client) { @@ -751,6 +749,10 @@ var AppRouter = Backbone.Router.extend({ view.load( function() { + + // set the scopes on the model now that everything's loaded + whiteList.set({allowedScopes: client.get('scope')}, {silent: true}); + $('#content').html(view.render().el); view.delegateEvents(); setPageTitle($.t('whitelist.manage')); diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js b/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js index a39a72eda..524e64ebb 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js @@ -341,7 +341,7 @@ var WhiteListFormView = Backbone.View.extend({ // process allowed scopes var allowedScopes = this.scopeCollection.pluck("item"); - this.model.set(this.options.client.get('clientId')); + this.model.set({clientId: this.options.client.get('clientId')}, {silent: true}); var valid = this.model.set({ allowedScopes: allowedScopes