diff --git a/.env b/.env index 09a319e..164e333 100644 --- a/.env +++ b/.env @@ -33,9 +33,9 @@ NEXT_PUBLIC_LOCALES_PATH=apps/web/public/locales # FEATURE FLAGS NEXT_PUBLIC_ENABLE_THEME_TOGGLE=true NEXT_PUBLIC_ENABLE_PERSONAL_ACCOUNT_DELETION=true -NEXT_PUBLIC_ENABLE_PERSONAL_ACCOUNT_BILLING=true -NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_DELETION=true -NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_BILLING=true +NEXT_PUBLIC_ENABLE_PERSONAL_ACCOUNT_BILLING=false +NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_DELETION=false +NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_BILLING=false NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS=true NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_CREATION=true NEXT_PUBLIC_LANGUAGE_PRIORITY=application @@ -46,4 +46,7 @@ NEXT_TELEMETRY_DISABLED=1 LOGGER=pino -NEXT_PUBLIC_DEFAULT_LOCALE=et \ No newline at end of file +NEXT_PUBLIC_DEFAULT_LOCALE=et + +NEXT_PUBLIC_TEAM_NAVIGATION_STYLE=custom +NEXT_PUBLIC_USER_NAVIGATION_STYLE=custom \ No newline at end of file diff --git a/.env.development b/.env.development index 82a3969..c22cdb6 100644 --- a/.env.development +++ b/.env.development @@ -10,12 +10,6 @@ SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhY SUPABASE_DB_WEBHOOK_SECRET=WEBHOOKSECRET # EMAILS -EMAIL_SENDER="Makerkit " -EMAIL_PORT=54325 -EMAIL_HOST=localhost -EMAIL_TLS=false -EMAIL_USER=user -EMAIL_PASSWORD=password # CONTACT FORM CONTACT_EMAIL=test@makerkit.dev @@ -24,4 +18,10 @@ CONTACT_EMAIL=test@makerkit.dev NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY= # MAILER -MAILER_PROVIDER=nodemailer \ No newline at end of file +MAILER_PROVIDER=nodemailer +# EMAIL_SENDER= +# EMAIL_USER= # refer to your email provider's documentation +# EMAIL_PASSWORD= # refer to your email provider's documentation +# EMAIL_HOST= # refer to your email provider's documentation +# EMAIL_PORT= # or 465 for SSL +# EMAIL_TLS= # or false for SSL (see provider documentation) \ No newline at end of file diff --git a/.env.example b/.env.example index 3686882..46d3948 100644 --- a/.env.example +++ b/.env.example @@ -7,4 +7,11 @@ NEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY=your-service-role-key MEDIPOST_URL=your-medipost-url MEDIPOST_USER=your-medipost-user MEDIPOST_PASSWORD=your-medipost-password -MEDIPOST_RECIPIENT=your-medipost-recipient \ No newline at end of file +MEDIPOST_RECIPIENT=your-medipost-recipient + +EMAIL_SENDER= +EMAIL_USER= # refer to your email provider's documentation +EMAIL_PASSWORD= # refer to your email provider's documentation +EMAIL_HOST= # refer to your email provider's documentation +EMAIL_PORT= # or 465 for SSL +EMAIL_TLS= # or false for SSL (see provider documentation) \ No newline at end of file diff --git a/app/(marketing)/page.tsx b/app/(marketing)/page.tsx index d1c8b2d..09dd6bc 100644 --- a/app/(marketing)/page.tsx +++ b/app/(marketing)/page.tsx @@ -1,6 +1,6 @@ import Link from 'next/link'; -import { MedReportTitle } from '@/components/med-report-title'; +import { MedReportLogo } from '@/components/med-report-title'; import { ArrowRightIcon } from 'lucide-react'; import { CtaButton, Hero } from '@kit/ui/marketing'; @@ -13,7 +13,7 @@ function Home() {
} + title={} subtitle={ diff --git a/app/(public)/register-company/page.tsx b/app/(public)/register-company/page.tsx index 905e0e6..c4a75df 100644 --- a/app/(public)/register-company/page.tsx +++ b/app/(public)/register-company/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { MedReportTitle } from "@/components/med-report-title"; +import { MedReportLogo } from "@/components/med-report-title"; import React from "react"; import { yupResolver } from "@hookform/resolvers/yup"; import { useForm } from "react-hook-form"; @@ -45,7 +45,7 @@ export default function RegisterCompany() { return (
- +

Ettevõtte andmed

Pakkumise saamiseks palun sisesta ettevõtte andmed millega MedReport diff --git a/app/(public)/register-company/success/page.tsx b/app/(public)/register-company/success/page.tsx index 9682cff..3ed223d 100644 --- a/app/(public)/register-company/success/page.tsx +++ b/app/(public)/register-company/success/page.tsx @@ -1,11 +1,12 @@ -import { MedReportTitle } from "@/components/med-report-title"; +import { MedReportLogo } from "@/components/med-report-title"; +import { Button } from "@kit/ui/button"; import Image from "next/image"; import Link from "next/link"; export default function CompanyRegistrationSuccess() { return (

- +
- - - ); + return ; } export function AppLogo({ diff --git a/components/med-report-title.tsx b/components/med-report-title.tsx index e8398cb..bf809f8 100644 --- a/components/med-report-title.tsx +++ b/components/med-report-title.tsx @@ -1,7 +1,8 @@ +import { cn } from "@/lib/utils"; import { MedReportSmallLogo } from "@/public/assets/med-report-small-logo"; -export const MedReportTitle = () => ( -
+export const MedReportLogo = ({ className }: { className?: string }) => ( +
MedReport diff --git a/lib/dev-mock-modules.ts b/lib/dev-mock-modules.ts index b433cce..5861368 100644 --- a/lib/dev-mock-modules.ts +++ b/lib/dev-mock-modules.ts @@ -32,4 +32,4 @@ export const setUser = noop('Sentry.setUser'); export const loadStripe = noop('Stripe.loadStripe'); // Nodemailer -export const createTransport = noop('Nodemailer.createTransport'); +// export const createTransport = noop('Nodemailer.createTransport'); diff --git a/next.config.mjs b/next.config.mjs index 0ffa657..73c7188 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -129,7 +129,7 @@ function getModulesAliases() { const excludeSentry = monitoringProvider !== 'sentry'; const excludeBaselime = monitoringProvider !== 'baselime'; const excludeStripe = billingProvider !== 'stripe'; - const excludeNodemailer = mailerProvider !== 'nodemailer'; + // const excludeNodemailer = mailerProvider !== 'nodemailer'; const excludeTurnstile = !captchaProvider; /** @type {Record} */ @@ -151,9 +151,9 @@ function getModulesAliases() { aliases['@stripe/stripe-js'] = noopPath; } - if (excludeNodemailer) { - aliases['nodemailer'] = noopPath; - } + // if (excludeNodemailer) { + // aliases['nodemailer'] = noopPath; + // } if (excludeTurnstile) { aliases['@marsidev/react-turnstile'] = noopPath; diff --git a/package.json b/package.json index e79bb89..be13199 100644 --- a/package.json +++ b/package.json @@ -93,6 +93,7 @@ "@types/react-dom": "19.1.5", "babel-plugin-react-compiler": "19.1.0-rc.2", "cssnano": "^7.0.7", + "dotenv": "^16.5.0", "pino-pretty": "^13.0.0", "prettier": "^3.5.3", "react-hook-form": "^7.57.0", @@ -100,8 +101,7 @@ "tailwindcss": "4.1.7", "tailwindcss-animate": "^1.0.7", "typescript": "^5.8.3", - "yup": "^1.6.1", - "dotenv": "^16.5.0" + "yup": "^1.6.1" }, "prettier": "@kit/prettier-config", "browserslist": [ diff --git a/packages/features/accounts/src/components/account-selector.tsx b/packages/features/accounts/src/components/account-selector.tsx index acf096d..909a929 100644 --- a/packages/features/accounts/src/components/account-selector.tsx +++ b/packages/features/accounts/src/components/account-selector.tsx @@ -24,6 +24,7 @@ import { cn } from '@kit/ui/utils'; import { CreateTeamAccountDialog } from '../../../team-accounts/src/components/create-team-account-dialog'; import { usePersonalAccountData } from '../hooks/use-personal-account-data'; +import { useUserWorkspace } from '../hooks/use-user-workspace'; interface AccountSelectorProps { accounts: Array<{ @@ -63,6 +64,7 @@ export function AccountSelector({ const [isCreatingAccount, setIsCreatingAccount] = useState(false); const { t } = useTranslation('teams'); const personalData = usePersonalAccountData(userId); + const { user } = useUserWorkspace(); const value = useMemo(() => { return selectedAccount ?? PERSONAL_ACCOUNT_SLUG; @@ -89,6 +91,16 @@ export function AccountSelector({ ); + const isSuperAdmin = useMemo(() => { + const factors = user?.factors ?? []; + const hasAdminRole = user?.app_metadata.role === 'super-admin'; + const hasTotpFactor = factors.some( + (factor) => factor.factor_type === 'totp' && factor.status === 'verified', + ); + + return hasAdminRole && hasTotpFactor; + }, [user]); + return ( <> @@ -172,7 +184,6 @@ export function AccountSelector({ > - - +