0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Fixed missing link on upgrade modals (#19237)

refs PROD-5
This commit is contained in:
Jono M 2023-12-05 14:59:49 +00:00 committed by GitHub
parent 40c486702c
commit 960fde80db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 5 deletions

View file

@ -20,7 +20,8 @@ const AddIntegrationModal: React.FC<RoutingModalProps> = () => {
limiter.errorIfWouldGoOverLimit('customIntegrations').catch((error) => { limiter.errorIfWouldGoOverLimit('customIntegrations').catch((error) => {
if (error instanceof HostLimitError) { if (error instanceof HostLimitError) {
NiceModal.show(LimitModal, { NiceModal.show(LimitModal, {
prompt: error.message || `Your current plan doesn't support more custom integrations.` prompt: error.message || `Your current plan doesn't support more custom integrations.`,
onOk: () => updateRoute({route: '/pro', isExternal: true})
}); });
modal.remove(); modal.remove();
updateRoute('integrations'); updateRoute('integrations');

View file

@ -53,7 +53,8 @@ const AddNewsletterModal: React.FC<RoutingModalProps> = () => {
limiter?.errorIfWouldGoOverLimit('newsletters').catch((error) => { limiter?.errorIfWouldGoOverLimit('newsletters').catch((error) => {
if (error instanceof HostLimitError) { if (error instanceof HostLimitError) {
NiceModal.show(LimitModal, { NiceModal.show(LimitModal, {
prompt: error.message || `Your current plan doesn't support more newsletters.` prompt: error.message || `Your current plan doesn't support more newsletters.`,
onOk: () => updateRoute({route: '/pro', isExternal: true})
}); });
modal.remove(); modal.remove();
updateRoute('newsletters'); updateRoute('newsletters');

View file

@ -102,6 +102,7 @@ const Sidebar: React.FC<{
errors: ErrorMessages; errors: ErrorMessages;
clearError: (field: string) => void; clearError: (field: string) => void;
}> = ({newsletter, onlyOne, updateNewsletter, validate, errors, clearError}) => { }> = ({newsletter, onlyOne, updateNewsletter, validate, errors, clearError}) => {
const {updateRoute} = useRouting();
const {mutateAsync: editNewsletter} = useEditNewsletter(); const {mutateAsync: editNewsletter} = useEditNewsletter();
const limiter = useLimiter(); const limiter = useLimiter();
const {settings, siteData, config} = useGlobalData(); const {settings, siteData, config} = useGlobalData();
@ -159,7 +160,8 @@ const Sidebar: React.FC<{
} catch (error) { } catch (error) {
if (error instanceof HostLimitError) { if (error instanceof HostLimitError) {
NiceModal.show(LimitModal, { NiceModal.show(LimitModal, {
prompt: error.message || `Your current plan doesn't support more newsletters.` prompt: error.message || `Your current plan doesn't support more newsletters.`,
onOk: () => updateRoute({route: '/pro', isExternal: true})
}); });
return; return;
} else { } else {

View file

@ -157,7 +157,8 @@ const UserDetailModalContent: React.FC<{user: User}> = ({user}) => {
if (error instanceof HostLimitError) { if (error instanceof HostLimitError) {
NiceModal.show(LimitModal, { NiceModal.show(LimitModal, {
formSheet: true, formSheet: true,
prompt: error.message || `Your current plan doesn't support more users.` prompt: error.message || `Your current plan doesn't support more users.`,
onOk: () => updateRoute({route: '/pro', isExternal: true})
}); });
return; return;
} else { } else {

View file

@ -221,7 +221,8 @@ const ThemeToolbar: React.FC<ThemeToolbarProps> = ({
} else { } else {
NiceModal.show(LimitModal, { NiceModal.show(LimitModal, {
title: 'Upgrade to enable custom themes', title: 'Upgrade to enable custom themes',
prompt: uploadConfig?.error || <>Your current plan only supports official themes. You can install them from the <a href="https://ghost.org/marketplace/">Ghost theme marketplace</a>.</> prompt: uploadConfig?.error || <>Your current plan only supports official themes. You can install them from the <a href="https://ghost.org/marketplace/">Ghost theme marketplace</a>.</>,
onOk: () => updateRoute({route: '/pro', isExternal: true})
}); });
} }
}; };