diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /app/assets/javascripts/pipelines/components/tokens/pipeline_branch_name_token.vue | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) | |
download | gitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'app/assets/javascripts/pipelines/components/tokens/pipeline_branch_name_token.vue')
-rw-r--r-- | app/assets/javascripts/pipelines/components/tokens/pipeline_branch_name_token.vue | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/app/assets/javascripts/pipelines/components/tokens/pipeline_branch_name_token.vue b/app/assets/javascripts/pipelines/components/tokens/pipeline_branch_name_token.vue deleted file mode 100644 index da14bb2d308..00000000000 --- a/app/assets/javascripts/pipelines/components/tokens/pipeline_branch_name_token.vue +++ /dev/null @@ -1,73 +0,0 @@ -<script> -import { GlFilteredSearchToken, GlFilteredSearchSuggestion, GlLoadingIcon } from '@gitlab/ui'; -import Api from '~/api'; -import { FETCH_BRANCH_ERROR_MESSAGE, FILTER_PIPELINES_SEARCH_DELAY } from '../../constants'; -import createFlash from '~/flash'; -import { debounce } from 'lodash'; - -export default { - components: { - GlFilteredSearchToken, - GlFilteredSearchSuggestion, - GlLoadingIcon, - }, - props: { - config: { - type: Object, - required: true, - }, - value: { - type: Object, - required: true, - }, - }, - data() { - return { - branches: null, - loading: true, - }; - }, - created() { - this.fetchBranches(); - }, - methods: { - fetchBranches(searchterm) { - Api.branches(this.config.projectId, searchterm) - .then(({ data }) => { - this.branches = data.map(branch => branch.name); - this.loading = false; - }) - .catch(err => { - createFlash(FETCH_BRANCH_ERROR_MESSAGE); - this.loading = false; - throw err; - }); - }, - searchBranches: debounce(function debounceSearch({ data }) { - this.fetchBranches(data); - }, FILTER_PIPELINES_SEARCH_DELAY), - }, -}; -</script> - -<template> - <gl-filtered-search-token - :config="config" - v-bind="{ ...$props, ...$attrs }" - v-on="$listeners" - @input="searchBranches" - > - <template #suggestions> - <gl-loading-icon v-if="loading" /> - <template v-else> - <gl-filtered-search-suggestion - v-for="(branch, index) in branches" - :key="index" - :value="branch" - > - {{ branch }} - </gl-filtered-search-suggestion> - </template> - </template> - </gl-filtered-search-token> -</template> |