Merge branch 'main' of github.com:appwrite/console into feat-downgrade-feedback-options

This commit is contained in:
Arman
2024-03-06 12:22:16 +01:00
4 changed files with 27 additions and 18 deletions
@@ -18,15 +18,18 @@
let name: string;
let showCustomId = false;
let error: string;
let disabled: boolean = false;
async function create() {
try {
disabled = true;
const project = await sdk.forConsole.projects.create(
id ?? ID.unique(),
name,
teamId,
'default'
);
show = false;
dispatch('created', project);
trackEvent(Submit.ProjectCreate, {
customId: !!id,
@@ -40,6 +43,7 @@
} catch (e) {
error = e.message;
trackError(e, Submit.ProjectCreate);
disabled = false;
}
}
</script>
@@ -61,6 +65,6 @@
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (show = false)}>Cancel</Button>
<Button submit>Create</Button>
<Button submit {disabled}>Create</Button>
</svelte:fragment>
</Modal>
@@ -58,9 +58,9 @@
</Button>
</div>
{:else}
<ul class="u-grid u-gap-8">
<ul class="u-grid u-gap-4">
{#each [...formValues[attribute.key].keys()] as index}
<li class="form-item is-multiple">
<li class="form-item is-multiple u-gap-8">
<div class="form-item-part u-stretch">
<Attribute
{attribute}
@@ -121,11 +121,7 @@
</Button>
</svelte:fragment>
</Alert>
<InputTextarea
label="Body"
placeholder={`{ "myKey": "myValue" }`}
id="body"
bind:value={body} />
<InputTextarea label="Body" placeholder={`Hello, World!`} id="body" bind:value={body} />
{:else}
<InputText label="Path" id="path" placeholder="/" bind:value={path} required />
@@ -214,7 +210,7 @@
<InputTextarea
label="Body"
placeholder={`{ "myKey": "myValue" }`}
placeholder={`Hello, World!`}
id="body"
bind:value={body} />
</FormList>
@@ -23,6 +23,7 @@
import { organization } from '$lib/stores/organization';
import { wizard } from '$lib/stores/wizard';
import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte';
import InputSelect from '$lib/elements/forms/inputSelect.svelte';
let enabled = false;
let senderName: string;
@@ -32,7 +33,13 @@
let port: number;
let username: string;
let password: string;
let secure = false;
let secure: string;
const options = [
{ value: 'tls', label: 'TLS' },
{ value: 'ssl', label: 'SSL' },
{ value: '', label: 'None' }
];
onMount(() => {
enabled = $project.smtpEnabled ?? false;
@@ -43,7 +50,7 @@
port = $project.smtpPort;
username = $project.smtpUsername;
password = $project.smtpPassword;
secure = $project.smtpSecure === 'tls';
secure = $project.smtpSecure === 'tls' ? 'tls' : $project.smtpSecure === 'ssl' ? 'ssl' : '';
});
async function updateSmtp() {
@@ -68,7 +75,7 @@
port ? port : undefined,
username ? username : undefined,
password ? password : undefined,
secure ? 'tls' : undefined
secure ? secure : undefined
);
invalidate(Dependencies.PROJECT);
@@ -97,7 +104,7 @@
port: $project.smtpPort,
username: $project.smtpUsername,
password: $project.smtpPassword,
secure: $project.smtpSecure === 'tls'
secure: $project.smtpSecure
}
);
@@ -109,7 +116,7 @@
port = undefined;
username = undefined;
password = undefined;
secure = false;
secure = undefined;
}
</script>
@@ -189,10 +196,12 @@
label="Password"
bind:value={password}
placeholder="Enter password" />
<InputChoice bind:value={secure} id="tls" label="TLS secure protocol">
Enable if TLS is supported on your SMTP server.
</InputChoice>
<InputSelect
id="tls"
label="Secure protocol"
placeholder="Select protocol"
bind:value={secure}
{options} />
{/if}
</FormList>
{/if}