@@ -261,7 +261,6 @@ export const handleSharedDashboardsThunk = () => (dispatch: any) => {
261
261
if ( dashboardDatabase ) {
262
262
dispatch ( setStandaloneDashboardDatabase ( dashboardDatabase ) ) ;
263
263
}
264
-
265
264
if ( urlParams . get ( 'credentials' ) ) {
266
265
setWelcomeScreenOpen ( false ) ;
267
266
const connection = decodeURIComponent ( urlParams . get ( 'credentials' ) ) ;
@@ -271,32 +270,6 @@ export const handleSharedDashboardsThunk = () => (dispatch: any) => {
271
270
const database = connection . split ( '@' ) [ 1 ] . split ( ':' ) [ 0 ] ;
272
271
const url = connection . split ( '@' ) [ 1 ] . split ( ':' ) [ 1 ] ;
273
272
const port = connection . split ( '@' ) [ 1 ] . split ( ':' ) [ 2 ] ;
274
- // if (url == password) {
275
- // // Special case where a connect link is generated without a password.
276
- // // Here, the format is parsed incorrectly and we open the connection window instead.
277
- // dispatch(setConnectionProperties(protocol, url, port, database, username.split('@')[0], ''));
278
- // dispatch(
279
- // setShareDetailsFromUrl(
280
- // type,
281
- // id,
282
- // standalone,
283
- // protocol,
284
- // url,
285
- // port,
286
- // database,
287
- // username.split('@')[0],
288
- // '',
289
- // dashboardDatabase,
290
- // true
291
- // )
292
- // );
293
- // setDashboardToLoadAfterConnecting(id);
294
- // window.history.pushState({}, document.title, window.location.pathname);
295
- // dispatch(setConnectionModalOpen(true));
296
- // dispatch(setWelcomeScreenOpen(false));
297
- // // window.history.pushState({}, document.title, "/");
298
- // return;
299
- // }
300
273
301
274
dispatch ( setConnectionModalOpen ( false ) ) ;
302
275
dispatch (
@@ -327,7 +300,7 @@ export const handleSharedDashboardsThunk = () => (dispatch: any) => {
327
300
setShareDetailsFromUrl (
328
301
type ,
329
302
id ,
330
- undefined ,
303
+ standalone ,
331
304
undefined ,
332
305
undefined ,
333
306
undefined ,
@@ -385,6 +358,7 @@ export const onConfirmLoadSharedDashboardThunk = () => (dispatch: any, getState:
385
358
}
386
359
if ( shareDetails . standalone == true ) {
387
360
dispatch ( setStandaloneMode ( true ) ) ;
361
+ localStorage . setItem ( 'standaloneShared' , 'true' ) ; // EDGE CASE: redirect SSO removes the shareDetails when redirecting
388
362
}
389
363
dispatch ( resetShareDetails ( ) ) ;
390
364
} catch ( e ) {
@@ -455,10 +429,13 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
455
429
dispatch ( setSSOEnabled ( config . ssoEnabled , state . application . cachedSSODiscoveryUrl ) ) ;
456
430
dispatch ( setSSOProviders ( config . ssoProviders ) ) ;
457
431
432
+ // Check if we are in standalone mode
433
+ // const standaloneShared = localStorage.getItem('standaloneShared') == 'true'; // EDGE case: from url param it could happen that we lose the value due to SSO redirect
458
434
const { standalone } = config ;
435
+ // || standaloneShared;
436
+
459
437
// if a dashboard database was previously set, remember to use it.
460
438
const dashboardDatabase = state . application . standaloneDashboardDatabase ;
461
-
462
439
dispatch (
463
440
setStandaloneEnabled (
464
441
standalone ,
@@ -478,6 +455,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
478
455
config . standaloneDatabaseList
479
456
)
480
457
) ;
458
+ localStorage . removeItem ( 'standaloneShared' ) ;
481
459
482
460
dispatch ( setLoggingMode ( config . loggingMode ) ) ;
483
461
dispatch ( setLoggingDatabase ( config . loggingDatabase ) ) ;
0 commit comments