From 384252770b8a9dadf18f7e24eaccfc54594c551d Mon Sep 17 00:00:00 2001 From: Sync Fork Date: Tue, 23 Jan 2024 00:04:28 +0000 Subject: [PATCH] Merge upstream changes --- dashboard/CHANGELOG.md | 12 +++++ dashboard/package.json | 2 +- .../components/common/ContactUs/ContactUs.tsx | 36 ++++++++++++- .../src/components/layout/Header/Header.tsx | 9 +++- .../ChangePlanModal/ChangePlanModal.tsx | 51 +------------------ .../useIsCurrentUserOwner.ts | 2 +- .../planDescriptions/planDescriptions.ts | 1 + .../OverviewTopBar/OverviewTopBar.tsx | 9 ++-- dashboard/src/pages/new.tsx | 14 +++++ docs/CHANGELOG.md | 6 +++ docs/package.json | 2 +- 11 files changed, 84 insertions(+), 60 deletions(-) diff --git a/dashboard/CHANGELOG.md b/dashboard/CHANGELOG.md index 156f30f6f8..52efa95277 100644 --- a/dashboard/CHANGELOG.md +++ b/dashboard/CHANGELOG.md @@ -1,5 +1,17 @@ # @nhost/dashboard +## 1.6.0 + +### Minor Changes + +- 3ff1c2b53: fix: show upgrade option for pro projects + +## 1.5.0 + +### Minor Changes + +- c2ef17c0a: feat: add support for new Team plan + ## 1.4.0 ### Minor Changes diff --git a/dashboard/package.json b/dashboard/package.json index a3a537a75c..a1fbad68ad 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -1,6 +1,6 @@ { "name": "@nhost/dashboard", - "version": "1.4.0", + "version": "1.6.0", "private": true, "scripts": { "preinstall": "npx only-allow pnpm", diff --git a/dashboard/src/components/common/ContactUs/ContactUs.tsx b/dashboard/src/components/common/ContactUs/ContactUs.tsx index 93a996b268..60ce91e48f 100644 --- a/dashboard/src/components/common/ContactUs/ContactUs.tsx +++ b/dashboard/src/components/common/ContactUs/ContactUs.tsx @@ -4,9 +4,17 @@ import type { DetailedHTMLProps, HTMLProps } from 'react'; import { twMerge } from 'tailwind-merge'; export interface ContactUsProps - extends DetailedHTMLProps, HTMLDivElement> {} + extends DetailedHTMLProps, HTMLDivElement> { + isTeam?: boolean; + isOwner?: boolean; +} -export default function FeedbackForm({ className, ...props }: ContactUsProps) { +export default function FeedbackForm({ + className, + isTeam, + isOwner, + ...props +}: ContactUsProps) { return (
+ {isTeam && isOwner && ( + + If this is a new Team project, or you need to manage members, reach + out to us on discord or via email at{' '} + + support@nhost.io + {' '} + so we can have your dedicated channel set up. + + )} + + {isTeam && !isOwner && ( + + As part of a team plan you can reach out to us on the private channel + for this workspace. If you haven't been added to the channel, ask + the workspace owner to add you. + + )} + To report issues with Nhost, please open a GitHub issue in the{' '} - + )} diff --git a/dashboard/src/features/projects/common/components/ChangePlanModal/ChangePlanModal.tsx b/dashboard/src/features/projects/common/components/ChangePlanModal/ChangePlanModal.tsx index c89c604ee6..e1e58fe3d5 100644 --- a/dashboard/src/features/projects/common/components/ChangePlanModal/ChangePlanModal.tsx +++ b/dashboard/src/features/projects/common/components/ChangePlanModal/ChangePlanModal.tsx @@ -4,7 +4,6 @@ import { Box } from '@/components/ui/v2/Box'; import { Button } from '@/components/ui/v2/Button'; import { Checkbox } from '@/components/ui/v2/Checkbox'; import { BaseDialog } from '@/components/ui/v2/Dialog'; -import { Link } from '@/components/ui/v2/Link'; import { Text } from '@/components/ui/v2/Text'; import { useAppState } from '@/features/projects/common/hooks/useAppState'; import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject'; @@ -85,6 +84,7 @@ export function ChangePlanModalWithData({ app, plans, close }: any) { const currentPlan = plans.find((plan) => plan.id === app.plan.id); const selectedPlan = plans.find((plan) => plan.id === selectedPlanId); + const higherPlans = plans.filter((plan) => plan.price > currentPlan.price); useEffect(() => { if (!pollingCurrentProject || state === ApplicationStatus.Paused) { @@ -201,53 +201,6 @@ export function ChangePlanModalWithData({ app, plans, close }: any) { ); } - if (app.plan.id !== plans.find((plan) => plan.isFree)?.id) { - return ( - -
-
- Nhost Logo -
- - Downgrade is not available - - - - You can't downgrade from a paid plan to a free plan here. - - - - Please contact us at{' '} - info@nhost.io if you want - to downgrade. - - -
- -
-
-
- ); - } - return (
- {plans + {higherPlans .filter((plan) => plan.id !== app.plan.id) .map((plan) => (
diff --git a/dashboard/src/features/projects/common/hooks/useIsCurrentUserOwner/useIsCurrentUserOwner.ts b/dashboard/src/features/projects/common/hooks/useIsCurrentUserOwner/useIsCurrentUserOwner.ts index de6118851c..52ee514070 100644 --- a/dashboard/src/features/projects/common/hooks/useIsCurrentUserOwner/useIsCurrentUserOwner.ts +++ b/dashboard/src/features/projects/common/hooks/useIsCurrentUserOwner/useIsCurrentUserOwner.ts @@ -10,7 +10,7 @@ export default function useIsCurrentUserOwner() { const { currentWorkspace, loading } = useCurrentWorkspaceAndProject(); const currentUser = useUserData(); - if (loading || !currentWorkspace.workspaceMembers || !currentUser) { + if (loading || !currentWorkspace?.workspaceMembers || !currentUser) { return false; } diff --git a/dashboard/src/features/projects/common/utils/planDescriptions/planDescriptions.ts b/dashboard/src/features/projects/common/utils/planDescriptions/planDescriptions.ts index 0731841067..ffcbabccf1 100644 --- a/dashboard/src/features/projects/common/utils/planDescriptions/planDescriptions.ts +++ b/dashboard/src/features/projects/common/utils/planDescriptions/planDescriptions.ts @@ -1,6 +1,7 @@ const planDescriptions = { Starter: '1 GB database, 5 GB of file storage, 10 GB of network traffic.', Pro: '10 GB database, 25 GB of file storage, 50 GB of network traffic, and backups.', + Team: 'Reach out to us at support@nhost.io to have your private channel set up.', }; export default planDescriptions; diff --git a/dashboard/src/features/projects/overview/components/OverviewTopBar/OverviewTopBar.tsx b/dashboard/src/features/projects/overview/components/OverviewTopBar/OverviewTopBar.tsx index 1ce4a913c3..d712201736 100644 --- a/dashboard/src/features/projects/overview/components/OverviewTopBar/OverviewTopBar.tsx +++ b/dashboard/src/features/projects/overview/components/OverviewTopBar/OverviewTopBar.tsx @@ -16,7 +16,8 @@ export default function OverviewTopBar() { const isPlatform = useIsPlatform(); const { currentWorkspace, currentProject } = useCurrentWorkspaceAndProject(); const isOwner = useIsCurrentUserOwner(); - const isPro = !currentProject?.plan?.isFree; + const isStarter = currentProject?.plan?.name === 'Starter'; + const isPro = currentProject?.plan?.name === 'Pro'; const { openDialog } = useDialog(); const { maintenanceActive } = useUI(); @@ -65,7 +66,6 @@ export default function OverviewTopBar() { > {currentProject.name} - {currentProject.creator && ( )} -
- {!isPro && isOwner && ( + {(isStarter || isPro) && isOwner && (
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e6951b2cc2..644c27f583 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,11 @@ # @nhost/docs +## 2.1.0 + +### Minor Changes + +- 65b6a48d5: feat: added graphite/cli documentation + ## 2.0.0 ### Major Changes diff --git a/docs/package.json b/docs/package.json index dfa8155c57..12dd6f7f79 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "@nhost/docs", - "version": "2.0.0", + "version": "2.1.0", "private": true, "scripts": { "start": "mintlify dev"