diff --git a/packages/bbui/src/Banner/BannerDisplay.svelte b/packages/bbui/src/Banner/BannerDisplay.svelte
index 4785fcb9ba..9ea2eaf2ec 100644
--- a/packages/bbui/src/Banner/BannerDisplay.svelte
+++ b/packages/bbui/src/Banner/BannerDisplay.svelte
@@ -16,13 +16,15 @@
extraButtonText={message.extraButtonText}
extraButtonAction={message.extraButtonAction}
on:change={() => {
- message.onChange()
+ if (message.onChange) {
+ message.onChange()
+ }
}}
showCloseButton={typeof message.showCloseButton === "boolean"
? message.showCloseButton
: true}
>
-
+
{message.message}
diff --git a/packages/bbui/src/Stores/banner.js b/packages/bbui/src/Stores/banner.js
index 745c77e188..ba6d187d97 100644
--- a/packages/bbui/src/Stores/banner.js
+++ b/packages/bbui/src/Stores/banner.js
@@ -1,5 +1,10 @@
import { writable } from "svelte/store"
+export const BANNER_TYPES = {
+ INFO: "info",
+ NEGATIVE: "negative",
+}
+
export function createBannerStore() {
const DEFAULT_CONFIG = {
messages: [],
@@ -22,19 +27,26 @@ export function createBannerStore() {
const showStatus = async () => {
const config = {
message: "Some systems are experiencing issues",
- type: "negative",
+ type: BANNER_TYPES.NEGATIVE,
extraButtonText: "View Status",
extraButtonAction: () => window.open("https://status.budibase.com/"),
}
- await show(config)
+ await queue([config])
}
const queue = async entries => {
+ const priority = {
+ [BANNER_TYPES.NEGATIVE]: 0,
+ [BANNER_TYPES.INFO]: 1,
+ }
banner.update(store => {
- const sorted = [...store.messages, ...entries].sort(
- (a, b) => a.priority > b.priority
- )
+ const sorted = [...store.messages, ...entries].sort((a, b) => {
+ if (priority[a.type] == priority[b.type]) {
+ return 0
+ }
+ return priority[a.type] < priority[b.type] ? -1 : 1
+ })
return {
...store,
messages: sorted,
diff --git a/packages/bbui/src/Tooltip/TooltipWrapper.svelte b/packages/bbui/src/Tooltip/TooltipWrapper.svelte
index 0c6c8e167b..e7a96f6cd8 100644
--- a/packages/bbui/src/Tooltip/TooltipWrapper.svelte
+++ b/packages/bbui/src/Tooltip/TooltipWrapper.svelte
@@ -4,6 +4,7 @@
export let tooltip = ""
export let size = "M"
+ export let disabled = true
let showTooltip = false
@@ -19,7 +20,7 @@
on:mouseleave={() => (showTooltip = false)}
on:focus
>
-
+
{#if showTooltip}
- {`${$licensing.paymentDueDaysRemaining} day${
- $licensing.paymentDueDaysRemaining == 1 ? "" : "s"
+ {`${$licensing.pastDueDaysRemaining} day${
+ $licensing.pastDueDaysRemaining == 1 ? "" : "s"
} remaining`}
-
+
Please contact your account holder.
- {`${$licensing.paymentDueDaysRemaining} day${
- $licensing.paymentDueDaysRemaining == 1 ? "" : "s"
+ {`${$licensing.pastDueDaysRemaining} day${
+ $licensing.pastDueDaysRemaining == 1 ? "" : "s"
} remaining`}
-
+