diff --git a/app/Features/CoinbaseIntegration.php b/app/Features/CoinbaseIntegration.php deleted file mode 100644 index 5238e23c..00000000 --- a/app/Features/CoinbaseIntegration.php +++ /dev/null @@ -1,19 +0,0 @@ -user(); - return [ 'cashflow' => true, - 'coinbase' => $user ? Feature::for($user)->active(CoinbaseIntegration::class) : false, ]; } diff --git a/resources/js/components/open-banking/connect-account-dialog.tsx b/resources/js/components/open-banking/connect-account-dialog.tsx index 0654cfb5..7aaf5a87 100644 --- a/resources/js/components/open-banking/connect-account-dialog.tsx +++ b/resources/js/components/open-banking/connect-account-dialog.tsx @@ -8,7 +8,6 @@ import { DialogTitle, } from '@/components/ui/dialog'; import { Input } from '@/components/ui/input'; -import { Textarea } from '@/components/ui/textarea'; import { Label } from '@/components/ui/label'; import { Select, @@ -17,13 +16,12 @@ import { SelectTrigger, SelectValue, } from '@/components/ui/select'; +import { Textarea } from '@/components/ui/textarea'; import type { BankingConnection, EnableBankingInstitution, } from '@/types/banking'; import { __ } from '@/utils/i18n'; -import { usePage } from '@inertiajs/react'; -import type { SharedData } from '@/types'; import { useCallback, useEffect, useMemo, useState } from 'react'; const COUNTRIES = [ @@ -97,7 +95,6 @@ export function ConnectAccountDialog({ onOpenChange, connections = [], }: ConnectAccountDialogProps) { - const { features } = usePage().props; const [step, setStep] = useState('country'); const [country, setCountry] = useState(''); const [institutions, setInstitutions] = useState< @@ -204,10 +201,11 @@ export function ConnectAccountDialog({ const hasProvider = (provider: string) => connections.some((c) => c.provider === provider); - const extraInstitutions = [BINANCE_INSTITUTION, BITPANDA_INSTITUTION]; - if (features.coinbase) { - extraInstitutions.push(COINBASE_INSTITUTION); - } + const extraInstitutions = [ + BINANCE_INSTITUTION, + BITPANDA_INSTITUTION, + COINBASE_INSTITUTION, + ]; if (countryCode === 'ES') { extraInstitutions.push(INDEXA_CAPITAL_INSTITUTION); } diff --git a/resources/js/components/open-banking/connect-account-inline.tsx b/resources/js/components/open-banking/connect-account-inline.tsx index 7eaaa4e1..7aa0c2cd 100644 --- a/resources/js/components/open-banking/connect-account-inline.tsx +++ b/resources/js/components/open-banking/connect-account-inline.tsx @@ -2,7 +2,6 @@ import { BankLogo } from '@/components/bank-logo'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; -import { Textarea } from '@/components/ui/textarea'; import { Select, SelectContent, @@ -10,14 +9,13 @@ import { SelectTrigger, SelectValue, } from '@/components/ui/select'; +import { Textarea } from '@/components/ui/textarea'; import { useWebHaptics } from '@/hooks/use-web-haptics'; import type { BankingConnection, EnableBankingInstitution, } from '@/types/banking'; import { __ } from '@/utils/i18n'; -import { usePage } from '@inertiajs/react'; -import type { SharedData } from '@/types'; import { ArrowLeft } from 'lucide-react'; import { useCallback, useEffect, useMemo, useState } from 'react'; @@ -90,7 +88,6 @@ export function ConnectAccountInline({ onBack, connections = [], }: ConnectAccountInlineProps) { - const { features } = usePage().props; const [step, setStep] = useState('country'); const { trigger } = useWebHaptics(); const [country, setCountry] = useState(''); @@ -185,10 +182,11 @@ export function ConnectAccountInline({ const hasProvider = (provider: string) => connections.some((c) => c.provider === provider); - const extraInstitutions = [BINANCE_INSTITUTION, BITPANDA_INSTITUTION]; - if (features.coinbase) { - extraInstitutions.push(COINBASE_INSTITUTION); - } + const extraInstitutions = [ + BINANCE_INSTITUTION, + BITPANDA_INSTITUTION, + COINBASE_INSTITUTION, + ]; if (countryCode === 'ES') { extraInstitutions.push(INDEXA_CAPITAL_INSTITUTION); } diff --git a/resources/js/types/index.d.ts b/resources/js/types/index.d.ts index 7714ee89..c29cc5d4 100644 --- a/resources/js/types/index.d.ts +++ b/resources/js/types/index.d.ts @@ -41,7 +41,6 @@ export interface NavDivider { export interface Features { cashflow: boolean; - coinbase: boolean; } export interface Flash { diff --git a/tests/Feature/InertiaSharedDataTest.php b/tests/Feature/InertiaSharedDataTest.php index 9b90e32b..466d1b4a 100644 --- a/tests/Feature/InertiaSharedDataTest.php +++ b/tests/Feature/InertiaSharedDataTest.php @@ -33,6 +33,16 @@ test('all pages receive app url in shared props', function () { ); }); +test('shared feature flags do not include coinbase flag', function () { + $response = $this->withoutVite()->get(route('home')); + + $props = $response->viewData('page')['props']; + + expect($props['features'])->toBe([ + 'cashflow' => true, + ]); +}); + test('shared currency options split profile and account currencies', function () { $response = $this->withoutVite()->get(route('home'));