Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: open upgrade wizard with href #1089

Merged
merged 99 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
3cd5c51
tests: e2e journeys
TorstenDittmann Mar 21, 2024
ec9df15
ci: add e2e
TorstenDittmann Mar 21, 2024
f29ca52
chore: run formatter
TorstenDittmann Mar 21, 2024
637a1fc
fix: show the runtime in the selector when only one exists.
ItzNotABug Apr 6, 2024
568de6a
Merge branch 'main' into fix-1011-show-a-default-runtime-when-length-…
ItzNotABug Apr 11, 2024
cd3dd4d
test: add journeys
TorstenDittmann Apr 17, 2024
0e68346
fix: check
TorstenDittmann Apr 17, 2024
7d41722
chore: remove unnecessary console.log
TorstenDittmann Apr 17, 2024
f793c9a
test: fix env vars
TorstenDittmann Apr 17, 2024
e3aeae1
test: fix env vars
TorstenDittmann Apr 17, 2024
ce418df
test: increase timeout
TorstenDittmann Apr 17, 2024
d2cb7d9
test: add more browser tests
TorstenDittmann Apr 18, 2024
c26fc80
test: fix config
TorstenDittmann Apr 18, 2024
1e65229
test: add browser dependencies
TorstenDittmann Apr 18, 2024
ad52788
test: remove webkit
TorstenDittmann Apr 18, 2024
1bf5426
test: fix deps
TorstenDittmann Apr 18, 2024
b6d62b4
chore: run formatter
TorstenDittmann Apr 18, 2024
05e43fb
feat: add members usage page
ArmanNik Apr 23, 2024
9aa0f5a
feat: add empty state
ArmanNik Apr 23, 2024
aadaf36
feat: add tracking
ArmanNik Apr 23, 2024
3e7b145
refactor(auth): refactor OAuth2 providers
stnguyen90 Mar 5, 2024
0600725
feat(console): add account identities card
stnguyen90 Mar 5, 2024
4d2a0d8
Add AnyScale integration
PineappleIOnic May 2, 2024
78ae482
Merge branch 'main' of github.com:appwrite/console into redesign-plan…
ArmanNik May 2, 2024
55b7951
Merge branch 'main' of github.com:appwrite/console into feat-add-memb…
ArmanNik May 2, 2024
5c304a5
chore: move card
ArmanNik May 2, 2024
7a0321f
feat: new style
ArmanNik May 2, 2024
7b36c03
fix: tooltip
ArmanNik May 2, 2024
5c38d99
Update marketplace.ts
PineappleIOnic May 3, 2024
0030a2e
Update marketplace.ts
PineappleIOnic May 3, 2024
7899eeb
Merge branch 'main' into fix-1011-show-a-default-runtime-when-length-…
ItzNotABug May 3, 2024
a5b98b5
fix: show select runtime placeholder.
ItzNotABug May 3, 2024
75dc017
Merge branch 'main' of github.com:appwrite/console into redesign-plan…
ArmanNik May 8, 2024
1943520
fix: design review
ArmanNik May 8, 2024
d946785
Merge branch 'main' of github.com:appwrite/console into feat-add-memb…
ArmanNik May 8, 2024
0bfa3a5
fix: await
ArmanNik May 8, 2024
2d165d3
Update old colors variables to the new ones
elad2412 May 12, 2024
a004615
Add missing environment variable
PineappleIOnic May 13, 2024
1192398
Merge main
PineappleIOnic May 13, 2024
f0959b8
empty commit
ArmanNik May 13, 2024
d4cd8fe
Update colors
elad2412 May 15, 2024
7dacea3
Merge branch 'main' of https://github.com/appwrite/console into tests…
TorstenDittmann May 15, 2024
2458a49
fix: design review
ArmanNik May 15, 2024
d8c8027
bump: stripe
ArmanNik May 15, 2024
88d9689
fix: tests
TorstenDittmann May 15, 2024
09efb22
remove unused env vars
TorstenDittmann May 15, 2024
ebee856
report e2e tests
TorstenDittmann May 15, 2024
96e6f33
fix: gitignore
TorstenDittmann May 15, 2024
61325c7
ci: change e2e job name
TorstenDittmann May 15, 2024
5d5fc02
ci: improve e2e by only downloading chromium
TorstenDittmann May 15, 2024
79dc8c9
Merge pull request #1088 from appwrite/tests-e2e-journeys
TorstenDittmann May 15, 2024
66dad86
feat: add new wizard to buttons
ArmanNik May 15, 2024
760c15e
feat: centralize url
ArmanNik May 15, 2024
dba4bf5
chore: delete old wizard, small fixes
ArmanNik May 15, 2024
fbfab72
chore: finish removing old wizard
ArmanNik May 15, 2024
7cb6252
chore(dependencies): bump pink and pink-icons to 0.19.0
stnguyen90 May 15, 2024
2d2b23a
Merge pull request #1014 from ItzNotABug/fix-1011-show-a-default-runt…
stnguyen90 May 15, 2024
d75976d
Merge pull request #1083 from appwrite/tooltip-color-update-to-new
stnguyen90 May 15, 2024
bb48ad8
chore: enable python runtime, bump sdk
loks0n May 15, 2024
ed43352
Merge pull request #1077 from appwrite/chore-bump-pink
stnguyen90 May 15, 2024
da41df2
Merge pull request #921 from appwrite/feat-account-identities
stnguyen90 May 15, 2024
069a1c0
Merge branch 'main' of https://github.com/appwrite/console into chore…
loks0n May 15, 2024
d13070d
chore: remove pnpm
loks0n May 15, 2024
8698576
chore: npm i
loks0n May 15, 2024
8a1e51f
Merge pull request #1090 from appwrite/chore-enable-python-run
stnguyen90 May 15, 2024
ea25a87
Merge pull request #1064 from appwrite/feat-anyscale
christyjacob4 May 16, 2024
1460ebd
feat(auth): show notification when MFA is enabled/disabled
stnguyen90 May 6, 2024
fb01768
feat(auth): rename recovery codes file download to appwrite-backups.txt
stnguyen90 May 7, 2024
184f2ec
feat(auth): only show "Successfully logged in." if MFA not required
stnguyen90 May 8, 2024
3eb6607
fix(auth): fix event tracking on login
stnguyen90 May 11, 2024
95096ea
refactor(auth): move mfa challenge to its own component
stnguyen90 May 8, 2024
be527f8
feat(auth): hide MFA methods and recovery if MFA is disabled
stnguyen90 May 8, 2024
264ce68
feat(auth): only show MFA recovery codes after a factor is enabled
stnguyen90 May 9, 2024
3e7eb80
fix(elements): allow InputDigits to auto submit again
stnguyen90 May 11, 2024
fdb9795
fix(elements): fix InputDigits undefined element error
stnguyen90 May 11, 2024
ce1ffb6
feat(auth): allow using other methods to regenerate recovery codes
stnguyen90 May 11, 2024
72f1563
fix(auth): await auth to prevent console.variables() from throwing
stnguyen90 May 11, 2024
0b9172e
fix(auth): remove margins on account MFA text buttons on mobile
stnguyen90 May 13, 2024
0af1af4
Merge pull request #1082 from appwrite/fix-mfa-flow
stnguyen90 May 16, 2024
2cdf5df
Add processing to list of statuses in migrations
PineappleIOnic May 17, 2024
bbbeb41
Merge pull request #1048 from appwrite/feat-add-members-usage-page
ArmanNik May 17, 2024
89bdd19
Merge pull request #1091 from appwrite/fix-migrations-processing
stnguyen90 May 17, 2024
4369ba7
fix: set visibility boolean to is-not-desktop
FatumaA May 18, 2024
9674475
fix: add bold, remove if statement
ArmanNik May 21, 2024
a5abbad
fix: addons count and design issues
ArmanNik May 21, 2024
98f770b
Merge branch 'main' of github.com:appwrite/console into redesign-plan…
ArmanNik May 21, 2024
1d9bd6e
Merge branch 'refactor-org-creation' of github.com:appwrite/console i…
ArmanNik May 21, 2024
8874726
fix: ci context for e2e tests
TorstenDittmann May 21, 2024
dfaf46b
Merge pull request #1094 from appwrite/fix-ci-e2e-context
stnguyen90 May 21, 2024
11ea013
Merge pull request #1092 from FatumaA/fix-1008-some-navigation-items-…
stnguyen90 May 21, 2024
d751874
Merge pull request #1067 from appwrite/redesign-plan-summary-card
TorstenDittmann May 21, 2024
4f3ec5c
fix: design and bugs
ArmanNik May 22, 2024
021db90
refactor: alert buttons
ArmanNik May 22, 2024
241b9aa
Merge branch 'main' of github.com:appwrite/console into feat-e2e-new-…
ArmanNik May 22, 2024
ea5ccb8
fix: old upgrade wizard
ArmanNik May 22, 2024
04fe869
feat: upgrade e2e test for new flow
ArmanNik May 22, 2024
55f794d
Merge pull request #1096 from appwrite/refactor-alert-buttons
TorstenDittmann May 22, 2024
db5200e
Merge pull request #1095 from appwrite/fix-new-org-flows-design-bugs
TorstenDittmann May 22, 2024
f820242
Merge pull request #1097 from appwrite/feat-e2e-new-flows
TorstenDittmann May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@popperjs/core": "^2.11.8",
"@sentry/svelte": "^7.66.0",
"@sentry/tracing": "^7.66.0",
"@stripe/stripe-js": "^2.2.0",
"@stripe/stripe-js": "^3.4.0",
"ai": "^2.2.11",
"analytics": "^0.8.9",
"dayjs": "^1.11.9",
Expand Down
8 changes: 3 additions & 5 deletions src/lib/components/billing/alerts/limitReached.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import { BillingPlan } from '$lib/constants';
import { Button } from '$lib/elements/forms';
import { HeaderAlert } from '$lib/layout';
import { readOnly, tierToPlan } from '$lib/stores/billing';
import { readOnly, tierToPlan, upgradeURL } from '$lib/stores/billing';
import { organization } from '$lib/stores/organization';
import { wizard } from '$lib/stores/wizard';
import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte';
</script>

{#if $organization?.$id && $organization?.billingPlan === BillingPlan.STARTER && $readOnly && !$page.url.pathname.includes('/console/account')}
Expand All @@ -21,14 +19,14 @@
</svelte:fragment>
<svelte:fragment slot="buttons">
<Button
href={`${base}/console/organization-${$organization?.$id}/usage`}
href={`${base}/console/organization-${$organization.$id}/usage`}
text
fullWidthMobile>
<span class="text">View usage</span>
</Button>
<Button
href={$upgradeURL}
on:click={() => {
wizard.start(ChangeOrganizationTierCloud);
trackEvent('click_organization_upgrade', {
from: 'button',
source: 'limit_reached_banner'
Expand Down
7 changes: 2 additions & 5 deletions src/lib/components/cardPlanLimit.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
<script lang="ts">
import { Button } from '$lib/elements/forms';
import { wizard } from '$lib/stores/wizard';
import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte';
import { upgradeURL } from '$lib/stores/billing';

export let service: string;
</script>

<article class="card u-grid u-cross-center u-width-full-line">
<div class="u-flex u-flex-vertical u-gap-24 u-main-center u-cross-center">
<p class="text u-text-center">Upgrade your plan to add more {service}</p>
<Button secondary on:click={() => wizard.start(ChangeOrganizationTierCloud)}>
Change plan
</Button>
<Button secondary href={$upgradeURL}>Change plan</Button>
</div>
</article>
5 changes: 2 additions & 3 deletions src/lib/components/support.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import { isCloud } from '$lib/system';
import { organization } from '$lib/stores/organization';
import { BillingPlan } from '$lib/constants';
import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte';
import { trackEvent } from '$lib/actions/analytics';
import { localeTimezoneName, utcHourToLocaleHour } from '$lib/helpers/date';
import { upgradeURL } from '$lib/stores/billing';

export let show = false;

Expand All @@ -33,9 +33,8 @@
{#if $organization?.billingPlan === BillingPlan.STARTER}
<Button
fullWidth
external
href={$upgradeURL}
on:click={() => {
wizard.start(ChangeOrganizationTierCloud);
trackEvent('click_organization_upgrade', {
from: 'button',
source: 'support_menu'
Expand Down
11 changes: 6 additions & 5 deletions src/lib/elements/table/body.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { getServiceLimit, type PlanServices } from '$lib/stores/billing';
import { wizard } from '$lib/stores/wizard';
import { getServiceLimit, upgradeURL, type PlanServices } from '$lib/stores/billing';
import { isCloud } from '$lib/system';
import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte';
import { Button } from '../forms';

let tableBody: HTMLDivElement;
Expand All @@ -16,8 +15,10 @@
let columns = 0;

const limit = getServiceLimit(service) || Infinity;

// TODO: refactor this to be a string
const upgradeMethod = () => {
wizard.start(ChangeOrganizationTierCloud);
goto($upgradeURL);
TorstenDittmann marked this conversation as resolved.
Show resolved Hide resolved
};

$: limitReached = limit !== 0 && limit < Infinity && total >= limit;
Expand All @@ -38,7 +39,7 @@
<span class="text">Upgrade your plan to add {name} to your organization</span>
<Button
secondary
on:click={upgradeMethod}
href={$upgradeURL}
on:click={() =>
trackEvent('click_organization_upgrade', {
from: 'button',
Expand Down
14 changes: 8 additions & 6 deletions src/lib/layout/containerHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
readOnly,
showUsageRatesModal,
tierToPlan,
upgradeURL,
type PlanServices
} from '$lib/stores/billing';
import { organization } from '$lib/stores/organization';
import { wizard } from '$lib/stores/wizard';
import { GRACE_PERIOD_OVERRIDE, isCloud } from '$lib/system';
import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte';
import { createEventDispatcher, onMount } from 'svelte';
import { ContainerButton } from '.';
import { trackEvent } from '$lib/actions/analytics';
import { goto } from '$app/navigation';

export let isFlex = true;
export let title: string;
Expand Down Expand Up @@ -53,9 +53,11 @@
];

const limit = getServiceLimit(serviceId) || Infinity;

//TODO: refactor this to be a string
const upgradeMethod = () => {
showDropdown = false;
wizard.start(ChangeOrganizationTierCloud);
goto($upgradeURL);
};
const dispatch = createEventDispatcher();

Expand Down Expand Up @@ -100,7 +102,7 @@
<span class="text">
You've reached the {services} limit for the {tier} plan. <Button
link
on:click={upgradeMethod}
href={$upgradeURL}
on:click={() =>
trackEvent('click_organization_upgrade', {
from: 'button',
Expand Down Expand Up @@ -135,7 +137,7 @@
{title.toLocaleLowerCase()} per project on the {tier} plan.
{#if $organization?.billingPlan === BillingPlan.STARTER}<Button
link
on:click={upgradeMethod}
href={$upgradeURL}
on:click={() =>
trackEvent('click_organization_upgrade', {
from: 'button',
Expand All @@ -157,7 +159,7 @@
You are limited to {limit}
{title.toLocaleLowerCase()} per organization on the {tier} plan.
{#if $organization?.billingPlan === BillingPlan.STARTER}
<Button link on:click={upgradeMethod}>Upgrade</Button>
<Button link href={$upgradeURL}>Upgrade</Button>
for additional {title.toLocaleLowerCase()}.
{/if}
</p>
Expand Down
5 changes: 2 additions & 3 deletions src/lib/layout/header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
import { slide } from 'svelte/transition';
import { sdk } from '$lib/stores/sdk';
import { isCloud } from '$lib/system';
import { wizard } from '$lib/stores/wizard';
import { Feedback } from '$lib/components/feedback';
import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte';
import { BillingPlan } from '$lib/constants';
import { upgradeURL } from '$lib/stores/billing';

let showDropdown = false;
let showSupport = false;
Expand Down Expand Up @@ -106,8 +105,8 @@
{#if isCloud && $organization?.billingPlan === BillingPlan.STARTER && !$page.url.pathname.startsWith('/console/account')}
<Button
disabled={$organization?.markedForDeletion}
href={$upgradeURL}
on:click={() => {
wizard.start(ChangeOrganizationTierCloud);
trackEvent('click_organization_upgrade', {
from: 'button',
source: 'top_nav'
Expand Down
12 changes: 3 additions & 9 deletions src/lib/layout/logs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
import { beforeNavigate } from '$app/navigation';
import { Pill } from '$lib/elements';
import { isCloud } from '$lib/system';
import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte';
import { wizard } from '$lib/stores/wizard';
import { getServiceLimit, tierToPlan } from '$lib/stores/billing';
import { getServiceLimit, tierToPlan, upgradeURL } from '$lib/stores/billing';
import { organization } from '$lib/stores/organization';
import { app } from '$lib/stores/app';
import { Button } from '$lib/elements/forms';
Expand Down Expand Up @@ -313,12 +311,8 @@
Logs are retained in rolling {hoursToDays(limit)} intervals
with the {tier} plan.
{#if $organization.billingPlan === BillingPlan.STARTER}
<Button
link
on:click={() =>
wizard.start(ChangeOrganizationTierCloud)}
>Upgrade</Button> to increase your log retention
for a longer period.
<Button link href={$upgradeURL}>Upgrade</Button> to increase
your log retention for a longer period.
{/if}
</Alert>
{/if}
Expand Down
8 changes: 3 additions & 5 deletions src/lib/layout/navigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import { BillingPlan } from '$lib/constants';
import { isMac } from '$lib/helpers/platform';
import { slide } from '$lib/helpers/transition';
import { upgradeURL } from '$lib/stores/billing';
import { organization } from '$lib/stores/organization';
import { wizard } from '$lib/stores/wizard';
import { isCloud } from '$lib/system';
import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte';
import Create from '$routes/console/feedbackWizard.svelte';
import { showSupportModal } from '$routes/console/wizard/support/store';

Expand Down Expand Up @@ -200,11 +200,9 @@
<ul class="drop-list is-only-mobile">
{#if isCloud && $organization?.billingPlan !== BillingPlan.SCALE}
<li class="drop-list-item">
<button
class="drop-button"
on:click={() => wizard.start(ChangeOrganizationTierCloud)}>
<a class="drop-button" href={$upgradeURL}>
<span class="text">Upgrade</span>
</button>
</a>
</li>
{/if}
<li class="drop-list-item">
Expand Down
9 changes: 6 additions & 3 deletions src/lib/stores/billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import { BillingPlan } from '$lib/constants';
import PaymentMandate from '$lib/components/billing/alerts/paymentMandate.svelte';
import MissingPaymentMethod from '$lib/components/billing/alerts/missingPaymentMethod.svelte';
import LimitReached from '$lib/components/billing/alerts/limitReached.svelte';
import { wizard } from './wizard';
import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte';
import { trackEvent } from '$lib/actions/analytics';

export type Tier = 'tier-0' | 'tier-1' | 'tier-2';
Expand Down Expand Up @@ -239,7 +237,7 @@ export async function checkForUsageLimit(org: Organization) {
{
name: 'Upgrade plan',
method: () => {
wizard.start(ChangeOrganizationTierCloud);
goto(`${base}/console/organization-${org.$id}/change-plan`);
trackEvent('click_organization_upgrade', {
from: 'button',
source: 'limit_reached_notification'
Expand Down Expand Up @@ -364,3 +362,8 @@ export async function checkForMissingPaymentMethod() {
});
}
}

export const upgradeURL = derived(
page,
($page) => `${base}/console/organization-${$page.data?.organization?.$id}/change-plan`
);
Loading
Loading