From 72492da29eb1f17a63e59e20ec36c7ddb0dcafbc Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Tue, 1 Sep 2020 10:12:01 +0100 Subject: [PATCH] event panel rework backup --- packages/builder/package.json | 2 +- .../EventsEditor/EventEditorModal.svelte | 256 ++++++++++-------- .../EventsEditor/EventPropertyControl.svelte | 17 +- .../EventsEditor/actions/CreateRecord.svelte | 5 + .../EventsEditor/actions/NavigateTo.svelte | 16 ++ .../EventsEditor/actions/UpdateRecord.svelte | 5 + .../EventsEditor/actions/index.js | 18 ++ .../userInterface/PropertyControl.svelte | 5 +- packages/builder/yarn.lock | 8 +- packages/client/src/state/eventHandlers.js | 2 + 10 files changed, 201 insertions(+), 133 deletions(-) create mode 100644 packages/builder/src/components/userInterface/EventsEditor/actions/CreateRecord.svelte create mode 100644 packages/builder/src/components/userInterface/EventsEditor/actions/NavigateTo.svelte create mode 100644 packages/builder/src/components/userInterface/EventsEditor/actions/UpdateRecord.svelte create mode 100644 packages/builder/src/components/userInterface/EventsEditor/actions/index.js diff --git a/packages/builder/package.json b/packages/builder/package.json index 6b278d9cdd..ace69a028a 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -60,7 +60,7 @@ ] }, "dependencies": { - "@budibase/bbui": "^1.28.0", + "@budibase/bbui": "^1.28.2", "@budibase/client": "^0.1.19", "@budibase/colorpicker": "^1.0.1", "@sentry/browser": "5.19.1", diff --git a/packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte b/packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte index d2e6cc5693..5ef8a3075d 100644 --- a/packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte +++ b/packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte @@ -1,170 +1,194 @@ -
-
-
-

- {eventData.name ? `${eventData.name} Event` : 'Create a New Component Event'} -

-
-
-
-

Event Type

- -
-
+
-
-

Event Action(s)

- { - createNewEventHandler(draftEventHandler) - draftEventHandler = { parameters: [] } - }} - handler={draftEventHandler} /> +
+ Actions +
+ + Add Action +
+ +
+
- {#if eventData} - {#each eventData.handlers as handler, index} - deleteEventHandler(index)} - {handler} /> + +
+ {#each actionTypes as actionType} +
+ {actionType.name} +
+ {/each} +
+
+
+ +
+ {#if actions && actions.length > 0} + {#each actions as action, index} +
+
+ + {index + 1}. {action[EVENT_TYPE_MEMBER_NAME]} + +
+ {#if action === selectedAction} +
+ +
+ Delete +
+
+ {/if} +
{/each} {/if} +
-
-
- + Learn more about Actions + +
diff --git a/packages/builder/src/components/userInterface/EventsEditor/EventPropertyControl.svelte b/packages/builder/src/components/userInterface/EventsEditor/EventPropertyControl.svelte index c1395ad31b..4bacbe9808 100644 --- a/packages/builder/src/components/userInterface/EventsEditor/EventPropertyControl.svelte +++ b/packages/builder/src/components/userInterface/EventsEditor/EventPropertyControl.svelte @@ -1,25 +1,22 @@ -
- -
- + + + - + on:close={eventsModal.hide} /> +