Merge branch '1.6.x' of github.com:appwrite/console into fix-desing-1.6

This commit is contained in:
Arman committed 2024-08-14 15:15:00 +02:00
commit 192d8da0a9
19 files changed
+743 -748

No files matched your search

+15 -15
View File
@@ -25,9 +25,9 @@
"@popperjs/core": "^2.11.8",
"@stripe/stripe-js": "^3.5.0",
"ai": "^2.2.37",
"analytics": "^0.8.13",
"analytics": "^0.8.14",
"cron-parser": "^4.9.0",
"dayjs": "^1.11.11",
"dayjs": "^1.11.12",
"deep-equal": "^2.2.3",
"echarts": "^5.5.1",
"envfile": "^7.1.0",
@@ -41,37 +41,37 @@
"devDependencies": {
"@melt-ui/pp": "^0.3.2",
"@melt-ui/svelte": "^0.83.0",
"@playwright/test": "^1.45.2",
"@sveltejs/adapter-static": "^3.0.2",
"@sveltejs/kit": "^2.5.18",
"@playwright/test": "^1.46.0",
"@sveltejs/adapter-static": "^3.0.4",
"@sveltejs/kit": "^2.5.22",
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"@testing-library/dom": "^10.3.2",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/svelte": "^5.2.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/svelte": "^5.2.1",
"@testing-library/user-event": "^14.5.2",
"@types/deep-equal": "^1.0.4",
"@types/prismjs": "^1.26.4",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vitest/ui": "^1.6.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.42.0",
"eslint-plugin-svelte": "^2.43.0",
"jsdom": "^22.1.0",
"kleur": "^4.1.5",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.6",
"sass": "^1.77.8",
"svelte": "^4.2.18",
"svelte-check": "^3.8.4",
"svelte-check": "^3.8.5",
"svelte-jester": "^2.3.2",
"svelte-preprocess": "^6.0.2",
"svelte-sequential-preprocessor": "^2.0.1",
"tslib": "^2.6.3",
"typescript": "^5.5.3",
"vite": "^5.3.4",
"typescript": "^5.5.4",
"vite": "^5.4.0",
"vitest": "^1.6.0"
},
"type": "module",
"packageManager": "pnpm@9.5.0+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
"packageManager": "pnpm@9.7.0+sha512.dc09430156b427f5ecfc79888899e1c39d2d690f004be70e05230b72cb173d96839587545d09429b55ac3c429c801b4dc3c0e002f653830a420fa2dd4e3cf9cf"
}
+609 -630
View File
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -319,5 +319,6 @@ export enum Submit {
MessagingTopicUpdateName = 'submit_messaging_topic_update_name',
MessagingTopicUpdatePermissions = 'submit_messaging_topic_update_permissions',
MessagingTopicSubscriberAdd = 'submit_messaging_topic_subscriber_add',
MessagingTopicSubscriberDelete = 'submit_messaging_topic_subscriber_delete'
MessagingTopicSubscriberDelete = 'submit_messaging_topic_subscriber_delete',
ApplyQuickFilter = 'submit_apply_quick_filter'
}
@@ -16,7 +16,7 @@
}
</script>
{#if $paymentMissingMandate && $paymentMissingMandate.country === 'in' && $paymentMissingMandate.mandateId === null && !hideBillingHeaderRoutes.includes($page.url.pathname)}
{#if $paymentMissingMandate && $paymentMissingMandate?.country?.toLowerCase() === 'in' && $paymentMissingMandate.mandateId === null && !hideBillingHeaderRoutes.includes($page.url.pathname)}
<HeaderAlert title="Authorization required" type="info">
The payment method for {$organization.name} needs to be verified.
<svelte:fragment slot="buttons">
@@ -44,7 +44,7 @@
</script>
{#if filteredMethods?.length}
{#if selectedPaymentMethod?.country === 'in'}
{#if selectedPaymentMethod?.country?.toLowerCase() === 'in'}
<Alert type="warning">
<svelte:fragment slot="title">Indian credit or debit card-holders</svelte:fragment>
To comply with RBI regulations in India, Appwrite will ask for verification to charge up
+3 -1
View File
@@ -12,6 +12,7 @@
export let external = false;
export let href: string = null;
export let event: string = null;
export let eventData: Record<string, unknown> = {};
export let style = '';
let classes = '';
export { classes as class };
@@ -22,7 +23,8 @@
}
trackEvent(`click_${event}`, {
from: 'tag'
from: 'tag',
...eventData
});
}
</script>
+2 -2
View File
@@ -7,10 +7,10 @@
export let title: string;
export let tooltipContent =
$organization.billingPlan === BillingPlan.FREE
$organization?.billingPlan === BillingPlan.FREE
? `Upgrade to add more ${title.toLocaleLowerCase()}`
: `You've reached the ${title.toLocaleLowerCase()} limit for the ${
tierToPlan($organization.billingPlan).name
tierToPlan($organization?.billingPlan)?.name
} plan`;
export let disabled: boolean;
export let buttonText: string;
+1 -1
View File
@@ -362,7 +362,7 @@ export async function checkForMandate(org: Organization) {
const paymentId = org.paymentMethodId ?? org.backupPaymentMethodId;
if (!paymentId) return;
const paymentMethod = await sdk.forConsole.billing.getPaymentMethod(paymentId);
if (paymentMethod.mandateId === null && paymentMethod.country === 'in') {
if (paymentMethod?.mandateId === null && paymentMethod?.country.toLowerCase() === 'in') {
headerAlert.add({
id: 'paymentMandate',
component: PaymentMandate,
+20
View File
@@ -68,6 +68,26 @@ campaigns
]
}
})
.set('Free100', {
template: 'review',
title: 'Get started with $100 credits',
description:
'Get $100 in Cloud credits when you upgrade or create an organization with a Pro plan.',
onlyNewOrgs: true,
data: {
cta: 'Get everything out of Cloud with Pro',
claimed: 'Your credits will be valid for 3 months.',
unclaimed: 'Apply your code to join Appwrite Pro.',
reviews: [
{
name: 'David Foster',
img: '1.jpeg',
desc: 'Managing director',
review: 'We really loved working with Appwrite for launching our bootstrapped "Open Mind" App. It was saving us a lot of money in comparison to Firebase since the amount of users grew quite fast and we needed a quick switch.'
}
]
}
})
.set('JSMastery', {
template: 'review',
title: 'Claim your JavaScript Mastery $50 credits.',
+26 -51
View File
@@ -24,7 +24,7 @@
<script lang="ts">
import { base } from '$app/paths';
import { AvatarGroup, Box, CardGrid, Heading } from '$lib/components';
import { AvatarGroup, Box, Heading } from '$lib/components';
import { app } from '$lib/stores/app';
import { wizard } from '$lib/stores/wizard';
import { repository, templateConfig, template as templateStore } from './store';
@@ -61,55 +61,7 @@
<WizardCover>
<svelte:fragment slot="title">Create Function</svelte:fragment>
<div class="wizard-container container">
{#if isSelfHosted && !isVcsEnabled}
<div class="u-flex-vertical u-text-center">
<Heading tag="h5" size="5">Choose your source</Heading>
<p>
Connect your function to a Git repository or use a template to get started. You
can also create a function manually.
</p>
</div>
<CardGrid>
<Heading tag="h6" size="6">Create manually</Heading>
<p class="text">Create and deploy your function manually.</p>
<svelte:fragment slot="aside">
<div class="u-flex u-height-100-percent u-main-end u-cross-center">
<Button
secondary
on:click={() => {
trackEvent('click_create_function_manual', {
from: 'cover'
});
}}
on:click={() => wizard.start(CreateManual)}>Create function</Button>
</div>
</svelte:fragment>
</CardGrid>
{/if}
<div
class="git-container u-position-relative"
class:u-margin-block-start-24={isSelfHosted && !isVcsEnabled}>
{#if isSelfHosted && !isVcsEnabled}
<div
class="overlay u-flex-vertical u-position-absolute u-height-100-percent u-width-full-line u-z-index-1 card u-text-center">
<div
class="u-flex-vertical u-height-100-percent u-main-center u-cross-center u-gap-16">
<Heading size="7" tag="h6">
Configure your self-hosted instance to connect to Git
</Heading>
<p>
Connect your function to a Git repository or use a pre-made template<br />after
configuring your self-hosted instance. Learn more in our
<a
href="https://appwrite.io/docs/advanced/self-hosting/functions#git"
target="_blank"
rel="noopener noreferrer"
class="link">documentation</a
>.
</p>
</div>
</div>
{/if}
<div class="git-container u-position-relative">
<div class="grid-1-1 u-gap-24">
<div class="card u-cross-child-start u-height-100-percent">
<Heading size="6" tag="h6">Connect Git repository</Heading>
@@ -127,7 +79,30 @@
}}
on:connect={connect} />
</div>
{#if isSelfHosted && isVcsEnabled}
<div
class="overlay u-flex-vertical u-position-absolute u-height-100-percent u-width-full-line u-z-index-1 u-text-center u-inset-0"
style="border-radius: var(--border-radius-medium)">
<div
class="u-flex-vertical u-height-100-percent u-main-center u-cross-center u-gap-16 u-padding-inline-24">
<Heading size="7" tag="h6" trimmed={false}>
Connect your self-hosted instance to Git
</Heading>
<p>
Configure your self-hosted instance to connect your function to
a Git repository.
<a
href="https://appwrite.io/docs/advanced/self-hosting/functions#git"
target="_blank"
rel="noopener noreferrer"
class="link">Learn more</a
>.
</p>
</div>
</div>
{/if}
</div>
<div class="card u-height-100-percent">
<section class="common-section">
<Heading size="6" tag="h6">Quick start</Heading>
@@ -291,7 +266,7 @@
background: linear-gradient(
0,
hsl(var(--p-card-bg-color)) 68.91%,
hsl(var(--p-card-bg-color) / 0.5) 95.8%
hsl(var(--p-card-bg-color) / 0.5) 92.8%
);
}
</style>
@@ -2,8 +2,18 @@
import { LabelCard } from '$lib/components';
import { FormList } from '$lib/elements/forms';
import { WizardStep } from '$lib/layout';
import { consoleVariables } from '$routes/(console)/store';
import { onMount } from 'svelte';
import { templateConfig, templateStepsComponents } from '../store';
const isVcsEnabled = $consoleVariables?._APP_VCS_ENABLED === true;
onMount(() => {
if (!isVcsEnabled) {
$templateConfig.repositoryBehaviour = 'manual';
}
});
async function beforeSubmit() {
if (!$templateConfig.repositoryBehaviour) {
throw new Error('Please select repository behaviour.');
@@ -30,14 +40,19 @@
<h3>Automatic with Git <span class="inline-code">Recommended</span></h3>
<FormList gap={16} class="u-margin-block-start-8">
<LabelCard name="behaviour" value="new" bind:group={$templateConfig.repositoryBehaviour}>
<LabelCard
name="behaviour"
value="new"
bind:group={$templateConfig.repositoryBehaviour}
disabled={!isVcsEnabled}>
<svelte:fragment slot="title">Create a new repository</svelte:fragment>
Clone the template to a newly created repository in your organization.
</LabelCard>
<LabelCard
name="behaviour"
value="existing"
bind:group={$templateConfig.repositoryBehaviour}>
bind:group={$templateConfig.repositoryBehaviour}
disabled={!isVcsEnabled}>
<svelte:fragment slot="title">Add to existing repository</svelte:fragment>
Clone the template to an existing repository in your organization.
</LabelCard>
@@ -125,7 +125,7 @@
{/if}
</TableCell>
<TableCellText title="due">
{formatCurrency(invoice.amount)}
{formatCurrency(invoice.grossAmount)}
</TableCellText>
<TableCell showOverflow right>
<DropList
@@ -19,6 +19,7 @@
import { paymentMethods } from '$lib/stores/billing';
import { onMount } from 'svelte';
import { getApiEndpoint, sdk } from '$lib/stores/sdk';
import { formatCurrency } from '$lib/helpers/numbers';
export let show = false;
export let invoice: Invoice;
@@ -121,9 +122,9 @@
title="Retry payment">
<!-- TODO: format currency -->
<p class="text">
Your payment of <span class="inline-tag">${invoice.amount}</span> due on {toLocaleDate(
invoice.dueAt
)} has failed. Retry your payment to avoid service interruptions with your projects.
Your payment of <span class="inline-tag">${formatCurrency(invoice.grossAmount)}</span> due
on {toLocaleDate(invoice.dueAt)} has failed. Retry your payment to avoid service interruptions
with your projects.
</p>
<Button
@@ -104,10 +104,7 @@
<svelte:fragment slot="subtitle">(optional)</svelte:fragment>
<FormList gap={16}>
<p class="text">
Overwrite your function entrypoint or build commands for a single
deployment or save commands for future use.
</p>
<p class="text">Overwrite your function entrypoint or build commands.</p>
<InputText
label="Entrypoint"
id="entrypoint"
@@ -1,5 +1,6 @@
<script lang="ts">
import { afterNavigate } from '$app/navigation';
import { Submit, trackEvent } from '$lib/actions/analytics';
import { DropList, DropListItem } from '$lib/components';
import {
addFilter,
@@ -163,6 +164,11 @@
}
}
queries.apply();
trackEvent(Submit.ApplyQuickFilter, {
source: 'function_executions',
column: colId,
value: value || arrayValues.join(', ')
});
}
function addStatusCodeFilter(value: string, colId: string) {
@@ -179,7 +185,11 @@
{#each [statusFilter, triggerFilter, methodFilter] as filter}
<DropList bind:show={filter.show} noArrow class="u-margin-block-start-16">
<Pill button on:click={() => (filter.show = !filter.show)}>
<Pill
button
on:click={() => (filter.show = !filter.show)}
event="apply_quick_filter"
eventData={{ source: 'function_execution', column: filter.title }}>
{#key filter.tag}
<span use:tagFormat>
{filter?.tag ?? filter.title}
@@ -226,7 +236,11 @@
{/each}
{#each [statusCodeFilter, createdAtFilter] as filter}
<DropList bind:show={filter.show} noArrow class="u-margin-block-start-16">
<Pill button on:click={() => (filter.show = !filter.show)}>
<Pill
button
on:click={() => (filter.show = !filter.show)}
event="apply_quick_filter"
eventData={{ source: 'function_execution', column: filter.title }}>
{#key filter.tag}
<span use:tagFormat>
{filter?.tag ?? filter.title}
@@ -1,5 +1,6 @@
<script lang="ts">
import { afterNavigate } from '$app/navigation';
import { Submit, trackEvent } from '$lib/actions/analytics';
import { DropList, DropListItem } from '$lib/components';
import {
addFilter,
@@ -162,6 +163,11 @@
}
}
queries.apply();
trackEvent(Submit.ApplyQuickFilter, {
source: 'function_deployments',
column: colId,
value: value || arrayValues.join(', ')
});
}
function addSizeFilter(value: string, colId: string) {
@@ -177,7 +183,11 @@
{#each [typeFilter] as filter}
<DropList bind:show={filter.show} noArrow class="u-margin-block-start-16">
<Pill button on:click={() => (filter.show = !filter.show)}>
<Pill
button
on:click={() => (filter.show = !filter.show)}
event="apply_quick_filter"
eventData={{ source: 'function_deployments', column: filter.title }}>
{#key filter.tag}
<span use:tagFormat>
{filter?.tag ?? filter.title}
@@ -224,7 +234,11 @@
{/each}
{#each [sizeFilter] as filter}
<DropList bind:show={filter.show} noArrow class="u-margin-block-start-16">
<Pill button on:click={() => (filter.show = !filter.show)}>
<Pill
button
on:click={() => (filter.show = !filter.show)}
event="apply_quick_filter"
eventData={{ source: 'function_deployments', column: filter.title }}>
{#key filter.tag}
<span use:tagFormat>
{filter?.tag ?? filter.title}
@@ -1,26 +1,20 @@
<script lang="ts">
import { Alert, Card, Collapsible, Heading } from '$lib/components';
import { Card, Collapsible, Heading } from '$lib/components';
import { Pill } from '$lib/elements';
import { Button } from '$lib/elements/forms';
import { Container, ContainerButton } from '$lib/layout';
import { isSelfHosted } from '$lib/system';
import { isCloud } from '$lib/system';
import AppwriteLogoDark from '$lib/images/appwrite-logo-dark.svg';
import AppwriteLogoLight from '$lib/images/appwrite-logo-light.svg';
import { connectTemplate } from '$lib/wizards/functions/cover.svelte';
import { consoleVariables } from '$routes/(console)/store';
import { template } from './store';
import { app } from '$lib/stores/app';
import { isServiceLimited } from '$lib/stores/billing';
import { organization } from '$lib/stores/organization';
import { functionsList } from '../../store';
const isVcsEnabled = $consoleVariables?._APP_VCS_ENABLED === true;
$: buttonDisabled = isServiceLimited(
'functions',
$organization?.billingPlan,
$functionsList?.total
);
$: buttonDisabled =
isCloud && isServiceLimited('functions', $organization?.billingPlan, $functionsList?.total);
</script>
<Container>
@@ -74,23 +68,7 @@
</span>
</Heading>
<p class="u-margin-block-start-24">{$template.tagline}</p>
{#if isSelfHosted && !isVcsEnabled}
<Alert class="u-margin-block-start-24" type="info">
<svelte:fragment slot="title">
Cloning templates to a self-hosted instance
</svelte:fragment>
In order to clone a template to a locally hosted Appwrite project, you must set
up a Git integration and configure your environment variables.
<svelte:fragment slot="buttons">
<Button
href="https://appwrite.io/docs/advanced/self-hosting/functions"
external
text>
Learn more
</Button>
</svelte:fragment>
</Alert>
{/if}
<div class="u-flex u-gap-16 u-main-end u-margin-block-start-24 u-flex-wrap">
<Button
text
@@ -101,7 +79,7 @@
</Button>
<ContainerButton
title="functions"
disabled={buttonDisabled || (isSelfHosted && !isVcsEnabled)}
disabled={buttonDisabled}
buttonMethod={() => connectTemplate($template)}
showIcon={false}
buttonText="Create function"
@@ -2,7 +2,6 @@
import Modal from '$lib/components/modal.svelte';
import Button from '$lib/elements/forms/button.svelte';
import { sdk } from '$lib/stores/sdk';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
export let showGitInstall: boolean;
@@ -15,7 +14,7 @@
target.searchParams.set('success', redirect.toString());
target.searchParams.set('failure', redirect.toString());
target.searchParams.set('mode', 'admin');
goto(target);
return target;
}
</script>
@@ -23,7 +22,7 @@
<p>Select a provider to import an existing git repositories.</p>
<div class="u-flex u-cross-center u-flex-vertical u-gap-16">
<Button on:click={connectGitHub} fullWidth secondary>
<Button href={connectGitHub().toString()} fullWidth secondary>
<span class="icon-github" aria-hidden="true" />
<span class="text">GitHub</span>
</Button>
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB