|
7 | 7 | import { useCallback, useEffect, useState } from 'react'; |
8 | 8 | import { Outlet, useLocation } from 'react-router-dom'; |
9 | 9 |
|
| 10 | +import { OpsErrorBoundary } from '@/app/common/error-boundaries/ops-error-boundary'; |
10 | 11 | import { AllowOnlyLoggedInUserOnlyGuard } from '@/app/common/guards/allow-logged-in-user-only-guard'; |
11 | 12 | import { FronteggAuthGuard } from '@/app/common/guards/frontegg-auth-guard'; |
12 | 13 | import { useResizablePanelGroup } from '@/app/common/hooks/use-resizable-panel-group'; |
@@ -103,78 +104,80 @@ export function GlobalLayout() { |
103 | 104 | } |
104 | 105 |
|
105 | 106 | return ( |
106 | | - <FronteggAuthGuard> |
107 | | - <AllowOnlyLoggedInUserOnlyGuard> |
108 | | - <div className="h-screen w-screen overflow-hidden"> |
109 | | - <ResizablePanelGroup |
110 | | - direction="horizontal" |
111 | | - id="page-container" |
112 | | - onLayout={onResize} |
113 | | - className="h-full" |
114 | | - > |
115 | | - <LeftSidebarResizablePanel |
116 | | - minSize={ |
117 | | - isMinimized |
118 | | - ? GLOBAL_SIDEBAR_MINIMIZED_WIDTH |
119 | | - : GLOBAL_SIDEBAR_MIN_SIZE |
120 | | - } |
121 | | - maxSize={ |
122 | | - isMinimized |
123 | | - ? GLOBAL_SIDEBAR_MINIMIZED_WIDTH |
124 | | - : LEFT_SIDEBAR_MAX_SIZE |
125 | | - } |
126 | | - collapsedSize={ |
127 | | - isMinimized |
128 | | - ? GLOBAL_SIDEBAR_MINIMIZED_WIDTH |
129 | | - : LEFT_SIDEBAR_MIN_SIZE |
130 | | - } |
131 | | - isDragging={isDragging} |
132 | | - className={cn( |
133 | | - LEFT_SIDEBAR_MIN_EFFECTIVE_WIDTH, |
134 | | - 'shadow-sidebar z-[12]', |
135 | | - { |
136 | | - 'min-w-[70px] max-w-[70px]': isMinimized, |
137 | | - }, |
138 | | - { |
139 | | - 'max-w-[400px]': !isMinimized, |
140 | | - }, |
141 | | - )} |
| 107 | + <OpsErrorBoundary> |
| 108 | + <FronteggAuthGuard> |
| 109 | + <AllowOnlyLoggedInUserOnlyGuard> |
| 110 | + <div className="h-screen w-screen overflow-hidden"> |
| 111 | + <ResizablePanelGroup |
| 112 | + direction="horizontal" |
| 113 | + id="page-container" |
| 114 | + onLayout={onResize} |
| 115 | + className="h-full" |
142 | 116 | > |
143 | | - <DashboardSideMenu /> |
144 | | - </LeftSidebarResizablePanel> |
145 | | - |
146 | | - <ResizableHandle |
147 | | - className="bg-transparent" |
148 | | - disabled={isMinimized} |
149 | | - onDragging={setIsDragging} |
150 | | - style={{ |
151 | | - width: '0px', |
152 | | - }} |
153 | | - /> |
154 | | - |
155 | | - <AiChatResizablePanel onDragging={setIsDragging} /> |
156 | | - |
157 | | - <ResizablePanel |
158 | | - id={RESIZABLE_PANEL_IDS.MAIN} |
159 | | - order={3} |
160 | | - className="flex-1 h-full overflow-hidden min-w-[900px] contain-layout" |
161 | | - defaultSize={GLOBAL_MAIN_PANEL_DEFAULT_SIZE} |
162 | | - minSize={GLOBAL_MAIN_PANEL_MIN_SIZE} |
163 | | - > |
164 | | - <div className="relative h-full w-full"> |
165 | | - <AiConfigurationPrompt |
166 | | - className={cn({ |
167 | | - 'bottom-[60px]': |
168 | | - location.pathname.startsWith('/flows/') || |
169 | | - location.pathname.startsWith('/runs/'), |
170 | | - })} |
171 | | - /> |
172 | | - <Outlet /> |
173 | | - </div> |
174 | | - </ResizablePanel> |
175 | | - </ResizablePanelGroup> |
176 | | - </div> |
177 | | - </AllowOnlyLoggedInUserOnlyGuard> |
178 | | - </FronteggAuthGuard> |
| 117 | + <LeftSidebarResizablePanel |
| 118 | + minSize={ |
| 119 | + isMinimized |
| 120 | + ? GLOBAL_SIDEBAR_MINIMIZED_WIDTH |
| 121 | + : GLOBAL_SIDEBAR_MIN_SIZE |
| 122 | + } |
| 123 | + maxSize={ |
| 124 | + isMinimized |
| 125 | + ? GLOBAL_SIDEBAR_MINIMIZED_WIDTH |
| 126 | + : LEFT_SIDEBAR_MAX_SIZE |
| 127 | + } |
| 128 | + collapsedSize={ |
| 129 | + isMinimized |
| 130 | + ? GLOBAL_SIDEBAR_MINIMIZED_WIDTH |
| 131 | + : LEFT_SIDEBAR_MIN_SIZE |
| 132 | + } |
| 133 | + isDragging={isDragging} |
| 134 | + className={cn( |
| 135 | + LEFT_SIDEBAR_MIN_EFFECTIVE_WIDTH, |
| 136 | + 'shadow-sidebar z-[12]', |
| 137 | + { |
| 138 | + 'min-w-[70px] max-w-[70px]': isMinimized, |
| 139 | + }, |
| 140 | + { |
| 141 | + 'max-w-[400px]': !isMinimized, |
| 142 | + }, |
| 143 | + )} |
| 144 | + > |
| 145 | + <DashboardSideMenu /> |
| 146 | + </LeftSidebarResizablePanel> |
| 147 | + |
| 148 | + <ResizableHandle |
| 149 | + className="bg-transparent" |
| 150 | + disabled={isMinimized} |
| 151 | + onDragging={setIsDragging} |
| 152 | + style={{ |
| 153 | + width: '0px', |
| 154 | + }} |
| 155 | + /> |
| 156 | + |
| 157 | + <AiChatResizablePanel onDragging={setIsDragging} /> |
| 158 | + |
| 159 | + <ResizablePanel |
| 160 | + id={RESIZABLE_PANEL_IDS.MAIN} |
| 161 | + order={3} |
| 162 | + className="flex-1 h-full overflow-hidden min-w-[900px] contain-layout" |
| 163 | + defaultSize={GLOBAL_MAIN_PANEL_DEFAULT_SIZE} |
| 164 | + minSize={GLOBAL_MAIN_PANEL_MIN_SIZE} |
| 165 | + > |
| 166 | + <div className="relative h-full w-full"> |
| 167 | + <AiConfigurationPrompt |
| 168 | + className={cn({ |
| 169 | + 'bottom-[60px]': |
| 170 | + location.pathname.startsWith('/flows/') || |
| 171 | + location.pathname.startsWith('/runs/'), |
| 172 | + })} |
| 173 | + /> |
| 174 | + <Outlet /> |
| 175 | + </div> |
| 176 | + </ResizablePanel> |
| 177 | + </ResizablePanelGroup> |
| 178 | + </div> |
| 179 | + </AllowOnlyLoggedInUserOnlyGuard> |
| 180 | + </FronteggAuthGuard> |
| 181 | + </OpsErrorBoundary> |
179 | 182 | ); |
180 | 183 | } |
0 commit comments