Privs small refactor

This commit is contained in:
Mo Bitar
2018-11-12 15:16:50 -06:00
parent 0410391fc5
commit 9835992e16
8 changed files with 99 additions and 90 deletions

View File

@@ -8,10 +8,10 @@
%a.close-button.info{"ng-click" => "cancel()"} Cancel
.content
.panel-section
.panel-row{"ng-repeat" => "priv in privileges"}
%p {{priv.prompt}}
%input{"type" => "password", "ng-model" => "priv.authenticationValue"}
%label.danger{"ng-if" => "doesPrivHaveFail(priv)"} Invalid authentication. Please try again.
.panel-row{"ng-repeat" => "credential in requiredCredentials"}
%p {{promptForCredential(credential)}}
%input{"type" => "password", "ng-model" => "authenticationParameters[credential]"}
%label.danger{"ng-if" => "isCredentialInFailureState(credential)"} Invalid authentication. Please try again.
.footer
.button.info.big.block.bold{"ng-click" => "submit()"} Submit

View File

@@ -5,7 +5,7 @@
.panel
.header
%h1.title Manage Privileges
%a.close-button.info{"ng-click" => "cancel()"} Cancel
%a.close-button.info{"ng-click" => "cancel()"} Done
.content
.panel-section
%table
@@ -13,13 +13,10 @@
%tr
%th
%th{"ng-repeat" => "cred in availableCredentials"}
{{cred}}
{{displayInfoForCredential(cred)}}
%tbody
%tr{"ng-repeat" => "action in availableActions"}
%td
%p {{metadata[action].displayInfo.label}}
%th{"ng-repeat" => "cred in availableCredentials"}
%input{"type" => "checkbox", "ng-model" => "metadata[action]['credentialValues'][cred]", "ng-change" => "checkboxValueChanged(action)"}
.footer
.button.info.big.block.bold{"ng-click" => "submit()"} Save
%p {{displayInfoForAction(action)}}
%th{"ng-repeat" => "credential in availableCredentials"}
%input{"type" => "checkbox", "ng-checked" => "isCredentialRequiredForAction(action, credential)", "ng-click" => "checkboxValueChanged(action, credential)"}