fix: selector unlabeled attr handling
parent
d254a8c329
commit
98f19da5f4
|
@ -77,13 +77,21 @@
|
|||
attribute,
|
||||
};
|
||||
});
|
||||
options.push({
|
||||
attribute: {
|
||||
labels: [],
|
||||
name: inputValue.toUpperCase().replaceAll(/[^A-Z0-9]/g, "_"),
|
||||
},
|
||||
labelToCreate: inputValue,
|
||||
});
|
||||
|
||||
const attributeToCreate = inputValue
|
||||
.toUpperCase()
|
||||
.replaceAll(/[^A-Z0-9]/g, "_");
|
||||
if (
|
||||
!allAttributes.map((attr) => attr.name).includes(attributeToCreate)
|
||||
) {
|
||||
options.push({
|
||||
attribute: {
|
||||
labels: [],
|
||||
name: attributeToCreate,
|
||||
},
|
||||
labelToCreate: inputValue,
|
||||
});
|
||||
}
|
||||
options = options;
|
||||
break;
|
||||
}
|
||||
|
@ -313,16 +321,20 @@
|
|||
}}
|
||||
>
|
||||
{#if option.attribute}
|
||||
{#if option.attribute.labels.length}
|
||||
{#if option.labelToCreate}
|
||||
<div class="content">{option.labelToCreate}</div>
|
||||
<div class="type">Create attribute ({option.attribute.name})</div>
|
||||
{:else if option.attribute.labels.length}
|
||||
<div class="content">
|
||||
{#each option.attribute.labels as label}
|
||||
<div class="label">{label}</div>
|
||||
{/each}
|
||||
</div>
|
||||
<div class="type">{option.attribute.name}</div>
|
||||
{:else if option.labelToCreate}
|
||||
<div class="content">{option.labelToCreate}</div>
|
||||
<div class="type">Create attribute ({option.attribute.name})</div>
|
||||
{:else}
|
||||
<div class="content">
|
||||
{option.attribute.name}
|
||||
</div>
|
||||
{/if}
|
||||
{:else if option.value}
|
||||
{#if option.value.t == "Address"}
|
||||
|
|
Loading…
Reference in New Issue