cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
829
Views
0
Helpful
6
Replies

Scripts to hide features within sponsor and guest portals

scott.stapleton
Level 1
Level 1

I have a few questions regarding customisation scripts within sponsored guest and sponsor portals:

 

1) I'm using this script to hide columns in the Manage Accounts screen of the sponsor portal. It works however there is a delay before the columns are hidden, noticeable to the user. Presumably this is the 3000 or 1000 msec values. How can I ensure the column isn't seen at all? I tied lowering these values but after the column disappears, I can't get it to show again on the same client even after clearing browser cache and restarting and logging back into the sponsor portal. I'm not in a position to be able to test on other clients.

<script>
    var manageAccSelected= false; 
    setTimeout(function() { 
        $('a.ui_manage_accounts_button').on("click", function(){
            displayColumns();
        });
    }, 3000);
                
    function displayColumns(){
        setTimeout(function() {
            if(!manageAccSelected){
                manageAccSelected = true;
                var arr = [1,2,3,4,5,16];
                for (var j = 1; j<=16 ; j++) {
                    if($('#col-'+j)[0].checked){
                        $('#col-'+j).click();
                    }
                }
                for (var i in arr) {
                    if(!$('#col-'+arr[i])[0].checked){
                        $('#col-'+arr[i]).click();
                    }
                }
                $('.ui-table-columntoggle-btn')[0].style.display = "none";             
            }
         }, 1000);
    }
</script>

2) I want to hide the Decline button on a Hotspot portal so only Accept appears but no luck with the following:

<script>
(function(){
    $(document).ready(function() {
                 $(".ui_aup_decline_button").hide();
    });
})();
</script>

 

 

1 Accepted Solution

Accepted Solutions

hslai
Cisco Employee
Cisco Employee

On 2, if we want the button aligned properly and/or if to provide more customization, we may use ISE Portal Builder. This tool is currently not allowing to remove the Decline button completely, as shown in the portal I shared with you, so I opened CSCvq69362 

As a workaround, I manually edited out the UI elements for the Decline button in the javascript file in the exported zip file, and then uploaded it to ISE. Below is what I removed in my test hotspot portal:

&lt;div  class=&quot;t t-button t-button_cancel&quot;  style=&quot;&quot;&gt;&lt;div class=&quot;b-content-holder&quot;&gt;&lt;input class=&quot;f-cancel-button&quot; style=&quot;style.input&quot; type=&quot;submit&quot; value=&quot;Decline&quot;&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;

which corresponding to 

<div class="t t-button t-button_cancel" style=""><div class="b-content-holder"><input class="f-cancel-button" style="border-color: rgb(179, 179, 179); background-color: rgb(238, 238, 238);" type="submit" value="Decline"></div></div>

Screen Shot 2019-07-28 at 11.02.47 AM.png 

View solution in original post

6 Replies 6

Jason Kunst
Cisco Employee
Cisco Employee
Please separate thread with appropriate titles on each and will see what we can do.

hslai
Cisco Employee
Cisco Employee

On 1, see Hide columns - example email and phone number

On 2, I am able to hide the Deny button as below. It does not resize the button, however.

<script>
$('#ui_aup_decline_button').remove();
</script>

Screen Shot 2019-07-20 at 15.30.28.png

Cheers - much appreciated.

 

I will give these a go.

hslai
Cisco Employee
Cisco Employee

On 2, if we want the button aligned properly and/or if to provide more customization, we may use ISE Portal Builder. This tool is currently not allowing to remove the Decline button completely, as shown in the portal I shared with you, so I opened CSCvq69362 

As a workaround, I manually edited out the UI elements for the Decline button in the javascript file in the exported zip file, and then uploaded it to ISE. Below is what I removed in my test hotspot portal:

&lt;div  class=&quot;t t-button t-button_cancel&quot;  style=&quot;&quot;&gt;&lt;div class=&quot;b-content-holder&quot;&gt;&lt;input class=&quot;f-cancel-button&quot; style=&quot;style.input&quot; type=&quot;submit&quot; value=&quot;Decline&quot;&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;

which corresponding to 

<div class="t t-button t-button_cancel" style=""><div class="b-content-holder"><input class="f-cancel-button" style="border-color: rgb(179, 179, 179); background-color: rgb(238, 238, 238);" type="submit" value="Decline"></div></div>

Screen Shot 2019-07-28 at 11.02.47 AM.png 

hslai
Cisco Employee
Cisco Employee
... 1) I'm using this script to hide columns in the Manage Accounts screen of the sponsor portal. It works however there is a delay before the columns are hidden, noticeable to the user. Presumably this is the 3000 or 1000 msec values. How can I ensure the column isn't seen at all? I tied lowering these values but after the column disappears, I can't get it to show again on the same client even after clearing browser cache and restarting and logging back into the sponsor portal. I'm not in a position to be able to test on other clients.

The javascript you tested with appears from ISE Sponsor Portal manage accounts page customization for GDPR compliance privacy (hide fields) -- Restrict sponsor edit and hide sensitive information -- ISE Community.

You are correct the 3000 and 1000 values in msec in the javascript from the source above. I tried a couple of different combinations and found 1500 and 150 giving me reasonable results. In my testings, I used Mozilla Firefox to access ISE admin web UI and Google Chrome/IE browser in Incognito mode to test the sponsor portal after editing. I also noticed that it not un-hiding the columns, even with a different sponsor portal, until I closing all instances of the Incognito browser windows/tabs and re-launching a new one.

Below shows the script I used and a screen capture when I tested it in IE.

<script>
    var manageAccSelected= false; 
    setTimeout(function() { 
        $('a.ui_manage_accounts_button').on("click", function(){
            displayColumns();
        });
    }, 1500);   
    function displayColumns(){
    setTimeout(function() { 
            if(!manageAccSelected){
                manageAccSelected = true;
                var arr = [1,2,10,14,15,16];
                for (var j = 1; j<=16 ; j++) {
                    if($('#col-'+j)[0].checked){
                        $('#col-'+j).click();
                    }
                }
                for (var i in arr) {
                    if(!$('#col-'+arr[i])[0].checked){
                        $('#col-'+arr[i]).click();
                    }
                }
                $('.ui-table-columntoggle-btn')[0].style.display = "none";             
            }
    }, 150);
   }
</script>

Thanks very much for the extensive follow-ups.

 

I'll give these a go soon - cheers.