feat(changelog): added in a place to see the changelogs
This commit is contained in:
33
frontend/src/components/changelog/ChangeLog.tsx
Normal file
33
frontend/src/components/changelog/ChangeLog.tsx
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
// src/components/Changelog.jsx
|
||||||
|
import { marked } from "marked";
|
||||||
|
import changelog from "../../../../CHANGELOG.md?raw"; // assuming changelog.md is in root
|
||||||
|
|
||||||
|
const Changelog = () => {
|
||||||
|
const html: any = marked.parse(changelog);
|
||||||
|
const recentChanges = html.split("<h2>")[1];
|
||||||
|
// const [htmlContent, setHtmlContent] = useState("");
|
||||||
|
|
||||||
|
// useEffect(() => {
|
||||||
|
// fetch("/changelog.md")
|
||||||
|
// .then((res) => res.text())
|
||||||
|
// .then((md) => {
|
||||||
|
// const versionBlocks = md.split(/^##\s+/gm); // Split on headings
|
||||||
|
// if (versionBlocks.length > 1) {
|
||||||
|
// const latestBlock = `## ${versionBlocks[1]}`;
|
||||||
|
// const html: any = marked.parse(latestBlock, {
|
||||||
|
// breaks: true,
|
||||||
|
// gfm: true,
|
||||||
|
// });
|
||||||
|
// setHtmlContent(html);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }, []);
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="prose m-3"
|
||||||
|
dangerouslySetInnerHTML={{ __html: `<h2>${recentChanges}` }}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Changelog;
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
import { Route as rootRoute } from './routes/__root'
|
import { Route as rootRoute } from './routes/__root'
|
||||||
import { Route as LoginImport } from './routes/login'
|
import { Route as LoginImport } from './routes/login'
|
||||||
|
import { Route as ChangelogImport } from './routes/changelog'
|
||||||
import { Route as AboutImport } from './routes/about'
|
import { Route as AboutImport } from './routes/about'
|
||||||
import { Route as EomImport } from './routes/_eom'
|
import { Route as EomImport } from './routes/_eom'
|
||||||
import { Route as AuthImport } from './routes/_auth'
|
import { Route as AuthImport } from './routes/_auth'
|
||||||
@@ -43,6 +44,12 @@ const LoginRoute = LoginImport.update({
|
|||||||
getParentRoute: () => rootRoute,
|
getParentRoute: () => rootRoute,
|
||||||
} as any)
|
} as any)
|
||||||
|
|
||||||
|
const ChangelogRoute = ChangelogImport.update({
|
||||||
|
id: '/changelog',
|
||||||
|
path: '/changelog',
|
||||||
|
getParentRoute: () => rootRoute,
|
||||||
|
} as any)
|
||||||
|
|
||||||
const AboutRoute = AboutImport.update({
|
const AboutRoute = AboutImport.update({
|
||||||
id: '/about',
|
id: '/about',
|
||||||
path: '/about',
|
path: '/about',
|
||||||
@@ -217,6 +224,13 @@ declare module '@tanstack/react-router' {
|
|||||||
preLoaderRoute: typeof AboutImport
|
preLoaderRoute: typeof AboutImport
|
||||||
parentRoute: typeof rootRoute
|
parentRoute: typeof rootRoute
|
||||||
}
|
}
|
||||||
|
'/changelog': {
|
||||||
|
id: '/changelog'
|
||||||
|
path: '/changelog'
|
||||||
|
fullPath: '/changelog'
|
||||||
|
preLoaderRoute: typeof ChangelogImport
|
||||||
|
parentRoute: typeof rootRoute
|
||||||
|
}
|
||||||
'/login': {
|
'/login': {
|
||||||
id: '/login'
|
id: '/login'
|
||||||
path: '/login'
|
path: '/login'
|
||||||
@@ -394,6 +408,7 @@ export interface FileRoutesByFullPath {
|
|||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
'': typeof EomRouteWithChildren
|
'': typeof EomRouteWithChildren
|
||||||
'/about': typeof AboutRoute
|
'/about': typeof AboutRoute
|
||||||
|
'/changelog': typeof ChangelogRoute
|
||||||
'/login': typeof LoginRoute
|
'/login': typeof LoginRoute
|
||||||
'/modules': typeof AdminModulesRoute
|
'/modules': typeof AdminModulesRoute
|
||||||
'/notificationMGT': typeof AdminNotificationMGTRoute
|
'/notificationMGT': typeof AdminNotificationMGTRoute
|
||||||
@@ -418,6 +433,7 @@ export interface FileRoutesByTo {
|
|||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
'': typeof EomRouteWithChildren
|
'': typeof EomRouteWithChildren
|
||||||
'/about': typeof AboutRoute
|
'/about': typeof AboutRoute
|
||||||
|
'/changelog': typeof ChangelogRoute
|
||||||
'/login': typeof LoginRoute
|
'/login': typeof LoginRoute
|
||||||
'/modules': typeof AdminModulesRoute
|
'/modules': typeof AdminModulesRoute
|
||||||
'/notificationMGT': typeof AdminNotificationMGTRoute
|
'/notificationMGT': typeof AdminNotificationMGTRoute
|
||||||
@@ -445,6 +461,7 @@ export interface FileRoutesById {
|
|||||||
'/_auth': typeof AuthRouteWithChildren
|
'/_auth': typeof AuthRouteWithChildren
|
||||||
'/_eom': typeof EomRouteWithChildren
|
'/_eom': typeof EomRouteWithChildren
|
||||||
'/about': typeof AboutRoute
|
'/about': typeof AboutRoute
|
||||||
|
'/changelog': typeof ChangelogRoute
|
||||||
'/login': typeof LoginRoute
|
'/login': typeof LoginRoute
|
||||||
'/_admin/modules': typeof AdminModulesRoute
|
'/_admin/modules': typeof AdminModulesRoute
|
||||||
'/_admin/notificationMGT': typeof AdminNotificationMGTRoute
|
'/_admin/notificationMGT': typeof AdminNotificationMGTRoute
|
||||||
@@ -471,6 +488,7 @@ export interface FileRouteTypes {
|
|||||||
| '/'
|
| '/'
|
||||||
| ''
|
| ''
|
||||||
| '/about'
|
| '/about'
|
||||||
|
| '/changelog'
|
||||||
| '/login'
|
| '/login'
|
||||||
| '/modules'
|
| '/modules'
|
||||||
| '/notificationMGT'
|
| '/notificationMGT'
|
||||||
@@ -494,6 +512,7 @@ export interface FileRouteTypes {
|
|||||||
| '/'
|
| '/'
|
||||||
| ''
|
| ''
|
||||||
| '/about'
|
| '/about'
|
||||||
|
| '/changelog'
|
||||||
| '/login'
|
| '/login'
|
||||||
| '/modules'
|
| '/modules'
|
||||||
| '/notificationMGT'
|
| '/notificationMGT'
|
||||||
@@ -519,6 +538,7 @@ export interface FileRouteTypes {
|
|||||||
| '/_auth'
|
| '/_auth'
|
||||||
| '/_eom'
|
| '/_eom'
|
||||||
| '/about'
|
| '/about'
|
||||||
|
| '/changelog'
|
||||||
| '/login'
|
| '/login'
|
||||||
| '/_admin/modules'
|
| '/_admin/modules'
|
||||||
| '/_admin/notificationMGT'
|
| '/_admin/notificationMGT'
|
||||||
@@ -546,6 +566,7 @@ export interface RootRouteChildren {
|
|||||||
AuthRoute: typeof AuthRouteWithChildren
|
AuthRoute: typeof AuthRouteWithChildren
|
||||||
EomRoute: typeof EomRouteWithChildren
|
EomRoute: typeof EomRouteWithChildren
|
||||||
AboutRoute: typeof AboutRoute
|
AboutRoute: typeof AboutRoute
|
||||||
|
ChangelogRoute: typeof ChangelogRoute
|
||||||
LoginRoute: typeof LoginRoute
|
LoginRoute: typeof LoginRoute
|
||||||
OcpIndexRoute: typeof OcpIndexRoute
|
OcpIndexRoute: typeof OcpIndexRoute
|
||||||
logisticsSiloAdjustmentsHistRoute: typeof logisticsSiloAdjustmentsHistRoute
|
logisticsSiloAdjustmentsHistRoute: typeof logisticsSiloAdjustmentsHistRoute
|
||||||
@@ -563,6 +584,7 @@ const rootRouteChildren: RootRouteChildren = {
|
|||||||
AuthRoute: AuthRouteWithChildren,
|
AuthRoute: AuthRouteWithChildren,
|
||||||
EomRoute: EomRouteWithChildren,
|
EomRoute: EomRouteWithChildren,
|
||||||
AboutRoute: AboutRoute,
|
AboutRoute: AboutRoute,
|
||||||
|
ChangelogRoute: ChangelogRoute,
|
||||||
LoginRoute: LoginRoute,
|
LoginRoute: LoginRoute,
|
||||||
OcpIndexRoute: OcpIndexRoute,
|
OcpIndexRoute: OcpIndexRoute,
|
||||||
logisticsSiloAdjustmentsHistRoute: logisticsSiloAdjustmentsHistRoute,
|
logisticsSiloAdjustmentsHistRoute: logisticsSiloAdjustmentsHistRoute,
|
||||||
@@ -592,6 +614,7 @@ export const routeTree = rootRoute
|
|||||||
"/_auth",
|
"/_auth",
|
||||||
"/_eom",
|
"/_eom",
|
||||||
"/about",
|
"/about",
|
||||||
|
"/changelog",
|
||||||
"/login",
|
"/login",
|
||||||
"/ocp/",
|
"/ocp/",
|
||||||
"/(logistics)/siloAdjustments/$hist",
|
"/(logistics)/siloAdjustments/$hist",
|
||||||
@@ -633,6 +656,9 @@ export const routeTree = rootRoute
|
|||||||
"/about": {
|
"/about": {
|
||||||
"filePath": "about.tsx"
|
"filePath": "about.tsx"
|
||||||
},
|
},
|
||||||
|
"/changelog": {
|
||||||
|
"filePath": "changelog.tsx"
|
||||||
|
},
|
||||||
"/login": {
|
"/login": {
|
||||||
"filePath": "login.tsx"
|
"filePath": "login.tsx"
|
||||||
},
|
},
|
||||||
|
|||||||
14
frontend/src/routes/changelog.tsx
Normal file
14
frontend/src/routes/changelog.tsx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import Changelog from "@/components/changelog/ChangeLog";
|
||||||
|
import { createFileRoute } from "@tanstack/react-router";
|
||||||
|
|
||||||
|
export const Route = createFileRoute("/changelog")({
|
||||||
|
component: RouteComponent,
|
||||||
|
});
|
||||||
|
|
||||||
|
function RouteComponent() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Changelog />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,16 +1,22 @@
|
|||||||
import {defineConfig} from "vite";
|
import { defineConfig } from "vite";
|
||||||
import react from "@vitejs/plugin-react-swc";
|
import react from "@vitejs/plugin-react-swc";
|
||||||
import tailwindcss from "@tailwindcss/vite";
|
import tailwindcss from "@tailwindcss/vite";
|
||||||
import {TanStackRouterVite} from "@tanstack/router-plugin/vite";
|
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
import dotenv from "dotenv";
|
import dotenv from "dotenv";
|
||||||
import {fileURLToPath} from "url";
|
import { fileURLToPath } from "url";
|
||||||
dotenv.config({path: path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../.env")});
|
dotenv.config({
|
||||||
|
path: path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../.env"),
|
||||||
|
});
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), tailwindcss(), TanStackRouterVite({target: "react", autoCodeSplitting: true})],
|
plugins: [
|
||||||
|
react(),
|
||||||
|
tailwindcss(),
|
||||||
|
TanStackRouterVite({ target: "react", autoCodeSplitting: true }),
|
||||||
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"@": path.resolve(__dirname, "./src"),
|
"@": path.resolve(__dirname, "./src"),
|
||||||
|
|||||||
Reference in New Issue
Block a user