Skip to content

Commit

Permalink
feat: GEO-381 Snowplow analytics button (#838)
Browse files Browse the repository at this point in the history
  • Loading branch information
jer3k authored Nov 5, 2024
1 parent 5a0dc0f commit c3c353c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 1 deletion.
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
14 changes: 14 additions & 0 deletions admin-frontend/src/components/AnalyticsPage.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<template>
<v-btn
v-tooltip:bottom-end="'Only authorized users can access this data'"
append-icon="mdi-open-in-new"
class="ml-auto btn-primary"
style="margin-top: -40px"
rel="noopener"
target="_blank"
:href="sanitizeUrl(snowplowUrl)"
>Web Traffic Analytics</v-btn
>

<div v-if="isAnalyticsAvailable" class="w-100 overflow-x-auto">
<div
v-for="[name, details] in powerBiDetailsPerResource"
Expand All @@ -25,6 +36,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 +45,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

0 comments on commit c3c353c

Please sign in to comment.