From 5bedc03533e8a62ee218d2eb92247c96bc85ce6f Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 23 Aug 2023 17:18:49 +0200 Subject: [PATCH] refactor: disable variable editor if there is no change --- src/lib/components/secondaryTabsItem.svelte | 4 +- .../rawVariableEditor.svelte | 84 +++++++++++-------- 2 files changed, 50 insertions(+), 38 deletions(-) diff --git a/src/lib/components/secondaryTabsItem.svelte b/src/lib/components/secondaryTabsItem.svelte index 3a87b01d7..6b8a06524 100644 --- a/src/lib/components/secondaryTabsItem.svelte +++ b/src/lib/components/secondaryTabsItem.svelte @@ -13,7 +13,8 @@ class="secondary-tabs-button" class:u-width-full-line={fullWidth} class:u-text-center={center} - disabled> + disabled + type="button"> {:else} @@ -30,6 +31,7 @@ class="secondary-tabs-button" class:u-width-full-line={fullWidth} class:u-text-center={center} + type="button" {disabled} on:click> diff --git a/src/routes/console/project-[project]/rawVariableEditor.svelte b/src/routes/console/project-[project]/rawVariableEditor.svelte index 540f7ea21..aef7b8844 100644 --- a/src/routes/console/project-[project]/rawVariableEditor.svelte +++ b/src/routes/console/project-[project]/rawVariableEditor.svelte @@ -1,5 +1,6 @@
-
    -
  • - -
  • -
  • - -
  • -
+ + (tab = 'env')} + disabled={tab === 'env'}> + ENV + + (tab = 'json')} + disabled={tab === 'json'}> + JSON + + - {#if tab === 'env'} -