mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: document creation label format
This commit is contained in:
1 parent
0e105ab630
commit
8d09afb635
3 files changed
+26
-3
No files matched your search
@@ -3,6 +3,7 @@
|
||||
import { FormItem, Helper, Label } from '.';
|
||||
|
||||
export let label: string;
|
||||
export let optionalText: string | undefined = undefined;
|
||||
export let showLabel = true;
|
||||
export let id: string;
|
||||
export let value = '';
|
||||
@@ -50,7 +51,7 @@
|
||||
</script>
|
||||
|
||||
<FormItem>
|
||||
<Label {required} hide={!showLabel} for={id}>
|
||||
<Label {required} {optionalText} hide={!showLabel} for={id}>
|
||||
{label}
|
||||
</Label>
|
||||
|
||||
|
||||
+15
-1
@@ -24,7 +24,21 @@
|
||||
}
|
||||
|
||||
function getAttributeType(attribute: Attributes) {
|
||||
if ('format' in attribute && attribute.format === 'enum') return 'Enum';
|
||||
if ('format' in attribute) {
|
||||
switch (attribute.format) {
|
||||
case 'ip':
|
||||
return 'IP';
|
||||
case 'email':
|
||||
return 'Email';
|
||||
case 'url':
|
||||
return 'URL';
|
||||
case 'enum':
|
||||
return 'Enum';
|
||||
default:
|
||||
'String';
|
||||
break;
|
||||
}
|
||||
}
|
||||
return `${capitalize(attribute.type)}${attribute.array ? '[]' : ''}`;
|
||||
}
|
||||
</script>
|
||||
|
||||
+9
-1
@@ -5,7 +5,15 @@
|
||||
export let id: string;
|
||||
export let label: string;
|
||||
export let value: string | null;
|
||||
export let optionalText: string | undefined = undefined;
|
||||
export let attribute: Models.AttributeUrl;
|
||||
</script>
|
||||
|
||||
<InputURL {id} {label} showLabel={!!label?.length} required={attribute.required} bind:value />
|
||||
<InputURL
|
||||
{id}
|
||||
{label}
|
||||
{optionalText}
|
||||
placeholder="Enter URL"
|
||||
showLabel={!!label?.length}
|
||||
required={attribute.required}
|
||||
bind:value />
|
||||
Reference in new issue
Block a user