From 7986c91e74228287d2d75554260a786f972f9e00 Mon Sep 17 00:00:00 2001 From: Vladyslav Prykhodko Date: Wed, 1 Jul 2026 21:51:28 +0300 Subject: [PATCH] fix(iot-hub): remove cloud install availability gating The cloud install dialog gated the ThingsBoard Cloud (NA/EU) rows behind an `availableFrom` launch date, showing a "coming soon" badge until it passed. The launch has happened, so drop the gating entirely: - Remove the `availableFrom` field, `IOT_HUB_CLOUD_AVAILABLE_FROM` constant, `isInstanceAvailable()` helper, and `comingSoonBadge` string from iot-hub.ts. - Simplify install-dialog.ts rowMarkup to always render copy + action buttons. - Remove the now-unused `.iot-hub-install-dialog__badge` styles. --- src/components/IotHub/install-dialog.scss | 17 ------------- src/components/IotHub/install-dialog.ts | 15 ++---------- src/models/iot-hub.ts | 29 ----------------------- 3 files changed, 2 insertions(+), 59 deletions(-) diff --git a/src/components/IotHub/install-dialog.scss b/src/components/IotHub/install-dialog.scss index 9d60f8620..1844f378c 100644 --- a/src/components/IotHub/install-dialog.scss +++ b/src/components/IotHub/install-dialog.scss @@ -282,23 +282,6 @@ } } -// Non-interactive "coming soon" pill shown in place of the copy + action -// buttons for instances that aren't live yet (see `availableFrom`). The pill -// shape and primary tint (matching the row-icon tile) read as a status chip, -// clearly distinct from the rectangular outlined action button. -.iot-hub-install-dialog__badge { - display: inline-flex; - align-items: center; - padding: 6px 14px; - font-size: 13px; - font-weight: $font-weight-medium; - line-height: 20px; - white-space: nowrap; - border-radius: 999px; - color: var(--color-primary); - background: rgba(var(--color-primary-rgb), 0.12); -} - // --- Narrow screens ------------------------------------------------------ // Below ~480px the dialog is viewport-width and the icon + label + actions no // longer fit on one line, so the copy/Connect actions wrap to their own diff --git a/src/components/IotHub/install-dialog.ts b/src/components/IotHub/install-dialog.ts index ec056b97d..afa82840e 100644 --- a/src/components/IotHub/install-dialog.ts +++ b/src/components/IotHub/install-dialog.ts @@ -6,7 +6,6 @@ import { IOT_HUB_STRINGS, buildInstallUrl, getInstallVerb, - isInstanceAvailable, stripScheme, stripTrailingSlash, type InstallInstance, @@ -92,21 +91,11 @@ function rowMarkup(inst: InstallInstance): string { ` : ''; - // Instances with a future `availableFrom` aren't live yet — show a - // "coming soon" badge instead of the copy + action buttons. - const available = isInstanceAvailable(inst); - const actions = available - ? `
+ const actions = `
${icon('external-link', 20)} -
` - : `
- ${S.comingSoonBadge}
`; - const rowClass = available - ? 'iot-hub-install-dialog__row' - : 'iot-hub-install-dialog__row iot-hub-install-dialog__row--coming-soon'; - return `
  • + return `
  • ${inst.label} diff --git a/src/models/iot-hub.ts b/src/models/iot-hub.ts index c0c4b4609..ace752df4 100644 --- a/src/models/iot-hub.ts +++ b/src/models/iot-hub.ts @@ -260,8 +260,6 @@ export const IOT_HUB_STRINGS = { save: 'Save', cancel: 'Cancel', invalidUrl: 'Enter a valid URL, e.g. http://localhost:8080', - // Paired with IOT_HUB_CLOUD_AVAILABLE_FROM — keep the date in sync. - comingSoonBadge: 'Coming July 2', }, creatorPage: { breadcrumbRoot: 'IoT Hub', @@ -624,25 +622,10 @@ export interface InstallInstance { icon: string; /** Cloud rows append `?fpr=` when one is available. */ referral?: boolean; - /** - * ISO date (YYYY-MM-DD) before which this instance is not yet live: the - * install dialog shows a "coming soon" badge in place of the action button. - * Once the date passes it auto-enables at runtime (client-side check) — no - * rebuild or redeploy needed. Omit for always-available instances. - */ - availableFrom?: string; /** Local row: user-editable + persisted to localStorage. */ editable?: boolean; } -/** - * IoT Hub launches on ThingsBoard Cloud on this date. Until then the two cloud - * rows show a "coming soon" badge instead of Connect/Install; on this date the - * dialog enables them automatically. To go live early/late, change this one - * value (and the matching `comingSoonBadge` copy below). - */ -export const IOT_HUB_CLOUD_AVAILABLE_FROM = '2026-07-03'; - // Order matches the design: NA, EU, Local. export const INSTALL_INSTANCES: readonly InstallInstance[] = [ { @@ -651,7 +634,6 @@ export const INSTALL_INSTANCES: readonly InstallInstance[] = [ base: 'https://thingsboard.cloud', icon: 'cloud', referral: true, - availableFrom: IOT_HUB_CLOUD_AVAILABLE_FROM, }, { key: 'eu', @@ -659,7 +641,6 @@ export const INSTALL_INSTANCES: readonly InstallInstance[] = [ base: 'https://eu.thingsboard.cloud', icon: 'cloud', referral: true, - availableFrom: IOT_HUB_CLOUD_AVAILABLE_FROM, }, { key: 'local', @@ -670,16 +651,6 @@ export const INSTALL_INSTANCES: readonly InstallInstance[] = [ }, ]; -/** - * Whether an instance's action is live yet. True unless it has a future - * `availableFrom` date. Evaluated client-side, so it flips on its own once the - * date arrives. `now` is injectable for testing. - */ -export const isInstanceAvailable = ( - inst: InstallInstance, - now: number = Date.now() -): boolean => !inst.availableFrom || now >= Date.parse(inst.availableFrom); - export const stripTrailingSlash = (s: string): string => s.endsWith('/') ? s.slice(0, -1) : s;