From 98333b87912a93da212da930b1b0abc01a4f2be2 Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 13 Sep 2022 11:52:31 +0100 Subject: [PATCH] Merge commit --- packages/bbui/src/Banner/BannerDisplay.svelte | 22 ++- packages/bbui/src/Stores/banner.js | 18 ++- .../bbui/src/Tooltip/TooltipWrapper.svelte | 3 +- packages/bbui/src/index.js | 1 + packages/builder/src/App.svelte | 4 + packages/builder/src/builderStore/index.js | 2 + .../src/builderStore/store/temporal.js | 44 ++++++ .../components/common/TemplateDisplay.svelte | 21 +-- .../licensing/AccountDowngradedModal.svelte | 51 +++++++ .../portal/licensing/AppLimitModal.svelte | 46 ++++++ .../licensing/DayPassWarningModal.svelte | 54 +++++++ .../portal/licensing/LicensingOverlays.svelte | 117 ++++++++++++++++ .../licensing/PaymentFailedModal.svelte | 87 ++++++++++++ .../components/portal/licensing/banners.js | 132 ++++++++++++++++++ .../components/portal/licensing/constants.js | 15 ++ .../builder/src/pages/builder/_layout.svelte | 5 +- .../pages/builder/portal/apps/create.svelte | 27 +++- .../pages/builder/portal/apps/index.svelte | 18 ++- .../builder/src/stores/portal/licensing.js | 121 +++++++++------- 19 files changed, 707 insertions(+), 81 deletions(-) create mode 100644 packages/builder/src/builderStore/store/temporal.js create mode 100644 packages/builder/src/components/portal/licensing/AccountDowngradedModal.svelte create mode 100644 packages/builder/src/components/portal/licensing/AppLimitModal.svelte create mode 100644 packages/builder/src/components/portal/licensing/DayPassWarningModal.svelte create mode 100644 packages/builder/src/components/portal/licensing/LicensingOverlays.svelte create mode 100644 packages/builder/src/components/portal/licensing/PaymentFailedModal.svelte create mode 100644 packages/builder/src/components/portal/licensing/banners.js create mode 100644 packages/builder/src/components/portal/licensing/constants.js diff --git a/packages/bbui/src/Banner/BannerDisplay.svelte b/packages/bbui/src/Banner/BannerDisplay.svelte index aad742b1bd..4785fcb9ba 100644 --- a/packages/bbui/src/Banner/BannerDisplay.svelte +++ b/packages/bbui/src/Banner/BannerDisplay.svelte @@ -4,22 +4,30 @@ import { banner } from "../Stores/banner" import Banner from "./Banner.svelte" import { fly } from "svelte/transition" + import TooltipWrapper from "../Tooltip/TooltipWrapper.svelte" diff --git a/packages/bbui/src/Stores/banner.js b/packages/bbui/src/Stores/banner.js index 81a9ee2204..745c77e188 100644 --- a/packages/bbui/src/Stores/banner.js +++ b/packages/bbui/src/Stores/banner.js @@ -1,7 +1,9 @@ import { writable } from "svelte/store" export function createBannerStore() { - const DEFAULT_CONFIG = {} + const DEFAULT_CONFIG = { + messages: [], + } const banner = writable(DEFAULT_CONFIG) @@ -28,9 +30,23 @@ export function createBannerStore() { await show(config) } + const queue = async entries => { + banner.update(store => { + const sorted = [...store.messages, ...entries].sort( + (a, b) => a.priority > b.priority + ) + return { + ...store, + messages: sorted, + } + }) + } + return { subscribe: banner.subscribe, showStatus, + show, + queue, } } diff --git a/packages/bbui/src/Tooltip/TooltipWrapper.svelte b/packages/bbui/src/Tooltip/TooltipWrapper.svelte index 92f5c6f474..0c6c8e167b 100644 --- a/packages/bbui/src/Tooltip/TooltipWrapper.svelte +++ b/packages/bbui/src/Tooltip/TooltipWrapper.svelte @@ -54,7 +54,6 @@ transform: scale(0.75); } .icon-small { - margin-top: -2px; - margin-bottom: -5px; + margin-bottom: -2px; } diff --git a/packages/bbui/src/index.js b/packages/bbui/src/index.js index b45f3e9ed6..11424b1261 100644 --- a/packages/bbui/src/index.js +++ b/packages/bbui/src/index.js @@ -34,6 +34,7 @@ export { default as Layout } from "./Layout/Layout.svelte" export { default as Page } from "./Layout/Page.svelte" export { default as Link } from "./Link/Link.svelte" export { default as Tooltip } from "./Tooltip/Tooltip.svelte" +export { default as TooltipWrapper } from "./Tooltip/TooltipWrapper.svelte" export { default as Menu } from "./Menu/Menu.svelte" export { default as MenuSection } from "./Menu/Section.svelte" export { default as MenuSeparator } from "./Menu/Separator.svelte" diff --git a/packages/builder/src/App.svelte b/packages/builder/src/App.svelte index 0fb0fe59d5..4d193df104 100644 --- a/packages/builder/src/App.svelte +++ b/packages/builder/src/App.svelte @@ -4,6 +4,7 @@ import { NotificationDisplay, BannerDisplay } from "@budibase/bbui" import { parse, stringify } from "qs" import HelpIcon from "components/common/HelpIcon.svelte" + import LicensingOverlays from "components/portal/licensing/LicensingOverlays.svelte" const queryHandler = { parse, stringify } @@ -12,6 +13,9 @@ + + +