2022-04-14 08:06:55 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div class="multiselect-wrap--small">
|
|
|
|
<multiselect
|
|
|
|
v-model="selectedTeams"
|
|
|
|
track-by="id"
|
|
|
|
label="name"
|
|
|
|
:placeholder="$t('AUTOMATION.ACTION.TEAM_DROPDOWN_PLACEHOLDER')"
|
|
|
|
:multiple="true"
|
|
|
|
selected-label
|
|
|
|
:select-label="$t('FORMS.MULTISELECT.ENTER_TO_SELECT')"
|
|
|
|
deselect-label=""
|
|
|
|
:max-height="160"
|
|
|
|
:options="teams"
|
|
|
|
:allow-empty="false"
|
|
|
|
@input="updateValue"
|
|
|
|
/>
|
|
|
|
<textarea
|
|
|
|
v-model="message"
|
|
|
|
rows="4"
|
|
|
|
:placeholder="$t('AUTOMATION.ACTION.TEAM_MESSAGE_INPUT_PLACEHOLDER')"
|
|
|
|
@input="updateValue"
|
2022-06-10 13:59:52 +00:00
|
|
|
/>
|
2022-04-14 08:06:55 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
// The value types are dynamic, hence prop validation removed to work with our action schema
|
|
|
|
// eslint-disable-next-line vue/require-prop-types
|
|
|
|
props: ['teams', 'value'],
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
selectedTeams: [],
|
|
|
|
message: '',
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
const { team_ids: teamIds } = this.value;
|
2022-10-10 14:03:22 +00:00
|
|
|
this.selectedTeams = teamIds;
|
2022-10-10 16:37:09 +00:00
|
|
|
this.message = this.value.message;
|
2022-04-14 08:06:55 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
updateValue() {
|
|
|
|
this.$emit('input', {
|
|
|
|
team_ids: this.selectedTeams.map(team => team.id),
|
|
|
|
message: this.message,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.multiselect {
|
|
|
|
margin: var(--space-smaller) var(--space-zero);
|
|
|
|
}
|
|
|
|
textarea {
|
|
|
|
margin-bottom: var(--space-zero);
|
|
|
|
}
|
|
|
|
</style>
|