diff --git a/src/lib/layout/wizardSecondaryHeader.svelte b/src/lib/layout/wizardSecondaryHeader.svelte
index bb74685db..048482de9 100644
--- a/src/lib/layout/wizardSecondaryHeader.svelte
+++ b/src/lib/layout/wizardSecondaryHeader.svelte
@@ -4,8 +4,18 @@
import { Button } from '$lib/elements/forms';
import { createEventDispatcher } from 'svelte';
- export let confirmExit = false;
- export let href = '';
+ type $$Props =
+ | {
+ confirmExit: boolean;
+ href?: string;
+ }
+ | {
+ confirmExit?: boolean;
+ href: string;
+ };
+
+ export let confirmExit: $$Props['confirmExit'] = false;
+ export let href: $$Props['href'] = '';
const dispatch = createEventDispatcher();
diff --git a/src/lib/stores/campaigns.ts b/src/lib/stores/campaigns.ts
index cc95cda59..6ffc9e0f1 100644
--- a/src/lib/stores/campaigns.ts
+++ b/src/lib/stores/campaigns.ts
@@ -1,30 +1,119 @@
//campaign welcome and startup
-type CampaignData = {
+export type CampaignData = {
title: string;
description: string;
+ template: 'card' | 'review';
+ data?: Record;
+ onlyNewOrgs?: boolean;
+ footer?: boolean;
};
export const campaigns: Map = new Map();
campaigns
.set('welcome', {
+ template: 'card',
title: "You've received $VALUE in credits",
description:
'Get $VALUE in credits when you upgrade or create an organization with a Pro plan.'
})
.set('startup', {
+ template: 'card',
title: 'Welcome to the Startups program!',
description:
"We're excited to have you on board. Add the coupon code to your Appwrite Pro account to join."
})
.set('RenderATL2024', {
+ template: 'card',
title: 'Claim your $100 RenderATL credits',
description:
'Get $100 in Cloud credits when you upgrade or create an organization with a Pro plan.'
})
.set('dealsfordevs', {
+ template: 'card',
title: 'Claim your $50 Deals For Devs credits',
description:
'Get $50 in Cloud credits when you upgrade or create an organization with a Pro plan.'
+ })
+ .set('WelcomeManual', {
+ template: 'card',
+ title: 'Here is your $VALUE welcome credit!',
+ description:
+ 'Upgrade to Appwrite Pro and add the credits to enjoy the full capabilities of Cloud.'
+ })
+ .set('InactiveAccounts', {
+ template: 'card',
+ title: 'Get everything out of Cloud. Claim your $VALUE credits.',
+ description:
+ 'Get $VALUE in Cloud credits when you upgrade or create an organization with a Pro plan.'
+ })
+ .set('StartupsProgram', {
+ template: 'review',
+ title: 'Welcome to the Startups program',
+ description:
+ "We're excited to have you on board. Add your credit code to your Appwrite Pro account to join.",
+ onlyNewOrgs: true,
+ data: {
+ cta: 'Get everything out of Cloud with Pro',
+ claimed: 'Your credits will be valid for 12 months.',
+ unclaimed: 'Apply your code to join the Startups program.',
+ 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.',
+ description:
+ 'Get $50 in Cloud credits when you upgrade or create an organization with a Pro plan',
+ data: {
+ reviews: [
+ {
+ name: 'Marius Bloki',
+ desc: 'CTO // mySHOEFITTER',
+ img: 'js_mastery_reviewer_1.png',
+ review: 'Appwrite has been a tremendous asset in implementing our IT infrastructure. Not only is the software an absolute game-changer, but the team is always there when you need them.'
+ }
+ ]
+ }
+ })
+ .set('FusionVC', {
+ template: 'review',
+ title: 'Welcome to Appwrite!',
+ description:
+ 'Upgrade to Appwrite Pro and add the credits to enjoy the full capabilities of Cloud. Provided to you by Fusion VC.',
+ footer: true,
+ data: {
+ 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('carbon', {
+ template: 'review',
+ title: 'Build your entire backend within minutes.',
+ description:
+ 'Get $50 in Cloud credits when you upgrade or create an organization with a Pro plan.',
+ data: {
+ 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.'
+ }
+ ]
+ }
});
diff --git a/src/lib/wizards/functions/connectExisting.svelte b/src/lib/wizards/functions/connectExisting.svelte
index 7d097f773..f28cc8555 100644
--- a/src/lib/wizards/functions/connectExisting.svelte
+++ b/src/lib/wizards/functions/connectExisting.svelte
@@ -31,6 +31,7 @@
$func.logging || undefined,
$func.entrypoint || undefined,
$func.commands || undefined,
+ $func.scopes || undefined,
$installation.$id,
$repository.id,
$choices.branch,
diff --git a/src/lib/wizards/functions/createGit.svelte b/src/lib/wizards/functions/createGit.svelte
index cf8a4b748..f6307df41 100644
--- a/src/lib/wizards/functions/createGit.svelte
+++ b/src/lib/wizards/functions/createGit.svelte
@@ -32,6 +32,7 @@
undefined,
$createFunction.entrypoint,
$createFunction.commands || undefined,
+ undefined,
$installation.$id,
$repository.id,
$choices.branch,
diff --git a/src/lib/wizards/functions/createTemplate.svelte b/src/lib/wizards/functions/createTemplate.svelte
index 7d0d4958f..11580051f 100644
--- a/src/lib/wizards/functions/createTemplate.svelte
+++ b/src/lib/wizards/functions/createTemplate.svelte
@@ -49,6 +49,7 @@
undefined,
runtimeDetail.entrypoint,
runtimeDetail.commands || undefined,
+ undefined,
$installation.$id,
$repository.id,
$choices.branch,
diff --git a/src/routes/console/apply-credit/+page.svelte b/src/routes/console/apply-credit/+page.svelte
index 5db19dea1..d1dd1ce47 100644
--- a/src/routes/console/apply-credit/+page.svelte
+++ b/src/routes/console/apply-credit/+page.svelte
@@ -67,10 +67,11 @@
let name: string;
let coupon: string;
let couponData = data?.couponData;
+ let campaign = campaigns.get(data?.couponData?.campaign ?? data?.campaign);
onMount(async () => {
await loadPaymentMethods();
- if (!$organizationList?.total) {
+ if (!$organizationList?.total || campaign?.onlyNewOrgs) {
selectedOrgId = newOrgId;
}
});
@@ -140,7 +141,8 @@
await sdk.forConsole.billing.updateTaxId(org.$id, taxId);
}
trackEvent(Submit.CreditRedeem, {
- coupon: couponData.code
+ coupon: couponData.code,
+ campaign: couponData?.campaign
});
await invalidate(Dependencies.ORGANIZATION);
await goto(`/console/organization-${org.$id}`);
@@ -182,7 +184,6 @@
$: isButtonDisabled =
checkButtonDisabled(selectedOrgId, name, paymentMethodId) ||
couponData?.status !== 'active';
- $: campaign = campaigns.get(data?.couponData?.campaign ?? data?.campaign);
function checkButtonDisabled(id: string | null, name: string | null, method: string | null) {
if (id === newOrgId) {
@@ -206,7 +207,7 @@
-
+
+
+
+
+
diff --git a/src/routes/console/project-[project]/functions/function-[function]/createManual.svelte b/src/routes/console/project-[project]/functions/function-[function]/createManual.svelte
index 91507d198..9e3d33160 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/createManual.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/createManual.svelte
@@ -11,10 +11,10 @@
export let show = false;
- let active = false;
+ let active = true;
let files: FileList;
- let entrypoint: string = null;
- let buildCommand: string = null;
+ let entrypoint: string = $func.entrypoint;
+ let buildCommand: string = $func.commands;
let error: string = null;
const functionId = $page.params.function;
@@ -31,7 +31,9 @@
);
await invalidate(Dependencies.DEPLOYMENTS);
files = undefined;
- active = false;
+ active = true;
+ entrypoint = $func.entrypoint;
+ buildCommand = $func.commands;
show = false;
dispatch('created');
trackEvent(Submit.DeploymentCreate);
@@ -43,7 +45,10 @@
$: if (!show) {
files = undefined;
- active = false;
+ active = true;
+ entrypoint = $func.entrypoint;
+ buildCommand = $func.commands;
+ show = false;
error = null;
}
@@ -71,13 +76,8 @@
allowedFileExtensions={['gz']}
bind:files
required={true} />
-
- {#if $func.version !== 'v3'}
+
+ {#if $func.version === 'v2'}
Build commands now available for functions v3.0
@@ -93,26 +93,35 @@
{:else}
- Build settings
+ Overwrite settings(optional)
+
- Overwrite your function configuration for a single deployment or save
- commands for future use.
+ Overwrite your function entrypoint or build commands for a single
+ deployment or save commands for future use.
+
+
+ This deployment will be activated after the build is completed.
+
{/if}
-
- This deployment will be activated after the build is completed.
-
diff --git a/src/routes/console/project-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte
index ccaacbe06..4e38f0fbf 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte
@@ -1,27 +1,33 @@
-
-