Skip to content

Commit

Permalink
Merge pull request #160 from kbss-cvut/add-ava-analytics
Browse files Browse the repository at this point in the history
Add ava-analytics
  • Loading branch information
blcham authored May 6, 2024
2 parents 2e0eb0b + cd056c0 commit e8b7475
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.internal-auth
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .env.keycloak-auth
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", "");
8 changes: 6 additions & 2 deletions deploy/internal-auth/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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}}"
Expand Down Expand Up @@ -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:
4 changes: 4 additions & 0 deletions deploy/keycloak-auth/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 7 additions & 1 deletion src/components/dashboard/DashboardController.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 = () => {
Expand Down

0 comments on commit e8b7475

Please sign in to comment.