From 525b6f84bb5d81a4b14745cb365b2b2503f4ca96 Mon Sep 17 00:00:00 2001
From: melohagan <101575380+melohagan@users.noreply.github.com>
Date: Thu, 28 Nov 2024 10:37:44 +0000
Subject: [PATCH] Remove references to day passes (#15079)
* Remove references to day passes
* lint
* Point pro to branch with no day passes code
* update yarn lock
---
.../core/utilities/structures/licenses.ts | 6 --
.../tests/core/utilities/structures/quotas.ts | 3 -
.../licensing/DayPassWarningModal.svelte | 81 -------------------
.../portal/licensing/LicensingOverlays.svelte | 15 ----
.../components/portal/licensing/constants.js | 2 -
.../portal/licensing/licensingBanners.js | 40 ---------
packages/builder/src/constants/index.js | 1 -
.../src/pages/builder/apps/index.svelte | 2 +-
.../pages/builder/portal/account/usage.svelte | 5 +-
packages/pro | 2 +-
packages/types/src/documents/global/quotas.ts | 1 -
packages/types/src/documents/global/user.ts | 1 -
packages/types/src/sdk/licensing/plan.ts | 2 -
packages/types/src/sdk/licensing/quota.ts | 2 -
.../src/api/routes/global/tests/self.spec.ts | 4 +-
yarn.lock | 35 ++------
16 files changed, 9 insertions(+), 193 deletions(-)
delete mode 100644 packages/builder/src/components/portal/licensing/DayPassWarningModal.svelte
diff --git a/packages/backend-core/tests/core/utilities/structures/licenses.ts b/packages/backend-core/tests/core/utilities/structures/licenses.ts
index b4d209a7ee..77f6d57b09 100644
--- a/packages/backend-core/tests/core/utilities/structures/licenses.ts
+++ b/packages/backend-core/tests/core/utilities/structures/licenses.ts
@@ -22,7 +22,6 @@ export function price(): PurchasedPrice {
currency: "usd",
duration: PriceDuration.MONTHLY,
priceId: "price_123",
- dayPasses: undefined,
isPerUser: true,
}
}
@@ -50,11 +49,6 @@ export function quotas(): Quotas {
value: 1,
triggers: [],
},
- dayPasses: {
- name: "Queries",
- value: 1,
- triggers: [],
- },
budibaseAICredits: {
name: "Budibase AI Credits",
value: 1,
diff --git a/packages/backend-core/tests/core/utilities/structures/quotas.ts b/packages/backend-core/tests/core/utilities/structures/quotas.ts
index 58817e4831..83c3a8a766 100644
--- a/packages/backend-core/tests/core/utilities/structures/quotas.ts
+++ b/packages/backend-core/tests/core/utilities/structures/quotas.ts
@@ -15,7 +15,6 @@ export const usage = (users: number = 0, creators: number = 0): QuotaUsage => {
monthly: {
"01-2023": {
automations: 0,
- dayPasses: 0,
queries: 0,
budibaseAICredits: 0,
triggers: {},
@@ -45,14 +44,12 @@ export const usage = (users: number = 0, creators: number = 0): QuotaUsage => {
},
"02-2023": {
automations: 0,
- dayPasses: 0,
queries: 0,
budibaseAICredits: 0,
triggers: {},
},
current: {
automations: 0,
- dayPasses: 0,
queries: 0,
budibaseAICredits: 0,
triggers: {},
diff --git a/packages/builder/src/components/portal/licensing/DayPassWarningModal.svelte b/packages/builder/src/components/portal/licensing/DayPassWarningModal.svelte
deleted file mode 100644
index 341e427bf0..0000000000
--- a/packages/builder/src/components/portal/licensing/DayPassWarningModal.svelte
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
- {#if $auth.user.accountPortalAccess}
- {
- window.location.href = upgradeUrl
- }}
- >
-
- You have used {dayPassesUsed}% of
- your plans Day Passes with {daysRemaining} day{daysRemaining == 1
- ? ""
- : "s"} remaining.
-
-
-
-
- {dayPassesBody}
-
- {:else}
-
-
- You have used {dayPassesUsed}% of
- your plans Day Passes with {daysRemaining} day{daysRemaining == 1
- ? ""
- : "s"} remaining.
-
-
-
-
- Please contact your account holder to upgrade.
-
- {/if}
-
-
-
diff --git a/packages/builder/src/components/portal/licensing/LicensingOverlays.svelte b/packages/builder/src/components/portal/licensing/LicensingOverlays.svelte
index ab80418b6e..e2c52e3448 100644
--- a/packages/builder/src/components/portal/licensing/LicensingOverlays.svelte
+++ b/packages/builder/src/components/portal/licensing/LicensingOverlays.svelte
@@ -1,7 +1,6 @@
-
{
- const appAuth = get(auth)
- const appLicensing = get(licensing)
- if (get(licensing)?.usageMetrics["dayPasses"] >= 100) {
- return {
- key: "max_dayPasses",
- type: BANNER_TYPES.NEGATIVE,
- criteria: () => {
- return true
- },
- message: `Your apps are currently offline. You have exceeded your plans limit for Day Passes. ${
- appAuth.user.accountPortalAccess
- ? ""
- : "Please contact your account holder to upgrade."
- }`,
- ...upgradeAction(),
- showCloseButton: false,
- }
- }
-
- return buildUsageInfoBanner(
- "dayPasses",
- "Day Passes",
- ExpiringKeys.LICENSING_DAYPASS_WARNING_BANNER,
- 90,
- `You have used ${
- appLicensing?.usageMetrics["dayPasses"]
- }% of your monthly usage of Day Passes with ${
- appLicensing?.quotaResetDaysRemaining
- } day${
- get(licensing).quotaResetDaysRemaining == 1 ? "" : "s"
- } remaining. All apps will be taken offline if this limit is reached. ${
- appAuth.user.accountPortalAccess
- ? ""
- : "Please contact your account holder to upgrade."
- }`
- )
-}
-
const buildPaymentFailedBanner = () => {
return {
key: "payment_Failed",
@@ -166,7 +127,6 @@ const buildUsersAboveLimitBanner = EXPIRY_KEY => {
export const getBanners = () => {
return [
buildPaymentFailedBanner(),
- buildDayPassBanner(ExpiringKeys.LICENSING_DAYPASS_WARNING_BANNER),
buildUsageInfoBanner(
"rows",
"Rows",
diff --git a/packages/builder/src/constants/index.js b/packages/builder/src/constants/index.js
index 0d51f57c3e..3498183c8e 100644
--- a/packages/builder/src/constants/index.js
+++ b/packages/builder/src/constants/index.js
@@ -68,7 +68,6 @@ export const OnboardingType = {
export const PlanModel = {
PER_USER: "perUser",
- DAY_PASS: "dayPass",
}
export const ChangelogURL = "https://docs.budibase.com/changelog"
diff --git a/packages/builder/src/pages/builder/apps/index.svelte b/packages/builder/src/pages/builder/apps/index.svelte
index 095bf2023b..632478748d 100644
--- a/packages/builder/src/pages/builder/apps/index.svelte
+++ b/packages/builder/src/pages/builder/apps/index.svelte
@@ -136,7 +136,7 @@