2023-04-23 21:23:45 +05:30
|
|
|
<script>
|
|
|
|
import { GlDisclosureDropdown } from '@gitlab/ui';
|
|
|
|
import { __ } from '~/locale';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'HookTestDropdown',
|
|
|
|
components: {
|
|
|
|
GlDisclosureDropdown,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
items: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
size: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: undefined,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
2023-06-20 00:43:36 +05:30
|
|
|
webhookTriggers() {
|
|
|
|
return this.items.map(({ text, href }) => ({
|
|
|
|
text,
|
|
|
|
href,
|
|
|
|
extraAttrs: {
|
|
|
|
'data-method': 'post',
|
|
|
|
},
|
2023-04-23 21:23:45 +05:30
|
|
|
}));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
i18n: {
|
|
|
|
test: __('Test'),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-06-20 00:43:36 +05:30
|
|
|
<gl-disclosure-dropdown :toggle-text="$options.i18n.test" :items="webhookTriggers" :size="size" />
|
2023-04-23 21:23:45 +05:30
|
|
|
</template>
|