diff --git a/frontend/src/components/left/EventTree.vue b/frontend/src/components/left/EventTree.vue index 4cbe294..746a9f0 100644 --- a/frontend/src/components/left/EventTree.vue +++ b/frontend/src/components/left/EventTree.vue @@ -3,11 +3,11 @@ diff --git a/frontend/src/components/right/EventSetter.vue b/frontend/src/components/right/EventSetter.vue index 54303dd..25a90d5 100644 --- a/frontend/src/components/right/EventSetter.vue +++ b/frontend/src/components/right/EventSetter.vue @@ -61,12 +61,12 @@ export default defineComponent({ if(store.eventTree.findEventById(addEventId)){ return; } - customEvents.events.push( - new kintoneEvent( - displayName, - addEventId, - customButtonId) - ); + customEvents.events.push({ + eventId: addEventId, + label: displayName, + parentId: customButtonId, + header: 'DELETABLE' + }); } } diff --git a/frontend/src/stores/flowEditor.ts b/frontend/src/stores/flowEditor.ts index 009756d..21580ce 100644 --- a/frontend/src/stores/flowEditor.ts +++ b/frontend/src/stores/flowEditor.ts @@ -113,19 +113,19 @@ export const useFlowEditorStore = defineStore('flowEditor', { }, - deleteEvent(event: IKintoneEvent) { + async deleteEvent(event: IKintoneEvent) { const store = useFlowEditorStore(); if (event.flowData) { const flow = event.flowData; - if (flow.id === '') { - return; + if (flow.id !== '') { + await flowCtrl.DeleteFlow(flow.id) + if (this.flows) { + this.flows = this.flows.filter((f) => f.id !== flow.id); + } } - flowCtrl.DeleteFlow(flow.id) eventTree.deleteEvent(event, store); - if(this.flows){ - this.flows = this.flows.filter((f) => f.id !== flow.id); - } - } else { + } + else { eventTree.deleteEvent(event, store); } }, diff --git a/frontend/src/types/KintoneEvents.ts b/frontend/src/types/KintoneEvents.ts index 975e929..da6db3d 100644 --- a/frontend/src/types/KintoneEvents.ts +++ b/frontend/src/types/KintoneEvents.ts @@ -95,10 +95,7 @@ export class KintoneEventManager { const lastIndex = eventId.lastIndexOf('.'); const groupId = eventId.substring(0, lastIndex); const eventNode = this.findEventById(groupId); - if ( - eventNode && - (eventNode.header === 'EVENTGROUP' || eventNode.header === 'CHANGE') - ) { + if (eventNode && (eventNode.header === 'EVENTGROUP' || eventNode.header === 'CHANGE')) { const groupEvent = eventNode as kintoneEventGroup; const newEvent = {