Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 0 additions & 17 deletions src/components/IotHub/install-dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 2 additions & 13 deletions src/components/IotHub/install-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
IOT_HUB_STRINGS,
buildInstallUrl,
getInstallVerb,
isInstanceAvailable,
stripScheme,
stripTrailingSlash,
type InstallInstance,
Expand Down Expand Up @@ -92,21 +91,11 @@ function rowMarkup(inst: InstallInstance): string {
<p class="iot-hub-install-dialog__error" id="${errorId}" data-error hidden>${S.invalidUrl}</p>
</div>`
: '';
// 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
? `<div class="iot-hub-install-dialog__row-actions">
const actions = `<div class="iot-hub-install-dialog__row-actions">
<button type="button" class="iot-hub-install-dialog__icon-btn" data-copy aria-label="${S.copy}">${icon('copy', 24)}</button>
<a class="iot-hub-install-dialog__action" data-open target="_blank" rel="noopener"><span data-verb></span>${icon('external-link', 20)}</a>
</div>`
: `<div class="iot-hub-install-dialog__row-actions">
<span class="iot-hub-install-dialog__badge">${S.comingSoonBadge}</span>
</div>`;
const rowClass = available
? 'iot-hub-install-dialog__row'
: 'iot-hub-install-dialog__row iot-hub-install-dialog__row--coming-soon';
return `<li class="${rowClass}" data-instance="${inst.key}">
return `<li class="iot-hub-install-dialog__row" data-instance="${inst.key}">
<span class="iot-hub-install-dialog__row-icon" aria-hidden="true">${icon(inst.icon, 32)}</span>
<div class="iot-hub-install-dialog__row-main">
<span class="iot-hub-install-dialog__row-label">${inst.label}</span>
Expand Down
29 changes: 0 additions & 29 deletions src/models/iot-hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -624,25 +622,10 @@ export interface InstallInstance {
icon: string;
/** Cloud rows append `?fpr=<affiliateId>` 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[] = [
{
Expand All @@ -651,15 +634,13 @@ export const INSTALL_INSTANCES: readonly InstallInstance[] = [
base: 'https://thingsboard.cloud',
icon: 'cloud',
referral: true,
availableFrom: IOT_HUB_CLOUD_AVAILABLE_FROM,
},
{
key: 'eu',
label: 'ThingsBoard Cloud (Europe)',
base: 'https://eu.thingsboard.cloud',
icon: 'cloud',
referral: true,
availableFrom: IOT_HUB_CLOUD_AVAILABLE_FROM,
},
{
key: 'local',
Expand All @@ -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;

Expand Down