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: billing #316

Merged
merged 473 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 241 commits
Commits
Show all changes
473 commits
Select commit Hold shift + click to select a range
0ed7372
Merge branch 'main' of github.com:appwrite/console into billing
ArmanNik Nov 9, 2023
337df50
fix: update card
ArmanNik Nov 13, 2023
96b3da7
feat: organization usage, stipe payment confimation
ArmanNik Nov 13, 2023
a5eb16e
fix: typos and update Stripe API call in
ArmanNik Nov 13, 2023
4738f59
fix: UI and functionality issues, downgrade flow WIP
ArmanNik Nov 14, 2023
3834dfc
feat: downgrade flow
ArmanNik Nov 14, 2023
c3a74ed
feat: support, fix qa
ArmanNik Nov 15, 2023
b3b9e63
Merge branch 'main' of github.com:appwrite/console into billing
ArmanNik Nov 15, 2023
c0ae6d1
fix: limit dropdown, update log retention messages
ArmanNik Nov 15, 2023
3963f26
fix organization tier upgrade logic
ArmanNik Nov 15, 2023
fceb3fa
feat: add billing to creation wizard
ArmanNik Nov 16, 2023
a294551
Merge branch 'main' of github.com:appwrite/console into billing
ArmanNik Nov 16, 2023
9e52ca1
fix: address details
ArmanNik Nov 16, 2023
d30ed9f
fix: design review
ArmanNik Nov 17, 2023
8199aea
fix: region cards
ArmanNik Nov 17, 2023
0c9e721
fix: deletion error
ArmanNik Nov 17, 2023
fb41c91
feat: read only mode
ArmanNik Nov 17, 2023
9d1c3d0
fix: excess copy
ArmanNik Nov 17, 2023
2b77ab5
fix: usage page WIP
ArmanNik Nov 20, 2023
e288200
feat: usage page fixes, implement date range picker, disable scale plan
ArmanNik Nov 20, 2023
007f4cb
fix: small fixes
ArmanNik Nov 21, 2023
336c083
Merge branch 'main' of github.com:appwrite/console into billing
ArmanNik Nov 21, 2023
77a4d69
fix: merge
ArmanNik Nov 21, 2023
e17be08
fix: QA
ArmanNik Nov 21, 2023
5afb3f9
fix: lots of QA fixes
ArmanNik Nov 21, 2023
05bf76a
fix: methods
ArmanNik Nov 22, 2023
f43e249
fix: error loading page
ArmanNik Nov 22, 2023
726d165
fix: address and invalidation
ArmanNik Nov 22, 2023
d24d6ae
fix: replace card and small refactor
ArmanNik Nov 22, 2023
e8bba14
fix: QA issues and some last minute changes
ArmanNik Nov 22, 2023
6804376
fix: readonly, org creation/update
ArmanNik Nov 23, 2023
7bd20f2
feat: confimation payment stripe
ArmanNik Nov 24, 2023
6cc245c
fix: feedback
ArmanNik Nov 24, 2023
f2754be
fix: QA and errors
ArmanNik Nov 24, 2023
1c13749
feat: add credits to upgrade flow
ArmanNik Nov 24, 2023
b7a50ec
feat: save notifications into user prefs
ArmanNik Nov 24, 2023
2dd404c
feat: new billing address flow during creation and upgrade
ArmanNik Nov 24, 2023
fc137fe
fix: QA issues
ArmanNik Nov 24, 2023
762bcbc
fix: usage
TorstenDittmann Nov 27, 2023
c2e08f2
Merge branch 'billing' of https://github.com/appwrite/console into fi…
TorstenDittmann Nov 27, 2023
29b0809
fix: date string
TorstenDittmann Nov 27, 2023
3452f3b
fix: delete flow, upgrade flow, QA
ArmanNik Nov 27, 2023
7dad70c
fix: tier for billing usage
TorstenDittmann Nov 28, 2023
72abe7b
Merge branches 'billing' and 'main' of github.com:appwrite/console in…
ArmanNik Nov 28, 2023
33737e2
Merge branch 'main' of github.com:appwrite/console into billing
ArmanNik Nov 30, 2023
b87a72b
Merge branch 'billing' of github.com:appwrite/console into fix-billin…
ArmanNik Nov 30, 2023
979b9a0
Merge pull request #629 from appwrite/fix-billing-usage
ArmanNik Nov 30, 2023
3b6dd23
Merge branch 'billing' of github.com:appwrite/console into billing
ArmanNik Nov 30, 2023
7478397
fix: invite button
ArmanNik Nov 30, 2023
0dcb475
feat: add notice to create org modal
christyjacob4 Nov 29, 2023
7ee2935
fix: review comments
christyjacob4 Nov 30, 2023
ab9ef73
Merge pull request #634 from appwrite/add-billing-note
christyjacob4 Nov 30, 2023
a76b5d5
feat: new credit flow
ArmanNik Dec 1, 2023
fe16ac2
feat: pre release modal
ArmanNik Dec 1, 2023
bd1e089
feat: credit wizard and some refactor
ArmanNik Dec 1, 2023
0f3871a
fix: functions create
TorstenDittmann Dec 4, 2023
50d4e47
revert: unused import
TorstenDittmann Dec 4, 2023
7a673d6
fix: cloud
TorstenDittmann Dec 4, 2023
0b8e66f
Merge pull request #637 from appwrite/chore-prerelease-modal
christyjacob4 Dec 4, 2023
97fe8c5
chore: add console logs
ArmanNik Dec 4, 2023
8bd7c27
feat: refactor coupons
ArmanNik Dec 4, 2023
0b8e3e7
fix: budget alerts
ArmanNik Dec 4, 2023
97c2ffe
feat: credits wizard
ArmanNik Dec 4, 2023
720a68a
feat: credits remove console log
ArmanNik Dec 4, 2023
155c545
feat: add credit modal
ArmanNik Dec 4, 2023
be7af56
chore: remove logs
ArmanNik Dec 4, 2023
95b8884
fix: tax id, add feedback project
ArmanNik Dec 4, 2023
cd96fca
Merge tag '3.2.12' of https://github.com/appwrite/console into 3.2.x
christyjacob4 Dec 5, 2023
9cf0ebc
more logs, copy, credit fix, trial days fix
ArmanNik Dec 5, 2023
474943f
fix: call
ArmanNik Dec 5, 2023
c03c00a
fix godammit
ArmanNik Dec 5, 2023
36fceca
logs, credits
ArmanNik Dec 5, 2023
54e2a1a
fix: wizards refactor, credits
ArmanNik Dec 5, 2023
2117c2d
fix: plan summary
ArmanNik Dec 5, 2023
e86ddc7
Fix some copy for mistakes + focus on organization vs. developer
Dec 5, 2023
8c062af
fix: dropdown arrow bg
ArmanNik Dec 5, 2023
387ba94
fix: overview media background
TorstenDittmann Dec 5, 2023
11244b1
chore: update packages
TorstenDittmann Dec 5, 2023
e4c0bb3
Merge branch 'dev-1.4.x' of github.com:appwrite/console into billing
ArmanNik Dec 5, 2023
5d9ab6e
fix: alert cap
ArmanNik Dec 5, 2023
c152162
fix: project count for delete modal
ArmanNik Dec 6, 2023
b4436d1
Login page
elad2412 Dec 6, 2023
ca6cc46
feat: refactor invoice
ArmanNik Dec 6, 2023
5db1e2f
fix: add type to header alert
ArmanNik Dec 6, 2023
dfeeb8f
Login page
elad2412 Dec 6, 2023
1f9bf4e
Login page
elad2412 Dec 6, 2023
68b9fa5
fix: address wizard step
ArmanNik Dec 6, 2023
a0fcc37
feat: downgrade banner
ArmanNik Dec 6, 2023
71a24c9
Merge pull request #644 from appwrite/billing-copy
heyCarla Dec 6, 2023
1056a27
fix: stuff
ArmanNik Dec 6, 2023
3a65123
Merge branch 'billing' of github.com:appwrite/console into billing
ArmanNik Dec 6, 2023
2b105cb
fix: credit reload
ArmanNik Dec 6, 2023
224d51e
fix: organization last step text
ArmanNik Dec 6, 2023
e557594
chore: clean up
ArmanNik Dec 6, 2023
852e6ef
fix: notification downgrade
ArmanNik Dec 6, 2023
b45f1a8
fix: trial
ArmanNik Dec 7, 2023
edfb1eb
Login page
elad2412 Dec 7, 2023
e31fde7
Login page
elad2412 Dec 7, 2023
1c74b88
fix: requires authentication tag
ArmanNik Dec 7, 2023
72612cd
Login page
elad2412 Dec 7, 2023
7a81474
Login page
elad2412 Dec 7, 2023
b0ee333
Login page
elad2412 Dec 7, 2023
d1df661
link
ArmanNik Dec 7, 2023
ddf61e2
Fix copy for usage page for org
Dec 7, 2023
8428c2d
fix: QA
ArmanNik Dec 7, 2023
7fca855
Merge branch 'billing' into billing-copy
Dec 7, 2023
d41e4d6
Add missing doc links for going over plan
Dec 7, 2023
567f84c
Merge branch 'billing' into login-new-pro
ArmanNik Dec 7, 2023
73750d0
fix: deletion
ArmanNik Dec 7, 2023
797a8f6
fix: header alerts
ArmanNik Dec 7, 2023
871e192
Merge pull request #645 from appwrite/login-new-pro
ArmanNik Dec 7, 2023
01b8292
Not your projects, your organization's projects
Dec 7, 2023
e31cd54
Change more cases of your project to this project
Dec 7, 2023
d221a2c
fix: payment auth
ArmanNik Dec 7, 2023
94abde2
fix: invoices total
ArmanNik Dec 7, 2023
750a12c
fix: disable upgrade button when marked for deletion
ArmanNik Dec 7, 2023
f21757c
fix: disable button when marked for deletion
ArmanNik Dec 7, 2023
05b417a
fix: patching issue where orgs could be submitted twice
ArmanNik Dec 8, 2023
ecb024d
feat: add too many free org header alert, fix redirection url when or…
ArmanNik Dec 8, 2023
d345c23
fix: usd
ArmanNik Dec 8, 2023
15b15b3
Merge branch 'main' of https://github.com/appwrite/console into billing
TorstenDittmann Dec 8, 2023
1bdd98e
chore: update packages
TorstenDittmann Dec 8, 2023
8a48ccb
remove mandatory zip
ArmanNik Dec 8, 2023
bac9730
fix: call
ArmanNik Dec 8, 2023
71ae43f
fix :support
ArmanNik Dec 8, 2023
3fc939f
fix: copy fix
ArmanNik Dec 8, 2023
cba7770
Fix sign in separator colors
Meldiron Dec 8, 2023
4fc77e8
fix: remove
ArmanNik Dec 8, 2023
0d429d3
Merge branch 'billing' of github.com:appwrite/console into billing
ArmanNik Dec 8, 2023
9da84b7
fix: copy
ArmanNik Dec 8, 2023
b15aec8
Fix double modal
Meldiron Dec 8, 2023
7f32890
Remove flag from project list
Meldiron Dec 8, 2023
f3f9345
fix: function creation button is created
ArmanNik Dec 8, 2023
492ce30
Merge branch 'billing' of github.com:appwrite/console into billing
ArmanNik Dec 8, 2023
a28cde7
Update label for changeTierSteps to 'Plans'
ArmanNik Dec 8, 2023
d19a920
fix: copy
ArmanNik Dec 8, 2023
3c46adb
fix: support images
ArmanNik Dec 8, 2023
8c27566
feat: country is slected automatically
ArmanNik Dec 9, 2023
2d1981d
fix: use lenght instead of total for condition checks
ArmanNik Dec 9, 2023
c9c89ee
fix: addresses can't be removed, only replaced
ArmanNik Dec 9, 2023
dcb7602
feat: add pill warning to addresses linked
ArmanNik Dec 9, 2023
5158af2
feat: deletion modal now doesn't allow deletion when linked to orgs
ArmanNik Dec 9, 2023
2d63142
fix: redirection link
ArmanNik Dec 9, 2023
a9b1a80
fix: remove the tag aroung regions
ArmanNik Dec 9, 2023
875a763
fix: apply new addresses
ArmanNik Dec 9, 2023
c747c44
fix: org usage
TorstenDittmann Dec 9, 2023
11cc02c
fix: leftovers
TorstenDittmann Dec 9, 2023
696cd7b
fix: unpushed changes
TorstenDittmann Dec 9, 2023
5c411b8
Merge pull request #648 from appwrite/fix-org-usage
ArmanNik Dec 9, 2023
246af14
feat: add loader to stripe and fixed height
ArmanNik Dec 9, 2023
c063b42
fix: copy
ArmanNik Dec 9, 2023
5f3241f
feat: add support iframe, fix width
ArmanNik Dec 9, 2023
6a33967
feat: add status
ArmanNik Dec 10, 2023
19b841f
fix: functions
ArmanNik Dec 10, 2023
46c60f9
fix: footer and homepage
ArmanNik Dec 10, 2023
6f6a631
fix: small issues
ArmanNik Dec 10, 2023
df330ce
fix: account preferences being overwritten, region notification, add …
ArmanNik Dec 10, 2023
411de81
fix: wizard last step disable
ArmanNik Dec 10, 2023
0c55833
feat: add upgrade button in usage
ArmanNik Dec 10, 2023
7fbb53c
fix: read only and disable custom smtp
ArmanNik Dec 10, 2023
cc7576f
fix: disable button
ArmanNik Dec 10, 2023
615fe7c
fix: block assistan user and team creation on readOnly
ArmanNik Dec 10, 2023
07c883d
fix: remove trial tag from free tier, copy
ArmanNik Dec 11, 2023
878f57c
feat: button can be a link now
ArmanNik Dec 11, 2023
a6cce4e
reafacton: container header
ArmanNik Dec 11, 2023
e0c54a8
fix: container header
ArmanNik Dec 11, 2023
1c10206
fix: support messaging
ArmanNik Dec 11, 2023
c04895e
refactor: layout billing functions
ArmanNik Dec 11, 2023
003211d
fix: racing conditions
ArmanNik Dec 11, 2023
f85660c
feat: if failed invoice older that 30 day activate readonly
ArmanNik Dec 11, 2023
b1fa5a1
fix: alert messages, modals
ArmanNik Dec 11, 2023
4f1a66d
Merge pull request #646 from appwrite/billing-copy
ArmanNik Dec 11, 2023
5b745f7
fix: merge issues
ArmanNik Dec 11, 2023
0a2f805
chore: formatter
ArmanNik Dec 11, 2023
fd2eceb
fix: excess modal
ArmanNik Dec 11, 2023
049e1fe
chore:remove console log
ArmanNik Dec 11, 2023
8ea65a6
fix: ligth mode for support service online
ArmanNik Dec 11, 2023
fc12f4e
fix: copy
ArmanNik Dec 11, 2023
be8b6c1
feat: project usage
TorstenDittmann Dec 11, 2023
1ef7dd1
fix: post release modal
ArmanNik Dec 11, 2023
c229ce6
fix: charts split line number
TorstenDittmann Dec 11, 2023
87fb484
Merge branch 'billing' of https://github.com/appwrite/console into bi…
TorstenDittmann Dec 11, 2023
6b0d20d
fix: typo
TorstenDittmann Dec 11, 2023
1ac0910
chore: remove unnecessary charts config
TorstenDittmann Dec 11, 2023
acc5803
fix: copy
ArmanNik Dec 11, 2023
f8277b7
fix: condition
ArmanNik Dec 11, 2023
23333ca
Merge branch 'billing' of github.com:appwrite/console into billing
ArmanNik Dec 11, 2023
b09c75e
fix: condition
TorstenDittmann Dec 11, 2023
16d652f
fix: post release modal
ArmanNik Dec 11, 2023
fe759d0
refactor: abstract functions
ArmanNik Dec 11, 2023
c7962b7
fix: confirmation method
ArmanNik Dec 11, 2023
0959e88
fix: alignment
ArmanNik Dec 12, 2023
973d99e
fix: buckets alert
ArmanNik Dec 12, 2023
6948485
Merge branch 'billing' of github.com:appwrite/console into refactor/c…
ArmanNik Dec 12, 2023
ce48638
fix: some stuff after merge
ArmanNik Dec 12, 2023
9ec2f21
Merge pull request #313 from appwrite/refactor/create-file-wizard
ArmanNik Dec 12, 2023
bd9b4d6
fix: reviews
ArmanNik Dec 12, 2023
3b51de0
chore: remove comments
ArmanNik Dec 12, 2023
dfae532
fix:upgrade flow
ArmanNik Dec 12, 2023
bf8c88c
feat: show max size alert on wizard
ArmanNik Dec 12, 2023
5253890
fix: usage
ArmanNik Dec 12, 2023
1b4e505
fix: fake modal
ArmanNik Dec 12, 2023
34f42b9
fix: service workers
ArmanNik Dec 12, 2023
8f3ce45
add data private
ArmanNik Dec 12, 2023
92b274c
chore: add pro message
ArmanNik Dec 12, 2023
d72f1df
fix: usage rates pagez
ArmanNik Dec 12, 2023
054089b
fix: copy
ArmanNik Dec 12, 2023
11c5e52
fix: footer line?
ArmanNik Dec 12, 2023
4ba4e90
fix: platform header
ArmanNik Dec 12, 2023
a74a517
chore: remove imports
ArmanNik Dec 12, 2023
f234956
feat: add redirection
ArmanNik Dec 12, 2023
c19919a
feat: open modal on search param set
ArmanNik Dec 12, 2023
b38e645
feat: hoodie WIP
ArmanNik Dec 12, 2023
8250530
fix: usage
TorstenDittmann Dec 13, 2023
a3f6638
Merge branch 'billing' of https://github.com/appwrite/console into bi…
TorstenDittmann Dec 13, 2023
8291bf3
fix: svelte check errors
ArmanNik Dec 13, 2023
a734bee
feat: hoodie cover wizard
ArmanNik Dec 13, 2023
155a120
fix: usage
TorstenDittmann Dec 13, 2023
5f33721
Merge branch 'billing' of https://github.com/appwrite/console into bi…
TorstenDittmann Dec 13, 2023
f5055aa
fix: hide default region
TorstenDittmann Dec 13, 2023
2e66eb7
fix: types, GRACE_PERIOD_OVERRIDE
ArmanNik Dec 13, 2023
ecc9b10
fix: review stuff
ArmanNik Dec 13, 2023
b5d8023
fix: type
ArmanNik Dec 13, 2023
ebb7b20
feat: add message to logs
ArmanNik Dec 13, 2023
0a443fd
feat: overview usage break down WIP
ArmanNik Dec 13, 2023
034986d
fix: styles excess
ArmanNik Dec 13, 2023
544709a
fix: types
ArmanNik Dec 13, 2023
fb620dc
fix: email after broken sdk, plan history, overview
ArmanNik Dec 14, 2023
6b1fcdc
fix: design plan summary
ArmanNik Dec 14, 2023
e447062
fix: light mode for logs
ArmanNik Dec 14, 2023
0838790
fix: org usage breakdown
TorstenDittmann Dec 14, 2023
2443b19
Merge branch 'billing' of https://github.com/appwrite/console into bi…
TorstenDittmann Dec 14, 2023
eeeb762
fix: post release modal
ArmanNik Dec 14, 2023
502cb3f
fix: show hoodie give away only for paid users
ArmanNik Dec 15, 2023
8686628
fix: unit functions
ArmanNik Dec 15, 2023
8dcd7da
feat: add activity table footer
ArmanNik Dec 15, 2023
a851cfb
fix: header order
ArmanNik Dec 15, 2023
9a1fc8a
fix: 9 months old bug
ArmanNik Dec 15, 2023
0bfd4ab
fix: align icons right, add column joined
ArmanNik Dec 15, 2023
739cd54
fix: review comments, refactor confirmation
ArmanNik Dec 18, 2023
b55fde1
fix: code review
ArmanNik Dec 18, 2023
393f53e
fix: check issue
ArmanNik Dec 18, 2023
c610061
fix: warnings
ArmanNik Dec 19, 2023
51fe5f0
fix: linter issues
ArmanNik Dec 19, 2023
228dc9c
fix: payment loader
ArmanNik Dec 19, 2023
b3441fd
fix: post release modal
ArmanNik Dec 19, 2023
cd90d89
chore: remove console logs
ArmanNik Dec 19, 2023
4b49043
fix: headerAlert not loading, and payment required iframe not loading
ArmanNik Dec 19, 2023
6b2e28f
fix: review
ArmanNik Dec 19, 2023
50448fb
chore: remove imports
ArmanNik Dec 19, 2023
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
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
VITE_APPWRITE_ENDPOINT=http://localhost/v1
VITE_APPWRITE_GROWTH_ENDPOINT=
VITE_GA_PROJECT=
VITE_CONSOLE_MODE=self-hosted
VITE_CONSOLE_MODE=self-hosted
VITE_STRIPE_PUBLIC_KEY=
ArmanNik marked this conversation as resolved.
Show resolved Hide resolved
VITE_CONSOLE_MODE=self-hosted
127 changes: 113 additions & 14 deletions package-lock.json

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

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@popperjs/core": "^2.11.8",
"@sentry/svelte": "^7.66.0",
"@sentry/tracing": "^7.66.0",
"@stripe/stripe-js": "^2.2.0",
"ai": "^2.2.11",
"analytics": "^0.8.9",
"dayjs": "^1.11.9",
Expand All @@ -40,6 +41,8 @@
"web-vitals": "^3.4.0"
},
"devDependencies": {
"@melt-ui/pp": "^0.1.4",
"@melt-ui/svelte": "^0.61.2",
"@playwright/test": "^1.37.1",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.24.0",
Expand All @@ -65,6 +68,7 @@
"svelte-check": "^3.5.1",
"svelte-jester": "^2.3.2",
"svelte-preprocess": "^5.0.4",
"svelte-sequential-preprocessor": "^2.0.1",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^4.4.9",
Expand Down
19 changes: 19 additions & 0 deletions src/lib/actions/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,25 @@ export enum Submit {
FileCreate = 'submit_file_create',
FileDelete = 'submit_file_delete',
FileUpdatePermissions = 'submit_file_update_permissions',
BudgetCapUpdate = 'submit_budget_cap_update',
BudgetAlertsUpdate = 'submit_budget_alert_conditions_update',
CreditRedeem = 'submit_credit_redeem',
PaymentMethodCreate = 'submit_payment_method_create',
PaymentMethodUpdate = 'submit_payment_method_update',
PaymentMethodDelete = 'submit_payment_method_delete',
BillingAddressCreate = 'submit_billing_address_create',
BillingAddressUpdate = 'submit_billing_address_update',
BillingAddressDelete = 'submit_billing_address_delete',
OrganizationPaymentUpdate = 'submit_organization_payment_update',
OrganizationPaymentDelete = 'submit_organization_payment_delete',
OrganizationBackupPaymentUpdate = 'submit_organization_backup_payment_update',
OrganizationBackupPaymentDelete = 'submit_organization_backup_payment_delete',
OrganizationBillingAddressUpdate = 'submit_organization_billing_address_update',
OrganizationBillingAddressDelete = 'submit_organization_billing_address_delete',
OrganizationUpgrade = 'submit_organization_upgrade',
OrganizationDowngrade = 'submit_organization_downgrade',
OrganizationBillingTaxIdUpdate = 'submit_organization_billing_tax_id_update',
SupportTicket = 'submit_support_ticket',
InstallationCreate = 'submit_installation_create',
InstallationDelete = 'submit_installation_delete',
EmailChangeLocale = 'submit_email_change_locale',
Expand Down
26 changes: 15 additions & 11 deletions src/lib/components/alert.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import type { Buttons } from '../stores/notifications';
import { Button } from '$lib/elements/forms';

export let dismissible = false;
export let type: 'info' | 'success' | 'warning' | 'error' | 'default' = 'info';
Expand Down Expand Up @@ -44,20 +45,23 @@
<slot name="title" />
</h6>
{/if}

{#if $$slots.default}
<p class="alert-message"><slot /></p>
{/if}
{#if ($$slots.buttons || buttons?.length) && !isAction}
<div class="alert-buttons u-flex">
<slot name="buttons">
{#each buttons as button}
<button type="button" class="button is-text" on:click={button.method}>
<span class="text">{button.name}</span>
</button>
{/each}
</slot>
</div>
{/if}
<slot name="action">
{#if ($$slots.buttons || buttons?.length) && !isAction}
<div class="alert-buttons u-flex">
<slot name="buttons">
{#each buttons as button}
<Button text on:click={button.method}>
<span class="text">{button.name}</span>
</Button>
{/each}
</slot>
</div>
{/if}
</slot>
</div>
{#if ($$slots.buttons || buttons?.length) && isAction}
<div class="alert-buttons u-flex u-gap-16 u-cross-child-center">
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/box.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
export { classes as class };

enum radiuses {
xsmall = '--border-radius-extra-large',
xsmall = '--border-radius-xsmall',
small = '--border-radius-small',
medium = '--border-radius-medium',
large = '--border-radius-large'
Expand Down
17 changes: 14 additions & 3 deletions src/lib/components/cardContainer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@
import { page } from '$app/stores';
import { Empty } from '$lib/components';
import { CARD_LIMIT } from '$lib/constants';
import { getServiceLimit, type PlanServices } from '$lib/stores/billing';
import { preferences } from '$lib/stores/preferences';
import { isCloud } from '$lib/system';
import CardPlanLimit from './cardPlanLimit.svelte';

export let offset = 0;
export let total = 0;
export let event: string = null;
export let service = '';
export let serviceId: PlanServices = service as PlanServices;

$: planLimit = getServiceLimit(serviceId) || Infinity;

$: limit = preferences.get($page.route)?.limit ?? CARD_LIMIT;
</script>
Expand All @@ -18,8 +25,12 @@
<slot />

{#if total > 3 ? total < limit + offset : total % 2 !== 0}
<Empty on:click target={event}>
<slot name="empty" />
</Empty>
{#if isCloud && serviceId && total >= planLimit}
<CardPlanLimit {service} />
{:else}
<Empty on:click target={event}>
<slot name="empty" />
</Empty>
{/if}
{/if}
</ul>
2 changes: 1 addition & 1 deletion src/lib/components/cardGrid.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="grid-1-2-col-1 u-flex u-flex-vertical u-gap-16">
<slot />
</div>
<div class="grid-1-2-col-2 u-flex u-flex-vertical u-gap-24">
<div class="grid-1-2-col-2 u-flex u-flex-vertical u-gap-16">
<slot name="aside" />
</div>
</div>
Expand Down
16 changes: 16 additions & 0 deletions src/lib/components/cardPlanLimit.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script lang="ts">
import { Button } from '$lib/elements/forms';
import { wizard } from '$lib/stores/wizard';
import ChangeOrganizationTierCloud from '$routes/console/changeOrganizationTierCloud.svelte';

export let service = '';
ArmanNik marked this conversation as resolved.
Show resolved Hide resolved
</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>
</div>
</article>
14 changes: 14 additions & 0 deletions src/lib/components/creditCardBrandImage.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script lang="ts">
import { sdk } from '$lib/stores/sdk';

export let brand: string;
export let width = 23;
export let height = 16;

function getCreditCardImage(brand: string, width = 46, height = 32) {
if (!brand) return '';
return sdk.forConsole.avatars.getCreditCard(brand, width, height).toString();
}
</script>

<img style="border-radius: 2.5px" {width} {height} src={getCreditCardImage(brand)} alt={brand} />
Loading
Loading