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
14 changes: 14 additions & 0 deletions public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
/docs/pe/edge/config/management/ /docs/edge/pe/key-concepts/edge-instance/ 301
/docs/pe/edge/config/provision-asset/ /docs/edge/pe/user-guide/asset-management/ 301
/docs/pe/edge/config/subscribe-to-attribute/ /docs/edge/pe/user-guide/attribute-sync/ 301
/docs/pe/edge/user-guide/provision-customer/ /docs/edge/pe/user-guide/provision-customers-and-users/ 301
/docs/pe/edge/user-guide/provision-user/ /docs/edge/pe/user-guide/provision-customers-and-users/ 301
/docs/pe/edge/user-guide/provision-dashboard/ /docs/edge/pe/user-guide/dashboards/ 301
/docs/pe/edge/user-guide/edge-proxy/ /docs/edge/pe/user-guide/edge-proxy/debian/ 301
/docs/pe/edge/edge-architecture/ /docs/edge/pe/reference/architecture/ 301
/docs/pe/edge/faq/ /docs/edge/pe/why-thingsboard-edge/ 301
/docs/pe/edge/user-guide/integrations/ /docs/edge/pe/user-guide/integrations/overview/ 301
Expand Down Expand Up @@ -142,6 +146,15 @@
/docs/edge/config/provision-entity-view/ /docs/edge/key-concepts/entities/ 301
/docs/edge/config/provision-user/ /docs/edge/user-guide/provision-customers-and-users/ 301
/docs/edge/config/subscribe-to-attribute/ /docs/edge/user-guide/attribute-sync/ 301
/docs/edge/user-guide/provision-customer/ /docs/edge/user-guide/provision-customers-and-users/ 301
/docs/edge/pe/user-guide/provision-customer/ /docs/edge/pe/user-guide/provision-customers-and-users/ 301
/docs/edge/user-guide/provision-user/ /docs/edge/user-guide/provision-customers-and-users/ 301
/docs/edge/pe/user-guide/provision-user/ /docs/edge/pe/user-guide/provision-customers-and-users/ 301
/docs/edge/user-guide/provision-dashboard/ /docs/edge/user-guide/dashboards/ 301
/docs/edge/pe/user-guide/provision-dashboard/ /docs/edge/pe/user-guide/dashboards/ 301
/docs/edge/user-guide/edge-proxy/ /docs/edge/user-guide/edge-proxy/debian/ 301
/docs/edge/pe/user-guide/edge-proxy/ /docs/edge/pe/user-guide/edge-proxy/debian/ 301
/docs/pe/reference/configuration-reference/ /docs/pe/reference/ 301
/docs/edge/edge-architecture/ /docs/edge/reference/architecture/ 301
/docs/edge/faq/ /docs/edge/why-thingsboard-edge/ 301
/docs/edge/getting-started-guides/what-is-edge/ /docs/edge/why-thingsboard-edge/ 301
Expand Down Expand Up @@ -979,6 +992,7 @@
/docs/paas/eu/recipes/ /docs/paas/eu/user-guide/ 301

# Non-docs redirects (from NON_DOCS_REDIRECTS)
/community/ / 301
/services/support/ /services/ 301
/products/trendz/trndz-request-demo/ /products/trendz/request-demo/ 301
/images/trendz/trndz-request-demo/ /products/trendz/request-demo/ 301
Expand Down
17 changes: 13 additions & 4 deletions public/redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,19 @@
"/docs/edge/config/provision-user/": "/docs/edge/user-guide/provision-customers-and-users/",
"/docs/edge/config/subscribe-to-attribute/": "/docs/edge/user-guide/attribute-sync/",
"/docs/pe/edge/config/subscribe-to-attribute/": "/docs/edge/pe/user-guide/attribute-sync/",
"/docs/edge/user-guide/provision-customer/": "/docs/edge/user-guide/provision-customers-and-users/",
"/docs/edge/pe/user-guide/provision-customer/": "/docs/edge/pe/user-guide/provision-customers-and-users/",
"/docs/pe/edge/user-guide/provision-customer/": "/docs/edge/pe/user-guide/provision-customers-and-users/",
"/docs/edge/user-guide/provision-user/": "/docs/edge/user-guide/provision-customers-and-users/",
"/docs/edge/pe/user-guide/provision-user/": "/docs/edge/pe/user-guide/provision-customers-and-users/",
"/docs/pe/edge/user-guide/provision-user/": "/docs/edge/pe/user-guide/provision-customers-and-users/",
"/docs/edge/user-guide/provision-dashboard/": "/docs/edge/user-guide/dashboards/",
"/docs/edge/pe/user-guide/provision-dashboard/": "/docs/edge/pe/user-guide/dashboards/",
"/docs/pe/edge/user-guide/provision-dashboard/": "/docs/edge/pe/user-guide/dashboards/",
"/docs/edge/user-guide/edge-proxy/": "/docs/edge/user-guide/edge-proxy/debian/",
"/docs/edge/pe/user-guide/edge-proxy/": "/docs/edge/pe/user-guide/edge-proxy/debian/",
"/docs/pe/edge/user-guide/edge-proxy/": "/docs/edge/pe/user-guide/edge-proxy/debian/",
"/docs/pe/reference/configuration-reference/": "/docs/pe/reference/",
"/docs/edge/edge-architecture/": "/docs/edge/reference/architecture/",
"/docs/pe/edge/edge-architecture/": "/docs/edge/pe/reference/architecture/",
"/docs/edge/faq/": "/docs/edge/why-thingsboard-edge/",
Expand Down Expand Up @@ -1917,7 +1930,6 @@
"/docs/pe/edge/user-guide/edge-management/": "/docs/edge/pe/user-guide/edge-management/",
"/docs/pe/edge/user-guide/edge-proxy/debian/": "/docs/edge/pe/user-guide/edge-proxy/debian/",
"/docs/pe/edge/user-guide/edge-proxy/docker/": "/docs/edge/pe/user-guide/edge-proxy/docker/",
"/docs/pe/edge/user-guide/edge-proxy/": "/docs/edge/pe/user-guide/edge-proxy/",
"/docs/pe/edge/user-guide/edge-status-events/": "/docs/edge/pe/user-guide/edge-status-events/",
"/docs/pe/edge/user-guide/grpc-keepalive/": "/docs/edge/pe/user-guide/grpc-keepalive/",
"/docs/pe/edge/user-guide/grpc-ssl/": "/docs/edge/pe/user-guide/grpc-ssl/",
Expand All @@ -1929,11 +1941,8 @@
"/docs/pe/edge/user-guide/message-statistics/": "/docs/edge/pe/user-guide/message-statistics/",
"/docs/pe/edge/user-guide/ota-updates/": "/docs/edge/pe/user-guide/ota-updates/",
"/docs/pe/edge/user-guide/prometheus-metrics/": "/docs/edge/pe/user-guide/prometheus-metrics/",
"/docs/pe/edge/user-guide/provision-customer/": "/docs/edge/pe/user-guide/provision-customer/",
"/docs/pe/edge/user-guide/provision-customers-and-users/": "/docs/edge/pe/user-guide/provision-customers-and-users/",
"/docs/pe/edge/user-guide/provision-dashboard/": "/docs/edge/pe/user-guide/provision-dashboard/",
"/docs/pe/edge/user-guide/provision-entity-view/": "/docs/edge/pe/user-guide/provision-entity-view/",
"/docs/pe/edge/user-guide/provision-user/": "/docs/edge/pe/user-guide/provision-user/",
"/docs/pe/edge/user-guide/public-dashboard/": "/docs/edge/pe/user-guide/public-dashboard/",
"/docs/pe/edge/user-guide/queues/": "/docs/edge/pe/user-guide/queues/",
"/docs/pe/edge/user-guide/rpc/": "/docs/edge/pe/user-guide/rpc/",
Expand Down
2 changes: 1 addition & 1 deletion src/components/IotHub/CategoryHero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const HERO_PLACEHOLDER =
<source media="(min-width: 1024px)" srcset={heroOptimized.src} />
<img
src={HERO_PLACEHOLDER}
alt=""
alt={crumbLabel ? `${crumbLabel} illustration` : ''}
width={heroWidth}
height={HERO_HEIGHT}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/IotHub/CategoryTile.astro
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const href = `/iot-hub/${slug}/`;
</svg>
</span>
<div class="iot-hub-tile__img">
<Image src={image} alt="" widths={[400, 600, 800]} sizes="(max-width: 750px) 100vw, 400px" />
<Image src={image} alt={`${label} illustration`} widths={[400, 600, 800]} sizes="(max-width: 750px) 100vw, 400px" />
</div>
</a>

Expand Down
6 changes: 3 additions & 3 deletions src/components/IotHub/CreatorHero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ const initials = getInitials(name) || '?';
<section class="creator-hero">
<Breadcrumbs items={[{ label: T.breadcrumbRoot, href: '/iot-hub/' }, { label: name }]} />
<div class="creator-hero__main">
<div class="creator-hero__photo" aria-hidden="true">
<div class="creator-hero__photo">
{avatarUrl ? (
<img src={avatarUrl} alt="" width="140" height="140" loading="eager" decoding="async" />
<img src={avatarUrl} alt={`Photo of ${name}`} width="140" height="140" loading="eager" decoding="async" />
) : (
<span class="creator-hero__initials">{initials}</span>
<span class="creator-hero__initials" aria-hidden="true">{initials}</span>
)}
</div>
<div class="creator-hero__text">
Expand Down
13 changes: 8 additions & 5 deletions src/components/IotHub/iot-hub-dynamic-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
SEARCH_PAGE_SIZE,
DEFAULT_IOT_HUB_SORT_ID,
getCardVariant,
getCategoryForItemType,
getIotHubSortOption,
type IotHubItemType,
type ListingView,
Expand Down Expand Up @@ -61,7 +62,6 @@ function updateResultsCount(countEl: HTMLElement, totalResults: number): void {
// (SearchFilterBar input, IotHubSort selection, Pagination per-page).

const DEBOUNCE_MS = 300;
const ITEM_TYPE_BY_TYPE = new Map(IOT_HUB_CATEGORIES.map((c) => [c.itemType, c]));

// FilterPanel section keys are translated to API/URL params here.
// `type` resolves to one of three names depending on the page's itemType
Expand Down Expand Up @@ -194,7 +194,7 @@ export function setupDynamicSearch(): void {
lastTrackedQuery = null;
return;
}
const key = `${term}${activeFilters}`;
const key = `${term} ${activeFilters}`;
if (key === lastTrackedQuery) return;
lastTrackedQuery = key;
window.dataLayer?.push({
Expand Down Expand Up @@ -318,7 +318,7 @@ export function setupDynamicSearch(): void {
): Array<{ slug: string; label: string; items: ListingView[] }> {
const byType = new Map<IotHubItemType, ListingView[]>();
for (const it of items) {
const cat = ITEM_TYPE_BY_TYPE.get(it.itemType as IotHubItemType);
const cat = getCategoryForItemType(it.itemType);
if (!cat) continue;
const list = byType.get(cat.itemType) ?? [];
list.push(it);
Expand All @@ -339,8 +339,11 @@ export function setupDynamicSearch(): void {
if (itemType) {
// Single-category context (category page) — emit a flat grid
// without a section header, matching the static SSR shape.
const cat = ITEM_TYPE_BY_TYPE.get(itemType as IotHubItemType);
const categorySlug = cat?.slug ?? '';
const cat = getCategoryForItemType(itemType);
// Unknown item type has no public category — skip rather than emit
// cards with a `/iot-hub//slug/` href (matches groupResults).
if (!cat) return;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same "itemType has no public category" condition is now handled three ways across these files: getListingHref returns '#', bindListingCard returns '#', and here renderResults early-returns and drops the whole grid. For this single-category branch the early return is actually the right call — every item shares the page's itemType, so if that type has no category there's genuinely nothing renderable. Just flagging that one condition with three different fallbacks is easy to trip over later; a shared helper for the cat-lookup + skip/'#' decision would make it one choice instead of three. Not blocking.

const categorySlug = cat.slug;
const variant = getCardVariant(itemType);
const grid = document.createElement('div');
grid.className = `iot-hub-grid iot-hub-grid--${variant}`;
Expand Down
11 changes: 9 additions & 2 deletions src/components/IotHub/iot-hub-listing-card-bind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import { bindIotHubIcon } from './iot-hub-icon-bind';
// Sync for everything except the compact thumb glyph, which delegates to
// bindIotHubIcon (async for MDI). Callers don't await — the icon wrapper
// stays in its reset state until the SVG arrives.
//
// Runtime caller: iot-hub-dynamic-search.ts buildCardNode() binds every cloned
// result card on the search / category / creator listing pages. (The
// commented-out line in ListingCardTemplate.astro is an illustrative example,
// not the live call site.)

export function bindListingCard(
root: HTMLElement,
Expand All @@ -27,8 +32,10 @@ export function bindListingCard(
): void {
const variant = getCardVariant(item.itemType);

// Root href.
root.setAttribute('href', `/iot-hub/${categorySlug}/${item.slug}/`);
// Root href. An empty categorySlug (item type with no public category, e.g.
// a type the site doesn't surface) would yield `/iot-hub//slug/` — guard it
// to '#' instead, matching getListingHref.
root.setAttribute('href', categorySlug ? `/iot-hub/${categorySlug}/${item.slug}/` : '#');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads-up that bindListingCard has no runtime caller — the only reference is a commented-out usage example in ListingCardTemplate.astro. So this new empty-slug guard hardens a path nothing currently exercises, and the comment asserting parity with getListingHref isn't exercised either. Fine to keep for symmetry, but worth confirming whether the binder is still meant to be wired up (or removed) rather than left as dead code.


// DEVICE cards get a white preview background (vs the light gray default).
root.classList.toggle('iot-hub-card--device', item.itemType === 'DEVICE');
Expand Down
9 changes: 4 additions & 5 deletions src/components/IotHub/iot-hub-listing-link-bind.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
IOT_HUB_CATEGORIES,
getCategoryForItemType,
getCardVariant,
getPlaceholderIcon,
resolveImage,
Expand All @@ -19,11 +19,10 @@ export const TYPE_FALLBACK_ICON: Record<string, string> = {
DEVICE: 'memory',
};

// Build the `/iot-hub/{category}/{slug}/` href for a listing, falling back
// to `#` when the itemType isn't in IOT_HUB_CATEGORIES (defensive — every
// known item type is registered).
// Build the `/iot-hub/{category}/{slug}/` href for a listing, falling back to
// `#` when the itemType has no public category (see getCategoryForItemType).
export function getListingHref(item: ListingView): string {
const cat = IOT_HUB_CATEGORIES.find((c) => c.itemType === item.itemType);
const cat = getCategoryForItemType(item.itemType);
return cat ? `/iot-hub/${cat.slug}/${item.slug}/` : '#';
}

Expand Down
185 changes: 0 additions & 185 deletions src/content/_includes/docs/edge/user-guide/edge-proxy.mdx

This file was deleted.

Empty file.
Empty file.
Empty file.
8 changes: 0 additions & 8 deletions src/content/docs/docs/edge/pe/user-guide/edge-proxy.mdx

This file was deleted.

Loading