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')
-rw-r--r--app/assets/javascripts/ide/components/new_dropdown/upload.vue8
-rw-r--r--app/assets/javascripts/pages/admin/application_settings/account_and_limits.js25
-rw-r--r--app/assets/javascripts/pages/admin/index.js6
-rw-r--r--app/assets/javascripts/pages/admin/users/new/index.js49
-rw-r--r--app/assets/stylesheets/framework/emojis.scss4
-rw-r--r--app/assets/stylesheets/page_bundles/ide.scss2
-rw-r--r--app/assets/stylesheets/pages/notes.scss3
7 files changed, 87 insertions, 10 deletions
diff --git a/app/assets/javascripts/ide/components/new_dropdown/upload.vue b/app/assets/javascripts/ide/components/new_dropdown/upload.vue
index 5b1743bb30e..e2be805ed22 100644
--- a/app/assets/javascripts/ide/components/new_dropdown/upload.vue
+++ b/app/assets/javascripts/ide/components/new_dropdown/upload.vue
@@ -24,12 +24,6 @@ export default {
default: null,
},
},
- mounted() {
- this.$refs.fileUpload.addEventListener('change', this.openFile);
- },
- beforeDestroy() {
- this.$refs.fileUpload.removeEventListener('change', this.openFile);
- },
methods: {
createFile(target, file, isText) {
const { name } = file;
@@ -85,6 +79,8 @@ export default {
ref="fileUpload"
type="file"
class="hidden"
+ multiple
+ @change="openFile"
/>
</div>
</template>
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);
+ });
+}
diff --git a/app/assets/javascripts/pages/admin/index.js b/app/assets/javascripts/pages/admin/index.js
index e50b61f09e2..3aa793e47b9 100644
--- a/app/assets/javascripts/pages/admin/index.js
+++ b/app/assets/javascripts/pages/admin/index.js
@@ -1,3 +1,7 @@
import initAdmin from './admin';
+import initUserInternalRegexPlaceholder from './application_settings/account_and_limits';
-document.addEventListener('DOMContentLoaded', initAdmin);
+document.addEventListener('DOMContentLoaded', () => {
+ initAdmin();
+ initUserInternalRegexPlaceholder();
+});
diff --git a/app/assets/javascripts/pages/admin/users/new/index.js b/app/assets/javascripts/pages/admin/users/new/index.js
new file mode 100644
index 00000000000..58bfa8d64e7
--- /dev/null
+++ b/app/assets/javascripts/pages/admin/users/new/index.js
@@ -0,0 +1,49 @@
+import $ from 'jquery';
+
+export default class UserInternalRegexHandler {
+ constructor() {
+ this.regexPattern = $('[data-user-internal-regex-pattern]').data('user-internal-regex-pattern');
+ if (this.regexPattern && this.regexPattern !== '') {
+ this.regexOptions = $('[data-user-internal-regex-options]').data('user-internal-regex-options');
+ this.external = $('#user_external');
+ this.warningMessage = $('#warning_external_automatically_set');
+ this.addListenerToEmailField();
+ this.addListenerToUserExternalCheckbox();
+ }
+ }
+
+ addListenerToEmailField() {
+ $('#user_email').on('input', (event) => {
+ this.setExternalCheckbox(event.currentTarget.value);
+ });
+ }
+
+ addListenerToUserExternalCheckbox() {
+ this.external.on('click', () => {
+ this.warningMessage.addClass('hidden');
+ });
+ }
+
+ isEmailInternal(email) {
+ const regex = new RegExp(this.regexPattern, this.regexOptions);
+ return regex.test(email);
+ }
+
+ setExternalCheckbox(email) {
+ const isChecked = this.external.prop('checked');
+ if (this.isEmailInternal(email)) {
+ if (isChecked) {
+ this.external.prop('checked', false);
+ this.warningMessage.removeClass('hidden');
+ }
+ } else if (!isChecked) {
+ this.external.prop('checked', true);
+ this.warningMessage.addClass('hidden');
+ }
+ }
+}
+
+document.addEventListener('DOMContentLoaded', () => {
+ // eslint-disable-next-line
+ new UserInternalRegexHandler();
+});
diff --git a/app/assets/stylesheets/framework/emojis.scss b/app/assets/stylesheets/framework/emojis.scss
index a8ec1e1145a..6c50ea719d3 100644
--- a/app/assets/stylesheets/framework/emojis.scss
+++ b/app/assets/stylesheets/framework/emojis.scss
@@ -3,6 +3,6 @@ gl-emoji {
display: inline-flex;
vertical-align: middle;
font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
- font-size: 1.5em;
- line-height: 0.9;
+ font-size: 1.4em;
+ line-height: 1em;
}
diff --git a/app/assets/stylesheets/page_bundles/ide.scss b/app/assets/stylesheets/page_bundles/ide.scss
index eac1345742d..f2db1510e5e 100644
--- a/app/assets/stylesheets/page_bundles/ide.scss
+++ b/app/assets/stylesheets/page_bundles/ide.scss
@@ -1199,7 +1199,7 @@ $ide-tree-text-start: $ide-activity-bar-width + $ide-tree-padding;
}
.avatar-container {
- flex: initial;
+ flex: 0 0 auto;
margin-right: 0;
}
diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss
index fce04c58c24..dbe9f0c03fb 100644
--- a/app/assets/stylesheets/pages/notes.scss
+++ b/app/assets/stylesheets/pages/notes.scss
@@ -141,6 +141,9 @@ ul.notes {
}
.note-body {
+ overflow-x: auto;
+ overflow-y: hidden;
+
.note-text {
@include md-typography;
// Reset ul style types since we're nested inside a ul already