diff --git a/src/assets/statistics.html b/src/assets/statistics.html new file mode 100644 index 00000000..45ba975a --- /dev/null +++ b/src/assets/statistics.html @@ -0,0 +1,130 @@ + + + + + + + Record Manager Statistics + + + +
+

Record Manager Statistics

+ +
General Statistics
+ + +
Record Statistics
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DateNumber of Records CompletedNumber of Invalid RecordsNumber of Rejected RecordsNumber of Confirmed Records
01/01/2024502543
01/02/2024603651
01/03/2024704759
+
+ + diff --git a/src/components/MainView.jsx b/src/components/MainView.jsx index 5cb6beef..beba46f9 100644 --- a/src/components/MainView.jsx +++ b/src/components/MainView.jsx @@ -20,6 +20,7 @@ import { isAdmin } from "../utils/SecurityUtils"; import Messages from "./message/Messages"; import Footer from "../Footer"; import PropTypes from "prop-types"; +import { ANALYTICS_URL } from "../../config/index.js"; class MainView extends React.Component { constructor(props) { @@ -61,6 +62,14 @@ class MainView extends React.Component { } } + showStatistics = () => { + if (ANALYTICS_URL === "") { + transitionTo(routes.statistics); + } else { + window.location.href = ANALYTICS_URL; + } + }; + render() { if (this.props.status === ACTION_STATUS.PENDING) { return ; @@ -123,6 +132,7 @@ class MainView extends React.Component { this.showStatistics()} isActive={() => path.startsWith(Routes.statistics.path)} to={Routes.statistics.path} > diff --git a/src/components/statistics/StatisticsMock.jsx b/src/components/statistics/StatisticsMock.jsx new file mode 100644 index 00000000..6b666399 --- /dev/null +++ b/src/components/statistics/StatisticsMock.jsx @@ -0,0 +1,8 @@ +import React from "react"; +import StatisticsHtml from "../../../deploy/shared/nginx/statistics.html"; + +const StatisticsMock = () => { + return
; +}; + +export default StatisticsMock; diff --git a/src/utils/Routes.jsx b/src/utils/Routes.jsx index 0cdd2472..855eef69 100644 --- a/src/utils/Routes.jsx +++ b/src/utils/Routes.jsx @@ -10,7 +10,7 @@ import requireAuth from "../components/misc/hoc/RequireAuth"; import UsersController from "../components/user/UsersController"; import UserController from "../components/user/UserController"; import PasswordChangeController from "../components/user/PasswordChangeController"; -import Statistics from "../components/statistics/Statistics"; +import StatisticsMock from "../components/statistics/StatisticsMock"; import InstitutionsController from "../components/institution/InstitutionsController"; import InstitutionController from "../components/institution/InstitutionController"; import RecordsController from "../components/record/RecordsController"; @@ -35,7 +35,7 @@ export const authRoutes = ( - + diff --git a/vite.config.js b/vite.config.js index 46e6d61c..f048f6f3 100644 --- a/vite.config.js +++ b/vite.config.js @@ -16,6 +16,7 @@ export default defineConfig({ cache: false, }), ], + assetsInclude: ["**/*.html"], build: { sourcemap: true, emptyOutDir: true,