Skip to content

Commit

Permalink
adapt from new storage entry
Browse files Browse the repository at this point in the history
  • Loading branch information
dlaxcess committed Feb 3, 2024
1 parent 3fb9cc0 commit 9cfef6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions svelte/components/Input/Config/ConfigFieldChoice.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
>
<div class="select" class:open>
<div class="select-trigger">
<span>{defaultChoiceDisplay}</span>
<span>{defaultChoiceDisplay || defaultChoice}</span>
</div>

<div class="custom-options">
Expand All @@ -32,7 +32,7 @@
on:click={() => (attributes[namespace].default.value = key)}
on:keydown={() => (attributes[namespace].default.value = key)}
>
{choice.display}
{choice.display || key}
</span>
{/each}
</div>
Expand Down
8 changes: 8 additions & 0 deletions svelte/components/Input/Config/InputConfigFields.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@
const importConfigSection = (namespace, fieldsGroups) => {
Object.entries(fieldsGroups).forEach(([fieldGroupKey, fieldGroupFields]) => {
console.log("Object.entries ~ fieldGroupKey:", fieldGroupKey);
if (
!Object.keys(attributes[namespace].fieldsGroups).some((key) => key === fieldGroupKey) &&
typeof fieldGroupFields === "object"
) {
attributes[namespace].fieldsGroups[fieldGroupKey] = { fields: [] };
console.log("Object.entries ~ attributes[namespace].fieldsGroups:", attributes[namespace].fieldsGroups);
}
if (fieldGroupFields && typeof fieldGroupFields === "object") {
Object.entries(fieldGroupFields).forEach(([key, value]) => {
if (attributes[namespace].fieldsGroups[fieldGroupKey]?.fields.some((field) => field.key === key)) {
Expand Down

0 comments on commit 9cfef6e

Please sign in to comment.