Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions .envrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,14 @@
"valueType": "url",
"example": "https://viewer.kcmg.nl/",
"developmentDefault": "https://viewer.kcmg.nl/"
},
{
"name": "KCM_SURVEY_VERSION",
"description": "Version of the KCM Survey widget to use (e.g., 'latest' or specific version number).",
"required": false,
"valueType": "string",
"developmentDefault": "",
"example": "v4.49"
}
]
}
1 change: 1 addition & 0 deletions ENVIRONMENT_VARIABLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
| `KCM_SURVEY_ID` | string | | | Survey ID for the KCM Survey widget, used to identify which survey to display. | `add-kcm-survey-id` | `` |
| `KCM_SURVEY_STYLESHEETS_LINK` | url | | | URL for the custom stylesheet for the KCM Survey widget (e.g., https://www.utrecht.nl/fileadmin/kcm-radio.css). | `https://www.utrecht.nl` | `https://www.utrecht.nl` |
| `KCM_SURVEY_URL` | url | | | Base URL for the KCM Survey service where the survey widget is hosted. | `https://viewer.kcmg.nl/` | `https://viewer.kcmg.nl/` |
| `KCM_SURVEY_VERSION` | string | | | Version of the KCM Survey widget to use (e.g., 'latest' or specific version number). | `v4.49` | `` |
| `MATOMO_CONTAINER_ID` | string | | | Container ID for the Matomo tracker API. See: https://matomo.org/faq/general/faq_19212/ | `36D0C594-E017-485B-B032-C436` | `36D0C594-E017-485B-B032-C436` |
| `MATOMO_HOST` | url | | | URL where the Matomo is hosted | `https://example.com` | `https://example.com` |
| `MATOMO_SITE_ID` | string | | | Website ID for the Matomo tracker API. See: https://matomo.org/faq/general/faq_19212/ | `36D0C594-E017-485B-B032-C436` | `36D0C594-E017-485B-B032-C436EC876E5B` |
Expand Down
10 changes: 8 additions & 2 deletions apps/pdc-frontend/src/components/KCMSurvey/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@ export const KCMSurvey = ({ nonce }: KCMSurveyProps) => {
const kcmSurveyURL = buildURL({
env: process.env,
key: 'KCM_SURVEY_URL',
segments: ['surveyembedding', 'v4.48', 'kcm-survey.js'],
// the current API behaver is when you don't provide a version it pulls the latest version
segments: ['surveyembedding', process.env.KCM_SURVEY_VERSION ?? '', 'kcm-survey.js'].filter(Boolean),
});
const kcmSurveyStylesheetLink = buildURL({
env: process.env,
key: 'KCM_SURVEY_STYLESHEETS_LINK',
segments: ['fileadmin', 'kcm-radio.css'],
});

if (!process.env.KCM_SURVEY_URL || !process.env.KCM_SURVEY_ID || !process.env.KCM_SURVEY_API_KEY) {
if (
!process.env.KCM_SURVEY_URL ||
!process.env.KCM_SURVEY_ID ||
!process.env.KCM_SURVEY_API_KEY ||
!process.env.KCM_SURVEY_VERSION
) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
| `KCM_SURVEY_ID` | string | | | Survey ID for the KCM Survey widget, used to identify which survey to display. | `add-kcm-survey-id` | `` |
| `KCM_SURVEY_STYLESHEETS_LINK` | url | | | URL for the custom stylesheet for the KCM Survey widget (e.g., https://www.utrecht.nl/fileadmin/kcm-radio.css). | `https://www.utrecht.nl` | `https://www.utrecht.nl` |
| `KCM_SURVEY_URL` | url | | | Base URL for the KCM Survey service where the survey widget is hosted. | `https://viewer.kcmg.nl/` | `https://viewer.kcmg.nl/` |
| `KCM_SURVEY_VERSION` | string | | | Version of the KCM Survey widget to use (e.g., 'latest' or specific version number). | `v4.49` | `` |
| `MATOMO_CONTAINER_ID` | string | | | Container ID for the Matomo tracker API. See: https://matomo.org/faq/general/faq_19212/ | `36D0C594-E017-485B-B032-C436` | `36D0C594-E017-485B-B032-C436` |
| `MATOMO_HOST` | url | | | URL where the Matomo is hosted | `https://example.com` | `https://example.com` |
| `MATOMO_SITE_ID` | string | | | Website ID for the Matomo tracker API. See: https://matomo.org/faq/general/faq_19212/ | `36D0C594-E017-485B-B032-C436` | `36D0C594-E017-485B-B032-C436EC876E5B` |
Expand Down
1 change: 1 addition & 0 deletions docker-compose.pdc.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ services:
KCM_SURVEY_ID: ${KCM_SURVEY_ID}
KCM_SURVEY_STYLESHEETS_LINK: ${KCM_SURVEY_STYLESHEETS_LINK}
KCM_SURVEY_URL: ${KCM_SURVEY_URL}
KCM_SURVEY_VERSION: ${KCM_SURVEY_VERSION}
MATOMO_HOST: ${MATOMO_HOST}
MATOMO_SITE_ID: ${MATOMO_SITE_ID}
MATOMO_CONTAINER_ID: ${MATOMO_CONTAINER_ID}
Expand Down
1 change: 1 addition & 0 deletions docker-compose.pdc.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ services:
KCM_SURVEY_ID: ${KCM_SURVEY_ID}
KCM_SURVEY_STYLESHEETS_LINK: ${KCM_SURVEY_STYLESHEETS_LINK}
KCM_SURVEY_URL: ${KCM_SURVEY_URL}
KCM_SURVEY_VERSION: ${KCM_SURVEY_VERSION}
MATOMO_HOST: ${MATOMO_HOST}
MATOMO_SITE_ID: ${MATOMO_SITE_ID}
MATOMO_CONTAINER_ID: ${MATOMO_CONTAINER_ID}
Expand Down
Loading