diff --git a/components/dashboard/DashboardTimeSeriesChart.vue b/components/dashboard/DashboardTimeSeriesChart.vue index c850749f..35dc4cf3 100644 --- a/components/dashboard/DashboardTimeSeriesChart.vue +++ b/components/dashboard/DashboardTimeSeriesChart.vue @@ -52,7 +52,7 @@ const crosshairTemplate = (d: GetFraKaareStatisticsChurchStatisticsSnapshot) => :grid-line="false" :tick-line="false" :tick-format=" - (v: number, i: number) => data[i]?.snapshotDate?.toLocaleDateString() + (timestamp: number) => new Date(timestamp).toLocaleDateString() " /> -import { StatisticsApi } from "@bcc-code/bmm-sdk-fetch"; -import type { GetFraKaareStatisticsResponse } from "@bcc-code/bmm-sdk-fetch"; -import { breakpointsTailwind } from "@vueuse/core"; -import DashboardDataTable from "~/components/dashboard/DashboardDataTable.vue"; -import type { SortDirection } from "~/components/dashboard/DashboardDataTable.vue"; - -const { t } = useI18n(); -setTitle(() => t("dashboards.title")); - -definePageMeta({ - middleware: ["frakaare-dashboard-viewer"], -}); - -const sortDirection = ref("descending"); -const churchSize = ref<"small" | "large">("large"); - -const statistics = ref(); -onBeforeMount(async () => { - statistics.value = await new StatisticsApi().statisticsFraKaareGet(); -}); - -watch(statistics, (stats) => { - if (!stats) return; - churchSize.value = (stats.largeChurches || []).some( - (item) => item.churchName === stats.highlightedChurchName, - ) - ? "large" - : "small"; -}); - -const rows = computed( - () => - (churchSize.value === "large" - ? statistics.value?.largeChurches - : statistics.value?.smallChurches) ?? [], -); - -function sortPercentageColumn( - a: number | null | undefined, - b: number | null | undefined, -) { - if (typeof a !== "number" || typeof b !== "number") return 0; - if (a === b) return 0; - if (sortDirection.value === "descending") { - return b - a; - } - return a - b; -} - -function sortStringColumn( - a: string | null | undefined, - b: string | null | undefined, -) { - if (typeof a !== "string" || typeof b !== "string") return 0; - if (sortDirection.value === "ascending") { - return b.localeCompare(a); - } - return a.localeCompare(b); -} - -const breakpoints = useBreakpoints(breakpointsTailwind); -const isSmallScreeen = breakpoints.smaller("lg"); - -const shouldHideColumns = computed( - () => churchSize.value === "small" || isSmallScreeen.value, -); - -const columnGroupWidth = computed(() => { - if (churchSize.value === "small" && !isSmallScreeen.value) return 2; - if (shouldHideColumns.value) return 1; - return 5; -}); +import { NuxtLink } from "#components"; diff --git a/pages/dashboards/fra-kaare/index.vue b/pages/dashboards/fra-kaare/index.vue new file mode 100644 index 00000000..2b860ca3 --- /dev/null +++ b/pages/dashboards/fra-kaare/index.vue @@ -0,0 +1,6 @@ + diff --git a/pages/dashboards/fra-kaare/overview.vue b/pages/dashboards/fra-kaare/overview.vue new file mode 100644 index 00000000..79718746 --- /dev/null +++ b/pages/dashboards/fra-kaare/overview.vue @@ -0,0 +1,332 @@ + + + diff --git a/pages/dashboards/fra-kaare/raffle.vue b/pages/dashboards/fra-kaare/raffle.vue new file mode 100644 index 00000000..619defbe --- /dev/null +++ b/pages/dashboards/fra-kaare/raffle.vue @@ -0,0 +1,242 @@ + + + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 45fe285b..b59c7060 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^2.3.3 version: 2.3.3(typescript@5.3.3)(vue-router@4.3.2(vue@3.4.19(typescript@5.3.3))) '@bcc-code/bmm-sdk-fetch': - specifier: ^8.7.4 - version: 8.7.4 + specifier: ^8.7.10 + version: 8.7.10 '@floating-ui/vue': specifier: ^1.0.6 version: 1.0.6(vue@3.4.19(typescript@5.3.3)) @@ -23,6 +23,9 @@ importers: '@microsoft/applicationinsights-web': specifier: ^3.0.8 version: 3.0.8(tslib@2.6.2) + '@neoconfetti/vue': + specifier: ^2.2.1 + version: 2.2.1 '@pinia/nuxt': specifier: ^0.5.1 version: 0.5.1(rollup@4.14.3)(typescript@5.3.3)(vue@3.4.19(typescript@5.3.3)) @@ -503,8 +506,8 @@ packages: resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} engines: {node: '>=6.9.0'} - '@bcc-code/bmm-sdk-fetch@8.7.4': - resolution: {integrity: sha512-XDQ90lmwMQoMOtWD9HpiG8F6gu1hVMpadbyvumaLnqGws32PwvQT5dxov0yEmqLhwI9EpT5Shdw+FfpDZ8XuBQ==} + '@bcc-code/bmm-sdk-fetch@8.7.10': + resolution: {integrity: sha512-Xb4fhVSn7bwkSbM2dcq5TNGeeSt17qs3vwFmdKLcCqZGJRa9o8/6JcceueXu9mxckHC/26KglM3vF2tJ5NeIjg==} '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} @@ -1156,6 +1159,9 @@ packages: peerDependencies: rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 + '@neoconfetti/vue@2.2.1': + resolution: {integrity: sha512-GXe5XoHlMK8VIxmxKuAgF9QQwRoDLmtiwVhONA9rzF+zOLGfOVLxo4OEDZqU9F0gJkB7U23BLlGJ3ouOb+kguw==} + '@netlify/functions@2.6.0': resolution: {integrity: sha512-vU20tij0fb4nRGACqb+5SQvKd50JYyTyEhQetCMHdakcJFzjLDivvRR16u1G2Oy4A7xNAtGJF1uz8reeOtTVcQ==} engines: {node: '>=14.0.0'} @@ -8296,7 +8302,7 @@ snapshots: '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 - '@bcc-code/bmm-sdk-fetch@8.7.4': {} + '@bcc-code/bmm-sdk-fetch@8.7.10': {} '@bcoe/v8-coverage@0.2.3': {} @@ -8987,6 +8993,8 @@ snapshots: json5: 2.2.3 rollup: 4.14.3 + '@neoconfetti/vue@2.2.1': {} + '@netlify/functions@2.6.0': dependencies: '@netlify/serverless-functions-api': 1.14.0 @@ -9480,7 +9488,7 @@ snapshots: '@nuxtjs/eslint-config-typescript@12.1.0(eslint@8.56.0)(typescript@5.3.3)': dependencies: - '@nuxtjs/eslint-config': 12.0.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + '@nuxtjs/eslint-config': 12.0.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-plugin-import@2.29.1)(eslint@8.56.0))(eslint@8.56.0) '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 @@ -9493,10 +9501,10 @@ snapshots: - supports-color - typescript - '@nuxtjs/eslint-config@12.0.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0)': + '@nuxtjs/eslint-config@12.0.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-plugin-import@2.29.1)(eslint@8.56.0))(eslint@8.56.0)': dependencies: eslint: 8.56.0 - eslint-config-standard: 17.1.0(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0(eslint@8.56.0))(eslint-plugin-promise@6.1.1(eslint@8.56.0))(eslint@8.56.0) + eslint-config-standard: 17.1.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0))(eslint-plugin-n@15.7.0(eslint@8.56.0))(eslint-plugin-promise@6.1.1(eslint@8.56.0))(eslint@8.56.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) eslint-plugin-n: 15.7.0(eslint@8.56.0) eslint-plugin-node: 11.1.0(eslint@8.56.0) @@ -12756,7 +12764,7 @@ snapshots: dependencies: eslint: 8.56.0 - eslint-config-standard@17.1.0(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0(eslint@8.56.0))(eslint-plugin-promise@6.1.1(eslint@8.56.0))(eslint@8.56.0): + eslint-config-standard@17.1.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0))(eslint-plugin-n@15.7.0(eslint@8.56.0))(eslint-plugin-promise@6.1.1(eslint@8.56.0))(eslint@8.56.0): dependencies: eslint: 8.56.0 eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) @@ -12776,7 +12784,7 @@ snapshots: debug: 4.3.4(supports-color@8.1.1) enhanced-resolve: 5.15.0 eslint: 8.56.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-plugin-import@2.29.1)(eslint@8.56.0))(eslint@8.56.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) fast-glob: 3.3.2 get-tsconfig: 4.7.2 @@ -12788,7 +12796,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): + eslint-module-utils@2.8.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-plugin-import@2.29.1)(eslint@8.56.0))(eslint@8.56.0): dependencies: debug: 3.2.7(supports-color@8.1.1) optionalDependencies: @@ -12821,7 +12829,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint-plugin-import@2.29.1)(eslint@8.56.0))(eslint@8.56.0) hasown: 2.0.1 is-core-module: 2.13.1 is-glob: 4.0.3