Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: GEO-381 Snowplow analytics button #838

Merged
merged 8 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions .github/workflows/.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ jobs:
--set-string crunchy.pgBackRest.s3.accessKey="${{ secrets.S3_ACCESS_KEY }}" \
--set-string crunchy.pgBackRest.s3.secretKey="${{ secrets.S3_SECRET_ACCESS_KEY }}" \
--set-string global.secrets.clamavApiKey="${{ secrets.CLAMAV_API_KEY }}" \
--set-string global.secrets.snowplowUrl="${{ secrets.SNOWPLOW_URL }}" \
${{ inputs.params }} \
--timeout "$DEPLOY_TIMEOUT"m ./${{ github.event.repository.name }}-${{ steps.vars.outputs.semver }}.tgz

Expand Down
3 changes: 2 additions & 1 deletion admin-frontend/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
}
respond `window.config = {
"IS_ADMIN_DASHBOARD_AVAILABLE":"{$IS_ADMIN_DASHBOARD_AVAILABLE}",
"IS_ADMIN_ANALYTICS_AVAILABLE":"{$IS_ADMIN_ANALYTICS_AVAILABLE}"
"IS_ADMIN_ANALYTICS_AVAILABLE":"{$IS_ADMIN_ANALYTICS_AVAILABLE}",
"SNOWPLOW_URL":"{$SNOWPLOW_URL}"
};`
}
root * /app/dist
Expand Down
4 changes: 4 additions & 0 deletions admin-frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ a:hover {
background-color: transparent !important;
}

.v-card-title {
font-size: 1.35rem !important; //default is 1.25, but BCSans font looks wonky at that size.
}

.theme--light.application {
background: #f1f1f1;
}
Expand Down
20 changes: 20 additions & 0 deletions admin-frontend/src/components/AnalyticsPage.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
<template>
<v-card
class="mb-5"
append-icon="mdi-open-in-new"
:href="sanitizeUrl(snowplowUrl)"
rel="noopener"
target="_blank"
title="Snowplow Analytics"
subtitle="Track and analyze user behavior."
>
<v-card-text>
<span class="text-info">
<v-icon icon="mdi-information" />
Only authorized users can access Snowplow.
</span>
</v-card-text>
</v-card>

<div v-if="isAnalyticsAvailable" class="w-100 overflow-x-auto">
<div
v-for="[name, details] in powerBiDetailsPerResource"
Expand All @@ -25,6 +42,7 @@ import ApiService from '../services/apiService';
import { ZonedDateTime, Duration } from '@js-joda/core';
import { POWERBI_RESOURCE } from '../utils/constant';
import { NotificationService } from '../services/notificationService';
import { sanitizeUrl } from '@braintree/sanitize-url';

type PowerBiDetails = {
config: IReportEmbedConfiguration;
Expand All @@ -33,6 +51,8 @@ type PowerBiDetails = {
eventHandlersMap: Map<string, EventHandler>;
};

const snowplowUrl = (window as any).config?.SNOWPLOW_URL;

const isAnalyticsAvailable =
(window as any).config?.IS_ADMIN_ANALYTICS_AVAILABLE?.toUpperCase() == 'TRUE';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ spec:
value: "{{ .Values.env.isAdminDashboardAvailable }}"
- name: IS_ADMIN_ANALYTICS_AVAILABLE
value: "{{ .Values.env.isAdminAnalyticsAvailable }}"
- name: SNOWPLOW_URL
value: "{{ .Values.global.secrets.snowplowUrl }}"
- name: CLAMAV_API_KEY
valueFrom:
secretKeyRef:
Expand Down
1 change: 1 addition & 0 deletions charts/fin-pay-transparency/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ data:
S3_BUCKET_NAME: {{ .Values.global.secrets.s3Bucket | b64enc | quote }}
S3_ENDPOINT: {{ .Values.global.secrets.s3Endpoint | b64enc | quote }}
CLAMAV_API_KEY: {{ .Values.global.secrets.clamavApiKey | b64enc | quote }}
SNOWPLOW_URL: {{ .Values.global.secrets.snowplowUrl | b64enc | quote }}

1 change: 1 addition & 0 deletions charts/fin-pay-transparency/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ admin-frontend:
env:
isAdminDashboardAvailable: true
isAdminAnalyticsAvailable: true
isAdminAnalyticsAvailable: true
database:
enabled: false
crunchy:
Expand Down