diff --git a/packages/builder/src/App.svelte b/packages/builder/src/App.svelte index 87a83463a2..230aa17179 100644 --- a/packages/builder/src/App.svelte +++ b/packages/builder/src/App.svelte @@ -5,6 +5,7 @@ import { store, initialise } from "./builderStore" import { onMount } from "svelte" import IconButton from "./common/IconButton.svelte" + import Spinner from "./common/Spinner.svelte" let init = initialise() @@ -12,9 +13,9 @@
{#await init} - -

loading

- +
+ +
{:then result} {#if $store.hasAppPackage} @@ -52,4 +53,13 @@ bottom: 25px; right: 25px; } + + .spinner-container { + height: 100%; + width: 100%; + display: flex; + align-items: center; + justify-content: center; + } + diff --git a/packages/builder/src/accessLevels/AccessLevelView.svelte b/packages/builder/src/accessLevels/AccessLevelView.svelte index 76a57718c0..a21f768d7f 100644 --- a/packages/builder/src/accessLevels/AccessLevelView.svelte +++ b/packages/builder/src/accessLevels/AccessLevelView.svelte @@ -4,6 +4,7 @@ import Checkbox from "../common/Checkbox.svelte" import ButtonGroup from "../common/ButtonGroup.svelte" import Button from "../common/Button.svelte" + import ActionButton from "../common/ActionButton.svelte" import { validateAccessLevels } from "../common/core" import ErrorsBox from "../common/ErrorsBox.svelte" @@ -64,10 +65,11 @@
- + +

Permissions

{#each permissionMatrix as permission} -
+
- - - - +
diff --git a/packages/builder/src/accessLevels/AccessLevelsRoot.svelte b/packages/builder/src/accessLevels/AccessLevelsRoot.svelte index c7fe19abf3..4168d36bfb 100644 --- a/packages/builder/src/accessLevels/AccessLevelsRoot.svelte +++ b/packages/builder/src/accessLevels/AccessLevelsRoot.svelte @@ -1,6 +1,7 @@
- - + {#if $store.accessLevels} @@ -82,7 +82,11 @@ {:else}(no actions added){/if} - + isEditing = false} + bind:isOpen={isEditing} + title={isEditing ? "Edit Access Level" : "Create Access Level"} + > {#if isEditing} import Textbox from "../common/Textbox.svelte" import Button from "../common/Button.svelte" + import ActionButton from "../common/ActionButton.svelte" import ButtonGroup from "../common/ButtonGroup.svelte" import { cloneDeep, filter, keys, map, isUndefined } from "lodash/fp" import ErrorsBox from "../common/ErrorsBox.svelte" @@ -10,16 +11,15 @@ export let action export let onFinished = action => {} export let allActions - export let isNew = true let optKey = "" let optValue = "" let clonedAction = cloneDeep(action) - let initialOptions = pipe(action.initialOptions, [ - keys, - map(k => ({ key: k, value: action.initialOptions[k] })), - ]) + let initialOptions = pipe( + action.initialOptions, + [keys, map(k => ({ key: k, value: action.initialOptions[k] }))] + ) let errors = [] const addNewOption = () => { @@ -44,17 +44,26 @@ const removeOption = opt => { if (opt) { delete clonedAction.initialOptions[opt.key] - initialOptions = pipe(initialOptions, [filter(o => o.key !== opt.key)]) + initialOptions = pipe( + initialOptions, + [filter(o => o.key !== opt.key)] + ) } } const save = () => { const newActionsList = [ - ...pipe(allActions, [filter(a => a !== action)]), + ...pipe( + allActions, + [filter(a => a !== action)] + ), clonedAction, ] - errors = pipe(newActionsList, [validateActions, map(e => e.error)]) + errors = pipe( + newActionsList, + [validateActions, map(e => e.error)] + ) if (errors.length === 0) onFinished(clonedAction) } @@ -89,9 +98,7 @@ class="uk-input uk-width-1-4 uk-margin-right" placeholder="value" bind:value={optValue} /> - + Add
{#each initialOptions as option} @@ -107,11 +114,12 @@
- - - - - + diff --git a/packages/builder/src/common/CodeArea.svelte b/packages/builder/src/common/CodeArea.svelte index 47f563b045..4ef86a6602 100644 --- a/packages/builder/src/common/CodeArea.svelte +++ b/packages/builder/src/common/CodeArea.svelte @@ -1,10 +1,17 @@ -
{label}
+
+ {#if javascript} + + {/if} + {label} +