Merge branch 'main' into revert-2491-revert-2477-copy-prompt

This commit is contained in:
Atharva Deosthale committed 2025-11-19 14:29:15 +05:30
commit 8a708cece4
19 files changed
+214 -55

No files matched your search

+1 -1
View File
@@ -22,7 +22,7 @@
},
"dependencies": {
"@ai-sdk/svelte": "^1.1.24",
"@appwrite.io/console": "https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2752",
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@315d6c5",
"@appwrite.io/pink-icons": "0.25.0",
"@appwrite.io/pink-icons-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@bd82d9a",
"@appwrite.io/pink-legacy": "^1.0.3",
+5 -5
View File
@@ -12,8 +12,8 @@ importers:
specifier: ^1.1.24
version: 1.1.24(svelte@5.25.3)(zod@3.24.3)
'@appwrite.io/console':
specifier: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2752
version: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2752
specifier: https://pkg.vc/-/@appwrite/@appwrite.io/console@315d6c5
version: https://pkg.vc/-/@appwrite/@appwrite.io/console@315d6c5
'@appwrite.io/pink-icons':
specifier: 0.25.0
version: 0.25.0
@@ -260,8 +260,8 @@ packages:
'@analytics/type-utils@0.6.2':
resolution: {integrity: sha512-TD+xbmsBLyYy/IxFimW/YL/9L2IEnM7/EoV9Aeh56U64Ify8o27HJcKjo38XY9Tcn0uOq1AX3thkKgvtWvwFQg==}
'@appwrite.io/console@https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2752':
resolution: {tarball: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2752}
'@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@315d6c5':
resolution: {tarball: https://pkg.vc/-/@appwrite/@appwrite.io/console@315d6c5}
version: 1.10.0
'@appwrite.io/pink-icons-svelte@2.0.0-RC.1':
@@ -3703,7 +3703,7 @@ snapshots:
'@analytics/type-utils@0.6.2': {}
'@appwrite.io/console@https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2752': {}
'@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@315d6c5': {}
'@appwrite.io/pink-icons-svelte@2.0.0-RC.1(svelte@5.25.3)':
dependencies:
+1
View File
@@ -360,6 +360,7 @@ export enum Submit {
BucketUpdateSize = 'submit_bucket_update_size',
BucketUpdateCompression = 'submit_bucket_update_compression',
BucketUpdateExtensions = 'submit_bucket_update_extensions',
BucketUpdateTransformations = 'submit_bucket_update_transformations',
FileCreate = 'submit_file_create',
FileDelete = 'submit_file_delete',
FileUpdatePermissions = 'submit_file_update_permissions',
+2 -1
View File
@@ -490,7 +490,7 @@ export class Billing {
name: string,
billingPlan: string,
paymentMethodId: string,
billingAddressId: string = null,
billingAddressId: string = undefined,
couponId: string = null,
invites: Array<string> = [],
budget: number = undefined,
@@ -628,6 +628,7 @@ export class Billing {
budget,
taxId
};
const uri = new URL(this.client.config.endpoint + path);
return await this.client.call(
'patch',
@@ -134,7 +134,7 @@
name,
billingPlan,
paymentMethodId,
null,
undefined,
couponData.code ? couponData.code : null,
collaborators,
billingBudget,
@@ -148,7 +148,7 @@
selectedOrg.$id,
billingPlan,
paymentMethodId,
null,
undefined,
couponData.code ? couponData.code : null,
collaborators
);
@@ -112,7 +112,6 @@
ID.unique(),
name,
BillingPlan.FREE,
null,
null
);
} else {
@@ -121,7 +120,7 @@
name,
selectedPlan,
paymentMethodId,
null,
undefined,
selectedCoupon?.code,
collaborators,
billingBudget,
@@ -25,7 +25,6 @@
ID.unique(),
organizationName,
BillingPlan.FREE,
null,
null
);
@@ -29,7 +29,6 @@ export const load: PageLoad = async ({ parent }) => {
ID.unique(),
'Personal projects',
BillingPlan.FREE,
null,
null
);
trackEvent(Submit.OrganizationCreate, {
@@ -173,8 +173,7 @@
await sdk.forConsole.billing.updatePlan(
data.organization.$id,
selectedPlan,
paymentMethodId,
null
paymentMethodId
);
// 2) If the target plan has a project limit, apply selected projects now
@@ -254,7 +253,7 @@
data.organization.$id,
selectedPlan,
paymentMethodId,
null,
undefined,
selectedCoupon?.code,
newCollaborators,
billingBudget,
@@ -107,7 +107,7 @@
try {
await sdk
.forProject(page.params.region, page.params.project)
.migrations.createCsvMigration({
.migrations.createCSVImport({
bucketId: file.bucketId,
fileId: file.$id,
resourceId: `${page.params.database}:${page.params.table}`,
@@ -11,7 +11,7 @@
import { Fieldset, Layout, Icon, Input, Tag } from '@appwrite.io/pink-svelte';
import { IconGithub, IconPencil } from '@appwrite.io/pink-icons-svelte';
import { onMount } from 'svelte';
import { ID, Runtime } from '@appwrite.io/console';
import { ID, Runtime, Type } from '@appwrite.io/console';
import { CustomId } from '$lib/components';
import { getIconFromRuntime } from '$lib/stores/runtimes';
import { regionalConsoleVariables } from '$routes/(console)/project-[region]-[project]/store';
@@ -134,7 +134,8 @@
repository: data.repository.name,
owner: data.repository.owner,
rootDirectory: rootDir || '.',
version: latestTag ?? '1.0.0',
type: Type.Tag,
reference: latestTag ?? '1.0.0',
activate: true
});
@@ -15,7 +15,7 @@
import { writable } from 'svelte/store';
import ProductionBranch from '$lib/components/git/productionBranchFieldset.svelte';
import Configuration from './configuration.svelte';
import { ID, Runtime, type Models } from '@appwrite.io/console';
import { ID, Runtime, Type, type Models } from '@appwrite.io/console';
import {
ConnectBehaviour,
NewRepository,
@@ -179,7 +179,8 @@
repository: data.template.providerRepositoryId || undefined,
owner: data.template.providerOwner || undefined,
rootDirectory: rt?.providerRootDirectory || undefined,
version: data.template.providerVersion || undefined,
type: Type.Tag,
reference: data.template.providerVersion || undefined,
activate: true
});
@@ -12,7 +12,7 @@
import { IconGithub, IconPencil } from '@appwrite.io/pink-icons-svelte';
import { onMount } from 'svelte';
import Domain from '../domain.svelte';
import { Adapter, BuildRuntime, Framework, ID } from '@appwrite.io/console';
import { Adapter, BuildRuntime, Framework, ID, Type } from '@appwrite.io/console';
import { CustomId } from '$lib/components';
import { getFrameworkIcon } from '$lib/stores/sites';
import { regionalConsoleVariables } from '$routes/(console)/project-[region]-[project]/store';
@@ -172,7 +172,8 @@
repository: data.repository.name,
owner: data.repository.owner,
rootDirectory: rootDir || '.',
version: latestTag ?? '1.0.0',
type: Type.Tag,
reference: latestTag ?? '1.0.0',
activate: true
});
@@ -24,7 +24,7 @@
import Details from '../../details.svelte';
import Configuration from './configuration.svelte';
import Aside from '../../aside.svelte';
import { Adapter, BuildRuntime, Framework, ID, type Models } from '@appwrite.io/console';
import { Adapter, BuildRuntime, Framework, ID, Type, type Models } from '@appwrite.io/console';
import {
ConnectBehaviour,
NewRepository,
@@ -159,7 +159,8 @@
repository: data.template.providerRepositoryId,
owner: data.template.providerOwner,
rootDirectory: framework.providerRootDirectory,
version: data.template.providerVersion,
type: Type.Tag,
reference: data.template.providerVersion,
activate: true
});
@@ -32,7 +32,8 @@
allowedFileExtensions: values.allowedFileExtensions,
compression: values.compression,
encryption: values.encryption,
antivirus: values.antivirus
antivirus: values.antivirus,
transformations: values.transformations
});
await invalidate(Dependencies.BUCKET);
@@ -101,7 +102,8 @@
$permissions: permissions,
encryption,
antivirus,
compression
compression,
transformations
} = data.bucket;
const compressionOptions = [
@@ -214,6 +216,18 @@
}
);
}
function updateTransformations() {
updateBucket(
data.bucket,
{
transformations
},
{
trackEventName: Submit.BucketUpdateTransformations
}
);
}
</script>
<Container>
@@ -365,6 +379,28 @@
</CardGrid>
</Form>
<Form onSubmit={updateTransformations}>
<CardGrid>
<svelte:fragment slot="title">Image transformations</svelte:fragment>
<svelte:fragment slot="aside">
<Selector.Switch
label="Image transformations"
id="transformations"
bind:checked={transformations}
description="Enabling this option allows image manipulation through the API, including resizing, cropping, and format conversion." />
</svelte:fragment>
<svelte:fragment slot="actions">
<Button
disabled={transformations === data.bucket.transformations ||
($readOnly && !GRACE_PERIOD_OVERRIDE)}
submit>
Update
</Button>
</svelte:fragment>
</CardGrid>
</Form>
<UpdateMaxFileSize currentPlan={data.currentPlan} bucket={data.bucket} />
<Form onSubmit={updateAllowedExtensions}>
+145 -25
View File
@@ -1,11 +1,17 @@
<script lang="ts">
import { Wizard } from '$lib/layout';
import { Icon, Layout, Tag, Typography, Button, Card } from '@appwrite.io/pink-svelte';
import { Icon, Input, Layout, Popover, Tag, Typography, Card } from '@appwrite.io/pink-svelte';
import { supportData, isSupportOnline } from './wizard/support/store';
import { onMount } from 'svelte';
import { onMount, onDestroy } from 'svelte';
import { sdk } from '$lib/stores/sdk';
import { Form, InputSelect, InputText, InputTextarea } from '$lib/elements/forms/index.js';
import {
Form,
InputSelect,
InputText,
InputTextarea,
Button
} from '$lib/elements/forms/index.js';
import { Query } from '@appwrite.io/console';
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
import {
localeTimezoneName,
@@ -18,29 +24,83 @@
import { user } from '$lib/stores/user';
import { wizard } from '$lib/stores/wizard';
import { VARS } from '$lib/system';
import { onDestroy } from 'svelte';
import { IconCheckCircle, IconXCircle } from '@appwrite.io/pink-icons-svelte';
import { IconCheckCircle, IconXCircle, IconInfo } from '@appwrite.io/pink-icons-svelte';
let projectOptions: Array<{ value: string; label: string }>;
let projectOptions = $state<Array<{ value: string; label: string }>>([]);
// Category options with display names
const categories = [
{ value: 'general', label: 'General' },
{ value: 'billing', label: 'Billing' },
{ value: 'technical', label: 'Technical' }
];
// Topic options based on category
const topicsByCategory = {
general: ['Security', 'Compliance', 'Performance'],
billing: ['Invoices', 'Plans'],
technical: [
'Auth',
'Databases',
'Storage',
'Functions',
'Realtime',
'Messaging',
'Migrations',
'Webhooks',
'SDKs',
'Console'
]
};
// Severity options
const severityOptions = [
{ value: 'critical', label: 'Critical' },
{ value: 'high', label: 'High' },
{ value: 'medium', label: 'Medium' },
{ value: 'low', label: 'Low' },
{ value: 'question', label: 'Question' }
];
onMount(async () => {
const projectList = await sdk.forConsole.projects.list();
// Filter projects by organization ID using server-side queries
const projectList = await sdk.forConsole.projects.list({
queries: $organization?.$id ? [Query.equal('teamId', $organization.$id)] : []
});
projectOptions = projectList.projects.map((project) => ({
value: project.$id,
label: project.name
}));
});
// Cleanup on component destroy
onDestroy(() => {
$supportData = {
message: null,
subject: null,
category: 'general',
category: 'technical',
topic: undefined,
severity: 'question',
file: null
};
});
// Update topic options when category changes
const topicOptions = $derived(
($supportData.category ? topicsByCategory[$supportData.category] || [] : []).map(
(topic) => ({
value: topic.toLowerCase(),
label: topic
})
)
);
async function handleSubmit() {
// Create category-topic tag
const categoryTopicTag = $supportData.topic
? `${$supportData.category}-${$supportData.topic}`.toLowerCase()
: $supportData.category.toLowerCase();
const response = await fetch(`${VARS.GROWTH_ENDPOINT}/support`, {
method: 'POST',
headers: {
@@ -51,13 +111,13 @@
subject: $supportData.subject,
firstName: ($user?.name || 'Unknown').slice(0, 40),
message: $supportData.message,
tags: ['cloud'],
tags: [categoryTopicTag],
customFields: [
{ id: '41612', value: $supportData.category },
{ id: '48493', value: $user?.name ?? '' },
{ id: '48492', value: $organization?.$id ?? '' },
{ id: '48491', value: $supportData?.project ?? '' },
{ id: '48490', value: $user?.$id ?? '' }
{ id: '56023', value: $supportData?.severity ?? '' },
{ id: '56024', value: $organization?.billingPlan ?? '' }
]
})
});
@@ -84,7 +144,9 @@
$supportData = {
message: null,
subject: null,
category: 'general',
category: 'technical',
topic: undefined,
severity: undefined,
file: null,
project: null
};
@@ -99,10 +161,43 @@
endDay: 'Friday' as WeekDay
};
$: supportTimings = `${utcHourToLocaleHour(workTimings.start)} - ${utcHourToLocaleHour(workTimings.end)} ${localeTimezoneName()}`;
$: supportWeekDays = `${utcWeekDayToLocaleWeekDay(workTimings.startDay, workTimings.start)} - ${utcWeekDayToLocaleWeekDay(workTimings.endDay, workTimings.end)}`;
const supportTimings = $derived(
`${utcHourToLocaleHour(workTimings.start)} - ${utcHourToLocaleHour(workTimings.end)} ${localeTimezoneName()}`
);
const supportWeekDays = $derived(
`${utcWeekDayToLocaleWeekDay(workTimings.startDay, workTimings.start)} - ${utcWeekDayToLocaleWeekDay(workTimings.endDay, workTimings.end)}`
);
</script>
{#snippet severityPopover()}
<Popover let:toggle>
<Button extraCompact size="s" on:click={toggle}>
<Icon size="s" icon={IconInfo} />
</Button>
<div slot="tooltip" style="max-width: 400px;">
<Layout.Stack gap="s">
<Typography.Text>
<b>Critical:</b> System is down or a critical component is non-functional, causing
a complete stoppage of work or significant business impact.
</Typography.Text>
<Typography.Text>
<b>High:</b> Major functionality is impaired, but a workaround is available, or a
critical component is significantly degraded.
</Typography.Text>
<Typography.Text>
<b>Medium:</b> Minor functionality is impaired without significant business impact.
</Typography.Text>
<Typography.Text>
<b>Low:</b> Issue has minor impact on business operations; workaround is not necessary.
</Typography.Text>
<Typography.Text>
<b>Question:</b> Requests for information, general guidance, or feature requests.
</Typography.Text>
</Layout.Stack>
</div>
</Popover>
{/snippet}
<Wizard title="Contact us" confirmExit={true}>
<Form onSubmit={handleSubmit}>
<Layout.Stack gap="xl">
@@ -113,24 +208,48 @@
</Layout.Stack>
<Layout.Stack gap="s">
<Typography.Text color="--fgcolor-neutral-secondary"
>Choose a topic</Typography.Text>
>Choose a category</Typography.Text>
<Layout.Stack gap="s" direction="row">
{#each ['general', 'billing', 'technical'] as category}
{#each categories as category}
<Tag
on:click={() => {
$supportData.category = category;
if ($supportData.category !== category.value) {
$supportData.topic = undefined;
}
$supportData.category = category.value;
}}
selected={$supportData.category === category}>{category}</Tag>
selected={$supportData.category === category.value}
>{category.label}</Tag>
{/each}
</Layout.Stack>
</Layout.Stack>
<InputSelect
required
{#if topicOptions.length > 0}
{#key $supportData.category}
<Input.ComboBox
id="topic"
label="Choose a topic"
placeholder="Select topic"
bind:value={$supportData.topic}
options={topicOptions} />
{/key}
{/if}
<Input.ComboBox
id="project"
label="Choose a project"
options={projectOptions ?? []}
bind:value={$supportData.project}
placeholder="Select project" />
<InputSelect
id="severity"
label="Severity"
options={severityOptions}
bind:value={$supportData.severity}
required
placeholder="Select severity">
<div slot="info">
{@render severityPopover()}
</div>
</InputSelect>
<InputText
id="subject"
label="Subject"
@@ -143,15 +262,16 @@
bind:value={$supportData.message}
placeholder="Type here..."
label="Tell us a bit more"
required
maxlength={4096} />
<Layout.Stack direction="row" justifyContent="flex-end" gap="s">
<Button.Button
<Button
size="s"
variant="secondary"
secondary
on:click={() => {
wizard.hide();
}}>Cancel</Button.Button>
<Button.Button size="s">Submit</Button.Button>
}}>Cancel</Button>
<Button submit size="s">Submit</Button>
</Layout.Stack>
</Layout.Stack>
</Form>
+4 -1
View File
@@ -4,6 +4,8 @@ export type SupportData = {
message: string;
subject: string;
category: string;
topic?: string;
severity?: string;
file?: File | null;
project?: string;
};
@@ -11,7 +13,8 @@ export type SupportData = {
export const supportData = writable<SupportData>({
message: '',
subject: '',
category: 'general',
category: 'technical',
severity: 'question',
file: null
});
@@ -78,7 +78,6 @@ export const load: PageLoad = async ({ parent, url }) => {
ID.unique(),
'Personal Projects',
BillingPlan.FREE,
null,
null
);
} else {
@@ -49,7 +49,6 @@ export const load = async ({ parent, url, params }) => {
ID.unique(),
'Personal project',
BillingPlan.FREE,
null,
null
);
}