@seliseblocks/genesis-os 4.3.2 → 4.3.4
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/{chunk-BCALMPEF.cjs → chunk-CME46DIB.cjs} +933 -472
- package/dist/chunk-CME46DIB.cjs.map +1 -0
- package/dist/{chunk-VNSES4D3.js → chunk-EF42GERU.js} +907 -447
- package/dist/chunk-EF42GERU.js.map +1 -0
- package/dist/{chunk-QMVZVNIZ.js → chunk-H47HQ5UX.js} +56 -15
- package/dist/chunk-H47HQ5UX.js.map +1 -0
- package/dist/{chunk-GZSVB47D.cjs → chunk-XALNVJQU.cjs} +55 -13
- package/dist/chunk-XALNVJQU.cjs.map +1 -0
- package/dist/components/index.cjs +343 -339
- package/dist/components/index.d.cts +13 -2
- package/dist/components/index.d.ts +13 -2
- package/dist/components/index.js +2 -2
- package/dist/hooks/index.cjs +45 -41
- package/dist/hooks/index.d.cts +26 -11
- package/dist/hooks/index.d.ts +26 -11
- package/dist/hooks/index.js +1 -1
- package/dist/index.cjs +399 -391
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/layouts/index.cjs +9 -9
- package/dist/layouts/index.js +2 -2
- package/dist/pages/index.cjs +7 -7
- package/dist/pages/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-BCALMPEF.cjs.map +0 -1
- package/dist/chunk-GZSVB47D.cjs.map +0 -1
- package/dist/chunk-QMVZVNIZ.js.map +0 -1
- package/dist/chunk-VNSES4D3.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkXJ6DPUCV_cjs = require('./chunk-XJ6DPUCV.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkXALNVJQU_cjs = require('./chunk-XALNVJQU.cjs');
|
|
5
5
|
var chunkVTOD5ZQU_cjs = require('./chunk-VTOD5ZQU.cjs');
|
|
6
6
|
var chunkZVGCCTNK_cjs = require('./chunk-ZVGCCTNK.cjs');
|
|
7
7
|
var chunkQ7Y32IBM_cjs = require('./chunk-Q7Y32IBM.cjs');
|
|
@@ -1525,7 +1525,7 @@ function RightSidePanelProvider({
|
|
|
1525
1525
|
const close = React8__namespace.useCallback(() => {
|
|
1526
1526
|
setOpen(false);
|
|
1527
1527
|
}, [setOpen]);
|
|
1528
|
-
|
|
1528
|
+
chunkXALNVJQU_cjs.useKeyboardShortcut(shortcut, toggle);
|
|
1529
1529
|
React8__namespace.useEffect(() => {
|
|
1530
1530
|
if (!syncHash || isControlled || typeof window === "undefined") return;
|
|
1531
1531
|
const handleHashChange = () => {
|
|
@@ -3501,7 +3501,7 @@ function MultiSelect({
|
|
|
3501
3501
|
onChange,
|
|
3502
3502
|
value: selectedValues
|
|
3503
3503
|
}) {
|
|
3504
|
-
const [buttonRef, popoverWidth] =
|
|
3504
|
+
const [buttonRef, popoverWidth] = chunkXALNVJQU_cjs.usePopoverWidth();
|
|
3505
3505
|
const onSelectHandler = (value) => {
|
|
3506
3506
|
const nextValues = selectedValues.includes(value) ? selectedValues.filter((item) => item !== value) : [...selectedValues, value];
|
|
3507
3507
|
onChange(nextValues);
|
|
@@ -6690,7 +6690,7 @@ function useAppRedirectUrls({
|
|
|
6690
6690
|
const controller = new AbortController();
|
|
6691
6691
|
const { signal } = controller;
|
|
6692
6692
|
stableApps.forEach((app) => {
|
|
6693
|
-
|
|
6693
|
+
chunkXALNVJQU_cjs.initiateService.fetchRedirectUrl({
|
|
6694
6694
|
clientId: chunkX4YCRWXO_cjs.getRuntimeEnv(app.clientId),
|
|
6695
6695
|
redirectUri: chunkX4YCRWXO_cjs.getRuntimeEnv(app.redirectUri),
|
|
6696
6696
|
forwardedTo: resolveRef.current(app)
|
|
@@ -6716,7 +6716,7 @@ function useAppRedirectUrls({
|
|
|
6716
6716
|
}
|
|
6717
6717
|
var AppSwitcher = ({ forwardedTo }) => {
|
|
6718
6718
|
const [open, setOpen] = React8.useState(false);
|
|
6719
|
-
const config =
|
|
6719
|
+
const config = chunkXALNVJQU_cjs.useBlocksAppConfigStore((state) => state.getConfig());
|
|
6720
6720
|
const filteredApps = React8.useMemo(
|
|
6721
6721
|
() => filteredAppSwitcherData.filter((app) => app.id !== config.name),
|
|
6722
6722
|
[config.name]
|
|
@@ -6743,32 +6743,82 @@ var AppSwitcher = ({ forwardedTo }) => {
|
|
|
6743
6743
|
)
|
|
6744
6744
|
] });
|
|
6745
6745
|
};
|
|
6746
|
-
var OPTIONS =
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6746
|
+
var OPTIONS = {
|
|
6747
|
+
system: { Icon: lucideReact.Monitor, label: "Auto" },
|
|
6748
|
+
light: { Icon: lucideReact.Sun, label: "Light" },
|
|
6749
|
+
dark: { Icon: lucideReact.Moon, label: "Dark" }
|
|
6750
|
+
};
|
|
6751
|
+
var OPTION_ORDER = ["system", "light", "dark"];
|
|
6752
|
+
var TRIGGER_BASE_CLASSES = "relative z-50 inline-flex h-9 items-center justify-center gap-2 px-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";
|
|
6753
|
+
var TRIGGER_DEFAULT_TYPOGRAPHY_CLASSES = "text-sm font-medium text-muted-foreground hover:text-foreground";
|
|
6754
|
+
function ThemeSwitcher({
|
|
6755
|
+
className,
|
|
6756
|
+
showChevron = true
|
|
6757
|
+
} = {}) {
|
|
6758
|
+
const { theme, setTheme } = chunkXALNVJQU_cjs.useTheme();
|
|
6759
|
+
const { Icon: ThemeIcon, label: themeLabel } = OPTIONS[theme];
|
|
6760
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
|
|
6761
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6762
|
+
"button",
|
|
6763
|
+
{
|
|
6764
|
+
type: "button",
|
|
6765
|
+
"aria-label": "Change theme",
|
|
6766
|
+
className: chunkYAF2X7W5_cjs.cn(
|
|
6767
|
+
TRIGGER_BASE_CLASSES,
|
|
6768
|
+
className ?? TRIGGER_DEFAULT_TYPOGRAPHY_CLASSES
|
|
6769
|
+
),
|
|
6770
|
+
children: [
|
|
6771
|
+
/* @__PURE__ */ jsxRuntime.jsx(ThemeIcon, { className: "h-4 w-4", "aria-hidden": true }),
|
|
6772
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: themeLabel }),
|
|
6773
|
+
showChevron && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6774
|
+
lucideReact.ChevronDown,
|
|
6775
|
+
{
|
|
6776
|
+
className: "h-3.5 w-3.5 text-muted-foreground",
|
|
6777
|
+
"aria-hidden": true
|
|
6778
|
+
}
|
|
6779
|
+
)
|
|
6780
|
+
]
|
|
6781
|
+
}
|
|
6782
|
+
) }),
|
|
6783
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { align: "end", className: "min-w-40", children: [
|
|
6784
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuLabel, { className: "px-2 py-1.5 text-xs font-medium text-muted-foreground", children: "Appearance" }),
|
|
6785
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6786
|
+
DropdownMenuRadioGroup,
|
|
6760
6787
|
{
|
|
6761
|
-
value,
|
|
6762
|
-
|
|
6763
|
-
children:
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6788
|
+
value: theme,
|
|
6789
|
+
onValueChange: (value) => setTheme(value),
|
|
6790
|
+
children: OPTION_ORDER.map((value) => {
|
|
6791
|
+
const { Icon: Icon2, label } = OPTIONS[value];
|
|
6792
|
+
const isActive = value === theme;
|
|
6793
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6794
|
+
DropdownMenuRadioItem,
|
|
6795
|
+
{
|
|
6796
|
+
value,
|
|
6797
|
+
className: chunkYAF2X7W5_cjs.cn(
|
|
6798
|
+
"gap-2 border border-transparent py-2 hover:border-input",
|
|
6799
|
+
isActive && "text-primary"
|
|
6800
|
+
),
|
|
6801
|
+
children: [
|
|
6802
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6803
|
+
Icon2,
|
|
6804
|
+
{
|
|
6805
|
+
className: chunkYAF2X7W5_cjs.cn(
|
|
6806
|
+
"h-4 w-4",
|
|
6807
|
+
isActive ? "text-foreground" : "text-muted-foreground"
|
|
6808
|
+
),
|
|
6809
|
+
"aria-hidden": true
|
|
6810
|
+
}
|
|
6811
|
+
),
|
|
6812
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkYAF2X7W5_cjs.cn(isActive && "text-foreground font-medium"), children: label })
|
|
6813
|
+
]
|
|
6814
|
+
},
|
|
6815
|
+
value
|
|
6816
|
+
);
|
|
6817
|
+
})
|
|
6818
|
+
}
|
|
6819
|
+
)
|
|
6820
|
+
] })
|
|
6821
|
+
] });
|
|
6772
6822
|
}
|
|
6773
6823
|
|
|
6774
6824
|
// src/services/user.service.ts
|
|
@@ -6816,14 +6866,14 @@ function UserAvatar({ size = "sm" }) {
|
|
|
6816
6866
|
);
|
|
6817
6867
|
}
|
|
6818
6868
|
function UserDropdownMenu() {
|
|
6819
|
-
const { name } =
|
|
6869
|
+
const { name } = chunkXALNVJQU_cjs.useBlocksAppConfigStore((state) => state.config);
|
|
6820
6870
|
const { data: data2 } = useGetUserInfo();
|
|
6821
6871
|
const userData = data2?.data;
|
|
6822
|
-
const { isPending, mutateAsync } =
|
|
6872
|
+
const { isPending, mutateAsync } = chunkXALNVJQU_cjs.useLogout();
|
|
6823
6873
|
const { resetProjectStore } = chunkVAKGHXK6_cjs.useProjectStore();
|
|
6824
6874
|
const { setUnAuthenticated, clearTokens } = chunkVAKGHXK6_cjs.useAuthStore();
|
|
6825
6875
|
const { resetSelectedLanguages } = chunk3VNGGYRG_cjs.useLanguageViewStore();
|
|
6826
|
-
const { data: myOrgsData, isLoading: isOrgsLoading } =
|
|
6876
|
+
const { data: myOrgsData, isLoading: isOrgsLoading } = chunkXALNVJQU_cjs.useGetMyOrganizations();
|
|
6827
6877
|
const fullName = [userData?.firstName, userData?.lastName].filter(Boolean).join(" ") || "\u2014";
|
|
6828
6878
|
const email = userData?.email || "";
|
|
6829
6879
|
const roles = Object.values(userData?.roles || {}).flat();
|
|
@@ -6953,7 +7003,7 @@ var languages = [
|
|
|
6953
7003
|
{ key: "fr", title: "French" }
|
|
6954
7004
|
];
|
|
6955
7005
|
function LanguageSelector() {
|
|
6956
|
-
const { changeLanguage, language } =
|
|
7006
|
+
const { changeLanguage, language } = chunkXALNVJQU_cjs.useLanguageSwitcher();
|
|
6957
7007
|
return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
|
|
6958
7008
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6959
7009
|
"button",
|
|
@@ -7043,7 +7093,7 @@ var notificationListenerService = new NotificationListenerService();
|
|
|
7043
7093
|
|
|
7044
7094
|
// src/components/common/notification/use-notification-socket.ts
|
|
7045
7095
|
function useNotificationSocket() {
|
|
7046
|
-
const { data: configData } =
|
|
7096
|
+
const { data: configData } = chunkXALNVJQU_cjs.useGetBlocksNotificationConfig(0, 100);
|
|
7047
7097
|
const queryClient = reactQuery.useQueryClient();
|
|
7048
7098
|
notificationListenerService.connect();
|
|
7049
7099
|
React8.useEffect(() => {
|
|
@@ -7058,7 +7108,7 @@ function useNotificationSocket() {
|
|
|
7058
7108
|
notificationListenerService.connection.on(
|
|
7059
7109
|
config.notifyMethod,
|
|
7060
7110
|
(message) => {
|
|
7061
|
-
|
|
7111
|
+
chunkXALNVJQU_cjs.notificationService.getNotificationConfig(config, message);
|
|
7062
7112
|
try {
|
|
7063
7113
|
const notice = typeof message === "string" ? JSON.parse(message) : message;
|
|
7064
7114
|
const denom = JSON.parse(
|
|
@@ -7082,12 +7132,12 @@ function useNotificationFeed(open) {
|
|
|
7082
7132
|
const [notifications, setNotifications] = React8.useState([]);
|
|
7083
7133
|
const [hasMore, setHasMore] = React8.useState(true);
|
|
7084
7134
|
const listRef = React8.useRef(null);
|
|
7085
|
-
const { data: data2, isLoading, isFetching } =
|
|
7135
|
+
const { data: data2, isLoading, isFetching } = chunkXALNVJQU_cjs.useGetNotifications(
|
|
7086
7136
|
pageNumber,
|
|
7087
7137
|
PAGE_SIZE
|
|
7088
7138
|
);
|
|
7089
|
-
const markAsRead =
|
|
7090
|
-
const markAllAsRead =
|
|
7139
|
+
const markAsRead = chunkXALNVJQU_cjs.useMarkAsRead();
|
|
7140
|
+
const markAllAsRead = chunkXALNVJQU_cjs.useMarkAllAsRead();
|
|
7091
7141
|
React8.useEffect(() => {
|
|
7092
7142
|
if (!data2?.notifications) return;
|
|
7093
7143
|
setNotifications((prev) => {
|
|
@@ -7321,7 +7371,7 @@ function ConsoleHeader() {
|
|
|
7321
7371
|
window.addEventListener("scroll", handleScroll);
|
|
7322
7372
|
return () => window.removeEventListener("scroll", handleScroll);
|
|
7323
7373
|
}, []);
|
|
7324
|
-
const { appLightLogo, appDarkLogo } =
|
|
7374
|
+
const { appLightLogo, appDarkLogo } = chunkXALNVJQU_cjs.useLogo();
|
|
7325
7375
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7326
7376
|
"div",
|
|
7327
7377
|
{
|
|
@@ -7784,12 +7834,11 @@ function OidcLayout({
|
|
|
7784
7834
|
var LoginHeader = ({
|
|
7785
7835
|
docsUrl = "https://docs.seliseblocks.com/",
|
|
7786
7836
|
blocksUrl = "https://seliseblocks.com",
|
|
7787
|
-
githubUrl = "https://github.com/SELISEdigitalplatforms"
|
|
7788
|
-
signUpUrl
|
|
7837
|
+
githubUrl = "https://github.com/SELISEdigitalplatforms"
|
|
7789
7838
|
}) => {
|
|
7790
7839
|
const {
|
|
7791
7840
|
config: { appLogoUrl }
|
|
7792
|
-
} =
|
|
7841
|
+
} = chunkXALNVJQU_cjs.useBlocksAppConfigStore((state) => state);
|
|
7793
7842
|
const resolveLogo = (variant) => {
|
|
7794
7843
|
if (!appLogoUrl) return void 0;
|
|
7795
7844
|
if (typeof appLogoUrl === "string") return appLogoUrl;
|
|
@@ -7830,8 +7879,13 @@ var LoginHeader = ({
|
|
|
7830
7879
|
children: "GitHub"
|
|
7831
7880
|
}
|
|
7832
7881
|
),
|
|
7833
|
-
|
|
7834
|
-
|
|
7882
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7883
|
+
ThemeSwitcher,
|
|
7884
|
+
{
|
|
7885
|
+
className: "nav-link inline-flex items-center gap-1.5",
|
|
7886
|
+
showChevron: false
|
|
7887
|
+
}
|
|
7888
|
+
)
|
|
7835
7889
|
] })
|
|
7836
7890
|
] });
|
|
7837
7891
|
};
|
|
@@ -8015,18 +8069,6 @@ var blocksLoginStyles = `
|
|
|
8015
8069
|
.blocksLogin-page .nav-link:hover { color: var(--fg); text-shadow: 0 0 12px var(--accent-glow); }
|
|
8016
8070
|
.blocksLogin-page .nav-link:hover::after { width: 100%; }
|
|
8017
8071
|
|
|
8018
|
-
.blocksLogin-page .nav-cta {
|
|
8019
|
-
font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
|
|
8020
|
-
font-weight: 600; color: var(--accent2); text-decoration: none;
|
|
8021
|
-
padding: 7px 16px; border-radius: 6px;
|
|
8022
|
-
border: 1px solid rgba(0,102,178,0.35); background: rgba(0,102,178,0.06);
|
|
8023
|
-
transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
|
|
8024
|
-
}
|
|
8025
|
-
.blocksLogin-page .nav-cta:hover {
|
|
8026
|
-
background: rgba(0,102,178,0.12); border-color: var(--accent);
|
|
8027
|
-
box-shadow: 0 0 12px rgba(0,102,178,0.12);
|
|
8028
|
-
}
|
|
8029
|
-
|
|
8030
8072
|
.blocksLogin-page .main {
|
|
8031
8073
|
flex: 1; min-height: 0; display: grid;
|
|
8032
8074
|
grid-template-columns: 1fr 400px; gap: 56px;
|
|
@@ -8179,10 +8221,15 @@ var blocksLoginStyles = `
|
|
|
8179
8221
|
display: inline-flex; align-items: center; gap: 6px;
|
|
8180
8222
|
color: var(--accent2); text-decoration: none; font-weight: 600;
|
|
8181
8223
|
transition: gap 0.25s var(--ease-out-expo), text-shadow 0.25s ease;
|
|
8224
|
+
/* Renders as a button: it asks IAM for the signup URL rather than linking to one,
|
|
8225
|
+
so the UA button styling has to be reset back to the inline-link look. */
|
|
8226
|
+
background: none; border: 0; padding: 0; margin: 0;
|
|
8227
|
+
font: inherit; font-weight: 600; cursor: pointer;
|
|
8182
8228
|
}
|
|
8183
|
-
.blocksLogin-page .cta-signup-link:
|
|
8229
|
+
.blocksLogin-page .cta-signup-link:disabled { cursor: default; opacity: 0.7; }
|
|
8230
|
+
.blocksLogin-page .cta-signup-link:hover:not(:disabled) { gap: 10px; text-shadow: 0 0 10px var(--accent2-glow); }
|
|
8184
8231
|
.blocksLogin-page .cta-signup-link svg { transition: transform 0.25s var(--ease-out-expo); }
|
|
8185
|
-
.blocksLogin-page .cta-signup-link:hover svg { transform: translateX(3px); }
|
|
8232
|
+
.blocksLogin-page .cta-signup-link:hover:not(:disabled) svg { transform: translateX(3px); }
|
|
8186
8233
|
|
|
8187
8234
|
.blocksLogin-page .col-right {
|
|
8188
8235
|
display: flex; flex-direction: column; min-height: 0; overflow: hidden;
|
|
@@ -8343,7 +8390,6 @@ var blocksLoginStyles = `
|
|
|
8343
8390
|
.blocksLogin-page .feature-pill { padding: 5px 10px; font-size: 0.58rem; }
|
|
8344
8391
|
.blocksLogin-page .cta-row { gap: 18px; }
|
|
8345
8392
|
.blocksLogin-page .cta-signup { font-size: 0.78rem; }
|
|
8346
|
-
.blocksLogin-page .nav-cta { padding: 6px 12px; font-size: 0.62rem; }
|
|
8347
8393
|
}
|
|
8348
8394
|
|
|
8349
8395
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -8738,7 +8784,9 @@ var BlocksLoginPage = ({
|
|
|
8738
8784
|
loginLabel = "Log in to your account",
|
|
8739
8785
|
docsUrl = "https://docs.seliseblocks.com/",
|
|
8740
8786
|
footerLink = { label: "Visit Blocks", url: "https://seliseblocks.com" },
|
|
8741
|
-
|
|
8787
|
+
showSignUp = false,
|
|
8788
|
+
onSignUp,
|
|
8789
|
+
isSignUpLoading = false,
|
|
8742
8790
|
carouselItems
|
|
8743
8791
|
}) => {
|
|
8744
8792
|
const canvasRef = React8.useRef(null);
|
|
@@ -8859,7 +8907,7 @@ var BlocksLoginPage = ({
|
|
|
8859
8907
|
}
|
|
8860
8908
|
}
|
|
8861
8909
|
),
|
|
8862
|
-
/* @__PURE__ */ jsxRuntime.jsx(LoginHeader, {
|
|
8910
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoginHeader, {}),
|
|
8863
8911
|
/* @__PURE__ */ jsxRuntime.jsxs("main", { className: "main", children: [
|
|
8864
8912
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-left", children: [
|
|
8865
8913
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "eyebrow", children: eyebrow }),
|
|
@@ -8912,24 +8960,33 @@ var BlocksLoginPage = ({
|
|
|
8912
8960
|
}
|
|
8913
8961
|
)
|
|
8914
8962
|
] }),
|
|
8915
|
-
|
|
8963
|
+
showSignUp && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "cta-signup", children: [
|
|
8916
8964
|
"Not a member?",
|
|
8917
8965
|
" ",
|
|
8918
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8919
|
-
"
|
|
8920
|
-
|
|
8921
|
-
"
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8966
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8967
|
+
"button",
|
|
8968
|
+
{
|
|
8969
|
+
type: "button",
|
|
8970
|
+
onClick: onSignUp,
|
|
8971
|
+
disabled: isSignUpLoading,
|
|
8972
|
+
className: "cta-signup-link",
|
|
8973
|
+
children: [
|
|
8974
|
+
isSignUpLoading ? "Redirecting\u2026" : "Sign up",
|
|
8975
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8976
|
+
"svg",
|
|
8977
|
+
{
|
|
8978
|
+
width: "11",
|
|
8979
|
+
height: "11",
|
|
8980
|
+
viewBox: "0 0 24 24",
|
|
8981
|
+
fill: "none",
|
|
8982
|
+
stroke: "currentColor",
|
|
8983
|
+
strokeWidth: "2.5",
|
|
8984
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 12h14M12 5l7 7-7 7" })
|
|
8985
|
+
}
|
|
8986
|
+
)
|
|
8987
|
+
]
|
|
8988
|
+
}
|
|
8989
|
+
)
|
|
8933
8990
|
] })
|
|
8934
8991
|
] }),
|
|
8935
8992
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-right", children: [
|
|
@@ -9046,16 +9103,19 @@ var BlocksLoginPage = ({
|
|
|
9046
9103
|
] });
|
|
9047
9104
|
};
|
|
9048
9105
|
var LoginPage = () => {
|
|
9049
|
-
const config =
|
|
9050
|
-
const { start, isLoading } =
|
|
9051
|
-
const {
|
|
9106
|
+
const config = chunkXALNVJQU_cjs.useBlocksAppConfigStore((state) => state.getConfig());
|
|
9107
|
+
const { start, isLoading } = chunkXALNVJQU_cjs.useLogin();
|
|
9108
|
+
const { canSignUp } = chunkXALNVJQU_cjs.useSignUpAffordance();
|
|
9109
|
+
const { start: startSignUp, isLoading: isSignUpLoading } = chunkXALNVJQU_cjs.useSignUpRedirect();
|
|
9052
9110
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9053
9111
|
BlocksLoginPage,
|
|
9054
9112
|
{
|
|
9055
9113
|
name: config.name,
|
|
9056
9114
|
onLogin: start,
|
|
9057
9115
|
isLoading,
|
|
9058
|
-
|
|
9116
|
+
showSignUp: canSignUp,
|
|
9117
|
+
onSignUp: startSignUp,
|
|
9118
|
+
isSignUpLoading,
|
|
9059
9119
|
carouselItems: BLOCKS_PRODUCTS
|
|
9060
9120
|
}
|
|
9061
9121
|
);
|
|
@@ -9131,10 +9191,10 @@ var DefaultDoc = () => {
|
|
|
9131
9191
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-5 md:grid-cols-2 lg:grid-cols-3", children: data.map((item) => /* @__PURE__ */ jsxRuntime.jsx(DocCard, { ...item }, item.url)) });
|
|
9132
9192
|
};
|
|
9133
9193
|
function useCreateProjectRedirect() {
|
|
9134
|
-
const { name } =
|
|
9194
|
+
const { name } = chunkXALNVJQU_cjs.useBlocksAppConfigStore((state) => state.config);
|
|
9135
9195
|
const navigate = reactRouter.useNavigate();
|
|
9136
9196
|
const osApp = filteredAppSwitcherData.find((app) => app.id === "blocks-os");
|
|
9137
|
-
const { isFetching, isReady, redirect } =
|
|
9197
|
+
const { isFetching, isReady, redirect } = chunkXALNVJQU_cjs.usePrefetchRedirect({
|
|
9138
9198
|
clientId: osApp ? chunkX4YCRWXO_cjs.getRuntimeEnv(osApp.clientId) : "",
|
|
9139
9199
|
redirectUri: osApp ? chunkX4YCRWXO_cjs.getRuntimeEnv(osApp.redirectUri) : "",
|
|
9140
9200
|
forwardedTo: "/app/create-project",
|
|
@@ -9226,10 +9286,10 @@ function useProjectOverviewRedirect({
|
|
|
9226
9286
|
tenantGroupId
|
|
9227
9287
|
}) {
|
|
9228
9288
|
const navigate = reactRouter.useNavigate();
|
|
9229
|
-
const { name } =
|
|
9289
|
+
const { name } = chunkXALNVJQU_cjs.useBlocksAppConfigStore((state) => state.config);
|
|
9230
9290
|
const osApp = filteredAppSwitcherData.find((app) => app.id === "blocks-os");
|
|
9231
9291
|
const redirectedRoute = `/app/project/${tenantGroupId}/environments`;
|
|
9232
|
-
const { isFetching, isReady, redirect } =
|
|
9292
|
+
const { isFetching, isReady, redirect } = chunkXALNVJQU_cjs.usePrefetchRedirect({
|
|
9233
9293
|
clientId: osApp ? chunkX4YCRWXO_cjs.getRuntimeEnv(osApp.clientId) : "",
|
|
9234
9294
|
redirectUri: osApp ? chunkX4YCRWXO_cjs.getRuntimeEnv(osApp.redirectUri) : "",
|
|
9235
9295
|
forwardedTo: redirectedRoute,
|
|
@@ -9249,52 +9309,141 @@ function useProjectOverviewRedirect({
|
|
|
9249
9309
|
isFetching
|
|
9250
9310
|
};
|
|
9251
9311
|
}
|
|
9252
|
-
var
|
|
9253
|
-
|
|
9312
|
+
var getActionLabels = (canOpen, isShared) => {
|
|
9313
|
+
if (canOpen) {
|
|
9314
|
+
return isShared ? { accessibleLabel: "Open shared project", tooltipLabel: "Open Project" } : {
|
|
9315
|
+
accessibleLabel: "Configure project",
|
|
9316
|
+
tooltipLabel: "Configure Project"
|
|
9317
|
+
};
|
|
9318
|
+
}
|
|
9319
|
+
return {
|
|
9320
|
+
accessibleLabel: "Project access unavailable",
|
|
9321
|
+
tooltipLabel: "Project access unavailable"
|
|
9322
|
+
};
|
|
9323
|
+
};
|
|
9324
|
+
var ProjectActionButton = ({
|
|
9254
9325
|
project,
|
|
9255
|
-
projects,
|
|
9256
9326
|
isShared,
|
|
9257
9327
|
canOpen = true
|
|
9258
9328
|
}) => {
|
|
9259
|
-
const
|
|
9260
|
-
const { setTenantGroup, setSelectedProject } = chunkVAKGHXK6_cjs.useProjectStore();
|
|
9329
|
+
const { setTenantGroup } = chunkVAKGHXK6_cjs.useProjectStore();
|
|
9261
9330
|
const { handleClick, isDisabled, isFetching } = useProjectOverviewRedirect({
|
|
9262
9331
|
tenantGroupId: project.tenantGroupId
|
|
9263
9332
|
});
|
|
9264
|
-
const
|
|
9333
|
+
const isActionDisabled = !canOpen || isDisabled || isFetching;
|
|
9334
|
+
const { accessibleLabel, tooltipLabel } = getActionLabels(canOpen, isShared);
|
|
9335
|
+
const onClick = () => {
|
|
9265
9336
|
setTenantGroup(project.tenantGroupId);
|
|
9266
9337
|
handleClick();
|
|
9267
9338
|
};
|
|
9268
|
-
|
|
9269
|
-
|
|
9339
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
9340
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9341
|
+
Button,
|
|
9342
|
+
{
|
|
9343
|
+
size: "icon",
|
|
9344
|
+
"data-testid": isShared ? "project-card-open-shared" : "project-card-configure",
|
|
9345
|
+
variant: "ghost",
|
|
9346
|
+
className: "text-primary hover:bg-primary/10 h-8 w-8 shrink-0 transition-colors",
|
|
9347
|
+
disabled: isActionDisabled,
|
|
9348
|
+
onClick,
|
|
9349
|
+
"aria-label": accessibleLabel,
|
|
9350
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings2, { size: 16 })
|
|
9351
|
+
}
|
|
9352
|
+
) }),
|
|
9353
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: tooltipLabel })
|
|
9354
|
+
] });
|
|
9355
|
+
};
|
|
9356
|
+
|
|
9357
|
+
// src/pages/console/project-list-utils.ts
|
|
9358
|
+
var canOpenProject = (group) => !group.isShared || !group.accessPolicies || group.accessPolicies.length > 0;
|
|
9359
|
+
var getProjectGroupName = (group) => group.projects[0]?.name ?? "";
|
|
9360
|
+
var getLatestProjectUpdate = (group) => group.projects.reduce((latest, project) => {
|
|
9361
|
+
const timestamp = Date.parse(project.lastUpdatedDate);
|
|
9362
|
+
return Number.isFinite(timestamp) ? Math.max(latest, timestamp) : latest;
|
|
9363
|
+
}, 0);
|
|
9364
|
+
var getEnvironmentLabel = (environment) => environmentOptions.find((option) => option.value === environment)?.label ?? environment;
|
|
9365
|
+
var INLINE_LIMIT = 3;
|
|
9366
|
+
var ProjectEnvironments = ({ projects }) => {
|
|
9367
|
+
const navigate = reactRouter.useNavigate();
|
|
9368
|
+
const { setTenantGroup, setSelectedProject } = chunkVAKGHXK6_cjs.useProjectStore();
|
|
9369
|
+
const onEnvironmentClick = async (event, project) => {
|
|
9370
|
+
event.stopPropagation();
|
|
9270
9371
|
try {
|
|
9271
|
-
setTenantGroup(
|
|
9272
|
-
setSelectedProject(
|
|
9273
|
-
navigate(`/app/${
|
|
9274
|
-
} catch (
|
|
9275
|
-
console.error("Failed to switch environment",
|
|
9372
|
+
setTenantGroup(project.tenantGroupId);
|
|
9373
|
+
setSelectedProject(project);
|
|
9374
|
+
navigate(`/app/${project.itemId}/dashboard`);
|
|
9375
|
+
} catch (error) {
|
|
9376
|
+
console.error("Failed to switch environment", error);
|
|
9276
9377
|
}
|
|
9277
9378
|
};
|
|
9278
|
-
const
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
9282
|
-
|
|
9283
|
-
"
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9294
|
-
};
|
|
9379
|
+
const renderEnvironmentChip = (project) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9380
|
+
"button",
|
|
9381
|
+
{
|
|
9382
|
+
type: "button",
|
|
9383
|
+
onClick: (event) => onEnvironmentClick(event, project),
|
|
9384
|
+
className: "group/chip border-primary bg-primary text-primary-foreground hover:text-primary inline-flex cursor-pointer items-center gap-1 rounded-full border px-2.5 py-0.5 text-xs font-medium transition-all duration-150 hover:border-blocks-primary-50 hover:bg-blocks-primary-25 active:scale-95",
|
|
9385
|
+
children: [
|
|
9386
|
+
getEnvironmentLabel(project.environment),
|
|
9387
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-3 w-3 transition-all duration-150 group-hover/chip:translate-x-0.5" })
|
|
9388
|
+
]
|
|
9389
|
+
},
|
|
9390
|
+
project.environment
|
|
9391
|
+
);
|
|
9392
|
+
if (projects.length === 0) {
|
|
9393
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "border-border/60 bg-muted/40 text-muted-foreground inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs", children: "No environments" });
|
|
9394
|
+
}
|
|
9295
9395
|
const hasOverflow = projects.length > INLINE_LIMIT;
|
|
9296
9396
|
const visibleProjects = hasOverflow ? projects.slice(0, INLINE_LIMIT) : projects;
|
|
9297
9397
|
const overflowCount = projects.length - INLINE_LIMIT;
|
|
9398
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
9399
|
+
visibleProjects.map(renderEnvironmentChip),
|
|
9400
|
+
hasOverflow && /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
9401
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9402
|
+
"button",
|
|
9403
|
+
{
|
|
9404
|
+
type: "button",
|
|
9405
|
+
onClick: (event) => event.stopPropagation(),
|
|
9406
|
+
className: "border-border/60 bg-muted/40 text-muted-foreground hover:bg-muted hover:text-foreground inline-flex cursor-pointer items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors",
|
|
9407
|
+
children: [
|
|
9408
|
+
"+",
|
|
9409
|
+
overflowCount,
|
|
9410
|
+
" more"
|
|
9411
|
+
]
|
|
9412
|
+
}
|
|
9413
|
+
) }),
|
|
9414
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9415
|
+
PopoverContent,
|
|
9416
|
+
{
|
|
9417
|
+
className: "w-52 p-1.5",
|
|
9418
|
+
align: "start",
|
|
9419
|
+
onClick: (event) => event.stopPropagation(),
|
|
9420
|
+
children: [
|
|
9421
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground px-2 pb-1.5 pt-1 text-[10px] font-semibold uppercase tracking-wider", children: "All environments" }),
|
|
9422
|
+
projects.map((project) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9423
|
+
"button",
|
|
9424
|
+
{
|
|
9425
|
+
type: "button",
|
|
9426
|
+
onClick: (event) => onEnvironmentClick(event, project),
|
|
9427
|
+
className: "group/item hover:bg-accent flex w-full items-center justify-between rounded-md px-2 py-1.5 text-sm transition-colors",
|
|
9428
|
+
children: [
|
|
9429
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: getEnvironmentLabel(project.environment) }),
|
|
9430
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "text-muted-foreground group-hover/item:text-foreground h-3.5 w-3.5 transition-transform duration-150 group-hover/item:translate-x-0.5" })
|
|
9431
|
+
]
|
|
9432
|
+
},
|
|
9433
|
+
project.environment
|
|
9434
|
+
))
|
|
9435
|
+
]
|
|
9436
|
+
}
|
|
9437
|
+
)
|
|
9438
|
+
] })
|
|
9439
|
+
] });
|
|
9440
|
+
};
|
|
9441
|
+
var ProjectCard = ({
|
|
9442
|
+
project,
|
|
9443
|
+
projects,
|
|
9444
|
+
isShared,
|
|
9445
|
+
canOpen = true
|
|
9446
|
+
}) => {
|
|
9298
9447
|
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "border-border/60 bg-card hover:border-primary/30 group flex h-40 flex-col overflow-hidden rounded-xl border p-4 shadow-sm transition-all duration-200 hover:shadow-md", children: [
|
|
9299
9448
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-start justify-between gap-2", children: [
|
|
9300
9449
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { className: "line-clamp-3 break-all text-base font-semibold leading-snug", children: project.name }) }),
|
|
@@ -9314,171 +9463,660 @@ var ProjectCard = ({
|
|
|
9314
9463
|
]
|
|
9315
9464
|
}
|
|
9316
9465
|
),
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
Button,
|
|
9320
|
-
{
|
|
9321
|
-
size: "icon",
|
|
9322
|
-
"data-testid": "project-card-open-shared",
|
|
9323
|
-
variant: "ghost",
|
|
9324
|
-
className: "text-primary hover:bg-primary/10 h-8 w-8 shrink-0 transition-colors",
|
|
9325
|
-
disabled: isDisabled || isFetching,
|
|
9326
|
-
onClick: onConfigureClick,
|
|
9327
|
-
"aria-label": "Open shared project",
|
|
9328
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings2, { size: 16 })
|
|
9329
|
-
}
|
|
9330
|
-
) }),
|
|
9331
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: "Open Project" })
|
|
9332
|
-
] })
|
|
9333
|
-
] }),
|
|
9334
|
-
whenFalse: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
9335
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9336
|
-
Button,
|
|
9466
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9467
|
+
ProjectActionButton,
|
|
9337
9468
|
{
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
className: "text-primary hover:bg-primary/10 h-8 w-8 shrink-0 transition-colors",
|
|
9342
|
-
disabled: isDisabled || isFetching,
|
|
9343
|
-
onClick: onConfigureClick,
|
|
9344
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings2, { size: 16 })
|
|
9469
|
+
project,
|
|
9470
|
+
isShared: true,
|
|
9471
|
+
canOpen
|
|
9345
9472
|
}
|
|
9346
|
-
)
|
|
9347
|
-
|
|
9348
|
-
|
|
9473
|
+
)
|
|
9474
|
+
] }),
|
|
9475
|
+
whenFalse: /* @__PURE__ */ jsxRuntime.jsx(ProjectActionButton, { project, isShared: false })
|
|
9349
9476
|
}
|
|
9350
9477
|
) })
|
|
9351
9478
|
] }),
|
|
9352
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-auto", children:
|
|
9353
|
-
visibleProjects.map((p) => renderEnvChip(p)),
|
|
9354
|
-
hasOverflow && /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
9355
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9356
|
-
"button",
|
|
9357
|
-
{
|
|
9358
|
-
onClick: (e) => e.stopPropagation(),
|
|
9359
|
-
className: "border-border/60 bg-muted/40 text-muted-foreground hover:bg-muted hover:text-foreground inline-flex cursor-pointer items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors",
|
|
9360
|
-
children: [
|
|
9361
|
-
"+",
|
|
9362
|
-
overflowCount,
|
|
9363
|
-
" more"
|
|
9364
|
-
]
|
|
9365
|
-
}
|
|
9366
|
-
) }),
|
|
9367
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9368
|
-
PopoverContent,
|
|
9369
|
-
{
|
|
9370
|
-
className: "w-52 p-1.5",
|
|
9371
|
-
align: "start",
|
|
9372
|
-
onClick: (e) => e.stopPropagation(),
|
|
9373
|
-
children: [
|
|
9374
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground px-2 pb-1.5 pt-1 text-[10px] font-semibold uppercase tracking-wider", children: "All environments" }),
|
|
9375
|
-
projects.map((p) => {
|
|
9376
|
-
const opt = environmentOptions.find(
|
|
9377
|
-
(o) => o.value === p.environment
|
|
9378
|
-
);
|
|
9379
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9380
|
-
"button",
|
|
9381
|
-
{
|
|
9382
|
-
onClick: (e) => onEnvBadgeClick(e, p),
|
|
9383
|
-
className: "group/item hover:bg-accent flex w-full items-center justify-between rounded-md px-2 py-1.5 text-sm transition-colors",
|
|
9384
|
-
children: [
|
|
9385
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: opt?.label ?? p.environment }),
|
|
9386
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "text-muted-foreground group-hover/item:text-foreground h-3.5 w-3.5 transition-transform duration-150 group-hover/item:translate-x-0.5" })
|
|
9387
|
-
]
|
|
9388
|
-
},
|
|
9389
|
-
p.environment
|
|
9390
|
-
);
|
|
9391
|
-
})
|
|
9392
|
-
]
|
|
9393
|
-
}
|
|
9394
|
-
)
|
|
9395
|
-
] })
|
|
9396
|
-
] }) })
|
|
9479
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-auto", children: /* @__PURE__ */ jsxRuntime.jsx(ProjectEnvironments, { projects }) })
|
|
9397
9480
|
] });
|
|
9398
9481
|
};
|
|
9399
|
-
var
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
opacity: 1,
|
|
9403
|
-
y: 0,
|
|
9404
|
-
scale: 1,
|
|
9405
|
-
transition: {
|
|
9406
|
-
delay: i * 0.06,
|
|
9407
|
-
duration: 0.4,
|
|
9408
|
-
ease: [0.22, 1, 0.36, 1]
|
|
9409
|
-
}
|
|
9410
|
-
})
|
|
9482
|
+
var getLastUpdatedLabel = (group) => {
|
|
9483
|
+
const timestamp = getLatestProjectUpdate(group);
|
|
9484
|
+
return timestamp === 0 ? "Unknown" : dateFns.formatDistanceToNow(timestamp, { addSuffix: true });
|
|
9411
9485
|
};
|
|
9412
|
-
var
|
|
9413
|
-
|
|
9414
|
-
return
|
|
9415
|
-
(itemKey) => /* @__PURE__ */ jsxRuntime.jsx(ProjectCardLoadingSkeleton, {}, itemKey)
|
|
9416
|
-
) });
|
|
9486
|
+
var getLastUpdatedCellLabel = (group) => {
|
|
9487
|
+
const timestamp = getLatestProjectUpdate(group);
|
|
9488
|
+
return timestamp === 0 ? "Not updated yet" : `Updated ${dateFns.formatDistanceToNow(timestamp, { addSuffix: true })}`;
|
|
9417
9489
|
};
|
|
9418
|
-
var
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
] }),
|
|
9430
|
-
canCreateProject && projectGroups.length > 9 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-sm text-[hsl(var(--medium-emphasis))]", children: "Please delete an existing project to create a new one." })
|
|
9431
|
-
] }),
|
|
9432
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: [
|
|
9433
|
-
projectGroups.length < 10 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9434
|
-
framerMotion.motion.div,
|
|
9435
|
-
{
|
|
9436
|
-
variants: cardVariants,
|
|
9437
|
-
custom: 0,
|
|
9438
|
-
initial: "hidden",
|
|
9439
|
-
animate: "visible",
|
|
9440
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(AddProjectCard, {})
|
|
9441
|
-
}
|
|
9442
|
-
),
|
|
9443
|
-
projectGroups.map((project, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
9444
|
-
framerMotion.motion.div,
|
|
9445
|
-
{
|
|
9446
|
-
variants: cardVariants,
|
|
9447
|
-
custom: projectGroups.length < 10 ? i + 1 : i,
|
|
9448
|
-
initial: "hidden",
|
|
9449
|
-
animate: "visible",
|
|
9450
|
-
children: project.projects[0] && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9451
|
-
ProjectCard,
|
|
9452
|
-
{
|
|
9453
|
-
project: project.projects[0],
|
|
9454
|
-
projects: project.projects,
|
|
9455
|
-
isShared: project.isShared,
|
|
9456
|
-
canOpen: canOpenProject(project)
|
|
9457
|
-
}
|
|
9458
|
-
)
|
|
9459
|
-
},
|
|
9460
|
-
project.tenantGroupId
|
|
9461
|
-
))
|
|
9462
|
-
] })
|
|
9463
|
-
] });
|
|
9490
|
+
var CARD_RADIUS = "0.75rem";
|
|
9491
|
+
var ROW_SPACING = "0 0.5rem";
|
|
9492
|
+
var cardCorners = {
|
|
9493
|
+
left: {
|
|
9494
|
+
borderTopLeftRadius: CARD_RADIUS,
|
|
9495
|
+
borderBottomLeftRadius: CARD_RADIUS
|
|
9496
|
+
},
|
|
9497
|
+
right: {
|
|
9498
|
+
borderTopRightRadius: CARD_RADIUS,
|
|
9499
|
+
borderBottomRightRadius: CARD_RADIUS
|
|
9500
|
+
}
|
|
9464
9501
|
};
|
|
9465
|
-
var
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9502
|
+
var SharedStatus = ({ isShared }) => isShared ? /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "outline", className: "flex w-fit items-center gap-1", children: [
|
|
9503
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.UsersRound, { size: 16 }),
|
|
9504
|
+
"Shared"
|
|
9505
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
9506
|
+
var AddProjectListAction = ({ mobile = false }) => {
|
|
9507
|
+
const { handleClick, isDisabled, isFetching } = useCreateProjectRedirect();
|
|
9508
|
+
const action = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9509
|
+
Button,
|
|
9510
|
+
{
|
|
9511
|
+
type: "button",
|
|
9512
|
+
variant: "ghost",
|
|
9513
|
+
className: "text-primary w-full justify-start gap-2",
|
|
9514
|
+
disabled: isDisabled || isFetching,
|
|
9515
|
+
onClick: handleClick,
|
|
9516
|
+
children: [
|
|
9517
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4" }),
|
|
9518
|
+
"Add Project"
|
|
9519
|
+
]
|
|
9520
|
+
}
|
|
9521
|
+
);
|
|
9522
|
+
if (mobile) {
|
|
9523
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9524
|
+
Card,
|
|
9525
|
+
{
|
|
9526
|
+
"data-testid": "add-project-list-row",
|
|
9527
|
+
className: "border-primary/30 rounded-xl border border-dashed p-2",
|
|
9528
|
+
children: action
|
|
9529
|
+
}
|
|
9530
|
+
);
|
|
9531
|
+
}
|
|
9532
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TableRow, { "data-testid": "add-project-list-row", className: "border-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9533
|
+
TableCell,
|
|
9534
|
+
{
|
|
9535
|
+
colSpan: 5,
|
|
9536
|
+
className: "border-primary/30 border border-dashed bg-transparent p-2",
|
|
9537
|
+
style: { borderRadius: CARD_RADIUS },
|
|
9538
|
+
children: action
|
|
9539
|
+
}
|
|
9540
|
+
) });
|
|
9541
|
+
};
|
|
9542
|
+
var ProjectMobileList = ({
|
|
9543
|
+
projectGroups,
|
|
9544
|
+
showAddProject
|
|
9545
|
+
}) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-3", "data-testid": "project-list-mobile", children: [
|
|
9546
|
+
showAddProject && /* @__PURE__ */ jsxRuntime.jsx(AddProjectListAction, { mobile: true }),
|
|
9547
|
+
projectGroups.map((group) => {
|
|
9548
|
+
const project = group.projects[0];
|
|
9549
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9550
|
+
Card,
|
|
9551
|
+
{
|
|
9552
|
+
"data-testid": "project-list-row",
|
|
9553
|
+
className: "border-border/60 space-y-3 rounded-xl border p-4 shadow-sm",
|
|
9554
|
+
children: [
|
|
9555
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
9556
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 space-y-2", children: [
|
|
9557
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardTitle, { className: "break-all text-base", children: getProjectGroupName(group) || "Unnamed project" }),
|
|
9558
|
+
/* @__PURE__ */ jsxRuntime.jsx(SharedStatus, { isShared: group.isShared })
|
|
9559
|
+
] }),
|
|
9560
|
+
project && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9561
|
+
ProjectActionButton,
|
|
9562
|
+
{
|
|
9563
|
+
project,
|
|
9564
|
+
isShared: group.isShared,
|
|
9565
|
+
canOpen: canOpenProject(group)
|
|
9566
|
+
}
|
|
9567
|
+
)
|
|
9568
|
+
] }),
|
|
9569
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProjectEnvironments, { projects: group.projects }),
|
|
9570
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground text-xs", children: [
|
|
9571
|
+
"Last updated ",
|
|
9572
|
+
getLastUpdatedLabel(group)
|
|
9573
|
+
] })
|
|
9574
|
+
]
|
|
9575
|
+
},
|
|
9576
|
+
group.tenantGroupId
|
|
9577
|
+
);
|
|
9578
|
+
})
|
|
9579
|
+
] });
|
|
9580
|
+
var ProjectList = ({
|
|
9581
|
+
projectGroups,
|
|
9582
|
+
showAddProject
|
|
9583
|
+
}) => {
|
|
9584
|
+
const isMobile = chunkQ7Y32IBM_cjs.useIsMobile();
|
|
9585
|
+
if (isMobile) {
|
|
9586
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9587
|
+
ProjectMobileList,
|
|
9588
|
+
{
|
|
9589
|
+
projectGroups,
|
|
9590
|
+
showAddProject
|
|
9591
|
+
}
|
|
9592
|
+
);
|
|
9593
|
+
}
|
|
9594
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9595
|
+
Table,
|
|
9596
|
+
{
|
|
9597
|
+
"data-testid": "project-list-table",
|
|
9598
|
+
style: { borderCollapse: "separate", borderSpacing: ROW_SPACING },
|
|
9599
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(TableBody, { children: [
|
|
9600
|
+
showAddProject && /* @__PURE__ */ jsxRuntime.jsx(AddProjectListAction, {}),
|
|
9601
|
+
projectGroups.map((group) => {
|
|
9602
|
+
const project = group.projects[0];
|
|
9603
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9604
|
+
TableRow,
|
|
9605
|
+
{
|
|
9606
|
+
"data-testid": "project-list-row",
|
|
9607
|
+
className: "border-0",
|
|
9608
|
+
children: [
|
|
9609
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9610
|
+
TableCell,
|
|
9611
|
+
{
|
|
9612
|
+
className: "bg-card max-w-64 break-all py-2 font-medium",
|
|
9613
|
+
style: cardCorners.left,
|
|
9614
|
+
children: getProjectGroupName(group) || "Unnamed project"
|
|
9615
|
+
}
|
|
9616
|
+
),
|
|
9617
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "bg-card py-2", children: /* @__PURE__ */ jsxRuntime.jsx(ProjectEnvironments, { projects: group.projects }) }),
|
|
9618
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "bg-card py-2", children: /* @__PURE__ */ jsxRuntime.jsx(SharedStatus, { isShared: group.isShared }) }),
|
|
9619
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "bg-card whitespace-nowrap py-2 text-muted-foreground", children: getLastUpdatedCellLabel(group) }),
|
|
9620
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9621
|
+
TableCell,
|
|
9622
|
+
{
|
|
9623
|
+
className: "bg-card py-2 text-right",
|
|
9624
|
+
style: cardCorners.right,
|
|
9625
|
+
children: project && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9626
|
+
ProjectActionButton,
|
|
9627
|
+
{
|
|
9628
|
+
project,
|
|
9629
|
+
isShared: group.isShared,
|
|
9630
|
+
canOpen: canOpenProject(group)
|
|
9631
|
+
}
|
|
9632
|
+
)
|
|
9633
|
+
}
|
|
9634
|
+
)
|
|
9635
|
+
]
|
|
9636
|
+
},
|
|
9637
|
+
group.tenantGroupId
|
|
9638
|
+
);
|
|
9639
|
+
})
|
|
9640
|
+
] })
|
|
9641
|
+
}
|
|
9642
|
+
);
|
|
9643
|
+
};
|
|
9644
|
+
function MultiSelect2({
|
|
9645
|
+
label,
|
|
9646
|
+
options,
|
|
9647
|
+
onChange,
|
|
9648
|
+
value: selectedValues
|
|
9649
|
+
}) {
|
|
9650
|
+
const [buttonRef, popoverWidth] = chunkXALNVJQU_cjs.usePopoverWidth();
|
|
9651
|
+
const onSelectHandler = (value) => {
|
|
9652
|
+
const nextValues = selectedValues.includes(value) ? selectedValues.filter((item) => item !== value) : [...selectedValues, value];
|
|
9653
|
+
onChange(nextValues);
|
|
9654
|
+
};
|
|
9655
|
+
const onResetHandler = () => {
|
|
9656
|
+
onChange([]);
|
|
9657
|
+
};
|
|
9658
|
+
const isMobile = chunkQ7Y32IBM_cjs.useIsMobile();
|
|
9659
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
9660
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9661
|
+
Button,
|
|
9662
|
+
{
|
|
9663
|
+
ref: buttonRef,
|
|
9664
|
+
variant: "outline",
|
|
9665
|
+
size: "sm",
|
|
9666
|
+
className: "h-8 rounded-md border-dashed",
|
|
9667
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
9668
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
|
|
9669
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactIcons.PlusCircledIcon, { className: "mr-2 h-4 w-4" }),
|
|
9670
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: label }),
|
|
9671
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sm:hidden", children: label?.split(" ")[0] })
|
|
9672
|
+
] }),
|
|
9673
|
+
selectedValues?.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9674
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9675
|
+
Separator,
|
|
9676
|
+
{
|
|
9677
|
+
orientation: "vertical",
|
|
9678
|
+
className: "hidden h-4 sm:mx-2 sm:block"
|
|
9679
|
+
}
|
|
9680
|
+
),
|
|
9681
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex space-x-1", children: selectedValues.length > 2 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9682
|
+
Badge,
|
|
9683
|
+
{
|
|
9684
|
+
variant: "outline",
|
|
9685
|
+
className: "rounded-sm px-1 font-normal",
|
|
9686
|
+
children: [
|
|
9687
|
+
selectedValues.length,
|
|
9688
|
+
" selected"
|
|
9689
|
+
]
|
|
9690
|
+
}
|
|
9691
|
+
) : options.filter((option) => selectedValues.includes(option.value)).map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
9692
|
+
Badge,
|
|
9693
|
+
{
|
|
9694
|
+
variant: "outline",
|
|
9695
|
+
className: "rounded-sm px-1 font-normal",
|
|
9696
|
+
children: option.label
|
|
9697
|
+
},
|
|
9698
|
+
option.value
|
|
9699
|
+
)) })
|
|
9700
|
+
] })
|
|
9701
|
+
] })
|
|
9702
|
+
}
|
|
9703
|
+
) }),
|
|
9704
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9705
|
+
PopoverContent,
|
|
9706
|
+
{
|
|
9707
|
+
className: "w-auto p-0 sm:w-full",
|
|
9708
|
+
align: "start",
|
|
9709
|
+
style: isMobile ? { width: popoverWidth ? `${popoverWidth}px` : "auto" } : void 0,
|
|
9710
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
|
|
9711
|
+
/* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: label }),
|
|
9712
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
|
|
9713
|
+
/* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: "No results found." }),
|
|
9714
|
+
/* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: options.map((option) => {
|
|
9715
|
+
const isSelected = selectedValues.includes(option.value);
|
|
9716
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9717
|
+
CommandItem,
|
|
9718
|
+
{
|
|
9719
|
+
onSelect: () => onSelectHandler(option.value),
|
|
9720
|
+
children: [
|
|
9721
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9722
|
+
"div",
|
|
9723
|
+
{
|
|
9724
|
+
className: chunkYAF2X7W5_cjs.cn(
|
|
9725
|
+
"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
|
|
9726
|
+
isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
|
|
9727
|
+
),
|
|
9728
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.CheckIcon, { className: chunkYAF2X7W5_cjs.cn("h-4 w-4") })
|
|
9729
|
+
}
|
|
9730
|
+
),
|
|
9731
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: option.label })
|
|
9732
|
+
]
|
|
9733
|
+
},
|
|
9734
|
+
option.value
|
|
9735
|
+
);
|
|
9736
|
+
}) }),
|
|
9737
|
+
selectedValues.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9738
|
+
/* @__PURE__ */ jsxRuntime.jsx(CommandSeparator, {}),
|
|
9739
|
+
/* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9740
|
+
CommandItem,
|
|
9741
|
+
{
|
|
9742
|
+
onSelect: () => onResetHandler(),
|
|
9743
|
+
className: "justify-center text-center",
|
|
9744
|
+
children: "Clear"
|
|
9745
|
+
}
|
|
9746
|
+
) })
|
|
9747
|
+
] })
|
|
9748
|
+
] })
|
|
9749
|
+
] })
|
|
9750
|
+
}
|
|
9751
|
+
)
|
|
9752
|
+
] });
|
|
9753
|
+
}
|
|
9754
|
+
var ResetButton = ({ onClick }) => {
|
|
9755
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9756
|
+
Button,
|
|
9757
|
+
{
|
|
9758
|
+
type: "button",
|
|
9759
|
+
variant: "outline",
|
|
9760
|
+
onClick,
|
|
9761
|
+
className: "h-8 rounded-md px-2 lg:px-3",
|
|
9762
|
+
children: [
|
|
9763
|
+
"Reset",
|
|
9764
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "ml-2 h-4 w-4" })
|
|
9765
|
+
]
|
|
9766
|
+
}
|
|
9767
|
+
);
|
|
9768
|
+
};
|
|
9769
|
+
var SearchInput = ({
|
|
9770
|
+
onChange,
|
|
9771
|
+
placeholder = "Search...",
|
|
9772
|
+
value,
|
|
9773
|
+
className = ""
|
|
9774
|
+
}) => {
|
|
9775
|
+
const [state, setState] = React8.useState(value);
|
|
9776
|
+
const inputRef = React8.useRef(null);
|
|
9777
|
+
React8.useEffect(() => {
|
|
9778
|
+
setState(value);
|
|
9779
|
+
}, [value]);
|
|
9780
|
+
const debounced = React8.useRef(
|
|
9781
|
+
chunkVTOD5ZQU_cjs.debounce((val) => {
|
|
9782
|
+
onChange(val);
|
|
9783
|
+
}, 300)
|
|
9784
|
+
).current;
|
|
9785
|
+
React8.useEffect(() => {
|
|
9786
|
+
return () => {
|
|
9787
|
+
debounced.cancel();
|
|
9788
|
+
};
|
|
9789
|
+
}, [debounced]);
|
|
9790
|
+
const handleChange = (event) => {
|
|
9791
|
+
event.stopPropagation();
|
|
9792
|
+
setState(event.target.value);
|
|
9793
|
+
debounced(event.target.value);
|
|
9794
|
+
};
|
|
9795
|
+
const handleClear = (e) => {
|
|
9796
|
+
e.stopPropagation();
|
|
9797
|
+
setState("");
|
|
9798
|
+
onChange("");
|
|
9799
|
+
};
|
|
9800
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-md border bg-background flex items-center px-2", children: [
|
|
9801
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "mr-2 h-4 w-4 text-muted-foreground" }),
|
|
9802
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9803
|
+
Input,
|
|
9804
|
+
{
|
|
9805
|
+
ref: inputRef,
|
|
9806
|
+
placeholder,
|
|
9807
|
+
value: state,
|
|
9808
|
+
onChange: handleChange,
|
|
9809
|
+
className: chunkYAF2X7W5_cjs.cn(
|
|
9810
|
+
"h-8 w-52 border-none p-0 focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
9811
|
+
className
|
|
9812
|
+
)
|
|
9813
|
+
}
|
|
9814
|
+
),
|
|
9815
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9816
|
+
Button,
|
|
9817
|
+
{
|
|
9818
|
+
variant: "ghost",
|
|
9819
|
+
size: "xs",
|
|
9820
|
+
className: chunkYAF2X7W5_cjs.cn(
|
|
9821
|
+
"h-full p-1 pr-0 hover:bg-transparent",
|
|
9822
|
+
!value && "invisible"
|
|
9823
|
+
),
|
|
9824
|
+
onClick: handleClear,
|
|
9825
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4 text-muted-foreground" })
|
|
9826
|
+
}
|
|
9827
|
+
)
|
|
9828
|
+
] });
|
|
9829
|
+
};
|
|
9830
|
+
var ProjectToolbar = ({
|
|
9831
|
+
availableEnvironmentOptions,
|
|
9832
|
+
environmentFilter,
|
|
9833
|
+
onEnvironmentFilterChange,
|
|
9834
|
+
onReset,
|
|
9835
|
+
onSearchTextChange,
|
|
9836
|
+
onViewModeChange,
|
|
9837
|
+
searchText,
|
|
9838
|
+
viewMode
|
|
9839
|
+
}) => {
|
|
9840
|
+
const hasActiveFilters = searchText.trim().length > 0 || environmentFilter.length > 0;
|
|
9841
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9842
|
+
"div",
|
|
9843
|
+
{
|
|
9844
|
+
className: "flex flex-wrap items-center justify-between gap-3",
|
|
9845
|
+
"aria-label": "Project filters and view",
|
|
9846
|
+
children: [
|
|
9847
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
9848
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9849
|
+
SearchInput,
|
|
9850
|
+
{
|
|
9851
|
+
value: searchText,
|
|
9852
|
+
onChange: onSearchTextChange,
|
|
9853
|
+
placeholder: "Search projects..."
|
|
9854
|
+
}
|
|
9855
|
+
),
|
|
9856
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9857
|
+
MultiSelect2,
|
|
9858
|
+
{
|
|
9859
|
+
label: "Environment",
|
|
9860
|
+
options: availableEnvironmentOptions,
|
|
9861
|
+
value: environmentFilter,
|
|
9862
|
+
onChange: onEnvironmentFilterChange
|
|
9863
|
+
}
|
|
9864
|
+
),
|
|
9865
|
+
hasActiveFilters && /* @__PURE__ */ jsxRuntime.jsx(ResetButton, { onClick: onReset })
|
|
9866
|
+
] }),
|
|
9867
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9868
|
+
ToggleGroup,
|
|
9869
|
+
{
|
|
9870
|
+
type: "single",
|
|
9871
|
+
variant: "outline",
|
|
9872
|
+
size: "sm",
|
|
9873
|
+
value: viewMode,
|
|
9874
|
+
onValueChange: (value) => {
|
|
9875
|
+
if (value === "grid" || value === "list") onViewModeChange(value);
|
|
9876
|
+
},
|
|
9877
|
+
"aria-label": "Project view",
|
|
9878
|
+
className: "h-8 rounded-md border bg-background p-0.5",
|
|
9879
|
+
children: [
|
|
9880
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9881
|
+
ToggleGroupItem,
|
|
9882
|
+
{
|
|
9883
|
+
value: "grid",
|
|
9884
|
+
"aria-label": "Grid view",
|
|
9885
|
+
className: "h-7 w-7 min-w-0 border-0 px-0",
|
|
9886
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LayoutGrid, { className: "h-4 w-4" })
|
|
9887
|
+
}
|
|
9888
|
+
),
|
|
9889
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9890
|
+
ToggleGroupItem,
|
|
9891
|
+
{
|
|
9892
|
+
value: "list",
|
|
9893
|
+
"aria-label": "List view",
|
|
9894
|
+
className: "h-7 w-7 min-w-0 border-0 px-0",
|
|
9895
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.List, { className: "h-4 w-4" })
|
|
9896
|
+
}
|
|
9897
|
+
)
|
|
9898
|
+
]
|
|
9899
|
+
}
|
|
9900
|
+
)
|
|
9901
|
+
]
|
|
9902
|
+
}
|
|
9903
|
+
);
|
|
9904
|
+
};
|
|
9905
|
+
var DEFAULT_SORT = {
|
|
9906
|
+
property: "lastUpdatedDate",
|
|
9907
|
+
isDescending: true
|
|
9908
|
+
};
|
|
9909
|
+
var projectViewStorage = chunkVTOD5ZQU_cjs.createStorage("local", { prefix: "console" });
|
|
9910
|
+
var VIEW_MODE_KEY = "projectsViewMode";
|
|
9911
|
+
var readViewMode = () => {
|
|
9912
|
+
const storedValue = projectViewStorage.get(VIEW_MODE_KEY);
|
|
9913
|
+
return storedValue === "list" || storedValue === "grid" ? storedValue : "grid";
|
|
9914
|
+
};
|
|
9915
|
+
var SEARCH_OPTIONS = {
|
|
9916
|
+
keys: ["representativeName"],
|
|
9917
|
+
threshold: 0.3
|
|
9918
|
+
};
|
|
9919
|
+
var useProjectListState = (projectGroups) => {
|
|
9920
|
+
const [viewMode, setViewMode] = React8.useState(readViewMode);
|
|
9921
|
+
const [searchText, setSearchText] = React8.useState("");
|
|
9922
|
+
const [environmentFilter, setEnvironmentFilter] = React8.useState([]);
|
|
9923
|
+
const [sort, setSort] = React8.useState(DEFAULT_SORT);
|
|
9924
|
+
const searchableGroups = React8.useMemo(
|
|
9925
|
+
() => projectGroups.map((group) => ({
|
|
9926
|
+
group,
|
|
9927
|
+
representativeName: getProjectGroupName(group)
|
|
9928
|
+
})),
|
|
9929
|
+
[projectGroups]
|
|
9930
|
+
);
|
|
9931
|
+
const searchedGroups = chunkXALNVJQU_cjs.useDebouncedFuseFilter(
|
|
9932
|
+
searchableGroups,
|
|
9933
|
+
searchText,
|
|
9934
|
+
SEARCH_OPTIONS
|
|
9935
|
+
);
|
|
9936
|
+
const visibleProjectGroups = React8.useMemo(() => {
|
|
9937
|
+
const filteredGroups = searchedGroups.map(({ group }) => group).filter(
|
|
9938
|
+
(group) => environmentFilter.length === 0 || group.projects.some(
|
|
9939
|
+
(project) => environmentFilter.includes(project.environment)
|
|
9940
|
+
)
|
|
9941
|
+
);
|
|
9942
|
+
return filteredGroups.toSorted((left, right) => {
|
|
9943
|
+
const comparison = sort.property === "name" ? getProjectGroupName(left).localeCompare(getProjectGroupName(right)) : getLatestProjectUpdate(left) - getLatestProjectUpdate(right);
|
|
9944
|
+
return sort.isDescending ? -comparison : comparison;
|
|
9945
|
+
});
|
|
9946
|
+
}, [environmentFilter, searchedGroups, sort]);
|
|
9947
|
+
const availableEnvironmentOptions = React8.useMemo(() => {
|
|
9948
|
+
const presentValues = new Set(
|
|
9949
|
+
projectGroups.flatMap(
|
|
9950
|
+
(group) => group.projects.map((project) => project.environment).filter((environment) => environment.length > 0)
|
|
9951
|
+
)
|
|
9952
|
+
);
|
|
9953
|
+
const knownOptions = environmentOptions.filter((option) => presentValues.delete(option.value)).map(({ label, value }) => ({ label, value }));
|
|
9954
|
+
const unknownOptions = [...presentValues].sort((left, right) => left.localeCompare(right)).map((value) => ({ label: value, value }));
|
|
9955
|
+
return [...knownOptions, ...unknownOptions];
|
|
9956
|
+
}, [projectGroups]);
|
|
9957
|
+
const persistViewMode = React8.useCallback((nextViewMode) => {
|
|
9958
|
+
setViewMode(nextViewMode);
|
|
9959
|
+
projectViewStorage.set(VIEW_MODE_KEY, nextViewMode);
|
|
9960
|
+
}, []);
|
|
9961
|
+
const resetFilters = React8.useCallback(() => {
|
|
9962
|
+
setSearchText("");
|
|
9963
|
+
setEnvironmentFilter([]);
|
|
9964
|
+
}, []);
|
|
9965
|
+
return {
|
|
9966
|
+
availableEnvironmentOptions,
|
|
9967
|
+
environmentFilter,
|
|
9968
|
+
resetFilters,
|
|
9969
|
+
searchText,
|
|
9970
|
+
setEnvironmentFilter,
|
|
9971
|
+
setSearchText,
|
|
9972
|
+
setSort,
|
|
9973
|
+
setViewMode: persistViewMode,
|
|
9974
|
+
sort,
|
|
9975
|
+
viewMode,
|
|
9976
|
+
visibleProjectGroups
|
|
9977
|
+
};
|
|
9978
|
+
};
|
|
9979
|
+
var cardVariants = {
|
|
9980
|
+
hidden: { opacity: 0, y: 20, scale: 0.97 },
|
|
9981
|
+
visible: (i) => ({
|
|
9982
|
+
opacity: 1,
|
|
9983
|
+
y: 0,
|
|
9984
|
+
scale: 1,
|
|
9985
|
+
transition: {
|
|
9986
|
+
delay: i * 0.06,
|
|
9987
|
+
duration: 0.4,
|
|
9988
|
+
ease: [0.22, 1, 0.36, 1]
|
|
9989
|
+
}
|
|
9990
|
+
})
|
|
9991
|
+
};
|
|
9992
|
+
var SelfProjectLoading = ({ viewMode }) => {
|
|
9993
|
+
if (viewMode === "list") {
|
|
9994
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: ["sk-1", "sk-2", "sk-3", "sk-4", "sk-5"].map((itemKey) => /* @__PURE__ */ jsxRuntime.jsx(ProjectListRowLoadingSkeleton, {}, itemKey)) });
|
|
9995
|
+
}
|
|
9996
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: ["sk-1", "sk-2", "sk-3", "sk-4", "sk-5", "sk-6", "sk-7", "sk-8"].map(
|
|
9997
|
+
(itemKey) => /* @__PURE__ */ jsxRuntime.jsx(ProjectCardLoadingSkeleton, {}, itemKey)
|
|
9998
|
+
) });
|
|
9999
|
+
};
|
|
10000
|
+
var SelfProject = ({ canCreateProject = false }) => {
|
|
10001
|
+
const { data: data2, isLoading, isFetching } = chunkUVMFL4UV_cjs.useGetProjects({ enabled: true });
|
|
10002
|
+
const isPending = isLoading || isFetching;
|
|
10003
|
+
const projectGroups = data2 || [];
|
|
10004
|
+
const {
|
|
10005
|
+
availableEnvironmentOptions,
|
|
10006
|
+
environmentFilter,
|
|
10007
|
+
resetFilters,
|
|
10008
|
+
searchText,
|
|
10009
|
+
setEnvironmentFilter,
|
|
10010
|
+
setSearchText,
|
|
10011
|
+
setViewMode,
|
|
10012
|
+
viewMode,
|
|
10013
|
+
visibleProjectGroups
|
|
10014
|
+
} = useProjectListState(projectGroups);
|
|
10015
|
+
if (!isPending && !projectGroups.length && canCreateProject)
|
|
10016
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ConsoleCreateProject, {});
|
|
10017
|
+
const showAddProject = projectGroups.length < 10 && searchText.trim().length === 0;
|
|
10018
|
+
const hasNoMatches = projectGroups.length > 0 && visibleProjectGroups.length === 0;
|
|
10019
|
+
let projectsContent;
|
|
10020
|
+
if (isPending) {
|
|
10021
|
+
projectsContent = /* @__PURE__ */ jsxRuntime.jsx(SelfProjectLoading, { viewMode });
|
|
10022
|
+
} else if (viewMode === "grid") {
|
|
10023
|
+
projectsContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: [
|
|
10024
|
+
showAddProject && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10025
|
+
framerMotion.motion.div,
|
|
10026
|
+
{
|
|
10027
|
+
variants: cardVariants,
|
|
10028
|
+
custom: 0,
|
|
10029
|
+
initial: "hidden",
|
|
10030
|
+
animate: "visible",
|
|
10031
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(AddProjectCard, {})
|
|
10032
|
+
}
|
|
10033
|
+
),
|
|
10034
|
+
visibleProjectGroups.map((project, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10035
|
+
framerMotion.motion.div,
|
|
10036
|
+
{
|
|
10037
|
+
variants: cardVariants,
|
|
10038
|
+
custom: showAddProject ? index + 1 : index,
|
|
10039
|
+
initial: "hidden",
|
|
10040
|
+
animate: "visible",
|
|
10041
|
+
children: project.projects[0] && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10042
|
+
ProjectCard,
|
|
10043
|
+
{
|
|
10044
|
+
project: project.projects[0],
|
|
10045
|
+
projects: project.projects,
|
|
10046
|
+
isShared: project.isShared,
|
|
10047
|
+
canOpen: canOpenProject(project)
|
|
10048
|
+
}
|
|
10049
|
+
)
|
|
10050
|
+
},
|
|
10051
|
+
project.tenantGroupId
|
|
10052
|
+
))
|
|
10053
|
+
] });
|
|
10054
|
+
} else {
|
|
10055
|
+
projectsContent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
10056
|
+
ProjectList,
|
|
10057
|
+
{
|
|
10058
|
+
projectGroups: visibleProjectGroups,
|
|
10059
|
+
showAddProject
|
|
10060
|
+
}
|
|
10061
|
+
);
|
|
10062
|
+
}
|
|
10063
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-4", children: [
|
|
10064
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-3", children: [
|
|
10065
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
10066
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "shrink-0 text-base font-semibold text-[hsl(var(--high-emphasis))]", children: "Your Blocks Projects" }),
|
|
10067
|
+
isPending ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-5 w-8 rounded-full" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-primary/10 text-primary shrink-0 rounded-full px-2 py-0.5 text-xs font-semibold", children: projectGroups.length })
|
|
10068
|
+
] }),
|
|
10069
|
+
!isPending && canCreateProject && projectGroups.length > 9 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-[hsl(var(--medium-emphasis))]", children: "Please delete an existing project to create a new one." })
|
|
10070
|
+
] }),
|
|
10071
|
+
(isPending || projectGroups.length > 0) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10072
|
+
ProjectToolbar,
|
|
10073
|
+
{
|
|
10074
|
+
availableEnvironmentOptions,
|
|
10075
|
+
environmentFilter,
|
|
10076
|
+
onEnvironmentFilterChange: setEnvironmentFilter,
|
|
10077
|
+
onReset: resetFilters,
|
|
10078
|
+
onSearchTextChange: setSearchText,
|
|
10079
|
+
onViewModeChange: setViewMode,
|
|
10080
|
+
searchText,
|
|
10081
|
+
viewMode
|
|
10082
|
+
}
|
|
10083
|
+
),
|
|
10084
|
+
projectsContent,
|
|
10085
|
+
hasNoMatches && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-10 text-center", children: [
|
|
10086
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-muted-foreground", children: searchText.trim() ? "No projects match your search" : "No projects match the selected filters" }),
|
|
10087
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10088
|
+
Button,
|
|
10089
|
+
{
|
|
10090
|
+
type: "button",
|
|
10091
|
+
variant: "outline",
|
|
10092
|
+
size: "sm",
|
|
10093
|
+
onClick: () => {
|
|
10094
|
+
if (searchText.trim()) setSearchText("");
|
|
10095
|
+
else setEnvironmentFilter([]);
|
|
10096
|
+
},
|
|
10097
|
+
children: searchText.trim() ? "Clear search" : "Clear filters"
|
|
10098
|
+
}
|
|
10099
|
+
)
|
|
10100
|
+
] })
|
|
10101
|
+
] });
|
|
10102
|
+
};
|
|
10103
|
+
var ConsolePage = ({ canCreateProject = false }) => {
|
|
10104
|
+
const { resetSelectedProject, resetTenantGroup } = chunkVAKGHXK6_cjs.useProjectStore();
|
|
10105
|
+
React8.useEffect(() => {
|
|
10106
|
+
resetSelectedProject();
|
|
10107
|
+
resetTenantGroup();
|
|
10108
|
+
}, [resetSelectedProject, resetTenantGroup]);
|
|
10109
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-1 flex-col overflow-hidden", children: [
|
|
10110
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-primary/[0.07] pointer-events-none absolute -top-20 right-0 h-[600px] w-[600px] rounded-full blur-[100px]" }),
|
|
10111
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-primary/[0.04] pointer-events-none absolute left-1/3 top-10 h-[350px] w-[350px] rounded-full blur-[80px]" }),
|
|
10112
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-1 flex-col gap-12 px-6 py-10 sm:px-10 xl:px-[154px]", children: [
|
|
10113
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelfProject, { canCreateProject }),
|
|
10114
|
+
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-5", children: [
|
|
10115
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
10116
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-primary/10 text-primary inline-flex items-center rounded-full px-2.5 py-1 text-xs font-semibold tracking-wide", children: "Resources" }),
|
|
10117
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px flex-1 bg-[hsl(var(--border-default))]" })
|
|
10118
|
+
] }),
|
|
10119
|
+
/* @__PURE__ */ jsxRuntime.jsx(DefaultDoc, {})
|
|
9482
10120
|
] })
|
|
9483
10121
|
] })
|
|
9484
10122
|
] });
|
|
@@ -9521,7 +10159,7 @@ var CallbackPage = ({ defaultRedirectUrl }) => {
|
|
|
9521
10159
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-screen items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader, { className: "h-12 w-12 animate-spin text-gray-500" }) });
|
|
9522
10160
|
};
|
|
9523
10161
|
function ProfilePage() {
|
|
9524
|
-
const { isLoading, error } =
|
|
10162
|
+
const { isLoading, error } = chunkXALNVJQU_cjs.useInitiateRedirect({
|
|
9525
10163
|
clientId: chunkX4YCRWXO_cjs.getRuntimeEnv("BLOCKS_IAM_CLIENT_ID"),
|
|
9526
10164
|
redirectUri: chunkX4YCRWXO_cjs.getRuntimeEnv("BLOCKS_IAM_CALLBACK_URL"),
|
|
9527
10165
|
forwardedTo: "/app/profile"
|
|
@@ -9799,7 +10437,7 @@ var ConfirmationModal = ({
|
|
|
9799
10437
|
] })
|
|
9800
10438
|
] });
|
|
9801
10439
|
var DashboardOverview = () => {
|
|
9802
|
-
const { name } =
|
|
10440
|
+
const { name } = chunkXALNVJQU_cjs.useBlocksAppConfigStore((state) => state.config);
|
|
9803
10441
|
const { data: data2, isFetching } = chunkUVMFL4UV_cjs.useGetProject();
|
|
9804
10442
|
const {
|
|
9805
10443
|
endpoints,
|
|
@@ -9888,7 +10526,7 @@ var wildcardToRegex2 = (pattern) => {
|
|
|
9888
10526
|
const escaped = pattern.replace(/[-/\\^$+?.()|[\]{}]/g, "\\$&");
|
|
9889
10527
|
return `^${escaped.replace(/\*/g, "[^/]+")}$`;
|
|
9890
10528
|
};
|
|
9891
|
-
function
|
|
10529
|
+
function ProjectList2({
|
|
9892
10530
|
redirectPaths,
|
|
9893
10531
|
collapsed = false
|
|
9894
10532
|
}) {
|
|
@@ -10440,8 +11078,8 @@ function EditProject() {
|
|
|
10440
11078
|
] });
|
|
10441
11079
|
}
|
|
10442
11080
|
var ProjectCardLoadingSkeleton = () => {
|
|
10443
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "border-border/60 flex h-
|
|
10444
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-
|
|
11081
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "border-border/60 bg-card flex h-40 flex-col overflow-hidden rounded-xl border p-4 shadow-sm", children: [
|
|
11082
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
10445
11083
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
10446
11084
|
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-4/5" }),
|
|
10447
11085
|
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "mt-1.5 h-4 w-3/5" })
|
|
@@ -10454,12 +11092,20 @@ var ProjectCardLoadingSkeleton = () => {
|
|
|
10454
11092
|
] })
|
|
10455
11093
|
] });
|
|
10456
11094
|
};
|
|
11095
|
+
var ProjectListRowLoadingSkeleton = () => {
|
|
11096
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "border-border/60 bg-card flex h-14 items-center gap-4 rounded-xl border px-4 py-2 shadow-sm", children: [
|
|
11097
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-32" }),
|
|
11098
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-5 w-16 shrink-0 rounded-full" }),
|
|
11099
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "ml-auto h-4 w-20 shrink-0" }),
|
|
11100
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-8 w-8 shrink-0 rounded-md" })
|
|
11101
|
+
] });
|
|
11102
|
+
};
|
|
10457
11103
|
function SidebarMobileView({
|
|
10458
11104
|
redirectPaths,
|
|
10459
11105
|
navigationMenus
|
|
10460
11106
|
}) {
|
|
10461
11107
|
const [open, setOpen] = React8.useState(false);
|
|
10462
|
-
const { appLightLogo, appDarkLogo } =
|
|
11108
|
+
const { appLightLogo, appDarkLogo } = chunkXALNVJQU_cjs.useLogo();
|
|
10463
11109
|
const allowedMenu = chunkQ7Y32IBM_cjs.useFilteredMenus(navigationMenus);
|
|
10464
11110
|
return /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { open, onOpenChange: setOpen, children: [
|
|
10465
11111
|
/* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "icon", className: "shrink-0", children: [
|
|
@@ -10491,7 +11137,7 @@ function SidebarMobileView({
|
|
|
10491
11137
|
/* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
|
|
10492
11138
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex w-full flex-col items-start px-6", children: [
|
|
10493
11139
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-1 text-sm text-low-emphasis", children: "Project" }),
|
|
10494
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11140
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProjectList2, { redirectPaths })
|
|
10495
11141
|
] }),
|
|
10496
11142
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-3 flex w-full flex-col items-start px-6", children: [
|
|
10497
11143
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-1 text-sm text-low-emphasis", children: "Environment" }),
|
|
@@ -10509,8 +11155,8 @@ function SidebarMenuDesktop({
|
|
|
10509
11155
|
navigationMenus
|
|
10510
11156
|
}) {
|
|
10511
11157
|
const { isSidebarOpen, toggleSidebar } = React8.useContext(chunkZVGCCTNK_cjs.SidebarContext);
|
|
10512
|
-
const { appLightLogo, appDarkLogo } =
|
|
10513
|
-
const icon =
|
|
11158
|
+
const { appLightLogo, appDarkLogo } = chunkXALNVJQU_cjs.useLogo();
|
|
11159
|
+
const icon = chunkXALNVJQU_cjs.useIcon();
|
|
10514
11160
|
const allowedMenu = chunkQ7Y32IBM_cjs.useFilteredMenus(navigationMenus);
|
|
10515
11161
|
const { isActivePath: isProjectOverviewRoute } = chunkQ7Y32IBM_cjs.useIsActiveMenu("/app/project");
|
|
10516
11162
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -10559,11 +11205,11 @@ function SidebarMenuDesktop({
|
|
|
10559
11205
|
isSidebarOpen ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b px-2 pb-2 pt-2", children: [
|
|
10560
11206
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-1 px-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: "Workspace" }),
|
|
10561
11207
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
|
|
10562
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11208
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProjectList2, { redirectPaths }),
|
|
10563
11209
|
/* @__PURE__ */ jsxRuntime.jsx(RenderConditionally, { condition: !isProjectOverviewRoute, children: /* @__PURE__ */ jsxRuntime.jsx(EnvironmentList, { redirectPaths }) })
|
|
10564
11210
|
] })
|
|
10565
11211
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b py-1", children: [
|
|
10566
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11212
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProjectList2, { redirectPaths, collapsed: true }),
|
|
10567
11213
|
/* @__PURE__ */ jsxRuntime.jsx(RenderConditionally, { condition: !isProjectOverviewRoute, children: /* @__PURE__ */ jsxRuntime.jsx(EnvironmentList, { redirectPaths, collapsed: true }) })
|
|
10568
11214
|
] }),
|
|
10569
11215
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("nav", { className: chunkYAF2X7W5_cjs.cn("grid w-full items-start gap-1 text-sm"), children: allowedMenu.map((menu) => /* @__PURE__ */ jsxRuntime.jsx(React8.Fragment, { children: menu.type === "menu" ? /* @__PURE__ */ jsxRuntime.jsx(DesktopMenuItem, { menu, isSidebarOpen }) : /* @__PURE__ */ jsxRuntime.jsx(Separator, {}) }, menu.id)) }) })
|
|
@@ -11596,116 +12242,6 @@ var DropdownSearchInput = ({
|
|
|
11596
12242
|
)
|
|
11597
12243
|
] });
|
|
11598
12244
|
};
|
|
11599
|
-
function MultiSelect2({
|
|
11600
|
-
label,
|
|
11601
|
-
options,
|
|
11602
|
-
onChange,
|
|
11603
|
-
value: selectedValues
|
|
11604
|
-
}) {
|
|
11605
|
-
const [buttonRef, popoverWidth] = chunkGZSVB47D_cjs.usePopoverWidth();
|
|
11606
|
-
const onSelectHandler = (value) => {
|
|
11607
|
-
const nextValues = selectedValues.includes(value) ? selectedValues.filter((item) => item !== value) : [...selectedValues, value];
|
|
11608
|
-
onChange(nextValues);
|
|
11609
|
-
};
|
|
11610
|
-
const onResetHandler = () => {
|
|
11611
|
-
onChange([]);
|
|
11612
|
-
};
|
|
11613
|
-
const isMobile = chunkQ7Y32IBM_cjs.useIsMobile();
|
|
11614
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
11615
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11616
|
-
Button,
|
|
11617
|
-
{
|
|
11618
|
-
ref: buttonRef,
|
|
11619
|
-
variant: "outline",
|
|
11620
|
-
size: "sm",
|
|
11621
|
-
className: "h-8 border-dashed",
|
|
11622
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
11623
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
|
|
11624
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactIcons.PlusCircledIcon, { className: "mr-2 h-4 w-4" }),
|
|
11625
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: label }),
|
|
11626
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sm:hidden", children: label?.split(" ")[0] })
|
|
11627
|
-
] }),
|
|
11628
|
-
selectedValues?.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11629
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11630
|
-
Separator,
|
|
11631
|
-
{
|
|
11632
|
-
orientation: "vertical",
|
|
11633
|
-
className: "hidden h-4 sm:mx-2 sm:block"
|
|
11634
|
-
}
|
|
11635
|
-
),
|
|
11636
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex space-x-1", children: selectedValues.length > 2 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11637
|
-
Badge,
|
|
11638
|
-
{
|
|
11639
|
-
variant: "secondary",
|
|
11640
|
-
className: "rounded-sm px-1 font-normal",
|
|
11641
|
-
children: [
|
|
11642
|
-
selectedValues.length,
|
|
11643
|
-
" selected"
|
|
11644
|
-
]
|
|
11645
|
-
}
|
|
11646
|
-
) : options.filter((option) => selectedValues.includes(option.value)).map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11647
|
-
Badge,
|
|
11648
|
-
{
|
|
11649
|
-
variant: "secondary",
|
|
11650
|
-
className: "rounded-sm px-1 font-normal",
|
|
11651
|
-
children: option.label
|
|
11652
|
-
},
|
|
11653
|
-
option.value
|
|
11654
|
-
)) })
|
|
11655
|
-
] })
|
|
11656
|
-
] })
|
|
11657
|
-
}
|
|
11658
|
-
) }),
|
|
11659
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11660
|
-
PopoverContent,
|
|
11661
|
-
{
|
|
11662
|
-
className: "w-auto p-0 sm:w-full",
|
|
11663
|
-
align: "start",
|
|
11664
|
-
style: isMobile ? { width: popoverWidth ? `${popoverWidth}px` : "auto" } : void 0,
|
|
11665
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
|
|
11666
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: label }),
|
|
11667
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
|
|
11668
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: "No results found." }),
|
|
11669
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: options.map((option) => {
|
|
11670
|
-
const isSelected = selectedValues.includes(option.value);
|
|
11671
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11672
|
-
CommandItem,
|
|
11673
|
-
{
|
|
11674
|
-
onSelect: () => onSelectHandler(option.value),
|
|
11675
|
-
children: [
|
|
11676
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11677
|
-
"div",
|
|
11678
|
-
{
|
|
11679
|
-
className: chunkYAF2X7W5_cjs.cn(
|
|
11680
|
-
"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
|
|
11681
|
-
isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
|
|
11682
|
-
),
|
|
11683
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.CheckIcon, { className: chunkYAF2X7W5_cjs.cn("h-4 w-4") })
|
|
11684
|
-
}
|
|
11685
|
-
),
|
|
11686
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: option.label })
|
|
11687
|
-
]
|
|
11688
|
-
},
|
|
11689
|
-
option.value
|
|
11690
|
-
);
|
|
11691
|
-
}) }),
|
|
11692
|
-
selectedValues.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11693
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandSeparator, {}),
|
|
11694
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11695
|
-
CommandItem,
|
|
11696
|
-
{
|
|
11697
|
-
onSelect: () => onResetHandler(),
|
|
11698
|
-
className: "justify-center text-center",
|
|
11699
|
-
children: "Clear"
|
|
11700
|
-
}
|
|
11701
|
-
) })
|
|
11702
|
-
] })
|
|
11703
|
-
] })
|
|
11704
|
-
] })
|
|
11705
|
-
}
|
|
11706
|
-
)
|
|
11707
|
-
] });
|
|
11708
|
-
}
|
|
11709
12245
|
var ClearButton = ({ onClear }) => {
|
|
11710
12246
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11711
12247
|
Button,
|
|
@@ -11719,7 +12255,7 @@ var ClearButton = ({ onClear }) => {
|
|
|
11719
12255
|
};
|
|
11720
12256
|
function Radio({ label, options, onChange, value }) {
|
|
11721
12257
|
const [search, setSearch] = React8.useState("");
|
|
11722
|
-
const [buttonRef, popoverWidth] =
|
|
12258
|
+
const [buttonRef, popoverWidth] = chunkXALNVJQU_cjs.usePopoverWidth();
|
|
11723
12259
|
const isMobile = chunkQ7Y32IBM_cjs.useIsMobile();
|
|
11724
12260
|
const selected = React8.useMemo(
|
|
11725
12261
|
() => options.find((item) => item.value === value) || null,
|
|
@@ -11814,82 +12350,6 @@ function Radio({ label, options, onChange, value }) {
|
|
|
11814
12350
|
)
|
|
11815
12351
|
] });
|
|
11816
12352
|
}
|
|
11817
|
-
var ResetButton = ({ onClick }) => {
|
|
11818
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11819
|
-
Button,
|
|
11820
|
-
{
|
|
11821
|
-
type: "button",
|
|
11822
|
-
variant: "outline",
|
|
11823
|
-
onClick,
|
|
11824
|
-
className: "h-8 px-2 lg:px-3",
|
|
11825
|
-
children: [
|
|
11826
|
-
"Reset",
|
|
11827
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "ml-2 h-4 w-4" })
|
|
11828
|
-
]
|
|
11829
|
-
}
|
|
11830
|
-
);
|
|
11831
|
-
};
|
|
11832
|
-
var SearchInput = ({
|
|
11833
|
-
onChange,
|
|
11834
|
-
placeholder = "Search...",
|
|
11835
|
-
value,
|
|
11836
|
-
className = ""
|
|
11837
|
-
}) => {
|
|
11838
|
-
const [state, setState] = React8.useState(value);
|
|
11839
|
-
const inputRef = React8.useRef(null);
|
|
11840
|
-
React8.useEffect(() => {
|
|
11841
|
-
setState(value);
|
|
11842
|
-
}, [value]);
|
|
11843
|
-
const debounced = React8.useRef(
|
|
11844
|
-
chunkVTOD5ZQU_cjs.debounce((val) => {
|
|
11845
|
-
onChange(val);
|
|
11846
|
-
}, 300)
|
|
11847
|
-
).current;
|
|
11848
|
-
React8.useEffect(() => {
|
|
11849
|
-
return () => {
|
|
11850
|
-
debounced.cancel();
|
|
11851
|
-
};
|
|
11852
|
-
}, [debounced]);
|
|
11853
|
-
const handleChange = (event) => {
|
|
11854
|
-
event.stopPropagation();
|
|
11855
|
-
setState(event.target.value);
|
|
11856
|
-
debounced(event.target.value);
|
|
11857
|
-
};
|
|
11858
|
-
const handleClear = (e) => {
|
|
11859
|
-
e.stopPropagation();
|
|
11860
|
-
setState("");
|
|
11861
|
-
onChange("");
|
|
11862
|
-
};
|
|
11863
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center rounded-sm border px-2", children: [
|
|
11864
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "mr-2 h-4 w-4 text-muted-foreground" }),
|
|
11865
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11866
|
-
Input,
|
|
11867
|
-
{
|
|
11868
|
-
ref: inputRef,
|
|
11869
|
-
placeholder,
|
|
11870
|
-
value: state,
|
|
11871
|
-
onChange: handleChange,
|
|
11872
|
-
className: chunkYAF2X7W5_cjs.cn(
|
|
11873
|
-
"h-8 w-52 border-none p-0 focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
11874
|
-
className
|
|
11875
|
-
)
|
|
11876
|
-
}
|
|
11877
|
-
),
|
|
11878
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11879
|
-
Button,
|
|
11880
|
-
{
|
|
11881
|
-
variant: "ghost",
|
|
11882
|
-
size: "xs",
|
|
11883
|
-
className: chunkYAF2X7W5_cjs.cn(
|
|
11884
|
-
"h-full p-1 pr-0 hover:bg-transparent",
|
|
11885
|
-
!value && "invisible"
|
|
11886
|
-
),
|
|
11887
|
-
onClick: handleClear,
|
|
11888
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4 text-muted-foreground" })
|
|
11889
|
-
}
|
|
11890
|
-
)
|
|
11891
|
-
] });
|
|
11892
|
-
};
|
|
11893
12353
|
var sortQueryParsers = (initialValues) => ({
|
|
11894
12354
|
sortProperty: nuqs.parseAsString.withDefault(initialValues.property),
|
|
11895
12355
|
isDescending: nuqs.parseAsBoolean.withDefault(initialValues.isDescending)
|
|
@@ -12668,7 +13128,8 @@ exports.Progress = Progress;
|
|
|
12668
13128
|
exports.ProjectActions = ProjectActions;
|
|
12669
13129
|
exports.ProjectCardLoadingSkeleton = ProjectCardLoadingSkeleton;
|
|
12670
13130
|
exports.ProjectDetail = ProjectDetail;
|
|
12671
|
-
exports.ProjectList =
|
|
13131
|
+
exports.ProjectList = ProjectList2;
|
|
13132
|
+
exports.ProjectListRowLoadingSkeleton = ProjectListRowLoadingSkeleton;
|
|
12672
13133
|
exports.ProjectOverview = ProjectOverview;
|
|
12673
13134
|
exports.ProjectRepoList = ProjectRepoList;
|
|
12674
13135
|
exports.PublicLayout = PublicLayout;
|
|
@@ -12796,5 +13257,5 @@ exports.usePaginationQueryParams = usePaginationQueryParams;
|
|
|
12796
13257
|
exports.useRightSidePanel = useRightSidePanel;
|
|
12797
13258
|
exports.useSortQueryParams = useSortQueryParams;
|
|
12798
13259
|
exports.useWizardStepper = useWizardStepper;
|
|
12799
|
-
//# sourceMappingURL=chunk-
|
|
12800
|
-
//# sourceMappingURL=chunk-
|
|
13260
|
+
//# sourceMappingURL=chunk-CME46DIB.cjs.map
|
|
13261
|
+
//# sourceMappingURL=chunk-CME46DIB.cjs.map
|