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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-05 15:12:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-05 15:12:58 +0300
commitc9b0dfef1ba43a9e04264023b08c589bcb9eb397 (patch)
tree4ea24fc43fe40e3c133e64e2476e0be42dafc10b /app/assets/javascripts/feature_flags
parente0c90aab261896abcf93f3806d965790dbd03408 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/feature_flags')
-rw-r--r--app/assets/javascripts/feature_flags/components/edit_feature_flag.vue16
-rw-r--r--app/assets/javascripts/feature_flags/components/form.vue2
-rw-r--r--app/assets/javascripts/feature_flags/edit.js2
3 files changed, 15 insertions, 5 deletions
diff --git a/app/assets/javascripts/feature_flags/components/edit_feature_flag.vue b/app/assets/javascripts/feature_flags/components/edit_feature_flag.vue
index 05d557db942..2bdc95e798c 100644
--- a/app/assets/javascripts/feature_flags/components/edit_feature_flag.vue
+++ b/app/assets/javascripts/feature_flags/components/edit_feature_flag.vue
@@ -1,7 +1,7 @@
<script>
import { GlAlert, GlLoadingIcon, GlToggle } from '@gitlab/ui';
import { mapState, mapActions } from 'vuex';
-import { sprintf, s__ } from '~/locale';
+import { sprintf, __ } from '~/locale';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import FeatureFlagForm from './form.vue';
@@ -10,6 +10,7 @@ export default {
GlAlert,
GlLoadingIcon,
GlToggle,
+ FeatureFlagActions: () => import('ee_component/feature_flags/components/actions.vue'),
FeatureFlagForm,
},
mixins: [glFeatureFlagMixin()],
@@ -28,7 +29,7 @@ export default {
title() {
return this.iid
? `^${this.iid} ${this.name}`
- : sprintf(s__('Edit %{name}'), { name: this.name });
+ : sprintf(this.$options.i18n.editTitle, { name: this.name });
},
},
created() {
@@ -37,6 +38,11 @@ export default {
methods: {
...mapActions(['updateFeatureFlag', 'fetchFeatureFlag', 'toggleActive']),
},
+ i18n: {
+ editTitle: __('Edit %{name}'),
+ toggleLabel: __('Feature flag status'),
+ submit: __('Save changes'),
+ },
};
</script>
<template>
@@ -51,11 +57,13 @@ export default {
data-track-action="click_button"
data-track-label="feature_flag_toggle"
class="gl-mr-4"
- :label="__('Feature flag status')"
+ :label="$options.i18n.toggleLabel"
label-position="hidden"
@change="toggleActive"
/>
<h3 class="page-title gl-m-0">{{ title }}</h3>
+
+ <feature-flag-actions class="gl-ml-auto" />
</div>
<gl-alert v-if="error.length" variant="warning" class="gl-mb-5" :dismissible="false">
@@ -67,7 +75,7 @@ export default {
:description="description"
:strategies="strategies"
:cancel-path="path"
- :submit-text="__('Save changes')"
+ :submit-text="$options.i18n.submit"
:active="active"
@handleSubmit="(data) => updateFeatureFlag(data)"
/>
diff --git a/app/assets/javascripts/feature_flags/components/form.vue b/app/assets/javascripts/feature_flags/components/form.vue
index f7ad2c1f106..29e82289107 100644
--- a/app/assets/javascripts/feature_flags/components/form.vue
+++ b/app/assets/javascripts/feature_flags/components/form.vue
@@ -95,7 +95,7 @@ export default {
return this.formStrategies.filter((s) => !s.shouldBeDestroyed);
},
showRelatedIssues() {
- return this.featureFlagIssuesEndpoint.length > 0;
+ return Boolean(this.featureFlagIssuesEndpoint);
},
},
methods: {
diff --git a/app/assets/javascripts/feature_flags/edit.js b/app/assets/javascripts/feature_flags/edit.js
index 98dee7c7e97..55dad87ea5b 100644
--- a/app/assets/javascripts/feature_flags/edit.js
+++ b/app/assets/javascripts/feature_flags/edit.js
@@ -15,6 +15,7 @@ export default () => {
environmentsEndpoint,
projectId,
featureFlagIssuesEndpoint,
+ searchPath,
} = el.dataset;
return new Vue({
@@ -26,6 +27,7 @@ export default () => {
environmentsEndpoint,
projectId,
featureFlagIssuesEndpoint,
+ searchPath,
},
render(createElement) {
return createElement(EditFeatureFlag);