Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
org settings: Add save/discard widget for realm authentication methods.
Along with this, we refactored settings_org.populate_auth_methods to use HTML function after rendering all auth methods rows rather than appending each row individually, which actually is a good practice. Also in this commit, to compare `current_val` and `changed_val` in `check_property_changed` function of the property `realm_authentication_methods`, which are objects, and we found here https://stackoverflow.com/a/1144249 that there is no easy way to do so. So I followed this approach, ```js JSON.stringify(obj1) === JSON.stringify(obj2) ``` but before converting them to string we want the same order of keys, so we used `sort_object_by_key` to sort `current_val` by keys and `get_auth_method_table_data` always return `changed_val` having keys sorted. Since these refactor were closely related we kept them as a single commit here. Fixes: #11954.
- Loading branch information
1 parent
c634d22
commit 4df971c
Showing
6 changed files
with
55 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 19 additions & 12 deletions
31
static/templates/settings/auth-methods-settings-admin.handlebars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
<div id="admin-auth-settings" class="settings-section" data-name="auth-methods"> | ||
<div id="organization-auth-settings" class="settings-section" data-name="auth-methods"> | ||
<form class="form-horizontal admin-realm-form org-authentications-form"> | ||
<div class="admin-table-wrapper"> | ||
<h3 class="inline-block">{{t "Authentication methods" }}</h3> | ||
<div class="alert-notification" id="admin-realm-authentication-methods-status"></div> | ||
<p>{{#tr this}}Configure the authentication methods for your organization.{{/tr}}</p> | ||
<table class="table table-condensed table-striped"> | ||
<thead> | ||
<th>{{t "Method" }}</th> | ||
<th>{{t "Enabled" }}</th> | ||
</thead> | ||
<tbody id="admin_auth_methods_table" class=" admin_auth_methods_table"></tbody> | ||
</table> | ||
<div id="org-auth_settings" class="admin-table-wrapper org-subsection-parent"> | ||
<div class ="subsection-header"> | ||
<h3>{{t "Authentication methods" }}</h3> | ||
{{ partial "settings-save-discard-widget" "section_name" "auth_settings" }} | ||
</div> | ||
|
||
<div> | ||
<p>{{t "Configure the authentication methods for your organization."}}</p> | ||
<table id="id_realm_authentication_methods" | ||
class="table table-condensed table-striped prop-element"> | ||
<thead> | ||
<th>{{t "Method" }}</th> | ||
<th>{{t "Enabled" }}</th> | ||
</thead> | ||
<tbody> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</form> | ||
</div> |