diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-25 12:07:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-25 12:07:34 +0300 |
commit | 6121eccf2bb21ac30a5c6c5b386e1bd3ddb17c91 (patch) | |
tree | bd4dc1d86d9480c41938ae26f37bca4ba55b169a /app | |
parent | 413a526be6609c00fc3fd630274a28f4e456a307 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/feature_flags/components/new_feature_flag.vue | 40 | ||||
-rw-r--r-- | app/assets/javascripts/feature_flags/store/new/actions.js | 10 | ||||
-rw-r--r-- | app/assets/javascripts/repository/components/blob_button_group.vue (renamed from app/assets/javascripts/repository/components/blob_replace.vue) | 19 | ||||
-rw-r--r-- | app/assets/javascripts/repository/components/blob_content_viewer.vue | 6 |
4 files changed, 18 insertions, 57 deletions
diff --git a/app/assets/javascripts/feature_flags/components/new_feature_flag.vue b/app/assets/javascripts/feature_flags/components/new_feature_flag.vue index 19be57f9d27..865c1e677cd 100644 --- a/app/assets/javascripts/feature_flags/components/new_feature_flag.vue +++ b/app/assets/javascripts/feature_flags/components/new_feature_flag.vue @@ -1,10 +1,8 @@ <script> import { GlAlert } from '@gitlab/ui'; import { mapState, mapActions } from 'vuex'; -import axios from '~/lib/utils/axios_utils'; import featureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; -import { NEW_VERSION_FLAG, ROLLOUT_STRATEGY_ALL_USERS } from '../constants'; -import { createNewEnvironmentScope } from '../store/helpers'; +import { ROLLOUT_STRATEGY_ALL_USERS } from '../constants'; import FeatureFlagForm from './form.vue'; export default { @@ -13,48 +11,14 @@ export default { GlAlert, }, mixins: [featureFlagsMixin()], - inject: { - showUserCallout: {}, - userCalloutId: { - default: '', - }, - userCalloutsPath: { - default: '', - }, - }, - data() { - return { - userShouldSeeNewFlagAlert: this.showUserCallout, - }; - }, computed: { ...mapState(['error', 'path']), - scopes() { - return [ - createNewEnvironmentScope( - { - environmentScope: '*', - active: true, - }, - this.glFeatures.featureFlagsPermissions, - ), - ]; - }, - version() { - return NEW_VERSION_FLAG; - }, strategies() { return [{ name: ROLLOUT_STRATEGY_ALL_USERS, parameters: {}, scopes: [] }]; }, }, methods: { ...mapActions(['createFeatureFlag']), - dismissNewVersionFlagAlert() { - this.userShouldSeeNewFlagAlert = false; - axios.post(this.userCalloutsPath, { - feature_name: this.userCalloutId, - }); - }, }, }; </script> @@ -69,9 +33,7 @@ export default { <feature-flag-form :cancel-path="path" :submit-text="s__('FeatureFlags|Create feature flag')" - :scopes="scopes" :strategies="strategies" - :version="version" @handleSubmit="(data) => createFeatureFlag(data)" /> </div> diff --git a/app/assets/javascripts/feature_flags/store/new/actions.js b/app/assets/javascripts/feature_flags/store/new/actions.js index d0a1c77a69e..dc3f7a21cdb 100644 --- a/app/assets/javascripts/feature_flags/store/new/actions.js +++ b/app/assets/javascripts/feature_flags/store/new/actions.js @@ -1,7 +1,6 @@ import axios from '~/lib/utils/axios_utils'; import { visitUrl } from '~/lib/utils/url_utility'; -import { NEW_VERSION_FLAG } from '../../constants'; -import { mapFromScopesViewModel, mapStrategiesToRails } from '../helpers'; +import { mapStrategiesToRails } from '../helpers'; import * as types from './mutation_types'; /** @@ -17,12 +16,7 @@ export const createFeatureFlag = ({ state, dispatch }, params) => { dispatch('requestCreateFeatureFlag'); return axios - .post( - state.endpoint, - params.version === NEW_VERSION_FLAG - ? mapStrategiesToRails(params) - : mapFromScopesViewModel(params), - ) + .post(state.endpoint, mapStrategiesToRails(params)) .then(() => { dispatch('receiveCreateFeatureFlagSuccess'); visitUrl(state.path); diff --git a/app/assets/javascripts/repository/components/blob_replace.vue b/app/assets/javascripts/repository/components/blob_button_group.vue index 91d7811eb6d..424dc4529ff 100644 --- a/app/assets/javascripts/repository/components/blob_replace.vue +++ b/app/assets/javascripts/repository/components/blob_button_group.vue @@ -1,5 +1,5 @@ <script> -import { GlButton, GlModalDirective } from '@gitlab/ui'; +import { GlButtonGroup, GlButton, GlModalDirective } from '@gitlab/ui'; import { uniqueId } from 'lodash'; import { sprintf, __ } from '~/locale'; import getRefMixin from '../mixins/get_ref'; @@ -9,8 +9,10 @@ export default { i18n: { replace: __('Replace'), replacePrimaryBtnText: __('Replace file'), + delete: __('Delete'), }, components: { + GlButtonGroup, GlButton, UploadBlobModal, }, @@ -48,7 +50,7 @@ export default { replaceModalId() { return uniqueId('replace-modal'); }, - title() { + replaceModalTitle() { return sprintf(__('Replace %{name}'), { name: this.name }); }, }, @@ -57,13 +59,16 @@ export default { <template> <div class="gl-mr-3"> - <gl-button v-gl-modal="replaceModalId"> - {{ $options.i18n.replace }} - </gl-button> + <gl-button-group> + <gl-button v-gl-modal="replaceModalId"> + {{ $options.i18n.replace }} + </gl-button> + <gl-button>{{ $options.i18n.delete }}</gl-button> + </gl-button-group> <upload-blob-modal :modal-id="replaceModalId" - :modal-title="title" - :commit-message="title" + :modal-title="replaceModalTitle" + :commit-message="replaceModalTitle" :target-branch="targetBranch || ref" :original-branch="originalBranch || ref" :can-push-code="canPushCode" diff --git a/app/assets/javascripts/repository/components/blob_content_viewer.vue b/app/assets/javascripts/repository/components/blob_content_viewer.vue index aa94f9cefdf..9cf853e1b86 100644 --- a/app/assets/javascripts/repository/components/blob_content_viewer.vue +++ b/app/assets/javascripts/repository/components/blob_content_viewer.vue @@ -7,14 +7,14 @@ import { SIMPLE_BLOB_VIEWER, RICH_BLOB_VIEWER } from '~/blob/components/constant import createFlash from '~/flash'; import { __ } from '~/locale'; import blobInfoQuery from '../queries/blob_info.query.graphql'; +import BlobButtonGroup from './blob_button_group.vue'; import BlobEdit from './blob_edit.vue'; -import BlobReplace from './blob_replace.vue'; export default { components: { BlobHeader, BlobEdit, - BlobReplace, + BlobButtonGroup, BlobContent, GlLoadingIcon, }, @@ -132,7 +132,7 @@ export default { > <template #actions> <blob-edit :edit-path="blobInfo.editBlobPath" :web-ide-path="blobInfo.ideEditPath" /> - <blob-replace + <blob-button-group v-if="isLoggedIn" :path="path" :name="blobInfo.name" |