diff --git a/.envrc.json b/.envrc.json index 6e2153df2..85b22962d 100644 --- a/.envrc.json +++ b/.envrc.json @@ -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" } ] } diff --git a/ENVIRONMENT_VARIABLES.md b/ENVIRONMENT_VARIABLES.md index b6c2b4a01..af85da194 100644 --- a/ENVIRONMENT_VARIABLES.md +++ b/ENVIRONMENT_VARIABLES.md @@ -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` | diff --git a/apps/pdc-frontend/src/components/KCMSurvey/index.tsx b/apps/pdc-frontend/src/components/KCMSurvey/index.tsx index 649bf685e..25dd6273a 100644 --- a/apps/pdc-frontend/src/components/KCMSurvey/index.tsx +++ b/apps/pdc-frontend/src/components/KCMSurvey/index.tsx @@ -18,7 +18,8 @@ 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, @@ -26,7 +27,12 @@ export const KCMSurvey = ({ nonce }: KCMSurveyProps) => { 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; } diff --git a/apps/strapi.frameless.io/docs/developers/ENVIRONMENT_VARIABLES.md b/apps/strapi.frameless.io/docs/developers/ENVIRONMENT_VARIABLES.md index b6c2b4a01..af85da194 100644 --- a/apps/strapi.frameless.io/docs/developers/ENVIRONMENT_VARIABLES.md +++ b/apps/strapi.frameless.io/docs/developers/ENVIRONMENT_VARIABLES.md @@ -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` | diff --git a/docker-compose.pdc.dev.yml b/docker-compose.pdc.dev.yml index 385e3fbd9..5c83245db 100644 --- a/docker-compose.pdc.dev.yml +++ b/docker-compose.pdc.dev.yml @@ -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} diff --git a/docker-compose.pdc.prod.yml b/docker-compose.pdc.prod.yml index 9c838f2b8..ee2d15d78 100644 --- a/docker-compose.pdc.prod.yml +++ b/docker-compose.pdc.prod.yml @@ -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}