mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: function fist deployment, select validity
This commit is contained in:
@@ -27,6 +27,14 @@
|
||||
error = element.validationMessage;
|
||||
};
|
||||
|
||||
$: if (element && required && !value) {
|
||||
element.setCustomValidity('This field is required');
|
||||
}
|
||||
|
||||
$: if (element && required && value) {
|
||||
element.setCustomValidity('');
|
||||
}
|
||||
|
||||
$: if (value) {
|
||||
error = null;
|
||||
}
|
||||
|
||||
+2
@@ -7,6 +7,7 @@
|
||||
export let value: string;
|
||||
export let attribute: Models.AttributeEnum;
|
||||
export let optionalText: string | undefined = undefined;
|
||||
export let required = false;
|
||||
|
||||
$: options = attribute.elements.map((element) => {
|
||||
return {
|
||||
@@ -22,5 +23,6 @@
|
||||
{id}
|
||||
{label}
|
||||
{optionalText}
|
||||
required={attribute.required}
|
||||
placeholder="Select a value"
|
||||
showLabel={!!label?.length} />
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@
|
||||
<div class="common-section">
|
||||
<Heading tag="h3" size="7">Inactive</Heading>
|
||||
</div>
|
||||
{#if data.deployments.total > 1}
|
||||
{#if data.deployments.total > 1 || (!activeDeployment && data.deployments.total === 1)}
|
||||
<TableScroll>
|
||||
<TableHeader>
|
||||
<TableCellHead width={90}>Deployment ID</TableCellHead>
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import { Modal, Collapsible, CollapsibleItem, Tabs, Tab, Code } from '$lib/components';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { page } from '$app/stores';
|
||||
import GithubLight from '$lib/images/github-illustration-light.svg';
|
||||
import GithubDark from '$lib/images/github-illustration-dark.svg';
|
||||
@@ -27,6 +26,7 @@
|
||||
let lang = 'js';
|
||||
let codeSnippets = {};
|
||||
let os = 'unknown';
|
||||
let error: string = null;
|
||||
|
||||
const functionId = $page.params.function;
|
||||
const dispatch = createEventDispatcher();
|
||||
@@ -97,16 +97,15 @@
|
||||
files[0],
|
||||
active
|
||||
);
|
||||
await invalidate(Dependencies.FUNCTION);
|
||||
files = entrypoint = active = null;
|
||||
await invalidate(Dependencies.DEPLOYMENTS);
|
||||
files = undefined;
|
||||
entrypoint = null;
|
||||
active = false;
|
||||
showCreate = false;
|
||||
dispatch('created');
|
||||
trackEvent('submit_deployment_create');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
});
|
||||
} catch ({ message }) {
|
||||
error = message;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,9 +123,16 @@
|
||||
return index === 0;
|
||||
}
|
||||
}
|
||||
|
||||
$: if (!showCreate) {
|
||||
files = undefined;
|
||||
entrypoint = null;
|
||||
active = false;
|
||||
error = null;
|
||||
}
|
||||
</script>
|
||||
|
||||
<Modal size="big" bind:show={showCreate} on:submit={create}>
|
||||
<Modal {error} size="big" bind:show={showCreate} on:submit={create}>
|
||||
<svelte:fragment slot="header">Create Deployment</svelte:fragment>
|
||||
<Tabs>
|
||||
<Tab on:click={() => (mode = Mode.CLI)} selected={mode === Mode.CLI} event="deploy_cli">
|
||||
|
||||
Reference in New Issue
Block a user