summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/packages_and_registries/settings/group/components/duplicates_settings.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/packages_and_registries/settings/group/components/duplicates_settings.vue')
-rw-r--r--app/assets/javascripts/packages_and_registries/settings/group/components/duplicates_settings.vue103
1 files changed, 0 insertions, 103 deletions
diff --git a/app/assets/javascripts/packages_and_registries/settings/group/components/duplicates_settings.vue b/app/assets/javascripts/packages_and_registries/settings/group/components/duplicates_settings.vue
deleted file mode 100644
index 51a97aead49..00000000000
--- a/app/assets/javascripts/packages_and_registries/settings/group/components/duplicates_settings.vue
+++ /dev/null
@@ -1,103 +0,0 @@
-<script>
-import { GlToggle, GlFormGroup, GlFormInput } from '@gitlab/ui';
-import { isEqual } from 'lodash';
-
-import {
- DUPLICATES_TOGGLE_LABEL,
- DUPLICATES_SETTING_EXCEPTION_TITLE,
- DUPLICATES_SETTINGS_EXCEPTION_LEGEND,
-} from '~/packages_and_registries/settings/group/constants';
-
-export default {
- name: 'DuplicatesSettings',
- i18n: {
- DUPLICATES_TOGGLE_LABEL,
- DUPLICATES_SETTING_EXCEPTION_TITLE,
- DUPLICATES_SETTINGS_EXCEPTION_LEGEND,
- },
- components: {
- GlToggle,
- GlFormGroup,
- GlFormInput,
- },
- props: {
- loading: {
- type: Boolean,
- required: false,
- default: false,
- },
- duplicatesAllowed: {
- type: Boolean,
- default: false,
- required: false,
- },
- duplicateExceptionRegex: {
- type: String,
- default: '',
- required: false,
- },
- duplicateExceptionRegexError: {
- type: String,
- default: '',
- required: false,
- },
- modelNames: {
- type: Object,
- required: true,
- validator(value) {
- return isEqual(Object.keys(value), ['allowed', 'exception']);
- },
- },
- toggleQaSelector: {
- type: String,
- required: false,
- default: null,
- },
- labelQaSelector: {
- type: String,
- required: false,
- default: null,
- },
- },
- computed: {
- isExceptionRegexValid() {
- return !this.duplicateExceptionRegexError;
- },
- },
- methods: {
- update(type, value) {
- this.$emit('update', { [type]: value });
- },
- },
-};
-</script>
-
-<template>
- <form>
- <gl-toggle
- :data-qa-selector="toggleQaSelector"
- :label="$options.i18n.DUPLICATES_TOGGLE_LABEL"
- :value="!duplicatesAllowed"
- :disabled="loading"
- @change="update(modelNames.allowed, !$event)"
- />
- <gl-form-group
- v-if="!duplicatesAllowed"
- class="gl-mt-4"
- :label="$options.i18n.DUPLICATES_SETTING_EXCEPTION_TITLE"
- label-size="sm"
- :state="isExceptionRegexValid"
- :invalid-feedback="duplicateExceptionRegexError"
- :description="$options.i18n.DUPLICATES_SETTINGS_EXCEPTION_LEGEND"
- label-for="maven-duplicated-settings-regex-input"
- >
- <gl-form-input
- id="maven-duplicated-settings-regex-input"
- :disabled="loading"
- size="lg"
- :value="duplicateExceptionRegex"
- @change="update(modelNames.exception, $event)"
- />
- </gl-form-group>
- </form>
-</template>