From df809acb8c5dea1934409b35e5ea46ba878770f9 Mon Sep 17 00:00:00 2001 From: bilalmirza74 Date: Sun, 20 Oct 2024 10:58:11 +0530 Subject: [PATCH 1/4] Fix: removed unused variables, exported name as a property of default import --- .../src/components/analytics/chart-social.tsx | 1 - .../billing/main.billing.component.tsx | 3 --- .../src/components/launches/bot.picture.tsx | 5 +---- .../components/launches/calendar.context.tsx | 5 +++-- .../src/components/launches/calendar.tsx | 10 +++++++--- .../src/components/launches/editor.tsx | 3 +-- .../launches/generator/generator.tsx | 1 - .../launches/launches.component.tsx | 1 - .../src/components/layout/layout.context.tsx | 1 - .../src/components/layout/layout.settings.tsx | 20 +++++++++---------- .../marketplace/preview.popup.dynamic.tsx | 2 +- .../onboarding/connect.channels.tsx | 1 - .../platform-analytics/render.analytics.tsx | 2 +- 13 files changed, 24 insertions(+), 31 deletions(-) diff --git a/apps/frontend/src/components/analytics/chart-social.tsx b/apps/frontend/src/components/analytics/chart-social.tsx index f51db426..b4191ba8 100644 --- a/apps/frontend/src/components/analytics/chart-social.tsx +++ b/apps/frontend/src/components/analytics/chart-social.tsx @@ -2,7 +2,6 @@ import { FC, useEffect, useMemo, useRef } from 'react'; import DrawChart from 'chart.js/auto'; import { TotalList } from '@gitroom/frontend/components/analytics/stars.and.forks.interface'; -import dayjs from 'dayjs'; import { chunk } from 'lodash'; function mergeDataPoints(data: TotalList[], numPoints: number): TotalList[] { diff --git a/apps/frontend/src/components/billing/main.billing.component.tsx b/apps/frontend/src/components/billing/main.billing.component.tsx index fc2f88d2..71aaf7da 100644 --- a/apps/frontend/src/components/billing/main.billing.component.tsx +++ b/apps/frontend/src/components/billing/main.billing.component.tsx @@ -3,8 +3,6 @@ import { Slider } from '@gitroom/react/form/slider'; import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; import { Button } from '@gitroom/react/form/button'; -import { sortBy } from 'lodash'; -import { Track } from '@gitroom/react/form/track'; import { useFetch } from '@gitroom/helpers/utils/custom.fetch'; import { Subscription } from '@prisma/client'; import { useDebouncedCallback } from 'use-debounce'; @@ -21,7 +19,6 @@ import interClass from '@gitroom/react/helpers/inter.font'; import { useRouter } from 'next/navigation'; import { useVariables } from '@gitroom/react/helpers/variable.context'; import { useModals } from '@mantine/modals'; -import { AddProviderComponent } from '@gitroom/frontend/components/launches/add.provider.component'; import { TopTitle } from '@gitroom/frontend/components/launches/helpers/top.title.component'; import { Textarea } from '@gitroom/react/form/textarea'; diff --git a/apps/frontend/src/components/launches/bot.picture.tsx b/apps/frontend/src/components/launches/bot.picture.tsx index fadac522..cca8f426 100644 --- a/apps/frontend/src/components/launches/bot.picture.tsx +++ b/apps/frontend/src/components/launches/bot.picture.tsx @@ -6,10 +6,7 @@ import { Input } from '@gitroom/react/form/input'; import { Button } from '@gitroom/react/form/button'; import { useFetch } from '@gitroom/helpers/utils/custom.fetch'; import { useToaster } from '@gitroom/react/toaster/toaster'; -import { - MediaComponent, - showMediaBox, -} from '@gitroom/frontend/components/media/media.component'; +import { showMediaBox } from '@gitroom/frontend/components/media/media.component'; export const BotPicture: FC<{ integration: Integrations; diff --git a/apps/frontend/src/components/launches/calendar.context.tsx b/apps/frontend/src/components/launches/calendar.context.tsx index 03373f25..1bad55b0 100644 --- a/apps/frontend/src/components/launches/calendar.context.tsx +++ b/apps/frontend/src/components/launches/calendar.context.tsx @@ -19,8 +19,9 @@ import { useSearchParams } from 'next/navigation'; import isoWeek from 'dayjs/plugin/isoWeek'; import weekOfYear from 'dayjs/plugin/weekOfYear'; -dayjs.extend(isoWeek); -dayjs.extend(weekOfYear); +import { extend } from 'dayjs'; +extend(isoWeek); +extend(weekOfYear); export const CalendarContext = createContext({ currentDay: dayjs().day() as 0 | 1 | 2 | 3 | 4 | 5 | 6, diff --git a/apps/frontend/src/components/launches/calendar.tsx b/apps/frontend/src/components/launches/calendar.tsx index 93ea124b..6aac17c6 100644 --- a/apps/frontend/src/components/launches/calendar.tsx +++ b/apps/frontend/src/components/launches/calendar.tsx @@ -26,8 +26,9 @@ import isSameOrAfter from 'dayjs/plugin/isSameOrAfter'; import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'; import { groupBy, sortBy } from 'lodash'; import Image from 'next/image'; -dayjs.extend(isSameOrAfter); -dayjs.extend(isSameOrBefore); +import { extend } from 'dayjs'; +extend(isSameOrAfter); +extend(isSameOrBefore); export const days = [ 'Monday', @@ -499,7 +500,10 @@ export const CalendarColumn: FC<{ className={`w-full h-full rounded-[10px] hover:border hover:border-seventh flex justify-center items-center gap-[20px] opacity-30 grayscale hover:grayscale-0 hover:opacity-100`} > {integrations.map((selectedIntegrations) => ( -
+
{ const fetch = useFetch(); @@ -93,9 +94,7 @@ export const LayoutSettings = ({ children }: { children: ReactNode }) => { />
{isGeneral ? ( { )}
- {user?.orgId && (user.tier !== 'FREE' || !isGeneral || !billingEnabled) ? ( + {user?.orgId && + (user.tier !== 'FREE' || !isGeneral || !billingEnabled) ? ( ) : (
@@ -141,7 +141,7 @@ export const LayoutSettings = ({ children }: { children: ReactNode }) => {
- {(user.tier === 'FREE' && isGeneral) && billingEnabled ? ( + {user.tier === 'FREE' && isGeneral && billingEnabled ? ( <>

diff --git a/apps/frontend/src/components/marketplace/preview.popup.dynamic.tsx b/apps/frontend/src/components/marketplace/preview.popup.dynamic.tsx index c806bcd8..09c7bd0d 100644 --- a/apps/frontend/src/components/marketplace/preview.popup.dynamic.tsx +++ b/apps/frontend/src/components/marketplace/preview.popup.dynamic.tsx @@ -1,5 +1,5 @@ import 'reflect-metadata'; -import { FC, useCallback } from 'react'; +import { FC } from 'react'; import { Post as PrismaPost } from '.prisma/client'; import { Providers } from '@gitroom/frontend/components/launches/providers/show.all.providers'; diff --git a/apps/frontend/src/components/onboarding/connect.channels.tsx b/apps/frontend/src/components/onboarding/connect.channels.tsx index 65e5c7f7..a7bf5234 100644 --- a/apps/frontend/src/components/onboarding/connect.channels.tsx +++ b/apps/frontend/src/components/onboarding/connect.channels.tsx @@ -5,7 +5,6 @@ import React, { useCallback, useEffect, useMemo, - useRef, useState, } from 'react'; import { useFetch } from '@gitroom/helpers/utils/custom.fetch'; diff --git a/apps/frontend/src/components/platform-analytics/render.analytics.tsx b/apps/frontend/src/components/platform-analytics/render.analytics.tsx index 6b2e2608..233af868 100644 --- a/apps/frontend/src/components/platform-analytics/render.analytics.tsx +++ b/apps/frontend/src/components/platform-analytics/render.analytics.tsx @@ -1,4 +1,4 @@ -import { FC, useCallback, useEffect, useMemo, useState } from 'react'; +import { FC, useCallback, useMemo, useState } from 'react'; import { Integration } from '@prisma/client'; import useSWR from 'swr'; import { useFetch } from '@gitroom/helpers/utils/custom.fetch'; From cc187b507d6f202f9dffb10e0c4d43548c00a2fb Mon Sep 17 00:00:00 2001 From: bilalmirza74 Date: Tue, 22 Oct 2024 05:25:35 +0530 Subject: [PATCH 2/4] , --- apps/frontend/src/components/analytics/chart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/frontend/src/components/analytics/chart.tsx b/apps/frontend/src/components/analytics/chart.tsx index 06ff4354..7d46d349 100644 --- a/apps/frontend/src/components/analytics/chart.tsx +++ b/apps/frontend/src/components/analytics/chart.tsx @@ -1,5 +1,5 @@ 'use client'; -import { FC, useEffect, useMemo, useRef } from 'react'; +import { FC, useEffect, useRef } from 'react'; import DrawChart from 'chart.js/auto'; import { ForksList, From 76a83d622661a22ea4916fa83afe6ad3dc7c2cc6 Mon Sep 17 00:00:00 2001 From: bilalmirza74 Date: Tue, 22 Oct 2024 05:33:46 +0530 Subject: [PATCH 3/4] Done all --- .../src/components/launches/helpers/linkedin.component.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/frontend/src/components/launches/helpers/linkedin.component.tsx b/apps/frontend/src/components/launches/helpers/linkedin.component.tsx index af1c36a2..7870013e 100644 --- a/apps/frontend/src/components/launches/helpers/linkedin.component.tsx +++ b/apps/frontend/src/components/launches/helpers/linkedin.component.tsx @@ -13,8 +13,6 @@ import { import { useFetch } from '@gitroom/helpers/utils/custom.fetch'; import { Input } from '@gitroom/react/form/input'; import { Button } from '@gitroom/react/form/button'; -import { useCustomProviderFunction } from '@gitroom/frontend/components/launches/helpers/use.custom.provider.function'; -import dayjs from 'dayjs'; const postUrlEmitter = new EventEmitter(); From 31e78a8c1ceedd210fbc3aa0f790d35a96703370 Mon Sep 17 00:00:00 2001 From: jamesread Date: Sun, 3 Nov 2024 21:21:57 +0000 Subject: [PATCH 4/4] bugfix: Ignore cloudflare in config checker, as it is no longer needed. --- .../helpers/src/configuration/configuration.checker.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libraries/helpers/src/configuration/configuration.checker.ts b/libraries/helpers/src/configuration/configuration.checker.ts index 425de8ad..7703b666 100644 --- a/libraries/helpers/src/configuration/configuration.checker.ts +++ b/libraries/helpers/src/configuration/configuration.checker.ts @@ -30,12 +30,7 @@ export class ConfigurationChecker { this.checkIsValidUrl('FRONTEND_URL') this.checkIsValidUrl('NEXT_PUBLIC_BACKEND_URL') this.checkIsValidUrl('BACKEND_INTERNAL_URL') - this.checkNonEmpty('CLOUDFLARE_ACCOUNT_ID', 'Needed to setup providers.') - this.checkNonEmpty('CLOUDFLARE_ACCESS_KEY', 'Needed to setup providers.') - this.checkNonEmpty('CLOUDFLARE_SECRET_ACCESS_KEY', 'Needed to setup providers.') - this.checkNonEmpty('CLOUDFLARE_BUCKETNAME', 'Needed to setup providers.') - this.checkNonEmpty('CLOUDFLARE_BUCKET_URL', 'Needed to setup providers.') - this.checkNonEmpty('CLOUDFLARE_REGION', 'Needed to setup providers.') + this.checkNonEmpty('STORAGE_PROVIDER', 'Needed to setup storage.') } checkNonEmpty (key: string, description?: string): boolean {