diff --git a/aws_access/templates/aws_access/accessRequest.html b/aws_access/templates/aws_access/accessRequest.html index a9dc9c0..820cb2c 100644 --- a/aws_access/templates/aws_access/accessRequest.html +++ b/aws_access/templates/aws_access/accessRequest.html @@ -103,7 +103,7 @@ awsHandleDisableMode(); updateSelectedAWSGroup(); handleAWSGroupSelectionView(); - $('#max-groups-selected-warning').hide(); + $('#max-aws-group-selected-warning').hide(); }; const selectAllAWSGroup = () => { @@ -144,7 +144,7 @@ removeGroupSelectionSpanElem(rightElem, $("#aws-group-table").find(`tr[group="${$(rightElem).attr('group')}"]`)); } updateSelectedAWSGroup(); - $('#max-groups-selected-warning').hide(); + $('#max-aws-group-selected-warning').hide(); }; const findAWSSelectedListLength = () => { @@ -159,7 +159,7 @@ if(awsDisabled) return; if(!$(elem).find('input').prop('checked')) { if(findAWSSelectedListLength() === AWS_GROUP_SELECTION_LIMIT) { - $('#max-groups-selected-warning').show(); + $('#max-aws-group-selected-warning').show(); return; } addAWSGroupSelection(elem); @@ -168,9 +168,9 @@ } updateSelectedAWSGroup(); if(findAWSSelectedListLength() === AWS_GROUP_SELECTION_LIMIT) { - $('#max-groups-selected-warning').show(); + $('#max-aws-group-selected-warning').show(); } else { - $('#max-groups-selected-warning').hide(); + $('#max-aws-group-selected-warning').hide(); } }; @@ -222,7 +222,7 @@ error: function (XMLHttpRequest, textStatus, errorThrown) { if(XMLHttpRequest.responseJSON) { const msg = XMLHttpRequest.responseJSON; - showNotificiation("failed", msg["error"]); + showNotification("failed", msg["error"]); } $('#awsAccount').prop("disabled",false); $('#awsSearch').prop("disabled", false); @@ -231,6 +231,12 @@ }).done(function(data, statusText, xhr){ $("#aws-group-table").empty(); + if(data["search_error"]) { + showNotification("failed", data["search_error"], "No exact match found"); + } + + if(data["AWSGroups"] && data["AWSGroups"].length === 0) return; + let rows = $.map(data["AWSGroups"], function(group, idx){ return ` @@ -260,9 +266,6 @@ $("#awsPaginationNav").addClass("hidden"); } - if(data["search_error"]) { - showNotification("failed", data["search_error"], "No exact match found"); - } $("#awsGroupsScrollBar").scrollTop(0) $('#aws-group-table').append(rows.join("")); @@ -286,7 +289,7 @@ - - -