From a6a42f4d2e7e85cc8b8782b1156ec47c068600be Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 18 Jan 2023 17:49:18 +0000 Subject: [PATCH] Disabling edit/add options for environment variables when encryption key is not found. --- .../portal/settings/environment/index.svelte | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/settings/environment/index.svelte b/packages/builder/src/pages/builder/portal/settings/environment/index.svelte index f31f5dba69..28258ccf4b 100644 --- a/packages/builder/src/pages/builder/portal/settings/environment/index.svelte +++ b/packages/builder/src/pages/builder/portal/settings/environment/index.svelte @@ -18,26 +18,32 @@ let modal - const schema = { - name: { - width: "2fr", - }, - edit: { - width: "auto", - borderLeft: true, - displayName: "", - }, - } - const customRenderers = [{ column: "edit", component: EditVariableColumn }] - $: encryptionKeyAvailable = $environment.status?.encryptionKeyAvailable + $: noEncryptionKey = $environment.status?.encryptionKeyAvailable === false + $: schema = buildSchema(noEncryptionKey) onMount(async () => { await environment.checkStatus() await environment.loadVariables() }) + const buildSchema = noEncryptionKey => { + const schema = { + name: { + width: "2fr", + }, + } + if (!noEncryptionKey) { + schema.edit = { + width: "auto", + borderLeft: true, + displayName: "", + } + } + return schema + } + const save = data => { environment.createVariable(data) modal.hide() @@ -58,8 +64,8 @@ >Add and manage environment variables for development and production - {#if $licensing.environmentVariablesEnabled} - {#if encryptionKeyAvailable === false} + {#if !$licensing.environmentVariablesEnabled} + {#if noEncryptionKey}
- +
{:else}