From b60c99e6df85c69c42c752b3e49a20527e931605 Mon Sep 17 00:00:00 2001 From: Galen Charlton <gmc@equinoxinitiative.org> Date: Wed, 23 Jan 2019 10:52:24 -0500 Subject: [PATCH] LP#1812389: make Group Penalty Threshold admin page accessible again As a consequence of the patch for bug 1744756 adding a new admin/local/permission AngularJS app, the routing for admin/local/permission/grp_penalty_threshold got broken, making the embdeded Conify interface for group penalty thresholds inaccessible from the web staff client. This patch fixes that. To test ------- [1] From Administration | Local Administration, go to Group Penalty Thresholds. Note that the embedded Conify admin interface is not displayed and the URL changes to .../permission/grp_tree. [2] Apply the patch and repeat step 1. This time, the admin interface should appear. [3] Verify that the Permission Group Tree Entries interface remains accessible from Local Administration. Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Bill Erickson <berickxx@gmail.com> --- .../staff/admin/local/permission/index.tt2 | 3 +- .../ui/default/staff/admin/local/permission/app.js | 33 +++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/templates/staff/admin/local/permission/index.tt2 b/Open-ILS/src/templates/staff/admin/local/permission/index.tt2 index 6b63ed5f19..9e110ef526 100644 --- a/Open-ILS/src/templates/staff/admin/local/permission/index.tt2 +++ b/Open-ILS/src/templates/staff/admin/local/permission/index.tt2 @@ -6,6 +6,7 @@ [% BLOCK APP_JS %] <script src="[% ctx.media_prefix %]/js/ui/default/staff/services/ui.js"></script> +<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/eframe.js"></script> <script src="[% ctx.media_prefix %]/js/ui/default/staff/admin/local/permission/app.js"></script> <link rel="stylesheet" href="[% ctx.base_path %]/staff/css/admin.css" /> <script> @@ -23,4 +24,4 @@ angular.module('egCoreMod').run(['egStrings', function(s) { <div ng-view></div> -[% END %] \ No newline at end of file +[% END %] diff --git a/Open-ILS/web/js/ui/default/staff/admin/local/permission/app.js b/Open-ILS/web/js/ui/default/staff/admin/local/permission/app.js index 3b7f19a059..185ad33034 100644 --- a/Open-ILS/web/js/ui/default/staff/admin/local/permission/app.js +++ b/Open-ILS/web/js/ui/default/staff/admin/local/permission/app.js @@ -14,6 +14,15 @@ angular.module('egAdminPermGrpTreeApp', resolve : resolver }); + // catch admin/local/permission/grp_penalty_threshold + var eframe_template = + '<eg-embed-frame allow-escape="true" min-height="min_height" url="local_admin_url" handlers="funcs"></eg-embed-frame>'; + $routeProvider.when('/admin/local/:schema/:page', { + template: eframe_template, + controller: 'EmbedConifyCtl', + resolve : resolver + }); + $routeProvider.otherwise({redirectTo : '/admin/local/permission/grp_tree'}); }) @@ -433,4 +442,26 @@ function($scope , $q , $timeout , $location , $uibModal , egCore , egPermGrpTree egCore.startup.go(function() { $scope.refreshTree(egCore.auth.user().ws_ou()); }); -}]) \ No newline at end of file +}]) + +.controller('EmbedConifyCtl', + ['$scope','$routeParams','$location','egCore', +function($scope , $routeParams , $location , egCore) { + + $scope.funcs = { + ses : egCore.auth.token(), + } + + var conify_path = '/eg/conify/global/' + + $routeParams.schema + '/' + $routeParams.page; + + $scope.min_height = 800; + + // embed URL must include protocol/domain or it will be loaded via + // push-state, resulting in an infinitely nested pages. + $scope.local_admin_url = + $location.absUrl().replace(/\/eg\/staff.*/, conify_path); + + console.log('Loading local admin URL: ' + $scope.local_admin_url); + +}]) -- 2.11.0