diff --git a/backend b/backend index 5c673b26..a06277e3 160000 --- a/backend +++ b/backend @@ -1 +1 @@ -Subproject commit 5c673b2604105ecb97a4c401a477b089d45c77ca +Subproject commit a06277e38cdc2922a9673decc6c83ca16837393e diff --git a/package.json b/package.json index 1a3df5c0..a0ae8148 100644 --- a/package.json +++ b/package.json @@ -94,5 +94,10 @@ "vite-tsconfig-paths": "^4.2.2", "vitest": "^1.1.0" }, - "packageManager": "pnpm@8.6.0+sha1.71f9126a20cd3d00fa47c188f956918858180e54" + "packageManager": "pnpm@8.6.0+sha1.71f9126a20cd3d00fa47c188f956918858180e54", + "pnpm": { + "patchedDependencies": { + "@ifrc-go/ui@1.2.1": "patches/@ifrc-go__ui@1.2.1.patch" + } + } } diff --git a/patches/@ifrc-go__ui@1.2.1.patch b/patches/@ifrc-go__ui@1.2.1.patch new file mode 100644 index 00000000..3393a2dd --- /dev/null +++ b/patches/@ifrc-go__ui@1.2.1.patch @@ -0,0 +1,47 @@ +diff --git a/dist/components/Chip/index.d.ts b/dist/components/Chip/index.d.ts +index 7345249eaad9a8fb959fe0330639292354032909..ceba3ed438c7fa0b687d07f7591bab624aff06bc 100644 +--- a/dist/components/Chip/index.d.ts ++++ b/dist/components/Chip/index.d.ts +@@ -2,7 +2,7 @@ export type ChipVariant = 'primary' | 'secondary' | 'tertiary'; + export interface Props { + className?: string; + name: N; +- label: string; ++ label: React.ReactNode; + variant?: ChipVariant; + onDelete?: (name: N, e: React.MouseEvent) => void; + } +diff --git a/package.json b/package.json +index 999e201527e87de45a377344ca40f13212549f61..8ce9c9c085e950405fb0d0f888d5c57876b5e080 100644 +--- a/package.json ++++ b/package.json +@@ -97,5 +97,10 @@ + "vite-plugin-lib-inject-css": "^1.3.0", + "vite-tsconfig-paths": "^4.2.3", + "vitest": "^1.1.1" ++ }, ++ "pnpm": { ++ "patchedDependencies": { ++ "@ifrc-go/ui@1.2.1": "patches/@ifrc-go__ui@1.2.1.patch" ++ } + } + } +diff --git a/patches/@ifrc-go__ui@1.2.1.patch b/patches/@ifrc-go__ui@1.2.1.patch +new file mode 100644 +index 0000000000000000000000000000000000000000..31603365255a6e1aa30c140c96b27fa3e93cd7fa +--- /dev/null ++++ b/patches/@ifrc-go__ui@1.2.1.patch +@@ -0,0 +1,13 @@ ++diff --git a/dist/components/Chip/index.d.ts b/dist/components/Chip/index.d.ts ++index 7345249eaad9a8fb959fe0330639292354032909..ceba3ed438c7fa0b687d07f7591bab624aff06bc 100644 ++--- a/dist/components/Chip/index.d.ts +++++ b/dist/components/Chip/index.d.ts ++@@ -2,7 +2,7 @@ export type ChipVariant = 'primary' | 'secondary' | 'tertiary'; ++ export interface Props { ++ className?: string; ++ name: N; ++- label: string; +++ label: React.ReactNode; ++ variant?: ChipVariant; ++ onDelete?: (name: N, e: React.MouseEvent) => void; ++ } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index def82ad0..da3f59fd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,11 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +patchedDependencies: + '@ifrc-go/ui@1.2.1': + hash: c344e4kpykmuqcoldcef7qfjaq + path: patches/@ifrc-go__ui@1.2.1.patch + dependencies: '@apollo/client': specifier: ^3.9.9 @@ -16,7 +21,7 @@ dependencies: version: 1.3.3(react@18.2.0) '@ifrc-go/ui': specifier: ^1.2.1 - version: 1.2.1(@ifrc-go/icons@1.3.3)(@types/react@18.2.79)(react-dom@18.2.0)(react@18.2.0) + version: 1.2.1(patch_hash=c344e4kpykmuqcoldcef7qfjaq)(@ifrc-go/icons@1.3.3)(@types/react@18.2.79)(react-dom@18.2.0)(react@18.2.0) '@mapbox/mapbox-gl-draw': specifier: ^1.4.3 version: 1.4.3 @@ -2429,7 +2434,7 @@ packages: react: 18.2.0 dev: false - /@ifrc-go/ui@1.2.1(@ifrc-go/icons@1.3.3)(@types/react@18.2.79)(react-dom@18.2.0)(react@18.2.0): + /@ifrc-go/ui@1.2.1(patch_hash=c344e4kpykmuqcoldcef7qfjaq)(@ifrc-go/icons@1.3.3)(@types/react@18.2.79)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-ZdWffxnowjtY8wgIuheS4mf3P1JnoKKaEC8yrf0JHceb3fCenMXJqMBQEdRMaJNBtd4MhQhuls53uErzX/l2gA==} peerDependencies: '@ifrc-go/icons': ^1.3.1 @@ -2446,6 +2451,7 @@ packages: transitivePeerDependencies: - '@types/react' dev: false + patched: true /@jest/schemas@29.6.3: resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} diff --git a/src/App/routes/index.tsx b/src/App/routes/index.tsx index dd24ba4a..4a1a0066 100644 --- a/src/App/routes/index.tsx +++ b/src/App/routes/index.tsx @@ -44,11 +44,11 @@ const homeLayout = customWrapRoute({ }, }); -const mySubscription = customWrapRoute({ +const mySubscriptions = customWrapRoute({ parent: rootLayout, path: 'subscriptions', component: { - render: () => import('#views/MySubscription'), + render: () => import('#views/MySubscriptions'), props: {}, }, wrapperComponent: Auth, @@ -62,7 +62,7 @@ const subscriptionDetail = customWrapRoute({ parent: rootLayout, path: 'subscriptions/:subscriptionId', component: { - render: () => import('#views/MySubscription/SubscriptionDetail'), + render: () => import('#views/MySubscriptions/SubscriptionDetail'), props: {}, }, context: { @@ -353,7 +353,7 @@ const wrappedRoutes = { login, recoverAccount, // resendValidationEmail, - mySubscription, + mySubscriptions, cookiePolicy, register, historicalAlerts, diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 121f8373..36a2353e 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -158,7 +158,7 @@ function Navbar(props: Props) { {isAuthenticated && ( {strings.headerMenuMySubscription} diff --git a/src/views/Home/styles.module.css b/src/views/Home/styles.module.css index 13e65d9f..1db31cba 100644 --- a/src/views/Home/styles.module.css +++ b/src/views/Home/styles.module.css @@ -8,7 +8,7 @@ .tab-section { display: flex; flex-direction: column; - gap:var(--go-ui-spacing-xl); + gap: var(--go-ui-spacing-xl); justify-content: center; .cards { @@ -22,8 +22,9 @@ overflow: auto; .cards-content { - display:flex; + display: flex; align-items: center; + justify-content: space-between; .alert-image { margin: 0 auto; @@ -41,4 +42,4 @@ flex-direction: column; gap: var(--go-ui-spacing-lg); } -} +} \ No newline at end of file diff --git a/src/views/MySubscription/ArchiveTableActions/i18n.json b/src/views/MySubscription/ArchiveTableActions/i18n.json deleted file mode 100644 index cd2fa016..00000000 --- a/src/views/MySubscription/ArchiveTableActions/i18n.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "namespace": "SubscriptionActions", - "strings": { - "unarchiveSubscriptionActions": "Unarchive", - "deleteSubscriptionActions": "Delete" - } -} diff --git a/src/views/MySubscription/SubscriptionDetail/AlertInfoItem/styles.module.css b/src/views/MySubscription/SubscriptionDetail/AlertInfoItem/styles.module.css deleted file mode 100644 index d335e76b..00000000 --- a/src/views/MySubscription/SubscriptionDetail/AlertInfoItem/styles.module.css +++ /dev/null @@ -1,4 +0,0 @@ -.alert-detail { - background-color: var(--go-ui-color-gray-20); - padding: var(--go-ui-spacing-md); -} diff --git a/src/views/MySubscription/SubscriptionDetail/i18n.json b/src/views/MySubscription/SubscriptionDetail/i18n.json deleted file mode 100644 index c8c62571..00000000 --- a/src/views/MySubscription/SubscriptionDetail/i18n.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "namespace": "subscriptionDetail", - "strings": { - "subscriptionDetailTitle": "Subscription Detail", - "subscriptionHeading": "Subscription", - "filterStartDateFrom": "Start date from", - "filterStartDateTo": "Start date To", - "filterEmptyMessage": "Alerts not available!" - } -} \ No newline at end of file diff --git a/src/views/MySubscription/SubscriptionDetail/styles.module.css b/src/views/MySubscription/SubscriptionDetail/styles.module.css deleted file mode 100644 index b24803bf..00000000 --- a/src/views/MySubscription/SubscriptionDetail/styles.module.css +++ /dev/null @@ -1,24 +0,0 @@ -.subscription-detail { - .alert-filters { - display: flex; - flex-direction: column; - gap: var(--go-ui-spacing-md); - - .filters { - display: flex; - gap: var(--go-ui-spacing-md); - - .badge-container { - display: flex; - gap: var(--go-ui-spacing-md); - min-height: 0%; - } - } - - .alert-item { - display: flex; - flex-direction: column; - gap: var(--go-ui-spacing-md); - } - } -} \ No newline at end of file diff --git a/src/views/MySubscription/SubscriptionTableItem/styles.module.css b/src/views/MySubscription/SubscriptionTableItem/styles.module.css deleted file mode 100644 index 696bca66..00000000 --- a/src/views/MySubscription/SubscriptionTableItem/styles.module.css +++ /dev/null @@ -1,15 +0,0 @@ -.subscription-detail { - background-color: var(--go-ui-color-gray-20); - padding: var(--go-ui-spacing-md); - - .alertDetail { - display: flex; - flex-wrap: wrap; - gap: var(--go-ui-spacing-xl); - } - - .label { - display: flex; - flex-direction: column; - } -} \ No newline at end of file diff --git a/src/views/MySubscription/ActiveTableActions/i18n.json b/src/views/MySubscriptions/ActiveTableActions/i18n.json similarity index 57% rename from src/views/MySubscription/ActiveTableActions/i18n.json rename to src/views/MySubscriptions/ActiveTableActions/i18n.json index 57399421..3d6053d0 100644 --- a/src/views/MySubscription/ActiveTableActions/i18n.json +++ b/src/views/MySubscriptions/ActiveTableActions/i18n.json @@ -3,6 +3,7 @@ "strings": { "deleteSubscriptionActions": "Delete", "archiveSubscriptionActions": "Archive", - "editSubscriptionActions": "Edit" + "editSubscriptionActions": "Edit", + "confirmationMessage": "Are you sure want to delete the subscription?" } } diff --git a/src/views/MySubscription/ActiveTableActions/index.tsx b/src/views/MySubscriptions/ActiveTableActions/index.tsx similarity index 80% rename from src/views/MySubscription/ActiveTableActions/index.tsx rename to src/views/MySubscriptions/ActiveTableActions/index.tsx index 015c37a6..a573690a 100644 --- a/src/views/MySubscription/ActiveTableActions/index.tsx +++ b/src/views/MySubscriptions/ActiveTableActions/index.tsx @@ -1,3 +1,4 @@ +import { useCallback } from 'react'; import { DeleteBinSixLineIcon, EditTwoLineIcon, @@ -12,7 +13,7 @@ import DropdownMenuItem from '#components/DropdownMenuItem'; import i18n from './i18n.json'; interface Props { - onSubscriptionRemove?: () => void; + onSubscriptionRemove: () => void; onArchiveClick?: () => void; onEditClick: () => void; } @@ -26,11 +27,16 @@ function ActiveTableActions(props: Props) { const strings = useTranslation(i18n); + const handleDelete = useCallback(() => { + onSubscriptionRemove(); + }, [onSubscriptionRemove]); + return ( } variant="tertiary" withoutDropdownIcon + persistent > } + persist > {strings.deleteSubscriptionActions} diff --git a/src/views/MySubscriptions/ArchiveTableActions/i18n.json b/src/views/MySubscriptions/ArchiveTableActions/i18n.json new file mode 100644 index 00000000..b2a3c552 --- /dev/null +++ b/src/views/MySubscriptions/ArchiveTableActions/i18n.json @@ -0,0 +1,8 @@ +{ + "namespace": "SubscriptionActions", + "strings": { + "unarchiveSubscriptionActions": "Unarchive", + "deleteSubscriptionActions": "Delete", + "confirmationMessage": "Are you sure want to delete the subscription?" + } +} \ No newline at end of file diff --git a/src/views/MySubscription/ArchiveTableActions/index.tsx b/src/views/MySubscriptions/ArchiveTableActions/index.tsx similarity index 77% rename from src/views/MySubscription/ArchiveTableActions/index.tsx rename to src/views/MySubscriptions/ArchiveTableActions/index.tsx index 88e4ff6a..6ef363a2 100644 --- a/src/views/MySubscription/ArchiveTableActions/index.tsx +++ b/src/views/MySubscriptions/ArchiveTableActions/index.tsx @@ -1,3 +1,4 @@ +import { useCallback } from 'react'; import { DeleteBinSixLineIcon, LayoutBottomLineIcon, @@ -11,7 +12,7 @@ import DropdownMenuItem from '#components/DropdownMenuItem'; import i18n from './i18n.json'; interface Props { - onSubscriptionRemove?: () => void; + onSubscriptionRemove: () => void; onUnArchive?: () => void; } @@ -23,6 +24,10 @@ function ArchiveTableActions(props: Props) { const strings = useTranslation(i18n); + const handleDelete = useCallback(() => { + onSubscriptionRemove(); + }, [onSubscriptionRemove]); + return ( } @@ -38,10 +43,12 @@ function ArchiveTableActions(props: Props) { {strings.unarchiveSubscriptionActions} } + persist > {strings.deleteSubscriptionActions} diff --git a/src/views/MySubscription/SubscriptionDetail/AlertInfoItem/i18n.json b/src/views/MySubscriptions/SubscriptionDetail/AlertInfoItem/i18n.json similarity index 100% rename from src/views/MySubscription/SubscriptionDetail/AlertInfoItem/i18n.json rename to src/views/MySubscriptions/SubscriptionDetail/AlertInfoItem/i18n.json diff --git a/src/views/MySubscription/SubscriptionDetail/AlertInfoItem/index.tsx b/src/views/MySubscriptions/SubscriptionDetail/AlertInfoItem/index.tsx similarity index 91% rename from src/views/MySubscription/SubscriptionDetail/AlertInfoItem/index.tsx rename to src/views/MySubscriptions/SubscriptionDetail/AlertInfoItem/index.tsx index ec546bdd..6a191f68 100644 --- a/src/views/MySubscription/SubscriptionDetail/AlertInfoItem/index.tsx +++ b/src/views/MySubscriptions/SubscriptionDetail/AlertInfoItem/index.tsx @@ -26,6 +26,8 @@ function AlertInfoItem(props: Props) { className={styles.alertDetail} heading={alertTitle} headingLevel={4} + withInternalPadding + childrenContainerClassName={styles.content} actions={( )} - footerActions={( + footerActions={isDefined(alertsData) && ( )} + pending={alertLoading} + errored={isDefined(alertError)} + overlayPending >
- {isDefined(alertsData?.filterAlertCountry) && ( - - )} - {isDefined(alertsData?.filterAlertAdmin1sDisplay) - && alertsData.filterAlertAdmin1sDisplay?.map((admin) => ( - - ))} - {isDefined(alertsData?.filterAlertUrgenciesDisplay) - && alertsData.filterAlertUrgenciesDisplay?.map((urgency) => ( - + admin.name, + ).join(', ')} + strongLabel /> - ))} - {isDefined(alertsData?.filterAlertCertaintiesDisplay) - && alertsData.filterAlertCertaintiesDisplay?.map((certainty) => ( - + - ))} - {isDefined(alertsData?.filterAlertCategoriesDisplay) - && alertsData.filterAlertCategoriesDisplay?.map((category) => ( - + - ))} - {isDefined(alertsData?.filterAlertSeveritiesDisplay) - && alertsData.filterAlertSeveritiesDisplay?.map((severity) => ( - + - ))} + )} + /> + + )} + />
- + + +
); diff --git a/src/views/MySubscriptions/SubscriptionDetail/styles.module.css b/src/views/MySubscriptions/SubscriptionDetail/styles.module.css new file mode 100644 index 00000000..3d9333d8 --- /dev/null +++ b/src/views/MySubscriptions/SubscriptionDetail/styles.module.css @@ -0,0 +1,11 @@ +.subscription-detail { + .filters { + display: flex; + flex-wrap: wrap; + gap: var(--go-ui-spacing-xs); + + .filter-item { + font-size: var(--go-ui-font-size-xs); + } + } +} \ No newline at end of file diff --git a/src/views/MySubscription/SubscriptionTableItem/i18n.json b/src/views/MySubscriptions/SubscriptionTableItem/i18n.json similarity index 100% rename from src/views/MySubscription/SubscriptionTableItem/i18n.json rename to src/views/MySubscriptions/SubscriptionTableItem/i18n.json diff --git a/src/views/MySubscription/SubscriptionTableItem/index.tsx b/src/views/MySubscriptions/SubscriptionTableItem/index.tsx similarity index 57% rename from src/views/MySubscription/SubscriptionTableItem/index.tsx rename to src/views/MySubscriptions/SubscriptionTableItem/index.tsx index e08b2aa3..0c8d7118 100644 --- a/src/views/MySubscription/SubscriptionTableItem/index.tsx +++ b/src/views/MySubscriptions/SubscriptionTableItem/index.tsx @@ -1,5 +1,7 @@ import { + Chip, Container, + NumberOutput, TextOutput, } from '@ifrc-go/ui'; import { useTranslation } from '@ifrc-go/ui/hooks'; @@ -40,77 +42,106 @@ function SubscriptionTableItem(props: Props) { return ( + )} actions={( <> - ( - {alertCount} - ) + + {strings.subscriptionItemView} + {actions} )} - footerContentClassName={styles.alertDetail} - footerContent={( - <> + childrenContainerClassName={styles.content} + > + + )} + /> + + )} + /> + + )} + /> + + )} + /> + + )} + /> + - - )} - footerActions={( - - {strings.subscriptionItemView} - - )} - /> + )} + /> + ); } diff --git a/src/views/MySubscriptions/SubscriptionTableItem/styles.module.css b/src/views/MySubscriptions/SubscriptionTableItem/styles.module.css new file mode 100644 index 00000000..88054597 --- /dev/null +++ b/src/views/MySubscriptions/SubscriptionTableItem/styles.module.css @@ -0,0 +1,14 @@ +.subscription-detail { + border-radius: var(--go-ui-border-radius-lg); + background-color: var(--go-ui-color-background); + + .content { + display: flex; + flex-wrap: wrap; + gap: var(--go-ui-spacing-xs); + + .filter-item { + font-size: var(--go-ui-font-size-xs); + } + } +} diff --git a/src/views/MySubscription/i18n.json b/src/views/MySubscriptions/i18n.json similarity index 83% rename from src/views/MySubscription/i18n.json rename to src/views/MySubscriptions/i18n.json index 2c6640e7..5ce22e1c 100644 --- a/src/views/MySubscription/i18n.json +++ b/src/views/MySubscriptions/i18n.json @@ -1,7 +1,7 @@ { - "namespace": "mySubscription", + "namespace": "mySubscriptions", "strings": { - "mySubscription": "My Subscription", + "mySubscription": "My Subscriptions", "myNewSubscription": "New Subscription", "createNewSubscription": "Create", "sendViaEmailLabel": "Send via email", @@ -12,7 +12,7 @@ "subscriptionFailedToUpdate": "Failed to update subscription.", "subscriptionDescription": "Customize your alerts with tailored filters, manage your subscriptions, and stay informed with relevant alerts delivered directly to your inbox.", "subscriptionDeleted": "Subscription deleted.", - "subscriptionFailedToDelete": "Failed to delete subscription" - + "subscriptionFailedToDelete": "Failed to delete subscription", + "subscriptionEmptyMessage": "No subscription available!" } } diff --git a/src/views/MySubscription/index.tsx b/src/views/MySubscriptions/index.tsx similarity index 91% rename from src/views/MySubscription/index.tsx rename to src/views/MySubscriptions/index.tsx index 453dee45..6d81b0ec 100644 --- a/src/views/MySubscription/index.tsx +++ b/src/views/MySubscriptions/index.tsx @@ -65,11 +65,9 @@ const ALERT_SUBSCRIPTIONS = gql` name isActive notifyByEmail - alerts { - count - } emailFrequency emailFrequencyDisplay + totalAlertsCount filterAlertAdmin1s filterAlertAdmin1sDisplay { id @@ -282,8 +280,9 @@ export function Component() { variables: { subscriptionId: id, }, + }).then(() => { + refetch(); }); - refetch(); }, [ triggerSubscriptionDelete, refetch, @@ -326,7 +325,7 @@ export function Component() { ) => ({ id: value.id, name: value.name, - alertCount: value.alerts.count ?? 0, + alertCount: value.totalAlertsCount ?? 0, filterAlertUrgencies: value?.filterAlertUrgenciesDisplay, filterAlertCertainties: value?.filterAlertCertaintiesDisplay, filterAlertSeverities: value?.filterAlertSeveritiesDisplay, @@ -350,7 +349,7 @@ export function Component() { const archiveRendererParams = useCallback((_: string, value: UserAlertSubscriptionType) => ({ id: value.id, name: value.name, - alertCount: value.alerts.count ?? 0, + alertCount: value.totalAlertsCount ?? 0, filterAlertUrgencies: value?.filterAlertUrgenciesDisplay, filterAlertCertainties: value?.filterAlertCertaintiesDisplay, filterAlertSeverities: value?.filterAlertSeveritiesDisplay, @@ -452,27 +451,37 @@ export function Component() { name="active" className={styles.tabPanel} > - + + + - + + + ); } -Component.displayName = 'MySubscription'; +Component.displayName = 'MySubscriptions'; diff --git a/src/views/MySubscription/styles.module.css b/src/views/MySubscriptions/styles.module.css similarity index 100% rename from src/views/MySubscription/styles.module.css rename to src/views/MySubscriptions/styles.module.css diff --git a/src/views/NewSubscriptionModal/i18n.json b/src/views/NewSubscriptionModal/i18n.json index 3236f300..a6e3ad5d 100644 --- a/src/views/NewSubscriptionModal/i18n.json +++ b/src/views/NewSubscriptionModal/i18n.json @@ -19,10 +19,10 @@ "filterRegionsPlaceholder": "All Regions", "newSubscriptionHeading": "New Subscription", "newSubscriptionTitle": "Title", - "newSubscriptionCreatedSucessfully": "Subscription created successfully.", + "newSubscriptionCreatedSuccessfully": "Subscription created successfully.", "newSubscriptionFailed": "Failed to create subscription", - "newSubscriptionLimitExceed": "You have reached the maximum limit of 10 subscriptions", + "newSubscriptionLimitExceeded": "You have reached the maximum limit of 10 subscriptions", "subscriptionUpdatedSuccessfully": "Subscription updated successfully.", "failedToUpdateSubscription": "Failed to update subscription." } -} \ No newline at end of file +} diff --git a/src/views/NewSubscriptionModal/index.tsx b/src/views/NewSubscriptionModal/index.tsx index f02342c1..35548508 100644 --- a/src/views/NewSubscriptionModal/index.tsx +++ b/src/views/NewSubscriptionModal/index.tsx @@ -308,9 +308,10 @@ function NewSubscriptionModal(props: Props) { if (!response) { return; } + if (response.ok) { alert.show( - strings.newSubscriptionCreatedSucessfully, + strings.newSubscriptionCreatedSuccessfully, { variant: 'success' }, ); onCloseModal(); @@ -319,7 +320,7 @@ function NewSubscriptionModal(props: Props) { } } else { alert.show( - strings.newSubscriptionFailed, + strings.newSubscriptionLimitExceeded, { variant: 'danger' }, ); } @@ -354,7 +355,7 @@ function NewSubscriptionModal(props: Props) { } } else { alert.show( - strings.failedToUpdateSubscription, + strings.newSubscriptionLimitExceeded, { variant: 'danger' }, ); } @@ -421,9 +422,7 @@ function NewSubscriptionModal(props: Props) { }, }).then(() => { if (onSuccess) { - ( - onSuccess() - ); + onSuccess(); } }); } else {