From c728329d51ea26c1f16ec8232596b0fa05c7233f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 23 Sep 2020 12:24:57 +0100 Subject: [PATCH 1/3] Improve responsiveness, handle scrolling and tidy up CSS in automations page --- .../AutomationBuilder.svelte | 4 +- .../AutomationBuilder/flowchart/Arrow.svelte | 2 +- .../flowchart/FlowChart.svelte | 2 +- .../AutomationList/AutomationList.svelte | 56 ++------- .../CreateAutomationModal.svelte | 79 +++++++------ .../AutomationPanel/AutomationPanel.svelte | 6 +- .../BlockList/AutomationBlock.svelte | 27 ++--- .../automation/SetupPanel/SetupPanel.svelte | 109 ++++++++---------- .../[application]/automate/_layout.svelte | 27 ++--- 9 files changed, 125 insertions(+), 187 deletions(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte b/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte index c46783092c..ad49776605 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte @@ -61,7 +61,7 @@ footer { position: absolute; - bottom: 20px; + bottom: var(--spacing-xl); right: 30px; display: flex; align-items: flex-end; @@ -80,7 +80,7 @@ justify-content: center; } footer > button:first-child { - margin-right: 20px; + margin-right: var(--spacing-m); } .play-button.highlighted { diff --git a/packages/builder/src/components/automation/AutomationBuilder/flowchart/Arrow.svelte b/packages/builder/src/components/automation/AutomationBuilder/flowchart/Arrow.svelte index eaf84c3088..4dab01d6f1 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/flowchart/Arrow.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/flowchart/Arrow.svelte @@ -10,6 +10,6 @@ diff --git a/packages/builder/src/components/automation/AutomationBuilder/flowchart/FlowChart.svelte b/packages/builder/src/components/automation/AutomationBuilder/flowchart/FlowChart.svelte index 2465a421d8..1d7ebb35f8 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/flowchart/FlowChart.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/flowchart/FlowChart.svelte @@ -37,7 +37,7 @@ diff --git a/packages/builder/src/components/automation/AutomationPanel/AutomationList/CreateAutomationModal.svelte b/packages/builder/src/components/automation/AutomationPanel/AutomationList/CreateAutomationModal.svelte index 7cd3d3f05a..6f07c97f4d 100644 --- a/packages/builder/src/components/automation/AutomationPanel/AutomationList/CreateAutomationModal.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/AutomationList/CreateAutomationModal.svelte @@ -22,67 +22,74 @@ } -
- - Create Automation -
-
- +
+
+ + Create Automation +
+
+ +
+
- diff --git a/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte b/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte index 1042f5456b..1940f88d44 100644 --- a/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte @@ -20,7 +20,7 @@ class="hoverable" class:selected={selectedTab === 'ADD'} on:click={() => (selectedTab = 'ADD')}> - Add step + Steps {/if} @@ -37,11 +37,11 @@ background: none; display: flex; align-items: center; - margin-bottom: 20px; + margin-bottom: var(--spacing-xl); } .automation-header { - margin-right: 20px; + margin-right: var(--spacing-xl); } span:not(.selected) { diff --git a/packages/builder/src/components/automation/AutomationPanel/BlockList/AutomationBlock.svelte b/packages/builder/src/components/automation/AutomationPanel/BlockList/AutomationBlock.svelte index 8de97dea20..884a109de5 100644 --- a/packages/builder/src/components/automation/AutomationPanel/BlockList/AutomationBlock.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/BlockList/AutomationBlock.svelte @@ -33,26 +33,15 @@ display: grid; grid-template-columns: 20px auto; align-items: center; - margin-top: 16px; - padding: 12px; + margin-top: var(--spacing-s); + padding: var(--spacing-m); border-radius: var(--border-radius-m); } - .automation-block:hover { background-color: var(--grey-1); } - - .automation-text { - margin-left: 16px; - } - - .icon { - height: 40px; - width: 40px; - background: var(--blue-light); - display: flex; - align-items: center; - justify-content: center; + .automation-block:first-child { + margin-top: 0; } i { @@ -60,14 +49,16 @@ font-size: 20px; } - h4 { + .automation-text { + margin-left: 16px; + } + .automation-text h4 { font-size: 14px; font-weight: 500; margin-bottom: 5px; margin-top: 0; } - - p { + .automation-text p { font-size: 12px; color: var(--grey-7); margin: 0; diff --git a/packages/builder/src/components/automation/SetupPanel/SetupPanel.svelte b/packages/builder/src/components/automation/SetupPanel/SetupPanel.svelte index b17fad7a2b..39ffaa370b 100644 --- a/packages/builder/src/components/automation/SetupPanel/SetupPanel.svelte +++ b/packages/builder/src/components/automation/SetupPanel/SetupPanel.svelte @@ -24,7 +24,9 @@ } function deleteAutomationBlock() { - automationStore.actions.deleteAutomationBlock($automationStore.selectedBlock) + automationStore.actions.deleteAutomationBlock( + $automationStore.selectedBlock + ) } async function testAutomation() { @@ -56,10 +58,24 @@ Setup - {#if $automationStore.selectedBlock} - -
- + {/if} +
+
+ {#if $automationStore.selectedBlock} + -
- {:else if $automationStore.selectedAutomation} -
-
-
- Automation - {automation.name} -
-
- -
- - -
-
- {/if} + {:else if $automationStore.selectedAutomation} + + + {/if} +
+ diff --git a/packages/builder/src/pages/[application]/automate/_layout.svelte b/packages/builder/src/pages/[application]/automate/_layout.svelte index 82f04ffcdc..b4fa599f89 100644 --- a/packages/builder/src/pages/[application]/automate/_layout.svelte +++ b/packages/builder/src/pages/[application]/automate/_layout.svelte @@ -1,23 +1,19 @@ - +
{#if $automationStore.selectedAutomation} {/if}
@@ -25,28 +21,19 @@ From aa47d18bb131b713e69a372a4a62867f34ea6c6e Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 23 Sep 2020 12:25:14 +0100 Subject: [PATCH 2/3] Sort automation steps by name --- .../AutomationPanel/BlockList/BlockList.svelte | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/automation/AutomationPanel/BlockList/BlockList.svelte b/packages/builder/src/components/automation/AutomationPanel/BlockList/BlockList.svelte index 5dd709c4b2..1455f60ef1 100644 --- a/packages/builder/src/components/automation/AutomationPanel/BlockList/BlockList.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/BlockList/BlockList.svelte @@ -1,11 +1,14 @@