diff --git a/example.env b/example.env index dc5b47329380cf3bed73a729e196b75e611f50da..c6734bf647eb74ae3e2cf0440435954c32631de2 100644 --- a/example.env +++ b/example.env @@ -28,6 +28,9 @@ GITHUB_PERSONAL_ACCESS_TOKEN=null # that should not be shown when editing test cases HIDDEN_ENTITIES=menages +# Key for household entity +HOUSEHOLD_KEY="menage" + # Matomo analytics configuration # MATOMO_SITE_ID=123 # MATOMO_URL="https://MATOMO_SERVER/" diff --git a/src/app.d.ts b/src/app.d.ts index 0e572ab33a31dc492b1fe74b026b8a8be0c1a9e1..3085b91f3e055afb7a84c2c5b5990df3206f4122 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -17,6 +17,7 @@ declare namespace App { familyEntityKey: string hasGithubPersonalAccessToken: boolean hiddenEntitiesKeyPlural?: string[] + householdEntityKey: string matomo?: { prependDomain?: boolean siteId: number diff --git a/src/hooks.ts b/src/hooks.ts index e27db3c3a17ccfb9b2e4cd843e1e3f219c56d261..c3cac06a56c27052467df453d16ba2ab784c3f9c 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -18,6 +18,7 @@ export const getSession: GetSession = async (event): Promise<App.Session> => { familyEntityKey: config.familyEntityKey, hasGithubPersonalAccessToken: githubPersonalAccessToken !== undefined, hiddenEntitiesKeyPlural: config.hiddenEntitiesKeyPlural, + householdEntityKey: config.householdEntityKey, matomo: config.matomo, openfiscaRepository: { branch: openfiscaRepository.branch, diff --git a/src/lib/auditors/config.ts b/src/lib/auditors/config.ts index d82225854ddbced375c9f730c3580b4d7d2ce9c0..444895cfb6dc98c0ff86e0473a04351254b567d3 100644 --- a/src/lib/auditors/config.ts +++ b/src/lib/auditors/config.ts @@ -68,6 +68,7 @@ export function auditConfig( for (const key of [ "childrenKey", "familyEntityKey", + "householdEntityKey", "simulationsDir", "title", ]) { diff --git a/src/lib/components/test_cases/TestCaseCompareView.svelte b/src/lib/components/test_cases/TestCaseCompareView.svelte index 53b33b75ed8a4f3de6ee9fcfa4fc430e30a65634..ad6c89c58f6630ea978633c994ce4d8e9f438f3e 100644 --- a/src/lib/components/test_cases/TestCaseCompareView.svelte +++ b/src/lib/components/test_cases/TestCaseCompareView.svelte @@ -53,6 +53,7 @@ EvaluationByName[] > const familyEntity = entityByKey[$session.familyEntityKey] + // const householdEntity = entityByKey[$session.householdEntityKey] const personEntity = entityByKey[personEntityKey] const parametricReform = getContext( "parametricReform", diff --git a/src/lib/components/test_cases/TestCaseSummary.svelte b/src/lib/components/test_cases/TestCaseSummary.svelte index 85b0ba1beb8712477f891d6fbbf2e5ebeabd5111..d36015f6795f3d194fdf40c0b6b2743a038ac8cf 100644 --- a/src/lib/components/test_cases/TestCaseSummary.svelte +++ b/src/lib/components/test_cases/TestCaseSummary.svelte @@ -39,6 +39,7 @@ style: "currency", }) const familyEntity = entityByKey[$session.familyEntityKey] + const householdEntity = entityByKey[$session.householdEntityKey] let isTestCaseCompareModalOpen = false const personEntity = entityByKey[personEntityKey] let slider: Slider | undefined = undefined diff --git a/src/lib/server/config.ts b/src/lib/server/config.ts index 60dfc7162d65ebc2541fc9f1bc1d5e3f87accaef..708ff9c1918812110a6ceba6f146a162a544d6c8 100644 --- a/src/lib/server/config.ts +++ b/src/lib/server/config.ts @@ -13,6 +13,7 @@ export interface Config { familyEntityKey: string githubPersonalAccessToken?: string hiddenEntitiesKeyPlural?: string[] + householdEntityKey: string matomo?: { prependDomain?: boolean siteId: number @@ -45,6 +46,7 @@ const [validConfig, error] = validateConfig({ familyEntityKey: process.env["FAMILY_KEY"], githubPersonalAccessToken: process.env["GITHUB_PERSONAL_ACCESS_TOKEN"], hiddenEntitiesKeyPlural: process.env["HIDDEN_ENTITIES"], + householdEntityKey: process.env["HOUSEHOLD_KEY"], matomo: process.env["MATOMO_SITE_ID"] && process.env["MATOMO_URL"] ? {