Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ public void viewTrash(HttpServerRequest request) {
renderView(request, new JsonObject(), "index.html", null);
eventHelper.onAccess(request);
}

@Get("/collect")
@SecuredAction(access)
public void viewCollect(HttpServerRequest request) {
renderView(request, new JsonObject(), "index.html", null);
eventHelper.onAccess(request);
}
//////////////
//// CRUD ////
//////////////
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@edifice.io/utilities": "develop-pedago",
"@edifice.io/bootstrap": "develop-pedago",
"@edifice.io/rack-client-rest": "workspace:*",
"@edifice.io/collect-frontend": "feat-PEDAGO-3966",
"@edifice.io/client": "develop-pedago",
"@edifice.io/react": "develop-pedago",
"@react-spring/web": "9.7.5",
Expand Down
14 changes: 14 additions & 0 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,17 @@
margin-left: calc(var(--edifice-gap) * -1);
margin-right: -2.4rem;
}
.separator-dashed {
height: 1px;

/* paramètres */
--color: var(--edifice-gray-400);
--dash: 8px;
--gap: 6px;

background: repeating-linear-gradient(
90deg,
var(--color) 0 var(--dash),
transparent var(--dash) calc(var(--dash) + var(--gap))
);
}
20 changes: 17 additions & 3 deletions frontend/src/pages/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
useBreakpoint,
} from "@edifice.io/react";
import { QueryClient } from "@tanstack/react-query";
import { Suspense } from "react";
import { lazy, Suspense } from "react";
import { Outlet, useLoaderData } from "react-router-dom";
import { rackQueryOptions } from "~/services/queries/rack.queries";
import { UploadDocumentModal } from "~/features/modals/UploadDocumentModal";
Expand All @@ -25,6 +25,18 @@ import configDefault from "~/config/Config";
import actionsDefault from "~/config/Actions";
import { TrashDocumentModal } from "~/features/modals/TrashDocumentModal";

type CollectFrontendModule = {
CollectMenu: React.ComponentType<{ showMenu?: boolean; basePath?: string }>;
};

const CollectMenu = lazy(() =>
(
import("@edifice.io/collect-frontend/lib") as Promise<CollectFrontendModule>
).then((m) => ({
default: m.CollectMenu,
})),
);

/**
* Root loader data interface
* Contains global configuration and preloaded data for the Rack application
Expand Down Expand Up @@ -83,8 +95,7 @@ export function Component() {
const { init, currentApp } = useEdificeClient();
const { lg } = useBreakpoint();
const { config, actions } = useLoaderData() as RootLoaderData;
const openedModal = useRackStore.use.openedModal();
// Show loading screen while initializing
const openedModal = useRackStore.use.openedModal(); // Show loading screen while initializing
if (!init || !currentApp) {
return <LoadingScreen position={false} />;
}
Expand Down Expand Up @@ -113,6 +124,9 @@ export function Component() {
className="d-none d-lg-block"
as="aside"
>
<Suspense fallback={null}>
<CollectMenu showMenu={false} basePath="/collect" />
</Suspense>
<DesktopMenu />
</Grid.Col>
<Grid.Col
Expand Down
34 changes: 33 additions & 1 deletion frontend/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { QueryClient } from "@tanstack/react-query";
import { RouteObject, createBrowserRouter } from "react-router-dom";
import {
RouteObject,
createBrowserRouter,
useLocation,
} from "react-router-dom";

// Import your main pages and features here
import { NotFound } from "../pages/NotFound"; // 404 page component
Expand Down Expand Up @@ -68,6 +72,34 @@ const routes = (queryClient: QueryClient): RouteObject[] => [
};
},
},
{
path: "/collect/*",
async lazy() {
const module = (await import("@edifice.io/collect-frontend/lib")) as {
CollectApp: React.ComponentType<{
header?: boolean;
showMenu?: boolean;
currentPath?: string;
}>;
};
return {
Component: () => {
const { pathname } = useLocation();
const cleanPath = pathname
.replace("/rack", "")
.replace("/collect", "");

return (
<module.CollectApp
header={false}
showMenu={false}
currentPath={cleanPath}
/>
);
},
};
},
},
],
},
{
Expand Down
3 changes: 3 additions & 0 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ export default ({ mode }: { mode: string }) => {
"/audience": proxyObj,
"/rack": proxyObj,
"/rack/api": proxyObj,
"/rack/collect/api": proxyObj,
"/collect/api": proxyObj,
"/collect/i18n": proxyObj,
"/resources-applications": proxyObj,
},
port: 4200,
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,10 @@
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"pnpm": {
"overrides": {
"@edifice.io/collect-client-rest": "develop-pedago"
}
}
}
Loading