Skip to content

Commit

Permalink
Merge pull request #1192 from ItzNotABug/add-helper-text-to-attribute…
Browse files Browse the repository at this point in the history
…-creation-modal

Add Helper Text to Attribute Creation Modal
  • Loading branch information
ernstmul authored Nov 26, 2024
2 parents c7560e3 + 32e18ad commit 4623e8e
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,28 @@
$: handleDefaultState($required || $array);
</script>

<InputNumber
id="min"
label="Min"
placeholder="Enter size"
bind:value={data.min}
step="any"
required={editing} />
<InputNumber
id="max"
label="Max"
placeholder="Enter size"
bind:value={data.max}
step="any"
required={editing} />
<div>
<ul class="u-flex u-gap-16">
<li class="u-flex-basis-50-percent">
<InputNumber
id="min"
label="Min"
placeholder="Enter size"
bind:value={data.min}
step="any"
required={editing} />
</li>
<li class="u-flex-basis-50-percent">
<InputNumber
id="max"
label="Max"
placeholder="Enter size"
bind:value={data.max}
step="any"
required={editing} />
</li>
</ul>
</div>
<InputNumber
id="default"
label="Default value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,27 @@
$: handleDefaultState($required || $array);
</script>

<InputNumber
id="min"
label="Min"
placeholder="Enter size"
bind:value={data.min}
required={editing} />
<InputNumber
id="max"
label="Max"
placeholder="Enter size"
bind:value={data.max}
required={editing} />
<div>
<ul class="u-flex u-gap-16">
<li class="u-flex-basis-50-percent">
<InputNumber
id="min"
label="Min"
placeholder="Enter size"
bind:value={data.min}
required={editing} />
</li>

<li class="u-flex-basis-50-percent">
<InputNumber
id="max"
label="Max"
placeholder="Enter size"
bind:value={data.max}
required={editing} />
</li>
</ul>
</div>
<InputNumber
id="default"
label="Default value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,30 +157,32 @@
</ul>
</li>

<InputSelectSearch
id="related"
label="Related Collection"
name="collections"
bind:search
bind:value={data.relatedCollection}
required
interactiveOutput={!editing}
placeholder="Select a collection"
disabled={editing}
options={collections?.map((n) => ({ value: n.$id, label: n.$id, data: [n.name] })) ?? []}
on:select={updateKeyName}
let:option={o}>
<SelectSearchItem data={o.data}>
{o.label}
</SelectSearchItem>
<svelte:fragment slot="output" let:option={o}>
<output class="input-text" class:is-read-only={editing}>
<SelectSearchItem data={o.data}>
{o.label}
</SelectSearchItem>
</output>
</svelte:fragment>
</InputSelectSearch>
<div>
<InputSelectSearch
id="related"
label="Related Collection"
name="collections"
bind:search
bind:value={data.relatedCollection}
required
interactiveOutput={!editing}
placeholder="Select a collection"
disabled={editing}
options={collections?.map((n) => ({ value: n.$id, label: n.$id, data: [n.name] })) ?? []}
on:select={updateKeyName}
let:option={o}>
<SelectSearchItem data={o.data}>
{o.label}
</SelectSearchItem>
<svelte:fragment slot="output" let:option={o}>
<output class="input-text" class:is-read-only={editing}>
<SelectSearchItem data={o.data}>
{o.label}
</SelectSearchItem>
</output>
</svelte:fragment>
</InputSelectSearch>
</div>

{#if data?.relatedCollection}
<div>
Expand All @@ -192,13 +194,11 @@
autofocus
required />

<div class="u-flex u-gap-4 u-margin-block-start-8 u-small u-cross-center">
<div class="u-flex u-gap-4 u-margin-block-start-8 u-small">
<span
class="icon-info u-cross-center u-margin-block-start-2 u-line-height-1 u-icon-small"
aria-hidden="true" />
<span class="text u-line-height-1-5">
Allowed characters: alphanumeric, hyphen, non-leading underscore, period
</span>
<span class="text u-line-height-1-5">Allowed characters: a-z, A-Z, 0-9, -, .</span>
</div>
</div>
{#if way === 'two'}
Expand All @@ -211,12 +211,13 @@
required
readonly={editing} />

<div class="u-flex u-gap-4 u-margin-block-start-8 u-small u-cross-center">
<div class="u-flex u-gap-4 u-margin-block-start-8 u-small">
<span
class="icon-info u-cross-center u-margin-block-start-2 u-line-height-1 u-icon-small"
aria-hidden="true" />
<span class="text u-line-height-1-5">
Allowed characters: alphanumeric, hyphen, non-leading underscore, period
Allowed characters: a-z, A-Z, 0-9, -, . Once created, attribute key cannot be
adjusted to maintain data integrity.
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@
autofocus
required />

<div class="u-flex u-gap-4 u-margin-block-start-8 u-small u-cross-center">
<div class="u-flex u-gap-4 u-margin-block-start-8 u-small">
<span
class="icon-info u-cross-center u-margin-block-start-2 u-line-height-1 u-icon-small"
aria-hidden="true" />
<span class="text u-line-height-1-5">
Allowed characters: alphanumeric, hyphen, non-leading underscore, period
Allowed characters: alphanumeric, hyphen, non-leading underscore, period.
</span>
</div>
</div>
Expand Down

0 comments on commit 4623e8e

Please sign in to comment.