Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ (Nordigen) rename to GoCardless #1361

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions packages/desktop-client/src/components/FinancesApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ import MobileBudget from './budget/MobileBudget';
import { View } from './common';
import FloatableSidebar, { SidebarProvider } from './FloatableSidebar';
import GlobalKeys from './GlobalKeys';
import GoCardlessLink from './gocardless/GoCardlessLink';
import { ManageRulesPage } from './ManageRulesPage';
import Modals from './Modals';
import NordigenLink from './nordigen/NordigenLink';
import Notifications from './Notifications';
import { ManagePayeesPage } from './payees/ManagePayeesPage';
import Reports from './reports';
Expand Down Expand Up @@ -135,11 +135,21 @@ function StackedRoutesInner({ location }) {
<Route path="/payees" element={<ManagePayeesPage />} />
<Route path="/rules" element={<ManageRulesPage />} />
<Route path="/settings" element={<Settings />} />

{/* TODO: remove Nordigen route after v23.8.0 */}
<Route
path="/nordigen/link"
element={
<NarrowNotSupported>
<NordigenLink />
<GoCardlessLink />
</NarrowNotSupported>
}
/>
<Route
path="/gocardless/link"
element={
<NarrowNotSupported>
<GoCardlessLink />
</NarrowNotSupported>
}
/>
Expand Down
14 changes: 7 additions & 7 deletions packages/desktop-client/src/components/Modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import CreateLocalAccount from './modals/CreateLocalAccount';
import EditField from './modals/EditField';
import EditRule from './modals/EditRule';
import FixEncryptionKey from './modals/FixEncryptionKey';
import GoCardlessExternalMsg from './modals/GoCardlessExternalMsg';
import GoCardlessInitialise from './modals/GoCardlessInitialise';
import ImportTransactions from './modals/ImportTransactions';
import LoadBackup from './modals/LoadBackup';
import ManageRulesModal from './modals/ManageRulesModal';
import MergeUnusedPayees from './modals/MergeUnusedPayees';
import NordigenExternalMsg from './modals/NordigenExternalMsg';
import NordigenInitialise from './modals/NordigenInitialise';
import PlaidExternalMsg from './modals/PlaidExternalMsg';
import SelectLinkedAccounts from './modals/SelectLinkedAccounts';

Expand Down Expand Up @@ -158,22 +158,22 @@ export default function Modals() {
/>
);

case 'nordigen-init':
case 'gocardless-init':
return (
<NordigenInitialise
<GoCardlessInitialise
modalProps={modalProps}
onSuccess={options.onSuccess}
/>
);

case 'nordigen-external-msg':
case 'gocardless-external-msg':
return (
<NordigenExternalMsg
<GoCardlessExternalMsg
modalProps={modalProps}
onMoveExternal={options.onMoveExternal}
onClose={() => {
options.onClose?.();
send('nordigen-poll-web-token-stop');
send('gocardless-poll-web-token-stop');
}}
onSuccess={options.onSuccess}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/accounts/Account.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import {
} from 'loot-core/src/shared/transactions';
import { applyChanges, groupById } from 'loot-core/src/shared/util';

import { authorizeBank } from '../../gocardless';
import { SelectedProviderWithItems } from '../../hooks/useSelected';
import { authorizeBank } from '../../nordigen';
import { styles, colors } from '../../style';
import { useActiveLocation } from '../ActiveLocation';
import { View, Text, Button } from '../common';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useParams } from 'react-router-dom';

import * as actions from 'loot-core/src/client/actions';

import { authorizeBank } from '../../gocardless';
import ExclamationOutline from '../../icons/v1/ExclamationOutline';
import { authorizeBank } from '../../nordigen';
import { colors } from '../../style';
import { View, Button, Tooltip, ExternalLink } from '../common';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import { Modal, P, View } from '../common';

export default function NordigenLink() {
export default function GoCardlessLink() {
window.close();

return (
Expand Down
33 changes: 17 additions & 16 deletions packages/desktop-client/src/components/modals/CreateAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useDispatch } from 'react-redux';

import { pushModal } from 'loot-core/src/client/actions/modals';

import useNordigenStatus from '../../hooks/useNordigenStatus';
import { authorizeBank } from '../../nordigen';
import { authorizeBank } from '../../gocardless';
import useGoCardlessStatus from '../../hooks/useGoCardlessStatus';
import {
View,
Text,
Expand All @@ -17,21 +17,22 @@ import {

export default function CreateAccount({ modalProps, syncServerStatus }) {
const dispatch = useDispatch();
const [isNordigenSetupComplete, setIsNordigenSetupComplete] = useState(null);
const [isGoCardlessSetupComplete, setIsGoCardlessSetupComplete] =
useState(null);

const onConnect = () => {
if (!isNordigenSetupComplete) {
onNordigenInit();
if (!isGoCardlessSetupComplete) {
onGoCardlessInit();
return;
}

authorizeBank((modal, params) => dispatch(pushModal(modal, params)));
};

const onNordigenInit = () => {
const onGoCardlessInit = () => {
dispatch(
pushModal('nordigen-init', {
onSuccess: () => setIsNordigenSetupComplete(true),
pushModal('gocardless-init', {
onSuccess: () => setIsGoCardlessSetupComplete(true),
}),
);
};
Expand All @@ -40,9 +41,9 @@ export default function CreateAccount({ modalProps, syncServerStatus }) {
dispatch(pushModal('add-local-account'));
};

const { configured } = useNordigenStatus();
const { configured } = useGoCardlessStatus();
useEffect(() => {
setIsNordigenSetupComplete(configured);
setIsGoCardlessSetupComplete(configured);
}, [configured]);

return (
Expand Down Expand Up @@ -88,13 +89,13 @@ export default function CreateAccount({ modalProps, syncServerStatus }) {
}}
onClick={onConnect}
>
{isNordigenSetupComplete
? 'Link bank account with Nordigen'
: 'Set up Nordigen for bank sync'}
{isGoCardlessSetupComplete
? 'Link bank account with GoCardless'
: 'Set up GoCardless for bank sync'}
</ButtonWithLoading>
<Text style={{ lineHeight: '1.4em', fontSize: 15 }}>
<strong>Link a bank account</strong> to automatically download
transactions. Nordigen provides reliable, up-to-date
transactions. GoCardless provides reliable, up-to-date
information from hundreds of banks.
</Text>
</>
Expand All @@ -108,15 +109,15 @@ export default function CreateAccount({ modalProps, syncServerStatus }) {
fontWeight: 600,
}}
>
Set up Nordigen for bank sync
Set up GoCardless for bank sync
</Button>
<P style={{ fontSize: 15 }}>
Connect to an Actual server to set up{' '}
<ExternalLink
to="https://actualbudget.org/docs/advanced/bank-sync"
linkColor="muted"
>
automatic syncing with Nordigen
automatic syncing with GoCardless
</ExternalLink>
.
</P>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useDispatch } from 'react-redux';
import { pushModal } from 'loot-core/src/client/actions/modals';
import { sendCatch } from 'loot-core/src/platform/client/fetch';

import useNordigenStatus from '../../hooks/useNordigenStatus';
import useGoCardlessStatus from '../../hooks/useGoCardlessStatus';
import AnimatedLoading from '../../icons/AnimatedLoading';
import DotsHorizontalTriple from '../../icons/v1/DotsHorizontalTriple';
import { colors } from '../../style';
Expand Down Expand Up @@ -41,7 +41,7 @@ function useAvailableBanks(country) {

setIsLoading(true);

const { data, error } = await sendCatch('nordigen-get-banks', country);
const { data, error } = await sendCatch('gocardless-get-banks', country);

if (error) {
setIsError(true);
Expand Down Expand Up @@ -73,7 +73,7 @@ function renderError(error) {
);
}

export default function NordigenExternalMsg({
export default function GoCardlessExternalMsg({
modalProps,
onMoveExternal,
onSuccess,
Expand All @@ -86,7 +86,8 @@ export default function NordigenExternalMsg({
let [institutionId, setInstitutionId] = useState();
let [country, setCountry] = useState();
let [error, setError] = useState(null);
let [isNordigenSetupComplete, setIsNordigenSetupComplete] = useState(null);
let [isGoCardlessSetupComplete, setIsGoCardlessSetupComplete] =
useState(null);
let [menuOpen, setMenuOpen] = useState(false);
let data = useRef(null);

Expand All @@ -96,7 +97,7 @@ export default function NordigenExternalMsg({
isError: isBankOptionError,
} = useAvailableBanks(country);
const { configured: isConfigured, isLoading: isConfigurationLoading } =
useNordigenStatus();
useGoCardlessStatus();

async function onJump() {
setError(null);
Expand Down Expand Up @@ -125,10 +126,10 @@ export default function NordigenExternalMsg({
setWaiting(null);
}

const onNordigenInit = () => {
const onGoCardlessInit = () => {
dispatch(
pushModal('nordigen-init', {
onSuccess: () => setIsNordigenSetupComplete(true),
pushModal('gocardless-init', {
onSuccess: () => setIsGoCardlessSetupComplete(true),
}),
);
};
Expand All @@ -151,10 +152,10 @@ export default function NordigenExternalMsg({

{isBankOptionError ? (
<Error>
Failed loading available banks: Nordigen access credentials might be
misconfigured. Please{' '}
Failed loading available banks: GoCardless access credentials might
be misconfigured. Please{' '}
<LinkButton
onClick={onNordigenInit}
onClick={onGoCardlessInit}
style={{ color: colors.b3, display: 'inline' }}
>
set them up
Expand Down Expand Up @@ -185,17 +186,13 @@ export default function NordigenExternalMsg({
)}

<Warning>
By enabling bank-sync, you will be granting Nordigen (a third party
By enabling bank-sync, you will be granting GoCardless (a third party
service) read-only access to your entire account’s transaction
history. This service is not affiliated with Actual in any way. Make
sure you’ve read and understand Nordigen’s{' '}
<ExternalLink to="https://nordigen.com/en/company/privacy-policy/">
sure you’ve read and understand GoCardless’s{' '}
<ExternalLink to="https://gocardless.com/privacy/">
Privacy Policy
</ExternalLink>{' '}
and{' '}
<ExternalLink to="https://nordigen.com/en/company/privacy-policy-end-user/">
End User Privacy Policy
</ExternalLink>{' '}
before proceeding.
</Warning>

Expand Down Expand Up @@ -229,7 +226,7 @@ export default function NordigenExternalMsg({
<Menu
onMenuSelect={item => {
if (item === 'reconfigure') {
onNordigenInit();
onGoCardlessInit();
}
}}
items={[
Expand Down Expand Up @@ -258,8 +255,8 @@ export default function NordigenExternalMsg({
<View>
<P style={{ fontSize: 15 }}>
To link your bank account, you will be redirected to a new page
where Nordigen will ask to connect to your bank. Nordigen will not
be able to withdraw funds from your accounts.
where GoCardless will ask to connect to your bank. GoCardless will
not be able to withdraw funds from your accounts.
</P>

{error && renderError(error)}
Expand All @@ -272,9 +269,9 @@ export default function NordigenExternalMsg({
/>
<View style={{ marginTop: 10, color: colors.n4 }}>
{isConfigurationLoading
? 'Checking Nordigen configuration..'
? 'Checking GoCardless configuration..'
: waiting === 'browser'
? 'Waiting on Nordigen...'
? 'Waiting on GoCardless...'
: waiting === 'accounts'
? 'Loading accounts...'
: null}
Expand All @@ -301,15 +298,15 @@ export default function NordigenExternalMsg({
>
Success! Click to continue &rarr;
</Button>
) : isConfigured || isNordigenSetupComplete ? (
) : isConfigured || isGoCardlessSetupComplete ? (
renderLinkButton()
) : (
<>
<P style={{ color: colors.r5 }}>
Nordigen integration has not yet been configured.
GoCardless integration has not yet been configured.
</P>
<Button primary onClick={onNordigenInit}>
Configure Nordigen integration
<Button primary onClick={onGoCardlessInit}>
Configure GoCardless integration
</Button>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import Text from '../common/Text';
import View from '../common/View';
import { FormField, FormLabel } from '../forms';

type NordigenInitialiseProps = {
type GoCardlessInitialiseProps = {
modalProps?: Partial<ModalProps>;
onSuccess: () => void;
};

const NordigenInitialise = ({
const GoCardlessInitialise = ({
modalProps,
onSuccess,
}: NordigenInitialiseProps) => {
}: GoCardlessInitialiseProps) => {
const [secretId, setSecretId] = useState('');
const [secretKey, setSecretKey] = useState('');
const [isValid, setIsValid] = useState(true);
Expand Down Expand Up @@ -51,13 +51,13 @@ const NordigenInitialise = ({
};

return (
<Modal title="Set-up Nordigen" size={{ width: 300 }} {...modalProps}>
<Modal title="Set-up GoCardless" size={{ width: 300 }} {...modalProps}>
<View style={{ display: 'flex', gap: 10 }}>
<Text>
In order to enable bank-sync via Nordigen (only for EU banks) you will
need to create access credentials. This can be done by creating an
account with{' '}
<ExternalLink to="https://nordigen.com/">Nordigen</ExternalLink>.
In order to enable bank-sync via GoCardless (only for EU banks) you
will need to create access credentials. This can be done by creating
an account with{' '}
<ExternalLink to="https://gocardless.com/">GoCardless</ExternalLink>.
</Text>

<FormField>
Expand Down Expand Up @@ -98,4 +98,4 @@ const NordigenInitialise = ({
);
};

export default NordigenInitialise;
export default GoCardlessInitialise;
Loading