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

new_feature_flag.vue « components « feature_flags « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 865c1e677cde397b6daad3291fce5e31b9c32cee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<script>
import { GlAlert } from '@gitlab/ui';
import { mapState, mapActions } from 'vuex';
import featureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { ROLLOUT_STRATEGY_ALL_USERS } from '../constants';
import FeatureFlagForm from './form.vue';

export default {
  components: {
    FeatureFlagForm,
    GlAlert,
  },
  mixins: [featureFlagsMixin()],
  computed: {
    ...mapState(['error', 'path']),
    strategies() {
      return [{ name: ROLLOUT_STRATEGY_ALL_USERS, parameters: {}, scopes: [] }];
    },
  },
  methods: {
    ...mapActions(['createFeatureFlag']),
  },
};
</script>
<template>
  <div>
    <h3 class="page-title">{{ s__('FeatureFlags|New feature flag') }}</h3>

    <gl-alert v-if="error.length" variant="warning" class="gl-mb-5" :dismissible="false">
      <p v-for="(message, index) in error" :key="index" class="gl-mb-0">{{ message }}</p>
    </gl-alert>

    <feature-flag-form
      :cancel-path="path"
      :submit-text="s__('FeatureFlags|Create feature flag')"
      :strategies="strategies"
      @handleSubmit="(data) => createFeatureFlag(data)"
    />
  </div>
</template>