Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/pages/admin/application_settings/account_and_limits.js')
-rw-r--r--app/assets/javascripts/pages/admin/application_settings/account_and_limits.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/assets/javascripts/pages/admin/application_settings/account_and_limits.js b/app/assets/javascripts/pages/admin/application_settings/account_and_limits.js
new file mode 100644
index 00000000000..7281f907ec7
--- /dev/null
+++ b/app/assets/javascripts/pages/admin/application_settings/account_and_limits.js
@@ -0,0 +1,25 @@
+import { __ } from '~/locale';
+
+export const PLACEHOLDER_USER_EXTERNAL_DEFAULT_TRUE = __('Regex pattern');
+export const PLACEHOLDER_USER_EXTERNAL_DEFAULT_FALSE = __('To define internal users, first enable new users set to external');
+
+function setUserInternalRegexPlaceholder(checkbox) {
+ const userInternalRegex = document.getElementById('application_setting_user_default_internal_regex');
+ if (checkbox && userInternalRegex) {
+ if (checkbox.checked) {
+ userInternalRegex.readOnly = false;
+ userInternalRegex.placeholder = PLACEHOLDER_USER_EXTERNAL_DEFAULT_TRUE;
+ } else {
+ userInternalRegex.readOnly = true;
+ userInternalRegex.placeholder = PLACEHOLDER_USER_EXTERNAL_DEFAULT_FALSE;
+ }
+ }
+}
+
+export default function initUserInternalRegexPlaceholder() {
+ const checkbox = document.getElementById('application_setting_user_default_external');
+ setUserInternalRegexPlaceholder(checkbox);
+ checkbox.addEventListener('change', () => {
+ setUserInternalRegexPlaceholder(checkbox);
+ });
+}