From f87ce0cadf3dd55cfc6b0724025a06f19308787e Mon Sep 17 00:00:00 2001 From: Ivan Fraixedes Date: Thu, 2 Dec 2021 18:52:33 +0100 Subject: [PATCH] satellite/admin/ui: Fix component rendering I introduced a change in the UI that was a better way to dynamically render Svelte components (https://review.dev.storj.io/c/storj/storj/+/5931/4..5) during the review of the first version of it, however, while it works perfectly on development mode it doesn't work when the assets are built for production, failing silently, because the constructor name get renamed due to the name mangling caused by the minifyer as stated in the following issue: https://github.com/sveltejs/svelte/issues/6980 This commit use a different alternative not based on the constructor name and it works fine with the production build. Change-Id: I643c405f877a9206cf0e51b44d5138e5a9756a79 --- satellite/admin/ui/src/lib/UIGenerator.svelte | 29 ++++++++++++++----- satellite/admin/ui/src/lib/ui-generator.ts | 2 +- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/satellite/admin/ui/src/lib/UIGenerator.svelte b/satellite/admin/ui/src/lib/UIGenerator.svelte index f63462a05..040543eef 100644 --- a/satellite/admin/ui/src/lib/UIGenerator.svelte +++ b/satellite/admin/ui/src/lib/UIGenerator.svelte @@ -9,8 +9,11 @@ See `ui-generator.ts` file for knowing about the `Operation` interface which is the type of the "operation" value to be passed in. -->
@@ -51,7 +64,7 @@ the type of the "operation" value to be passed in.
execOperation(operation, opArgs)}> {#each operation.params as param, i} Promise | null>; } -type ParamUI = InputText | Select | Textarea; +export type ParamUI = InputText | Select | Textarea; export class InputText { constructor(