diff --git a/.env.internal-auth b/.env.internal-auth index 6a1124c7..ff59a53e 100644 --- a/.env.internal-auth +++ b/.env.internal-auth @@ -6,3 +6,4 @@ RECORD_MANAGER_NAVIGATOR_LANGUAGE=true RECORD_MANAGER_BASENAME=/ RECORD_MANAGER_EXTENSIONS=supplier RECORD_MANAGER_AUTHENTICATION=internal +RECORD_MANAGER_ANALYTICS_URL=http://localhost:1235/statistics \ No newline at end of file diff --git a/.env.keycloak-auth b/.env.keycloak-auth index 7673b0b3..ed3ba0a6 100644 --- a/.env.keycloak-auth +++ b/.env.keycloak-auth @@ -8,3 +8,4 @@ RECORD_MANAGER_EXTENSIONS=supplier RECORD_MANAGER_AUTHENTICATION=oidc RECORD_MANAGER_AUTH_SERVER_URL=http://localhost:1235/services/auth/realms/record-manager RECORD_MANAGER_AUTH_CLIENT_ID=record-manager +RECORD_MANAGER_ANALYTICS_URL=http://localhost:1235/statistics diff --git a/config/index.js b/config/index.js index f20e8c67..b6b7a912 100644 --- a/config/index.js +++ b/config/index.js @@ -33,3 +33,4 @@ export const NAVIGATOR_LANGUAGE = JSON.parse(getEnv("NAVIGATOR_LANGUAGE", "true" export const BASENAME = getEnv("BASENAME", ""); export const EXTENSIONS = getEnv("EXTENSIONS", ""); export const APP_INFO = getEnv("APP_INFO", "© KBSS at FEE CTU in Prague, 2024"); +export const ANALYTICS_URL = getEnv("ANALYTICS_URL", ""); diff --git a/deploy/internal-auth/docker-compose.yml b/deploy/internal-auth/docker-compose.yml index 1aaa22b0..1c2b4a87 100644 --- a/deploy/internal-auth/docker-compose.yml +++ b/deploy/internal-auth/docker-compose.yml @@ -10,8 +10,8 @@ x-logging-java-application: &logging-java # Expose port to access db-server directly, bypassing nginx x-access-db-server-development-port: &db-server-dev-port - ports: - - "127.0.0.1:${DB_SERVER_DEV_PORT:-7205}:7200" + ports: + - "127.0.0.1:${DB_SERVER_DEV_PORT:-7205}:7200" services: nginx: @@ -25,6 +25,7 @@ services: - record-manager-server - s-pipes-engine - db-server + - ava-analytics-ui environment: NGINX_ENVSUBST_OUTPUT_DIR: /etc/nginx APP_ORIGIN: "${PUBLIC_ORIGIN:-http://localhost:${INTERNAL_HOST_PORT:-1235}}" @@ -97,5 +98,8 @@ services: - ../shared/db-server/import:/root/graphdb-import:ro - db-server:/opt/graphdb/home + ava-analytics-ui: + image: ghcr.io/kbss-cvut/ava-analytics-ui:latest + volumes: db-server: diff --git a/deploy/keycloak-auth/docker-compose.yml b/deploy/keycloak-auth/docker-compose.yml index 39db2169..fa3f92c5 100644 --- a/deploy/keycloak-auth/docker-compose.yml +++ b/deploy/keycloak-auth/docker-compose.yml @@ -25,6 +25,7 @@ services: - record-manager-server - s-pipes-engine - db-server + - ava-analytics-ui environment: NGINX_ENVSUBST_OUTPUT_DIR: /etc/nginx APP_ORIGIN: "${PUBLIC_ORIGIN:-http://localhost:${INTERNAL_HOST_PORT:-1235}}" @@ -149,6 +150,9 @@ services: depends_on: - auth-server-db + ava-analytics-ui: + image: ghcr.io/kbss-cvut/ava-analytics-ui:latest + volumes: db-server: auth-server: diff --git a/src/components/dashboard/DashboardController.jsx b/src/components/dashboard/DashboardController.jsx index 77b7962a..ed68bad1 100644 --- a/src/components/dashboard/DashboardController.jsx +++ b/src/components/dashboard/DashboardController.jsx @@ -11,6 +11,8 @@ import withI18n from "../../i18n/withI18n"; import { loadFormTemplates } from "../../actions/FormTemplatesActions"; import { importRecords } from "../../actions/RecordsActions"; import PropTypes from "prop-types"; +import { ANALYTICS_URL } from "../../../config/index.js"; +import routes from "../../constants/RoutesConstants"; class DashboardController extends React.Component { constructor(props) { @@ -46,7 +48,11 @@ class DashboardController extends React.Component { }; _showStatistics = () => { - transitionTo(Routes.statistics); + if (ANALYTICS_URL === "") { + transitionTo(routes.statistics); + } else { + window.location.href = ANALYTICS_URL; + } }; _createRecord = () => {