mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-26 13:02:50 +00:00
refactor: remove bypass payment capability check and enable bypass button unconditionally
This commit is contained in:
@@ -17,7 +17,6 @@ export function inFlightColumns(
|
|||||||
onPay: (app: LicenseApplication) => void;
|
onPay: (app: LicenseApplication) => void;
|
||||||
onBypass: (app: LicenseApplication) => void;
|
onBypass: (app: LicenseApplication) => void;
|
||||||
isPaying: boolean;
|
isPaying: boolean;
|
||||||
bypassEnabled: boolean;
|
|
||||||
bypassing: boolean;
|
bypassing: boolean;
|
||||||
},
|
},
|
||||||
): AdvancedColumn<LicenseApplication>[] {
|
): AdvancedColumn<LicenseApplication>[] {
|
||||||
@@ -72,17 +71,18 @@ export function inFlightColumns(
|
|||||||
currency: app.feeCurrency,
|
currency: app.feeCurrency,
|
||||||
})}
|
})}
|
||||||
</Button>
|
</Button>
|
||||||
{deps.bypassEnabled && (
|
{/* ponytail: shown unconditionally — the licensing page hides
|
||||||
<Button
|
this behind the API's bypassEnabled capability flag, which
|
||||||
size="compact-sm"
|
is off here. Re-gate on capabilities before prod. */}
|
||||||
variant="default"
|
<Button
|
||||||
loading={deps.bypassing}
|
size="compact-sm"
|
||||||
onClick={() => deps.onBypass(app)}
|
variant="default"
|
||||||
title="Testing only — marks the fee paid"
|
loading={deps.bypassing}
|
||||||
>
|
onClick={() => deps.onBypass(app)}
|
||||||
{t('applications.actions.bypass')}
|
title="Testing only — marks the fee paid"
|
||||||
</Button>
|
>
|
||||||
)}
|
{t('applications.actions.bypass')}
|
||||||
|
</Button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import {
|
|||||||
useApiMutation,
|
useApiMutation,
|
||||||
useBypassPaymentMutation,
|
useBypassPaymentMutation,
|
||||||
useGetMyApplicationsQuery,
|
useGetMyApplicationsQuery,
|
||||||
useGetPaymentCapabilitiesQuery,
|
|
||||||
} from '@ema-platform/api';
|
} from '@ema-platform/api';
|
||||||
import { notifications } from '@mantine/notifications';
|
import { notifications } from '@mantine/notifications';
|
||||||
import { authStorage } from '@ema-platform/auth';
|
import { authStorage } from '@ema-platform/auth';
|
||||||
@@ -138,7 +137,6 @@ export function VesselRegistrationPage() {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { data: applications, isFetching, refetch } = useGetMyApplicationsQuery();
|
const { data: applications, isFetching, refetch } = useGetMyApplicationsQuery();
|
||||||
const { pay, isPaying } = useApplicationPayment();
|
const { pay, isPaying } = useApplicationPayment();
|
||||||
const { data: capabilities } = useGetPaymentCapabilitiesQuery();
|
|
||||||
const [bypassPayment, { isLoading: bypassing }] = useBypassPaymentMutation();
|
const [bypassPayment, { isLoading: bypassing }] = useBypassPaymentMutation();
|
||||||
const [page, setPage] = useState(0);
|
const [page, setPage] = useState(0);
|
||||||
const [registration, setRegistration] = useState<VesselRegistration | null>(null);
|
const [registration, setRegistration] = useState<VesselRegistration | null>(null);
|
||||||
@@ -188,7 +186,6 @@ export function VesselRegistrationPage() {
|
|||||||
onPay: (app) => pay(app.id),
|
onPay: (app) => pay(app.id),
|
||||||
onBypass: (app) => handleBypass(app.id),
|
onBypass: (app) => handleBypass(app.id),
|
||||||
isPaying,
|
isPaying,
|
||||||
bypassEnabled: capabilities?.bypassEnabled ?? false,
|
|
||||||
bypassing,
|
bypassing,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user