@replicated/portal-components 0.0.21 → 0.0.23
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/components/metadata/registry.json +2 -2
- package/components/metadata/registry.md +2 -2
- package/dist/actions/change-team.js +39 -0
- package/dist/actions/change-team.js.map +1 -1
- package/dist/actions/index.d.mts +1 -1
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.js +40 -0
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/install-actions.d.mts +1 -1
- package/dist/actions/install-actions.d.ts +1 -1
- package/dist/actions/install-actions.js +39 -0
- package/dist/actions/install-actions.js.map +1 -1
- package/dist/actions/service-account.d.mts +1 -1
- package/dist/actions/service-account.d.ts +1 -1
- package/dist/actions/service-account.js +39 -0
- package/dist/actions/service-account.js.map +1 -1
- package/dist/actions/support-bundles.d.mts +1 -1
- package/dist/actions/support-bundles.d.ts +1 -1
- package/dist/actions/support-bundles.js +39 -0
- package/dist/actions/support-bundles.js.map +1 -1
- package/dist/actions/team-settings.d.mts +1 -1
- package/dist/actions/team-settings.d.ts +1 -1
- package/dist/actions/team-settings.js +39 -0
- package/dist/actions/team-settings.js.map +1 -1
- package/dist/actions/trial-signup.js +39 -0
- package/dist/actions/trial-signup.js.map +1 -1
- package/dist/actions/user-settings.d.mts +1 -1
- package/dist/actions/user-settings.d.ts +1 -1
- package/dist/actions/user-settings.js +39 -0
- package/dist/actions/user-settings.js.map +1 -1
- package/dist/airgap-instances.d.mts +1 -1
- package/dist/airgap-instances.d.ts +1 -1
- package/dist/airgap-instances.js +3 -2
- package/dist/airgap-instances.js.map +1 -1
- package/dist/esm/actions/change-team.js +39 -0
- package/dist/esm/actions/change-team.js.map +1 -1
- package/dist/esm/actions/index.js +40 -1
- package/dist/esm/actions/index.js.map +1 -1
- package/dist/esm/actions/install-actions.js +39 -0
- package/dist/esm/actions/install-actions.js.map +1 -1
- package/dist/esm/actions/service-account.js +39 -0
- package/dist/esm/actions/service-account.js.map +1 -1
- package/dist/esm/actions/support-bundles.js +39 -0
- package/dist/esm/actions/support-bundles.js.map +1 -1
- package/dist/esm/actions/team-settings.js +39 -0
- package/dist/esm/actions/team-settings.js.map +1 -1
- package/dist/esm/actions/trial-signup.js +39 -0
- package/dist/esm/actions/trial-signup.js.map +1 -1
- package/dist/esm/actions/user-settings.js +39 -0
- package/dist/esm/actions/user-settings.js.map +1 -1
- package/dist/esm/airgap-instances.js +3 -2
- package/dist/esm/airgap-instances.js.map +1 -1
- package/dist/esm/helm-install-wizard.js +414 -189
- package/dist/esm/helm-install-wizard.js.map +1 -1
- package/dist/esm/index.js +104 -81
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/install-actions.js +39 -0
- package/dist/esm/install-actions.js.map +1 -1
- package/dist/esm/instance-card.js +2 -1
- package/dist/esm/instance-card.js.map +1 -1
- package/dist/esm/license-details.js +39 -0
- package/dist/esm/license-details.js.map +1 -1
- package/dist/esm/linux-install-wizard.js +310 -166
- package/dist/esm/linux-install-wizard.js.map +1 -1
- package/dist/esm/logout-action.js +187 -0
- package/dist/esm/logout-action.js.map +1 -0
- package/dist/esm/logout-button.js +32 -0
- package/dist/esm/logout-button.js.map +1 -0
- package/dist/esm/markdown-renderer.js +16 -0
- package/dist/esm/markdown-renderer.js.map +1 -0
- package/dist/esm/middleware.js +3 -3
- package/dist/esm/middleware.js.map +1 -1
- package/dist/esm/online-instance-list.js +3 -2
- package/dist/esm/online-instance-list.js.map +1 -1
- package/dist/esm/saml-callback-client.js +5 -2
- package/dist/esm/saml-callback-client.js.map +1 -1
- package/dist/esm/saml-handlers.js +104 -0
- package/dist/esm/saml-handlers.js.map +1 -1
- package/dist/esm/support-bundle-collection-card.js +3 -2
- package/dist/esm/support-bundle-collection-card.js.map +1 -1
- package/dist/esm/support-bundles-card.js +2 -2
- package/dist/esm/support-bundles-card.js.map +1 -1
- package/dist/esm/support-card.js +39 -0
- package/dist/esm/support-card.js.map +1 -1
- package/dist/esm/top-nav-menu-close.js +46 -0
- package/dist/esm/top-nav-menu-close.js.map +1 -0
- package/dist/esm/top-nav.js +149 -59
- package/dist/esm/top-nav.js.map +1 -1
- package/dist/esm/trial-signup.js +6 -3
- package/dist/esm/trial-signup.js.map +1 -1
- package/dist/esm/update-layout.js +149 -59
- package/dist/esm/update-layout.js.map +1 -1
- package/dist/esm/upload-support-bundle-modal.js +2 -2
- package/dist/esm/upload-support-bundle-modal.js.map +1 -1
- package/dist/esm/user-menu-dropdown.js +52 -0
- package/dist/esm/user-menu-dropdown.js.map +1 -0
- package/dist/esm/user-settings.js +5 -5
- package/dist/esm/user-settings.js.map +1 -1
- package/dist/esm/utils/index.js +54 -17
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/helm-install-wizard.d.mts +18 -7
- package/dist/helm-install-wizard.d.ts +18 -7
- package/dist/helm-install-wizard.js +418 -189
- package/dist/helm-install-wizard.js.map +1 -1
- package/dist/{index-sMbq94M7.d.ts → index-DXy7RxOX.d.ts} +18 -1
- package/dist/{index-DyzJ0yKD.d.mts → index-JX9-CIMA.d.mts} +18 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +104 -81
- package/dist/index.js.map +1 -1
- package/dist/install-actions.d.mts +2 -2
- package/dist/install-actions.d.ts +2 -2
- package/dist/install-actions.js +39 -0
- package/dist/install-actions.js.map +1 -1
- package/dist/instance-card.d.mts +1 -1
- package/dist/instance-card.d.ts +1 -1
- package/dist/instance-card.js +2 -1
- package/dist/instance-card.js.map +1 -1
- package/dist/license-details.js +39 -0
- package/dist/license-details.js.map +1 -1
- package/dist/linux-install-wizard.d.mts +17 -7
- package/dist/linux-install-wizard.d.ts +17 -7
- package/dist/linux-install-wizard.js +314 -166
- package/dist/linux-install-wizard.js.map +1 -1
- package/dist/logout-action.d.mts +7 -0
- package/dist/logout-action.d.ts +7 -0
- package/dist/logout-action.js +189 -0
- package/dist/logout-action.js.map +1 -0
- package/dist/logout-button.d.mts +16 -0
- package/dist/logout-button.d.ts +16 -0
- package/dist/logout-button.js +34 -0
- package/dist/logout-button.js.map +1 -0
- package/dist/markdown-renderer.d.mts +12 -0
- package/dist/markdown-renderer.d.ts +12 -0
- package/dist/markdown-renderer.js +22 -0
- package/dist/markdown-renderer.js.map +1 -0
- package/dist/middleware.js +3 -3
- package/dist/middleware.js.map +1 -1
- package/dist/online-instance-list.d.mts +1 -1
- package/dist/online-instance-list.d.ts +1 -1
- package/dist/online-instance-list.js +3 -2
- package/dist/online-instance-list.js.map +1 -1
- package/dist/pending-installations.d.mts +1 -1
- package/dist/pending-installations.d.ts +1 -1
- package/dist/saml-callback-client.js +5 -2
- package/dist/saml-callback-client.js.map +1 -1
- package/dist/saml-handlers.js +104 -0
- package/dist/saml-handlers.js.map +1 -1
- package/dist/security-card.d.mts +1 -1
- package/dist/security-card.d.ts +1 -1
- package/dist/styles.css +39 -0
- package/dist/support-bundle-collection-card.js +3 -2
- package/dist/support-bundle-collection-card.js.map +1 -1
- package/dist/support-bundles-card.d.mts +2 -2
- package/dist/support-bundles-card.d.ts +2 -2
- package/dist/support-bundles-card.js +2 -2
- package/dist/support-bundles-card.js.map +1 -1
- package/dist/support-card.js +39 -0
- package/dist/support-card.js.map +1 -1
- package/dist/top-nav-menu-close.d.mts +10 -0
- package/dist/top-nav-menu-close.d.ts +10 -0
- package/dist/top-nav-menu-close.js +48 -0
- package/dist/top-nav-menu-close.js.map +1 -0
- package/dist/top-nav.js +149 -59
- package/dist/top-nav.js.map +1 -1
- package/dist/trial-signup.js +6 -3
- package/dist/trial-signup.js.map +1 -1
- package/dist/update-layout.js +149 -59
- package/dist/update-layout.js.map +1 -1
- package/dist/upload-support-bundle-modal.js +2 -2
- package/dist/upload-support-bundle-modal.js.map +1 -1
- package/dist/user-menu-dropdown.d.mts +25 -0
- package/dist/user-menu-dropdown.d.ts +25 -0
- package/dist/user-menu-dropdown.js +59 -0
- package/dist/user-menu-dropdown.js.map +1 -0
- package/dist/user-settings.js +5 -5
- package/dist/user-settings.js.map +1 -1
- package/dist/utils/index.d.mts +3 -2
- package/dist/utils/index.d.ts +3 -2
- package/dist/utils/index.js +54 -17
- package/dist/utils/index.js.map +1 -1
- package/package.json +29 -2
package/dist/esm/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { Buffer } from 'buffer';
|
|
4
4
|
import { cookies } from 'next/headers';
|
|
5
5
|
import Link from 'next/link';
|
|
6
|
+
import { User } from 'lucide-react';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Enterprise Portal Components
|
|
@@ -120,7 +121,7 @@ var init_tracer = __esm({
|
|
|
120
121
|
|
|
121
122
|
// package.json
|
|
122
123
|
var package_default = {
|
|
123
|
-
version: "0.0.
|
|
124
|
+
version: "0.0.23"};
|
|
124
125
|
|
|
125
126
|
// src/tokens/index.ts
|
|
126
127
|
var baseTokens = {
|
|
@@ -531,24 +532,22 @@ async function validateSession(token) {
|
|
|
531
532
|
if (!token || typeof token !== "string" || !token.trim()) {
|
|
532
533
|
return false;
|
|
533
534
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
return false;
|
|
546
|
-
}
|
|
547
|
-
return response.ok;
|
|
548
|
-
} catch (error) {
|
|
549
|
-
console.warn("[portal-components] session validation error:", error);
|
|
550
|
-
return true;
|
|
535
|
+
const endpoint = `${getApiOrigin()}/enterprise-portal/user`;
|
|
536
|
+
const response = await fetch(endpoint, {
|
|
537
|
+
method: "GET",
|
|
538
|
+
headers: {
|
|
539
|
+
authorization: `Bearer ${token}`
|
|
540
|
+
},
|
|
541
|
+
// Short timeout for validation
|
|
542
|
+
signal: AbortSignal.timeout(5e3)
|
|
543
|
+
});
|
|
544
|
+
if (response.status === 401) {
|
|
545
|
+
return false;
|
|
551
546
|
}
|
|
547
|
+
if (!response.ok) {
|
|
548
|
+
throw new Error(`Session validation failed with status ${response.status}`);
|
|
549
|
+
}
|
|
550
|
+
return true;
|
|
552
551
|
}
|
|
553
552
|
async function deleteSessionCookie() {
|
|
554
553
|
const { cookies: cookies2 } = await import('next/headers');
|
|
@@ -1450,6 +1449,45 @@ var updateNotifications = defineServerAction({
|
|
|
1450
1449
|
};
|
|
1451
1450
|
}
|
|
1452
1451
|
});
|
|
1452
|
+
var fetchDocumentationImpl = async () => {
|
|
1453
|
+
const { cookies: cookies2 } = await import('next/headers');
|
|
1454
|
+
const sessionStore = await cookies2();
|
|
1455
|
+
const session = sessionStore.get("portal_session");
|
|
1456
|
+
const token = session?.value;
|
|
1457
|
+
if (!token) {
|
|
1458
|
+
throw new Error("Authentication required");
|
|
1459
|
+
}
|
|
1460
|
+
const url = `${getApiOrigin()}/enterprise-portal/documentation`;
|
|
1461
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1462
|
+
console.debug(
|
|
1463
|
+
"[portal-components] fetching documentation via %s (Enterprise Portal API)",
|
|
1464
|
+
url
|
|
1465
|
+
);
|
|
1466
|
+
}
|
|
1467
|
+
const response = await authenticatedFetch(url, {
|
|
1468
|
+
method: "GET",
|
|
1469
|
+
token,
|
|
1470
|
+
headers: {
|
|
1471
|
+
accept: "application/json"
|
|
1472
|
+
}
|
|
1473
|
+
});
|
|
1474
|
+
if (!response.ok) {
|
|
1475
|
+
throw new Error(
|
|
1476
|
+
`Documentation request failed (${response.status} ${response.statusText})`
|
|
1477
|
+
);
|
|
1478
|
+
}
|
|
1479
|
+
const data = await response.json();
|
|
1480
|
+
return {
|
|
1481
|
+
helmPreInstall: data.helmPreInstall || "",
|
|
1482
|
+
helmPostInstall: data.helmPostInstall || "",
|
|
1483
|
+
embeddedClusterPreInstall: data.embeddedClusterPreInstall || "",
|
|
1484
|
+
embeddedClusterPostInstall: data.embeddedClusterPostInstall || "",
|
|
1485
|
+
helmInstallUrl: data.helmInstallUrl || "",
|
|
1486
|
+
embeddedClusterInstallUrl: data.embeddedClusterInstallUrl || "",
|
|
1487
|
+
valuesOverrideUrl: data.valuesOverrideUrl || ""
|
|
1488
|
+
};
|
|
1489
|
+
};
|
|
1490
|
+
cache(fetchDocumentationImpl);
|
|
1453
1491
|
var ShieldIcon = (props) => /* @__PURE__ */ jsx(
|
|
1454
1492
|
"svg",
|
|
1455
1493
|
{
|
|
@@ -1707,6 +1745,45 @@ var LicenseDetails = async ({
|
|
|
1707
1745
|
] })
|
|
1708
1746
|
] });
|
|
1709
1747
|
};
|
|
1748
|
+
function UserMenuDropdown({
|
|
1749
|
+
displayLabel,
|
|
1750
|
+
children,
|
|
1751
|
+
className = ""
|
|
1752
|
+
}) {
|
|
1753
|
+
return /* @__PURE__ */ jsxs("details", { className: `group relative ${className}`, children: [
|
|
1754
|
+
/* @__PURE__ */ jsxs("summary", { className: "flex cursor-pointer items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors list-none border border-transparent hover:border-gray-200", children: [
|
|
1755
|
+
/* @__PURE__ */ jsx(User, { className: "h-4 w-4" }),
|
|
1756
|
+
/* @__PURE__ */ jsx("span", { children: displayLabel }),
|
|
1757
|
+
/* @__PURE__ */ jsx(
|
|
1758
|
+
"svg",
|
|
1759
|
+
{
|
|
1760
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1761
|
+
width: "16",
|
|
1762
|
+
height: "16",
|
|
1763
|
+
viewBox: "0 0 24 24",
|
|
1764
|
+
fill: "none",
|
|
1765
|
+
stroke: "currentColor",
|
|
1766
|
+
strokeWidth: "2",
|
|
1767
|
+
strokeLinecap: "round",
|
|
1768
|
+
strokeLinejoin: "round",
|
|
1769
|
+
className: "h-4 w-4 text-gray-500 transition-transform group-open:rotate-180",
|
|
1770
|
+
children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" })
|
|
1771
|
+
}
|
|
1772
|
+
)
|
|
1773
|
+
] }),
|
|
1774
|
+
/* @__PURE__ */ jsx("div", { className: "absolute right-0 mt-2 w-52 rounded-lg border border-gray-200 bg-white py-1.5 shadow-xl z-50", children })
|
|
1775
|
+
] });
|
|
1776
|
+
}
|
|
1777
|
+
function UserMenuItem({ href, children }) {
|
|
1778
|
+
return /* @__PURE__ */ jsx(
|
|
1779
|
+
Link,
|
|
1780
|
+
{
|
|
1781
|
+
href,
|
|
1782
|
+
className: "block w-full px-4 py-2.5 text-sm text-gray-700 hover:bg-gray-50 transition-colors",
|
|
1783
|
+
children
|
|
1784
|
+
}
|
|
1785
|
+
);
|
|
1786
|
+
}
|
|
1710
1787
|
var defaultTopNavLinks = [
|
|
1711
1788
|
{
|
|
1712
1789
|
label: "Dashboard",
|
|
@@ -2003,65 +2080,11 @@ var TopNav = async ({
|
|
|
2003
2080
|
),
|
|
2004
2081
|
/* @__PURE__ */ jsx("span", { className: "text-xl font-bold text-gray-900", children: brandTitle || "Enterprise Portal" })
|
|
2005
2082
|
] }),
|
|
2006
|
-
/* @__PURE__ */ jsxs(
|
|
2007
|
-
/* @__PURE__ */
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2012
|
-
width: "16",
|
|
2013
|
-
height: "16",
|
|
2014
|
-
viewBox: "0 0 24 24",
|
|
2015
|
-
fill: "none",
|
|
2016
|
-
stroke: "currentColor",
|
|
2017
|
-
strokeWidth: "2",
|
|
2018
|
-
strokeLinecap: "round",
|
|
2019
|
-
strokeLinejoin: "round",
|
|
2020
|
-
className: "text-gray-500",
|
|
2021
|
-
children: [
|
|
2022
|
-
/* @__PURE__ */ jsx("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
2023
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "7", r: "4" })
|
|
2024
|
-
]
|
|
2025
|
-
}
|
|
2026
|
-
),
|
|
2027
|
-
/* @__PURE__ */ jsx("span", { children: displayLabel }),
|
|
2028
|
-
/* @__PURE__ */ jsx(
|
|
2029
|
-
"svg",
|
|
2030
|
-
{
|
|
2031
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2032
|
-
width: "16",
|
|
2033
|
-
height: "16",
|
|
2034
|
-
viewBox: "0 0 24 24",
|
|
2035
|
-
fill: "none",
|
|
2036
|
-
stroke: "currentColor",
|
|
2037
|
-
strokeWidth: "2",
|
|
2038
|
-
strokeLinecap: "round",
|
|
2039
|
-
strokeLinejoin: "round",
|
|
2040
|
-
className: "text-gray-500",
|
|
2041
|
-
children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" })
|
|
2042
|
-
}
|
|
2043
|
-
)
|
|
2044
|
-
] }),
|
|
2045
|
-
/* @__PURE__ */ jsxs("div", { className: "absolute right-0 mt-2 w-48 rounded-md border border-gray-200 bg-white py-2 text-sm text-gray-700 shadow-lg z-50", children: [
|
|
2046
|
-
/* @__PURE__ */ jsx(
|
|
2047
|
-
Link,
|
|
2048
|
-
{
|
|
2049
|
-
href: "/user-settings",
|
|
2050
|
-
className: "block w-full px-4 py-2 text-left hover:bg-gray-100",
|
|
2051
|
-
children: "User settings"
|
|
2052
|
-
}
|
|
2053
|
-
),
|
|
2054
|
-
/* @__PURE__ */ jsx(
|
|
2055
|
-
Link,
|
|
2056
|
-
{
|
|
2057
|
-
href: "/team-settings",
|
|
2058
|
-
className: "block w-full px-4 py-2 text-left hover:bg-gray-100",
|
|
2059
|
-
children: "Team settings"
|
|
2060
|
-
}
|
|
2061
|
-
),
|
|
2062
|
-
userMenuChildren,
|
|
2063
|
-
logoutButton
|
|
2064
|
-
] })
|
|
2083
|
+
/* @__PURE__ */ jsxs(UserMenuDropdown, { displayLabel, children: [
|
|
2084
|
+
/* @__PURE__ */ jsx(UserMenuItem, { href: "/user-settings", children: "User settings" }),
|
|
2085
|
+
/* @__PURE__ */ jsx(UserMenuItem, { href: "/team-settings", children: "Team settings" }),
|
|
2086
|
+
userMenuChildren,
|
|
2087
|
+
logoutButton
|
|
2065
2088
|
] })
|
|
2066
2089
|
] }),
|
|
2067
2090
|
/* @__PURE__ */ jsx("div", { className: "mt-3 flex flex-wrap gap-3 pb-2 text-sm font-medium text-gray-500", children: resolvedLinks.map(({ label, icon, href }) => {
|
|
@@ -2328,7 +2351,7 @@ var TeamsSection = ({
|
|
|
2328
2351
|
"svg",
|
|
2329
2352
|
{
|
|
2330
2353
|
className: "h-4 w-4",
|
|
2331
|
-
style: { color: primaryColor ||
|
|
2354
|
+
style: { color: primaryColor || DEFAULT_PRIMARY_COLOR },
|
|
2332
2355
|
fill: "none",
|
|
2333
2356
|
viewBox: "0 0 24 24",
|
|
2334
2357
|
stroke: "currentColor",
|
|
@@ -2352,7 +2375,7 @@ var TeamsSection = ({
|
|
|
2352
2375
|
"svg",
|
|
2353
2376
|
{
|
|
2354
2377
|
className: "h-4 w-4",
|
|
2355
|
-
style: { color: primaryColor ||
|
|
2378
|
+
style: { color: primaryColor || DEFAULT_PRIMARY_COLOR },
|
|
2356
2379
|
fill: "none",
|
|
2357
2380
|
viewBox: "0 0 24 24",
|
|
2358
2381
|
stroke: "currentColor",
|
|
@@ -2418,8 +2441,8 @@ var ProfileSection = ({
|
|
|
2418
2441
|
setIsEditing(true);
|
|
2419
2442
|
};
|
|
2420
2443
|
const buttonStyle = {
|
|
2421
|
-
backgroundColor: primaryColor ||
|
|
2422
|
-
borderColor: primaryColor ||
|
|
2444
|
+
backgroundColor: primaryColor || DEFAULT_PRIMARY_COLOR,
|
|
2445
|
+
borderColor: primaryColor || DEFAULT_PRIMARY_COLOR
|
|
2423
2446
|
};
|
|
2424
2447
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-2xl border border-gray-200 bg-white p-6 shadow-sm", children: [
|
|
2425
2448
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|