From b9a226f59c2c5e31cb4487591208ec3216aa069d Mon Sep 17 00:00:00 2001 From: ajnart Date: Tue, 24 Oct 2023 14:46:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=88=20Add=20`umami`=20analytics=20usin?= =?UTF-8?q?g=20`homarr.dev`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 20 ++++------- package.json | 3 +- .../Components/Shared/GenericElementType.tsx | 2 ++ .../AvailableStaticElementsTab.tsx | 7 ++-- .../WidgetsTab/WidgetElementType.tsx | 4 ++- .../Manage/Board/create-board.modal.tsx | 4 ++- .../Docker/docker-select-board.modal.tsx | 1 + .../Manage/User/Create/review-input-step.tsx | 1 + .../Manage/User/Create/security-step.tsx | 1 + .../Onboarding/step-create-account.tsx | 1 + .../layout/Templates/BoardLayout.tsx | 1 + src/env.js | 3 +- src/pages/_app.tsx | 22 ++++++++---- yarn.lock | 34 +++++++++++++------ 14 files changed, 66 insertions(+), 38 deletions(-) diff --git a/.env.example b/.env.example index db8aaac59..2de2526be 100644 --- a/.env.example +++ b/.env.example @@ -1,22 +1,14 @@ -# Since the ".env" file is gitignored, you can use the ".env.example" file to -# build a new ".env" file when you clone the repo. Keep this file up-to-date -# when you add new variables to `.env`. - -# This file will be committed to version control, so make sure not to have any -# secrets in it. If you are cloning this repo, create a copy of this file named -# ".env" and populate it with your secrets. - -# When adding additional environment variables, the schema in "/src/env.js" -# should be updated accordingly. - -# Database DATABASE_URL="file:./database/db.sqlite" # Next Auth # You can generate a new secret on the command line with: # openssl rand -base64 32 # https://next-auth.js.org/configuration/options#secret -# NEXTAUTH_SECRET="" NEXTAUTH_URL="http://localhost:3000" -NEXTAUTH_SECRET="" +NEXTAUTH_SECRET="anything" + +# Disable analytics +NEXT_PUBLIC_DISABLE_ANALYTICS="true" + +DEFAULT_COLOR_SCHEME="light" \ No newline at end of file diff --git a/package.json b/package.json index ce1b8f0ba..b0bcfd838 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@nivo/core": "^0.83.0", "@nivo/line": "^0.83.0", "@react-native-async-storage/async-storage": "^1.18.1", - "@t3-oss/env-nextjs": "^0.6.0", + "@t3-oss/env-nextjs": "^0.7.1", "@tabler/icons-react": "^2.20.0", "@tanstack/query-async-storage-persister": "^4.27.1", "@tanstack/query-sync-storage-persister": "^4.27.1", @@ -118,6 +118,7 @@ "@types/node": "18.17.8", "@types/prismjs": "^1.26.0", "@types/react": "^18.2.11", + "@types/umami": "^0.1.4", "@types/uuid": "^9.0.0", "@types/video.js": "^7.3.51", "@typescript-eslint/eslint-plugin": "^6.0.0", diff --git a/src/components/Dashboard/Modals/SelectElement/Components/Shared/GenericElementType.tsx b/src/components/Dashboard/Modals/SelectElement/Components/Shared/GenericElementType.tsx index 45c0807e9..aa6dbd33b 100644 --- a/src/components/Dashboard/Modals/SelectElement/Components/Shared/GenericElementType.tsx +++ b/src/components/Dashboard/Modals/SelectElement/Components/Shared/GenericElementType.tsx @@ -8,6 +8,7 @@ import { useStyles } from './styles'; interface GenericAvailableElementTypeProps { name: string; + id: string; handleAddition: () => Promise; description?: string; image: string | Icon; @@ -16,6 +17,7 @@ interface GenericAvailableElementTypeProps { export const GenericAvailableElementType = ({ name, + id, description, image, disabled, diff --git a/src/components/Dashboard/Modals/SelectElement/Components/StaticElementsTab/AvailableStaticElementsTab.tsx b/src/components/Dashboard/Modals/SelectElement/Components/StaticElementsTab/AvailableStaticElementsTab.tsx index a17f0f724..3c4a66821 100644 --- a/src/components/Dashboard/Modals/SelectElement/Components/StaticElementsTab/AvailableStaticElementsTab.tsx +++ b/src/components/Dashboard/Modals/SelectElement/Components/StaticElementsTab/AvailableStaticElementsTab.tsx @@ -1,4 +1,4 @@ -import { Grid, Text } from '@mantine/core'; +import { Container, Grid, Text } from '@mantine/core'; import { IconCursorText } from '@tabler/icons-react'; import { useTranslation } from 'next-i18next'; @@ -21,12 +21,13 @@ export const AvailableStaticTypes = ({ onClickBack }: AvailableStaticTypesProps) + {/* {}} - /> + handleAddition={async () => {}} + /> */} ); diff --git a/src/components/Dashboard/Modals/SelectElement/Components/WidgetsTab/WidgetElementType.tsx b/src/components/Dashboard/Modals/SelectElement/Components/WidgetsTab/WidgetElementType.tsx index 6a783ba12..aafbc5858 100644 --- a/src/components/Dashboard/Modals/SelectElement/Components/WidgetsTab/WidgetElementType.tsx +++ b/src/components/Dashboard/Modals/SelectElement/Components/WidgetsTab/WidgetElementType.tsx @@ -3,10 +3,10 @@ import { showNotification } from '@mantine/notifications'; import { Icon, IconChecks } from '@tabler/icons-react'; import { useTranslation } from 'next-i18next'; import { v4 as uuidv4 } from 'uuid'; - import { useConfigContext } from '~/config/provider'; import { useConfigStore } from '~/config/store'; import { IWidget, IWidgetDefinition } from '~/widgets/widgets'; + import { useEditModeStore } from '../../../../Views/useEditModeStore'; import { GenericAvailableElementType } from '../Shared/GenericElementType'; @@ -97,6 +97,7 @@ export const WidgetElementType = ({ id, image, disabled, widget }: WidgetElement icon: , color: 'teal', }); + umami.track('Add widget', { id: widget.id }); }; return ( @@ -104,6 +105,7 @@ export const WidgetElementType = ({ id, image, disabled, widget }: WidgetElement name={t('descriptor.name')} description={t('descriptor.description') ?? undefined} image={image} + id={widget.id} disabled={disabled} handleAddition={handleAddition} /> diff --git a/src/components/Manage/Board/create-board.modal.tsx b/src/components/Manage/Board/create-board.modal.tsx index 95919b05f..7cf7abe4e 100644 --- a/src/components/Manage/Board/create-board.modal.tsx +++ b/src/components/Manage/Board/create-board.modal.tsx @@ -58,7 +58,9 @@ export const CreateBoardModal = ({ id }: ContextModalProps<{}>) => {