diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-08-19 17:13:33 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-09-10 09:01:23 +0200 |
commit | 9f8ccf1036ff18d961949bfb644c9d445caa8a23 (patch) | |
tree | 5f8e4654ddbdce95cf66f0ed6ef602d312fbe5ba /apps/workflowengine/src/components/Event.vue | |
parent | aed630ac0a63771c7a217a3c1d400a354929fafe (diff) | |
download | nextcloud-server-9f8ccf1036ff18d961949bfb644c9d445caa8a23.tar.gz nextcloud-server-9f8ccf1036ff18d961949bfb644c9d445caa8a23.zip |
Use entity/event definitions from backend
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/workflowengine/src/components/Event.vue')
-rw-r--r-- | apps/workflowengine/src/components/Event.vue | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/apps/workflowengine/src/components/Event.vue b/apps/workflowengine/src/components/Event.vue index fd5097cecfc..caf5c7631bd 100644 --- a/apps/workflowengine/src/components/Event.vue +++ b/apps/workflowengine/src/components/Event.vue @@ -2,11 +2,11 @@ <div> <Multiselect :value="currentEvent" :options="allEvents" label="name" track-by="id" :allow-empty="false" :disabled="allEvents.length <= 1" @input="updateEvent"> <template slot="singleLabel" slot-scope="props"> - <span class="option__icon" :class="props.option.icon"></span> + <img class="option__icon" :src="props.option.icon" /> <span class="option__title option__title_single">{{ props.option.name }}</span> </template> <template slot="option" slot-scope="props"> - <span class="option__icon" :class="props.option.icon"></span> + <img class="option__icon" :src="props.option.icon" /> <span class="option__title">{{ props.option.name }}</span> </template> </Multiselect> @@ -15,7 +15,7 @@ <script> import { Multiselect } from 'nextcloud-vue' - import { eventService, operationService } from '../services/Operation' + import { Entities, operationService } from '../services/Operation' export default { name: "Event", @@ -36,7 +36,21 @@ return this.allEvents.find(event => event.id === this.rule.event) }, allEvents() { - return this.operation.events.map((eventName) => eventService.get(eventName)) + return this.operation.events.map((entityEventName) => { + const parts = entityEventName.split('::') + const entityId = parts[0] + const eventName = parts[1] + const Entity = Entities.find((entity) => entity.id === entityId) + const Event = Entity.events.find((event) => event.eventName === eventName) + return { + entity: entityId, + id: entityEventName, + event: eventName, + name: Event.displayName, + icon: Entity.icon, + checks: Entity.checks, + } + }) }, operation() { return operationService.get(this.rule.class) @@ -81,4 +95,4 @@ .option__title_single { font-weight: 900; } -</style>
\ No newline at end of file +</style> |