Skip to content

Commit a99108b

Browse files
authored
Merge pull request #691 from netzbegruenung/chore/sharepic-studio-dev-only
chore(web): gate sharepic studio routes to dev only
2 parents 3cd271e + 932a865 commit a99108b

1 file changed

Lines changed: 23 additions & 10 deletions

File tree

apps/web/src/config/routes.ts

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export interface RouteConfig {
1414
withForm?: boolean;
1515
layoutMode?: LayoutMode;
1616
auth?: 'required' | 'guest';
17+
devOnly?: boolean;
1718
}
1819

1920
/**
@@ -350,23 +351,33 @@ const standardRoutes: RouteConfig[] = [
350351
{ path: '/apps', component: AppsPage },
351352
// Media Library Route
352353
{ path: '/media-library', component: MediaLibraryPage },
353-
// Legacy /image-studio/* redirects to /studio/*
354-
{ path: '/image-studio', component: ImageStudioRedirect },
355-
{ path: '/image-studio/:category', component: ImageStudioCategoryRedirect },
356-
{ path: '/image-studio/:category/:type', component: ImageStudioCategoryTypeRedirect },
354+
// Legacy /image-studio/* redirects to /studio/* (dev-only — target is sharepics)
355+
{ path: '/image-studio', component: ImageStudioRedirect, devOnly: true },
356+
{ path: '/image-studio/:category', component: ImageStudioCategoryRedirect, devOnly: true },
357+
{
358+
path: '/image-studio/:category/:type',
359+
component: ImageStudioCategoryTypeRedirect,
360+
devOnly: true,
361+
},
357362
// Studio Routes - KI routes redirect to /imagine
358363
{ path: '/imagine', component: ImaginePage, withForm: true },
359364
{ path: '/imagine/:type', component: ImaginePage, withForm: true },
360-
{ path: '/studio', component: GrueneratorenBundle.ImageStudio, withForm: true },
365+
{ path: '/studio', component: GrueneratorenBundle.ImageStudio, withForm: true, devOnly: true },
361366
{ path: '/studio/ki', component: ImageStudioKiRedirect },
362367
{ path: '/studio/ki/:type', component: ImageStudioKiTypeRedirect },
363368
{ path: '/studio/video', component: GrueneratorenBundle.Reel },
364-
{ path: '/studio/gallery', component: GrueneratorenBundle.ImageGallery },
365-
{ path: '/studio/:category', component: GrueneratorenBundle.ImageStudio, withForm: true },
369+
{ path: '/studio/gallery', component: GrueneratorenBundle.ImageGallery, devOnly: true },
370+
{
371+
path: '/studio/:category',
372+
component: GrueneratorenBundle.ImageStudio,
373+
withForm: true,
374+
devOnly: true,
375+
},
366376
{
367377
path: '/studio/:category/:type',
368378
component: GrueneratorenBundle.ImageStudio,
369379
withForm: true,
380+
devOnly: true,
370381
},
371382
// Pages Feature Routes
372383
// Docs: overview and editor
@@ -394,10 +405,12 @@ export interface Routes {
394405
special: RouteConfig[];
395406
}
396407

408+
const enabledRoutes = standardRoutes.filter((r) => !r.devOnly || import.meta.env.DEV);
409+
397410
export const routes: Routes = {
398-
guest: standardRoutes.filter((r) => r.auth === 'guest'),
399-
protected: standardRoutes.filter((r) => r.auth === 'required'),
400-
public: standardRoutes.filter((r) => !r.auth),
411+
guest: enabledRoutes.filter((r) => r.auth === 'guest'),
412+
protected: enabledRoutes.filter((r) => r.auth === 'required'),
413+
public: enabledRoutes.filter((r) => !r.auth),
401414
special: specialRoutes,
402415
};
403416

0 commit comments

Comments
 (0)