2018-08-16 07:07:59 -04:00
|
|
|
<script>
|
2018-10-10 02:23:54 -04:00
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
trigger: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
2018-08-16 07:07:59 -04:00
|
|
|
},
|
2018-10-10 02:23:54 -04:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
areVariablesVisible: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
hasVariables() {
|
|
|
|
return this.trigger.variables && this.trigger.variables.length > 0;
|
2018-08-16 07:07:59 -04:00
|
|
|
},
|
2018-10-10 02:23:54 -04:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
revealVariables() {
|
|
|
|
this.areVariablesVisible = true;
|
2018-08-16 07:07:59 -04:00
|
|
|
},
|
2018-10-10 02:23:54 -04:00
|
|
|
},
|
|
|
|
};
|
2018-08-16 07:07:59 -04:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="build-widget block">
|
|
|
|
<h4 class="title">
|
|
|
|
{{ __('Trigger') }}
|
|
|
|
</h4>
|
|
|
|
|
|
|
|
<p
|
2018-09-25 04:07:47 -04:00
|
|
|
v-if="trigger.short_token"
|
2018-08-16 07:07:59 -04:00
|
|
|
class="js-short-token"
|
|
|
|
>
|
|
|
|
<span class="build-light-text">
|
|
|
|
{{ __('Token') }}
|
|
|
|
</span>
|
2018-09-25 04:07:47 -04:00
|
|
|
{{ trigger.short_token }}
|
2018-08-16 07:07:59 -04:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p v-if="hasVariables">
|
|
|
|
<button
|
2018-09-25 04:07:47 -04:00
|
|
|
v-if="!areVariablesVisible"
|
2018-08-16 07:07:59 -04:00
|
|
|
type="button"
|
|
|
|
class="btn btn-default group js-reveal-variables"
|
|
|
|
@click="revealVariables"
|
|
|
|
>
|
|
|
|
{{ __('Reveal Variables') }}
|
|
|
|
</button>
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<dl
|
|
|
|
v-if="areVariablesVisible"
|
|
|
|
class="js-build-variables trigger-build-variables"
|
|
|
|
>
|
|
|
|
<template
|
2018-09-25 04:07:47 -04:00
|
|
|
v-for="variable in trigger.variables"
|
2018-08-16 07:07:59 -04:00
|
|
|
>
|
|
|
|
<dt
|
2018-09-25 04:07:47 -04:00
|
|
|
:key="`${variable.key}-variable`"
|
2018-08-16 07:07:59 -04:00
|
|
|
class="js-build-variable trigger-build-variable"
|
|
|
|
>
|
2018-09-25 04:07:47 -04:00
|
|
|
{{ variable.key }}
|
2018-08-16 07:07:59 -04:00
|
|
|
</dt>
|
|
|
|
|
|
|
|
<dd
|
2018-09-25 04:07:47 -04:00
|
|
|
:key="`${variable.key}-value`"
|
2018-08-16 07:07:59 -04:00
|
|
|
class="js-build-value trigger-build-value"
|
|
|
|
>
|
2018-09-25 04:07:47 -04:00
|
|
|
{{ variable.value }}
|
2018-08-16 07:07:59 -04:00
|
|
|
</dd>
|
|
|
|
</template>
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</template>
|