fix: handling type === gold check in license notifications

This commit is contained in:
Simon Norris 2025-03-24 18:48:14 +01:00
parent 8e0423d29d
commit 4be9ba6828

View File

@ -15,6 +15,7 @@ import { useLicenseLimits } from './useLicenseLimits';
const STORAGE_KEY_PREFIX = 'strapi-notification-seat-limit'; const STORAGE_KEY_PREFIX = 'strapi-notification-seat-limit';
const BILLING_SELF_HOSTED_URL = 'https://strapi.io/billing/request-seats';
const MANAGE_SEATS_URL = 'https://strapi.io/billing/manage-seats'; const MANAGE_SEATS_URL = 'https://strapi.io/billing/manage-seats';
export const useLicenseLimitNotification = () => { export const useLicenseLimitNotification = () => {
@ -23,7 +24,7 @@ export const useLicenseLimitNotification = () => {
const { toggleNotification } = useNotification(); const { toggleNotification } = useNotification();
const { pathname } = useLocation(); const { pathname } = useLocation();
const { enforcementUserCount, permittedSeats, licenseLimitStatus, isHostedOnStrapiCloud } = const { enforcementUserCount, permittedSeats, licenseLimitStatus, type } =
license ?? {}; license ?? {};
React.useEffect(() => { React.useEffect(() => {
@ -66,7 +67,7 @@ export const useLicenseLimitNotification = () => {
} }
), ),
link: { link: {
url: MANAGE_SEATS_URL, url: type === 'gold' ? BILLING_SELF_HOSTED_URL : MANAGE_SEATS_URL,
label: formatMessage({ label: formatMessage({
id: 'notification.ee.warning.seat-limit.link', id: 'notification.ee.warning.seat-limit.link',
defaultMessage: 'Manage seats', defaultMessage: 'Manage seats',
@ -87,7 +88,7 @@ export const useLicenseLimitNotification = () => {
permittedSeats, permittedSeats,
licenseLimitStatus, licenseLimitStatus,
enforcementUserCount, enforcementUserCount,
isHostedOnStrapiCloud,
isError, isError,
type,
]); ]);
}; };