mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge remote-tracking branch 'origin/main' into fix-add-payment-method
This commit is contained in:
@@ -14,7 +14,7 @@ export async function enterCreditCard(page: Page) {
|
||||
state: 'visible'
|
||||
});
|
||||
await page.getByPlaceholder('cardholder').fill('Test User');
|
||||
const stripe = page.frameLocator('[title="Secure payment input frame"]');
|
||||
const stripe = page.locator('[title="Secure payment input frame"]').nth(0).contentFrame();
|
||||
await stripe.locator('id=Field-numberInput').fill('4242424242424242');
|
||||
await stripe.locator('id=Field-expiryInput').fill('1250');
|
||||
await stripe.locator('id=Field-cvcInput').fill('123');
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ai-sdk/svelte": "^1.1.24",
|
||||
"@appwrite.io/console": "https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2289",
|
||||
"@appwrite.io/console": "^1.10.0",
|
||||
"@appwrite.io/pink-icons": "0.25.0",
|
||||
"@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1",
|
||||
"@appwrite.io/pink-legacy": "^1.0.3",
|
||||
|
||||
Generated
+5
-6
@@ -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@2289
|
||||
version: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2289
|
||||
specifier: ^1.10.0
|
||||
version: 1.10.0
|
||||
'@appwrite.io/pink-icons':
|
||||
specifier: 0.25.0
|
||||
version: 0.25.0
|
||||
@@ -257,9 +257,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@2289':
|
||||
resolution: {tarball: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2289}
|
||||
version: 1.9.0
|
||||
'@appwrite.io/console@1.10.0':
|
||||
resolution: {integrity: sha512-7ErAZgS0djmB41ZFXPTlJH5kBNvJeKv2UHOEcI6uAOyXO4UoVWlhQk0D/3oktNylwOsr/K/98EWfsUDeYbq68w==}
|
||||
|
||||
'@appwrite.io/pink-icons-svelte@2.0.0-RC.1':
|
||||
resolution: {integrity: sha512-iLFlV55hj8mGuAbmxJGenxN5RaZMmVT4GJb9dv/MP1xBAtYibFq7JvBcxm18qV2KU8c31Rntf+Ub4GL7HwqTYg==}
|
||||
@@ -3646,7 +3645,7 @@ snapshots:
|
||||
|
||||
'@analytics/type-utils@0.6.2': {}
|
||||
|
||||
'@appwrite.io/console@https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2289': {}
|
||||
'@appwrite.io/console@1.10.0': {}
|
||||
|
||||
'@appwrite.io/pink-icons-svelte@2.0.0-RC.1(svelte@5.25.3)':
|
||||
dependencies:
|
||||
|
||||
@@ -85,7 +85,11 @@
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<form on:submit|preventDefault={addFilterAndReset}>
|
||||
<form
|
||||
onsubmit={(e) => {
|
||||
e.preventDefault();
|
||||
addFilterAndReset();
|
||||
}}>
|
||||
<Layout.Stack gap="s" direction="row" alignItems="flex-start">
|
||||
<InputSelect
|
||||
id="column"
|
||||
|
||||
@@ -8,27 +8,30 @@ import { page } from '$app/state';
|
||||
import { user } from '$lib/stores/user';
|
||||
import deepEqual from 'deep-equal';
|
||||
|
||||
type Preferences = {
|
||||
type ConsolePreferences = {
|
||||
limit?: number;
|
||||
view?: View;
|
||||
columns?: string[];
|
||||
};
|
||||
} /* support a strict + flexible preference type for TS compatibility */ & Record<
|
||||
string,
|
||||
string | number | boolean | object | null | unknown
|
||||
>;
|
||||
|
||||
type TeamPreferences = {
|
||||
names?: string[];
|
||||
};
|
||||
|
||||
type PreferencesStore = {
|
||||
[key: string]: Preferences;
|
||||
type ConsolePreferencesStore = {
|
||||
[key: string]: ConsolePreferences;
|
||||
collections?: {
|
||||
[key: string]: Preferences['columns'];
|
||||
[key: string]: ConsolePreferences['columns'];
|
||||
};
|
||||
displayNames?: {
|
||||
[key: string]: TeamPreferences['names'];
|
||||
};
|
||||
} & { hideAiDisclaimer?: boolean };
|
||||
|
||||
async function updateConsolePreferences(store: PreferencesStore): Promise<void> {
|
||||
async function updateConsolePreferences(store: ConsolePreferencesStore): Promise<void> {
|
||||
const currentPreferences = get(user)?.prefs ?? (await sdk.forConsole.account.getPrefs());
|
||||
if (!currentPreferences?.console || Array.isArray(currentPreferences.console)) {
|
||||
currentPreferences.console = {};
|
||||
@@ -43,8 +46,8 @@ async function updateConsolePreferences(store: PreferencesStore): Promise<void>
|
||||
}
|
||||
|
||||
function createPreferences() {
|
||||
const { subscribe, set, update } = writable<PreferencesStore>({});
|
||||
let preferences: PreferencesStore = {};
|
||||
const { subscribe, set, update } = writable<ConsolePreferencesStore>({});
|
||||
let preferences: ConsolePreferencesStore = {};
|
||||
|
||||
if (browser) {
|
||||
// fresh fetch.
|
||||
@@ -73,9 +76,9 @@ function createPreferences() {
|
||||
/**
|
||||
* Update the local store and then synchronizes them on user prefs.
|
||||
*/
|
||||
function updateAndSync(callback: (prefs: PreferencesStore) => void): Promise<void> {
|
||||
let oldPrefsSnapshot: PreferencesStore;
|
||||
let newPrefsSnapshot: PreferencesStore;
|
||||
function updateAndSync(callback: (prefs: ConsolePreferencesStore) => void): Promise<void> {
|
||||
let oldPrefsSnapshot: ConsolePreferencesStore;
|
||||
let newPrefsSnapshot: ConsolePreferencesStore;
|
||||
|
||||
update((currentPrefs) => {
|
||||
oldPrefsSnapshot = structuredClone(currentPrefs);
|
||||
@@ -96,7 +99,7 @@ function createPreferences() {
|
||||
subscribe,
|
||||
set,
|
||||
update,
|
||||
get: (route?: Page['route']): Preferences => {
|
||||
get: (route?: Page['route']): ConsolePreferences => {
|
||||
const parsedRoute = route ?? page.route;
|
||||
return (
|
||||
preferences?.[parsedRoute.id] ?? {
|
||||
@@ -106,10 +109,10 @@ function createPreferences() {
|
||||
}
|
||||
);
|
||||
},
|
||||
getCustomCollectionColumns: (collectionId: string): Preferences['columns'] => {
|
||||
getCustomCollectionColumns: (collectionId: string): ConsolePreferences['columns'] => {
|
||||
return preferences?.collections?.[collectionId] ?? [];
|
||||
},
|
||||
setLimit: (limit: Preferences['limit']) =>
|
||||
setLimit: (limit: ConsolePreferences['limit']) =>
|
||||
updateAndSync((n) => {
|
||||
const path = page.route.id;
|
||||
|
||||
@@ -122,7 +125,7 @@ function createPreferences() {
|
||||
|
||||
return n;
|
||||
}),
|
||||
setView: (view: Preferences['view']) =>
|
||||
setView: (view: ConsolePreferences['view']) =>
|
||||
updateAndSync((n) => {
|
||||
const path = page.route.id;
|
||||
|
||||
@@ -135,7 +138,7 @@ function createPreferences() {
|
||||
|
||||
return n;
|
||||
}),
|
||||
setColumns: (columns: Preferences['columns']) =>
|
||||
setColumns: (columns: ConsolePreferences['columns']) =>
|
||||
updateAndSync((n) => {
|
||||
const path = page.route.id;
|
||||
|
||||
@@ -148,7 +151,10 @@ function createPreferences() {
|
||||
|
||||
return n;
|
||||
}),
|
||||
setCustomCollectionColumns: (collectionId: string, columns: Preferences['columns']) =>
|
||||
setCustomCollectionColumns: (
|
||||
collectionId: string,
|
||||
columns: ConsolePreferences['columns']
|
||||
) =>
|
||||
updateAndSync((n) => {
|
||||
if (!n?.collections?.[collectionId]) {
|
||||
n ??= {};
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@
|
||||
group: 'databases',
|
||||
icon: IconPlus,
|
||||
rank: page.url.pathname.endsWith('backups') ? 10 : 0,
|
||||
disabled: !isCloud || !$currentPlan.backupsEnabled
|
||||
disabled: !isCloud || !$currentPlan?.backupsEnabled
|
||||
},
|
||||
{
|
||||
label: 'Create manual backup',
|
||||
@@ -77,7 +77,7 @@
|
||||
group: 'databases',
|
||||
icon: IconPlus,
|
||||
rank: page.url.pathname.endsWith('backups') ? 10 : 0,
|
||||
disabled: !isCloud || !$currentPlan.backupsEnabled
|
||||
disabled: !isCloud || !$currentPlan?.backupsEnabled
|
||||
},
|
||||
{
|
||||
label: 'Go to collections',
|
||||
|
||||
+8
-6
@@ -13,7 +13,7 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { collection } from '../../store';
|
||||
import { page } from '$app/stores';
|
||||
import { page } from '$app/state';
|
||||
import { Alert } from '@appwrite.io/pink-svelte';
|
||||
|
||||
let showDelete = false;
|
||||
@@ -23,13 +23,15 @@
|
||||
|
||||
async function updatePermissions() {
|
||||
try {
|
||||
const { $databaseId, $collectionId, $id: documentId } = $doc;
|
||||
|
||||
await sdk
|
||||
.forProject($page.params.region, $page.params.project)
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.databases.updateDocument(
|
||||
$doc.$databaseId,
|
||||
$doc.$collectionId,
|
||||
$doc.$id,
|
||||
$doc.data,
|
||||
$databaseId,
|
||||
$collectionId,
|
||||
documentId,
|
||||
undefined,
|
||||
permissions
|
||||
);
|
||||
await invalidate(Dependencies.DOCUMENT);
|
||||
|
||||
+11
-3
@@ -56,9 +56,17 @@
|
||||
await goto(routeBase);
|
||||
await invalidate(Dependencies.DOMAINS);
|
||||
} else {
|
||||
await goto(
|
||||
`${routeBase}/add-domain/verify-${domainName}?rule=${rule.$id}&domain=${domain.$id}`
|
||||
);
|
||||
let redirect = `${routeBase}/add-domain/verify-${domainName}?rule=${rule.$id}`;
|
||||
|
||||
if (isCloud) {
|
||||
/**
|
||||
* Domains are only on cloud!
|
||||
* Self-hosted instances have rules.
|
||||
*/
|
||||
redirect += `&domain=${domain.$id}`;
|
||||
}
|
||||
|
||||
await goto(redirect);
|
||||
await invalidate(Dependencies.DOMAINS);
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import type { Column } from '$lib/helpers/types';
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export const columns = writable<Column[]>([
|
||||
{
|
||||
id: 'domain',
|
||||
title: 'Domain',
|
||||
type: 'string',
|
||||
format: 'string',
|
||||
width: { min: 200, max: 550 }
|
||||
},
|
||||
|
||||
{
|
||||
id: 'redirectUrl',
|
||||
title: 'Redirect to',
|
||||
type: 'string',
|
||||
width: { min: 120, max: 400 }
|
||||
},
|
||||
{
|
||||
id: 'deploymentVcsProviderBranch',
|
||||
title: 'Production branch',
|
||||
type: 'string',
|
||||
width: { min: 90, max: 220 }
|
||||
}
|
||||
]);
|
||||
@@ -15,7 +15,6 @@
|
||||
} from '@appwrite.io/pink-svelte';
|
||||
import DeleteDomainModal from './deleteDomainModal.svelte';
|
||||
import RetryDomainModal from './retryDomainModal.svelte';
|
||||
import { columns } from './store';
|
||||
import { regionalProtocol } from '../../store';
|
||||
|
||||
let {
|
||||
@@ -27,11 +26,21 @@
|
||||
let showDelete = $state(false);
|
||||
let showRetry = $state(false);
|
||||
let selectedDomain: Models.ProxyRule = $state(null);
|
||||
|
||||
const columns = [
|
||||
{
|
||||
id: 'domain',
|
||||
title: 'Domain',
|
||||
type: 'string',
|
||||
format: 'string',
|
||||
width: { min: 200, max: 550 }
|
||||
}
|
||||
];
|
||||
</script>
|
||||
|
||||
<Table.Root columns={[...$columns, { id: 'actions', width: 40 }]} let:root>
|
||||
<Table.Root columns={[...columns, { id: 'actions', width: 40 }]} let:root>
|
||||
<svelte:fragment slot="header" let:root>
|
||||
{#each $columns as { id, title }}
|
||||
{#each columns as { id, title }}
|
||||
<Table.Header.Cell column={id} {root}>
|
||||
{title}
|
||||
</Table.Header.Cell>
|
||||
@@ -40,7 +49,7 @@
|
||||
</svelte:fragment>
|
||||
{#each domains.rules as domain}
|
||||
<Table.Row.Base {root}>
|
||||
{#each $columns as column}
|
||||
{#each columns as column}
|
||||
<Table.Cell column={column.id} {root}>
|
||||
{#if column.id === 'domain'}
|
||||
<Layout.Stack direction="row" gap="xs">
|
||||
|
||||
Reference in New Issue
Block a user