@campfire-interactive/shell-header 0.8.1 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -330,6 +330,7 @@ function UserMenu({
|
|
|
330
330
|
}
|
|
331
331
|
const showTenant = tenant !== void 0;
|
|
332
332
|
const canSwitchTenant = showTenant && onTenantSwitch !== void 0 && Array.isArray(tenants) && tenants.length > 1;
|
|
333
|
+
const sortedTenants = canSwitchTenant ? [...tenants].sort((a, b) => a.name.localeCompare(b.name)) : [];
|
|
333
334
|
async function handleTenantSelect(tenantId) {
|
|
334
335
|
if (!onTenantSwitch || tenantId === tenant?.id) {
|
|
335
336
|
setTenantExpanded(false);
|
|
@@ -386,7 +387,7 @@ function UserMenu({
|
|
|
386
387
|
/* @__PURE__ */ jsx4(Building2, { size: 14 }),
|
|
387
388
|
/* @__PURE__ */ jsx4("span", { className: "cfi-sh-locale-row-label", children: tenant.name })
|
|
388
389
|
] }),
|
|
389
|
-
canSwitchTenant && tenantExpanded && /* @__PURE__ */ jsx4("div", { className: "cfi-sh-locale-sublist", children:
|
|
390
|
+
canSwitchTenant && tenantExpanded && /* @__PURE__ */ jsx4("div", { className: "cfi-sh-locale-sublist", children: sortedTenants.map((t) => {
|
|
390
391
|
const active = t.id === tenant.id;
|
|
391
392
|
return /* @__PURE__ */ jsxs4(
|
|
392
393
|
"button",
|
|
@@ -569,7 +570,7 @@ function VersionSection({ title, version }) {
|
|
|
569
570
|
/* @__PURE__ */ jsx5("code", { children: version.revisionId }),
|
|
570
571
|
/* @__PURE__ */ jsxs5("span", { className: "cfi-sh-about-date", children: [
|
|
571
572
|
" (",
|
|
572
|
-
|
|
573
|
+
formatDateTime(version.revisionDate),
|
|
573
574
|
")"
|
|
574
575
|
] })
|
|
575
576
|
] }),
|
|
@@ -598,15 +599,10 @@ function formatClipboardPayload(about) {
|
|
|
598
599
|
].join("\n");
|
|
599
600
|
}
|
|
600
601
|
function formatLines(v) {
|
|
601
|
-
const lines = [`Revision: ${v.revisionId} (${
|
|
602
|
+
const lines = [`Revision: ${v.revisionId} (${formatDateTime(v.revisionDate)})`];
|
|
602
603
|
if (v.rolloutDate) lines.push(`Deployed: ${formatDateTime(v.rolloutDate)}`);
|
|
603
604
|
return lines;
|
|
604
605
|
}
|
|
605
|
-
function formatDate(iso) {
|
|
606
|
-
const d = new Date(iso);
|
|
607
|
-
if (Number.isNaN(d.getTime())) return iso;
|
|
608
|
-
return d.toISOString().slice(0, 10);
|
|
609
|
-
}
|
|
610
606
|
function formatDateTime(iso) {
|
|
611
607
|
const d = new Date(iso);
|
|
612
608
|
if (Number.isNaN(d.getTime())) return iso;
|