@@ -89,7 +89,14 @@ export function initAdminCommon() {
89
89
}
90
90
}
91
91
92
- function onVerifyGroupMembershipChange ( ) {
92
+ function onVerifyGroupMembershipChange ( event ) {
93
+ if ( $ ( event . target ) . attr ( 'id' ) === 'team_group_map_removal' && $ ( '#team_group_map_removal' ) . is ( ':checked' ) ) {
94
+ $ ( '#team_group_map_enabled' ) . prop ( 'checked' , true ) ;
95
+ $ ( '#team_group_map_enabled' ) . prop ( 'disabled' , true ) ;
96
+ } else if ( $ ( event . target ) . attr ( 'id' ) === 'team_group_map_removal' ) {
97
+ $ ( '#team_group_map_enabled' ) . prop ( 'checked' , false ) ;
98
+ $ ( '#team_group_map_enabled' ) . prop ( 'disabled' , false ) ;
99
+ }
93
100
if ( $ ( '#groups_enabled' ) . is ( ':checked' ) || $ ( '#team_group_map_enabled' ) . is ( ':checked' ) || $ ( '#team_group_map_removal' ) . is ( ':checked' ) ) {
94
101
$ ( '#groups_enabled_change' ) . show ( ) ;
95
102
} else {
@@ -158,18 +165,14 @@ export function initAdminCommon() {
158
165
$ ( '#use_paged_search' ) . on ( 'change' , onUsePagedSearchChange ) ;
159
166
$ ( '#oauth2_provider' ) . on ( 'change' , ( ) => onOAuth2Change ( true ) ) ;
160
167
$ ( '#oauth2_use_custom_url' ) . on ( 'change' , ( ) => onOAuth2UseCustomURLChange ( true ) ) ;
161
- $ ( '#groups_enabled' ) . on ( 'change' , onVerifyGroupMembershipChange ) ;
162
- $ ( '#team_group_map_enabled' ) . on ( 'change' , onVerifyGroupMembershipChange ) ;
163
- $ ( '#team_group_map_removal' ) . on ( 'change' , onVerifyGroupMembershipChange ) ;
168
+ $ ( '.ldap_group_options' ) . on ( 'change' , onVerifyGroupMembershipChange ) ;
164
169
}
165
170
// Edit authentication
166
171
if ( $ ( '.admin.edit.authentication' ) . length > 0 ) {
167
172
const authType = $ ( '#auth_type' ) . val ( ) ;
168
173
if ( authType === '2' || authType === '5' ) {
169
174
$ ( '#security_protocol' ) . on ( 'change' , onSecurityProtocolChange ) ;
170
- $ ( '#groups_enabled' ) . on ( 'change' , onVerifyGroupMembershipChange ) ;
171
- $ ( '#team_group_map_enabled' ) . on ( 'change' , onVerifyGroupMembershipChange ) ;
172
- $ ( '#team_group_map_removal' ) . on ( 'change' , onVerifyGroupMembershipChange ) ;
175
+ $ ( '.ldap_group_options' ) . on ( 'change' , onVerifyGroupMembershipChange ) ;
173
176
onVerifyGroupMembershipChange ( ) ;
174
177
if ( authType === '2' ) {
175
178
$ ( '#use_paged_search' ) . on ( 'change' , onUsePagedSearchChange ) ;
0 commit comments