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>2022-12-27 21:09:45 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-27 21:09:45 +0300
commit84f003a4cbf0d57afdaae8cc4f28af549b34ff33 (patch)
tree057e9740a8f96d8b6c7b19ebaba6ce1c074db045 /app/assets/javascripts/integrations
parenteedc7b50be0121effa4ea03862c045cf6114c944 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/integrations')
-rw-r--r--app/assets/javascripts/integrations/constants.js4
-rw-r--r--app/assets/javascripts/integrations/edit/components/sections/trigger.vue1
-rw-r--r--app/assets/javascripts/integrations/edit/components/trigger_field.vue29
3 files changed, 32 insertions, 2 deletions
diff --git a/app/assets/javascripts/integrations/constants.js b/app/assets/javascripts/integrations/constants.js
index 392dd63b089..b956bdf067d 100644
--- a/app/assets/javascripts/integrations/constants.js
+++ b/app/assets/javascripts/integrations/constants.js
@@ -52,6 +52,7 @@ export const integrationTriggerEvents = {
TAG_PUSH: 'tag_push_events',
PIPELINE: 'pipeline_events',
WIKI_PAGE: 'wiki_page_events',
+ DEPLOYMENT: 'deployment_events',
};
export const integrationTriggerEventTitles = {
@@ -72,6 +73,9 @@ export const integrationTriggerEventTitles = {
[integrationTriggerEvents.TAG_PUSH]: s__('IntegrationEvents|A tag is pushed to the repository'),
[integrationTriggerEvents.PIPELINE]: s__('IntegrationEvents|A pipeline status changes'),
[integrationTriggerEvents.WIKI_PAGE]: s__('IntegrationEvents|A wiki page is created or updated'),
+ [integrationTriggerEvents.DEPLOYMENT]: s__(
+ 'IntegrationEvents|A deployment is started or finished',
+ ),
};
export const billingPlans = {
diff --git a/app/assets/javascripts/integrations/edit/components/sections/trigger.vue b/app/assets/javascripts/integrations/edit/components/sections/trigger.vue
index 9af5070d4cf..228f761d5b6 100644
--- a/app/assets/javascripts/integrations/edit/components/sections/trigger.vue
+++ b/app/assets/javascripts/integrations/edit/components/sections/trigger.vue
@@ -20,6 +20,7 @@ export default {
v-for="event in propsSource.triggerEvents"
:key="`${currentKey}-trigger-fields-${event.name}`"
:event="event"
+ :type="propsSource.type"
class="gl-mb-3"
/>
</div>
diff --git a/app/assets/javascripts/integrations/edit/components/trigger_field.vue b/app/assets/javascripts/integrations/edit/components/trigger_field.vue
index dc5ae2f3a3d..57753c61587 100644
--- a/app/assets/javascripts/integrations/edit/components/trigger_field.vue
+++ b/app/assets/javascripts/integrations/edit/components/trigger_field.vue
@@ -1,13 +1,17 @@
<script>
-import { GlFormCheckbox } from '@gitlab/ui';
+import { GlFormCheckbox, GlFormInput } from '@gitlab/ui';
import { mapGetters } from 'vuex';
-import { integrationTriggerEventTitles } from '~/integrations/constants';
+import {
+ placeholderForType,
+ integrationTriggerEventTitles,
+} from 'any_else_ce/integrations/constants';
export default {
name: 'TriggerField',
components: {
GlFormCheckbox,
+ GlFormInput,
},
props: {
event: {
@@ -15,10 +19,15 @@ export default {
required: false,
default: () => ({}),
},
+ type: {
+ type: String,
+ required: true,
+ },
},
data() {
return {
value: false,
+ fieldValue: this.event.field?.value,
};
},
computed: {
@@ -26,9 +35,15 @@ export default {
name() {
return `service[${this.event.name}]`;
},
+ fieldName() {
+ return `service[${this.event.field?.name}]`;
+ },
title() {
return integrationTriggerEventTitles[this.event.name];
},
+ defaultPlaceholder() {
+ return placeholderForType[this.type];
+ },
},
mounted() {
this.value = this.event.value || false;
@@ -42,5 +57,15 @@ export default {
<gl-form-checkbox v-model="value" :disabled="isInheriting">
{{ title }}
</gl-form-checkbox>
+ <div class="gl-ml-6">
+ <gl-form-input
+ v-if="event.field"
+ v-show="value"
+ v-model="fieldValue"
+ :name="fieldName"
+ :placeholder="event.field.placeholder || defaultPlaceholder"
+ :readonly="isInheriting"
+ />
+ </div>
</div>
</template>