fix(crm): make 'Configure defaults in Settings' link navigate in-app
The link was an <a target="_blank"> doing a hard SPA boot in a new tab, which tripped the error boundary. Switch to a react-router <Link> so it opens Settings -> CRM the same way the sidebar nav does (known-good path).
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useNavigate, useParams, useSearchParams } from 'react-router-dom';
|
import { Link, useNavigate, useParams, useSearchParams } from 'react-router-dom';
|
||||||
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||||
import { ArrowLeft, Eye, Save as SaveIcon } from 'lucide-react';
|
import { ArrowLeft, Eye, Save as SaveIcon } from 'lucide-react';
|
||||||
import { Button, Card, Loading, Input, LocalizedDateInput, TimeField } from '../../../components/common';
|
import { Button, Card, Loading, Input, LocalizedDateInput, TimeField } from '../../../components/common';
|
||||||
@@ -653,10 +653,10 @@ export const BillEditorPage: React.FC = () => {
|
|||||||
only has the single FK still resolve their preview text. */}
|
only has the single FK still resolve their preview text. */}
|
||||||
<Card>
|
<Card>
|
||||||
<h3 className="font-semibold mb-2">{t('bills.section.payment', 'Payment conditions')}</h3>
|
<h3 className="font-semibold mb-2">{t('bills.section.payment', 'Payment conditions')}</h3>
|
||||||
<a href="/admin/settings?tab=crm" target="_blank" rel="noopener noreferrer"
|
<Link to="/admin/settings?tab=crm"
|
||||||
className="text-xs text-accent hover:underline mb-2 inline-block">
|
className="text-xs text-accent hover:underline mb-2 inline-block">
|
||||||
{t('common.configureInSettings', 'Configure defaults in Settings ↗')}
|
{t('common.configureInSettings', 'Configure defaults in Settings ↗')}
|
||||||
</a>
|
</Link>
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium mb-1">{t('bills.field.paymentNetDays', 'Net days')}</label>
|
<label className="block text-sm font-medium mb-1">{t('bills.field.paymentNetDays', 'Net days')}</label>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useNavigate, useParams, useSearchParams } from 'react-router-dom';
|
import { Link, useNavigate, useParams, useSearchParams } from 'react-router-dom';
|
||||||
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||||
import { ArrowLeft, Eye, Send } from 'lucide-react';
|
import { ArrowLeft, Eye, Send } from 'lucide-react';
|
||||||
import { Button, Card, Loading, Input, LocalizedDateInput, TimeField } from '../../../components/common';
|
import { Button, Card, Loading, Input, LocalizedDateInput, TimeField } from '../../../components/common';
|
||||||
@@ -536,10 +536,10 @@ export const QuoteEditorPage: React.FC = () => {
|
|||||||
below now reads from the timing template. */}
|
below now reads from the timing template. */}
|
||||||
<Card>
|
<Card>
|
||||||
<h3 className="font-semibold mb-2">4. {t('quotes.section.payment', 'Payment conditions')}</h3>
|
<h3 className="font-semibold mb-2">4. {t('quotes.section.payment', 'Payment conditions')}</h3>
|
||||||
<a href="/admin/settings?tab=crm" target="_blank" rel="noopener noreferrer"
|
<Link to="/admin/settings?tab=crm"
|
||||||
className="text-xs text-accent hover:underline mb-2 inline-block">
|
className="text-xs text-accent hover:underline mb-2 inline-block">
|
||||||
{t('common.configureInSettings', 'Configure defaults in Settings ↗')}
|
{t('common.configureInSettings', 'Configure defaults in Settings ↗')}
|
||||||
</a>
|
</Link>
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium mb-1">{t('quotes.field.paymentNetDays', 'Net days')}</label>
|
<label className="block text-sm font-medium mb-1">{t('quotes.field.paymentNetDays', 'Net days')}</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user