mirror of
https://gitlab.com/bramw/baserow.git
synced 2024-11-22 15:52:34 +00:00
55 lines
1.5 KiB
Vue
55 lines
1.5 KiB
Vue
<template>
|
|
<div>
|
|
<Event
|
|
v-for="event in elementType.getEvents(element)"
|
|
:key="event.name"
|
|
:element="element"
|
|
:event="event"
|
|
:available-workflow-action-types="availableWorkflowActionTypes"
|
|
:workflow-actions="getWorkflowActionsForEvent(event)"
|
|
:application-context-additions="event.applicationContextAdditions"
|
|
class="margin-bottom-2"
|
|
></Event>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import elementSidePanel from '@baserow/modules/builder/mixins/elementSidePanel'
|
|
import Event from '@baserow/modules/builder/components/event/Event.vue'
|
|
import { DATA_PROVIDERS_ALLOWED_WORKFLOW_ACTIONS } from '@baserow/modules/builder/enums'
|
|
|
|
export default {
|
|
name: 'EventsSidePanel',
|
|
components: { Event },
|
|
mixins: [elementSidePanel],
|
|
inject: ['applicationContext'],
|
|
provide() {
|
|
return {
|
|
applicationContext: {
|
|
...this.applicationContext,
|
|
element: this.element,
|
|
},
|
|
dataProvidersAllowed: DATA_PROVIDERS_ALLOWED_WORKFLOW_ACTIONS,
|
|
}
|
|
},
|
|
computed: {
|
|
availableWorkflowActionTypes() {
|
|
return Object.values(this.$registry.getAll('workflowAction'))
|
|
},
|
|
workflowActions() {
|
|
return this.$store.getters['workflowAction/getElementWorkflowActions'](
|
|
this.page,
|
|
this.element.id
|
|
)
|
|
},
|
|
},
|
|
methods: {
|
|
getWorkflowActionsForEvent(event) {
|
|
return this.workflowActions.filter(
|
|
(workflowAction) => workflowAction.event === event.name
|
|
)
|
|
},
|
|
},
|
|
}
|
|
</script>
|