From 7b47acc486a92dd7bd6e88acf1da6f960b640558 Mon Sep 17 00:00:00 2001 From: ilkin-overleaf <100852799+ilkin-overleaf@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:18:22 +0300 Subject: [PATCH] Merge pull request #18763 from overleaf/ii-bs5-projects-notifications [web] BS5 notifications in projects and welcome pages GitOrigin-RevId: 25780bb64660ef41c41c007f94f70df273cac716 --- .../Features/Project/ProjectListController.js | 17 -- services/web/app/views/project/list-react.pug | 1 - .../modals/delete-leave-project-modal.tsx | 10 +- .../modals/delete-project-modal.tsx | 10 +- .../components/modals/leave-project-modal.tsx | 10 +- .../modals/projects-action-modal.tsx | 76 ++++---- .../modals/rename-project-modal.tsx | 24 +-- .../modal-content-new-project-form.tsx | 22 +-- .../accessibility-survey-banner.tsx | 11 +- .../components/notifications/action.tsx | 9 - .../components/notifications/body.tsx | 9 - .../groups-and-enterprise-banner.tsx | 16 +- .../affiliation/reconfirm-affiliation.tsx | 167 ++++++++++-------- .../affiliation/reconfirmation-info.tsx | 17 +- .../notifications/groups/common.tsx | 96 +++++----- .../notifications/groups/confirm-email.tsx | 34 ++-- .../group-invitation-cancel-subscription.tsx | 32 ++-- .../group-invitation-join.tsx | 16 +- .../group-invitation-successful.tsx | 14 +- .../notifications/groups/institution.tsx | 51 ++---- .../notifications/ieee-retirement-banner.tsx | 5 +- .../components/notifications/notification.tsx | 120 ++----------- .../notifications/user-notifications.tsx | 8 +- .../writefull-premium-promo-banner.tsx | 12 +- .../components/project-list-root.tsx | 16 +- .../project-list/components/survey-widget.tsx | 9 +- .../features/ui/components/ol/ol-button.tsx | 2 + .../ui/components/types/button-props.ts | 2 + .../js/shared/components/notification.tsx | 8 +- services/web/frontend/js/utils/meta.ts | 1 - .../notifications-new.stories.tsx | 21 --- .../stylesheets/bootstrap-5/pages/all.scss | 1 + .../bootstrap-5/pages/project-list.scss | 51 ++++++ .../pages/sidebar-v2-dash-pane.scss | 13 ++ .../table/projects-action-modal.test.tsx | 4 +- 35 files changed, 388 insertions(+), 527 deletions(-) delete mode 100644 services/web/frontend/js/features/project-list/components/notifications/action.tsx delete mode 100644 services/web/frontend/js/features/project-list/components/notifications/body.tsx create mode 100644 services/web/frontend/stylesheets/bootstrap-5/pages/sidebar-v2-dash-pane.scss diff --git a/services/web/app/src/Features/Project/ProjectListController.js b/services/web/app/src/Features/Project/ProjectListController.js index afeb022448..dd274bfe67 100644 --- a/services/web/app/src/Features/Project/ProjectListController.js +++ b/services/web/app/src/Features/Project/ProjectListController.js @@ -415,22 +415,6 @@ async function projectListPage(req, res, next) { logger.error({ err: error }, 'Failed to get individual subscription') } - let newNotificationStyle - try { - const newNotificationStyleAssignment = - await SplitTestHandler.promises.getAssignment( - req, - res, - 'new-notification-style' - ) - newNotificationStyle = newNotificationStyleAssignment.variant === 'enabled' - } catch (error) { - logger.error( - { err: error }, - 'failed to get "new-notification-style" split test assignment' - ) - } - try { await SplitTestHandler.promises.getAssignment(req, res, 'paywall-cta') } catch (error) { @@ -473,7 +457,6 @@ async function projectListPage(req, res, next) { groupName: subscription.teamName, })), hasIndividualRecurlySubscription, - newNotificationStyle, }) } diff --git a/services/web/app/views/project/list-react.pug b/services/web/app/views/project/list-react.pug index cb55289c61..bac242c186 100644 --- a/services/web/app/views/project/list-react.pug +++ b/services/web/app/views/project/list-react.pug @@ -35,7 +35,6 @@ block append meta meta(name="ol-showLATAMBanner" data-type="boolean" content=showLATAMBanner) meta(name="ol-groupSubscriptionsPendingEnrollment" data-type="json" content=groupSubscriptionsPendingEnrollment) meta(name="ol-hasIndividualRecurlySubscription" data-type="boolean" content=hasIndividualRecurlySubscription) - meta(name="ol-newNotificationStyle" data-type="boolean" content=newNotificationStyle) meta(name="ol-groupSsoSetupSuccess" data-type="boolean" content=groupSsoSetupSuccess) block content diff --git a/services/web/frontend/js/features/project-list/components/modals/delete-leave-project-modal.tsx b/services/web/frontend/js/features/project-list/components/modals/delete-leave-project-modal.tsx index 4d870055f7..aa3e1ed45e 100644 --- a/services/web/frontend/js/features/project-list/components/modals/delete-leave-project-modal.tsx +++ b/services/web/frontend/js/features/project-list/components/modals/delete-leave-project-modal.tsx @@ -1,9 +1,9 @@ import { useEffect, useState, useMemo } from 'react' import { useTranslation } from 'react-i18next' import ProjectsActionModal from './projects-action-modal' -import Icon from '../../../../shared/components/icon' import ProjectsList from './projects-list' import { isLeavableProject, isDeletableProject } from '../../util/project' +import Notification from '@/shared/components/notification' type DeleteLeaveProjectModalProps = Pick< React.ComponentProps, @@ -70,10 +70,10 @@ function DeleteLeaveProjectModal({ projects={projectsToLeave} projectsToDisplay={projectsToLeaveDisplay} /> -
- {' '} - {t('this_action_cannot_be_undone')} -
+ ) } diff --git a/services/web/frontend/js/features/project-list/components/modals/delete-project-modal.tsx b/services/web/frontend/js/features/project-list/components/modals/delete-project-modal.tsx index c2fa587b81..3140251fc6 100644 --- a/services/web/frontend/js/features/project-list/components/modals/delete-project-modal.tsx +++ b/services/web/frontend/js/features/project-list/components/modals/delete-project-modal.tsx @@ -1,8 +1,8 @@ import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import ProjectsActionModal from './projects-action-modal' -import Icon from '../../../../shared/components/icon' import ProjectsList from './projects-list' +import Notification from '@/shared/components/notification' type DeleteProjectModalProps = Pick< React.ComponentProps, @@ -41,10 +41,10 @@ function DeleteProjectModal({ >

{t('about_to_delete_projects')}

-
- {' '} - {t('this_action_cannot_be_undone')} -
+ ) } diff --git a/services/web/frontend/js/features/project-list/components/modals/leave-project-modal.tsx b/services/web/frontend/js/features/project-list/components/modals/leave-project-modal.tsx index 6a26bd32cd..63073c59f3 100644 --- a/services/web/frontend/js/features/project-list/components/modals/leave-project-modal.tsx +++ b/services/web/frontend/js/features/project-list/components/modals/leave-project-modal.tsx @@ -1,8 +1,8 @@ import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import ProjectsActionModal from './projects-action-modal' -import Icon from '../../../../shared/components/icon' import ProjectsList from './projects-list' +import Notification from '@/shared/components/notification' type LeaveProjectModalProps = Pick< React.ComponentProps, @@ -41,10 +41,10 @@ function LeaveProjectModal({ >

{t('about_to_leave_projects')}

-
- {' '} - {t('this_action_cannot_be_undone')} -
+ ) } diff --git a/services/web/frontend/js/features/project-list/components/modals/projects-action-modal.tsx b/services/web/frontend/js/features/project-list/components/modals/projects-action-modal.tsx index a69155acbf..e658584cb4 100644 --- a/services/web/frontend/js/features/project-list/components/modals/projects-action-modal.tsx +++ b/services/web/frontend/js/features/project-list/components/modals/projects-action-modal.tsx @@ -1,14 +1,18 @@ import { memo, useEffect, useState } from 'react' -import { Alert, Modal } from 'react-bootstrap' +import { Modal } from 'react-bootstrap' import { useTranslation } from 'react-i18next' import { Project } from '../../../../../../types/project/dashboard/api' -import AccessibleModal from '../../../../shared/components/accessible-modal' import { getUserFacingMessage } from '../../../../infrastructure/fetch-json' import useIsMounted from '../../../../shared/hooks/use-is-mounted' import * as eventTracking from '../../../../infrastructure/event-tracking' import { isSmallDevice } from '../../../../infrastructure/event-tracking' -import getMeta from '@/utils/meta' import Notification from '@/shared/components/notification' +import OLButton from '@/features/ui/components/ol/ol-button' +import OLModal, { + OLModalBody, + OLModalFooter, + OLModalHeader, +} from '@/features/ui/components/ol/ol-modal' type ProjectsActionModalProps = { title?: string @@ -68,64 +72,44 @@ function ProjectsActionModal({ }, [action, showModal]) return ( - - + {title} - - {children} - + + + {children} {!isProcessing && errors.length > 0 && - errors.map((e, i) => )} - - - - + + + ) } -type ErrorNotificationProps = { - error: any -} - -function ErrorNotification({ error }: ErrorNotificationProps) { - const newNotificationStyle = getMeta('ol-newNotificationStyle') - - if (newNotificationStyle) { - return ( - // `notification-list` sets the margin-bottom correctly also when used individually in each notification. - // Once the legacy alerts are cleaned up we should move the styled div up to the notification list container. -
- -
- ) - } else { - return ( - - {error.projectName} -
- {getUserFacingMessage(error.error)} -
- ) - } -} - export default memo(ProjectsActionModal) diff --git a/services/web/frontend/js/features/project-list/components/modals/rename-project-modal.tsx b/services/web/frontend/js/features/project-list/components/modals/rename-project-modal.tsx index e325fa6487..083c25317f 100644 --- a/services/web/frontend/js/features/project-list/components/modals/rename-project-modal.tsx +++ b/services/web/frontend/js/features/project-list/components/modals/rename-project-modal.tsx @@ -1,6 +1,5 @@ import { memo, useCallback, useEffect, useMemo, useState } from 'react' import { - Alert, Button, ControlLabel, FormControl, @@ -18,7 +17,6 @@ import { getUserFacingMessage } from '../../../../infrastructure/fetch-json' import { debugConsole } from '@/utils/debugging' import { isSmallDevice } from '../../../../infrastructure/event-tracking' import Notification from '@/shared/components/notification' -import getMeta from '@/utils/meta' type RenameProjectModalProps = { handleCloseModal: () => void @@ -36,7 +34,6 @@ function RenameProjectModal({ const { error, isError, isLoading, runAsync } = useAsync() const { toggleSelectedProject, updateProjectViewData } = useProjectListContext() - const newNotificationStyle = getMeta('ol-newNotificationStyle') useEffect(() => { if (showModal) { @@ -99,19 +96,14 @@ function RenameProjectModal({ {t('rename_project')} - {isError && - (newNotificationStyle ? ( -
- -
- ) : ( - - {getUserFacingMessage(error)} - - ))} + {isError && ( +
+ +
+ )}
diff --git a/services/web/frontend/js/features/project-list/components/new-project-button/modal-content-new-project-form.tsx b/services/web/frontend/js/features/project-list/components/new-project-button/modal-content-new-project-form.tsx index 2b20be4bb2..562334847a 100644 --- a/services/web/frontend/js/features/project-list/components/new-project-button/modal-content-new-project-form.tsx +++ b/services/web/frontend/js/features/project-list/components/new-project-button/modal-content-new-project-form.tsx @@ -1,5 +1,4 @@ import React, { useState } from 'react' -import { Alert } from 'react-bootstrap' import { useTranslation } from 'react-i18next' import useAsync from '../../../../shared/hooks/use-async' import { @@ -8,7 +7,6 @@ import { } from '../../../../infrastructure/fetch-json' import { useRefWithAutoFocus } from '../../../../shared/hooks/use-ref-with-auto-focus' import { useLocation } from '../../../../shared/hooks/use-location' -import getMeta from '@/utils/meta' import Notification from '@/shared/components/notification' import { OLModalBody, @@ -42,7 +40,6 @@ function ModalContentNewProjectForm({ onCancel, template = 'none' }: Props) { const [projectName, setProjectName] = useState('') const { isLoading, isError, error, runAsync } = useAsync() const location = useLocation() - const newNotificationStyle = getMeta('ol-newNotificationStyle') const createNewProject = () => { runAsync( @@ -77,17 +74,14 @@ function ModalContentNewProjectForm({ onCancel, template = 'none' }: Props) { - {isError && - (newNotificationStyle ? ( -
- -
- ) : ( - {getUserFacingMessage(error)} - ))} + {isError && ( +
+ +
+ )} {t('help_improve_screen_reader_fill_out_this_survey')}

} + content={

{t('help_improve_screen_reader_fill_out_this_survey')}

} action={ - {t('take_survey')} - + } /> ) diff --git a/services/web/frontend/js/features/project-list/components/notifications/action.tsx b/services/web/frontend/js/features/project-list/components/notifications/action.tsx deleted file mode 100644 index 50949dda92..0000000000 --- a/services/web/frontend/js/features/project-list/components/notifications/action.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import classnames from 'classnames' - -function Action({ className, ...props }: React.ComponentProps<'div'>) { - return ( -
- ) -} - -export default Action diff --git a/services/web/frontend/js/features/project-list/components/notifications/body.tsx b/services/web/frontend/js/features/project-list/components/notifications/body.tsx deleted file mode 100644 index 0333d2f0a5..0000000000 --- a/services/web/frontend/js/features/project-list/components/notifications/body.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import classnames from 'classnames' - -function Body({ className, ...props }: React.ComponentProps<'div'>) { - return ( -
- ) -} - -export default Body diff --git a/services/web/frontend/js/features/project-list/components/notifications/groups-and-enterprise-banner.tsx b/services/web/frontend/js/features/project-list/components/notifications/groups-and-enterprise-banner.tsx index 223125b180..87dee98cf4 100644 --- a/services/web/frontend/js/features/project-list/components/notifications/groups-and-enterprise-banner.tsx +++ b/services/web/frontend/js/features/project-list/components/notifications/groups-and-enterprise-banner.tsx @@ -9,6 +9,7 @@ import { GroupsAndEnterpriseBannerVariant, GroupsAndEnterpriseBannerVariants, } from '../../../../../../types/project/dashboard/notification' +import OLButton from '@/features/ui/components/ol/ol-button' type urlForVariantsType = { [key in GroupsAndEnterpriseBannerVariant]: string // eslint-disable-line no-unused-vars @@ -31,7 +32,6 @@ export default function GroupsAndEnterpriseBanner() { const groupsAndEnterpriseBannerVariant = getMeta( 'ol-groupsAndEnterpriseBannerVariant' ) - const newNotificationStyle = getMeta('ol-newNotificationStyle') const hasDismissedGroupsAndEnterpriseBanner = hasRecentlyDismissedBanner() @@ -73,23 +73,19 @@ export default function GroupsAndEnterpriseBanner() { return ( } + content={} action={ - {t('contact_sales')} - + } /> ) diff --git a/services/web/frontend/js/features/project-list/components/notifications/groups/affiliation/reconfirm-affiliation.tsx b/services/web/frontend/js/features/project-list/components/notifications/groups/affiliation/reconfirm-affiliation.tsx index ebf0cf3c5d..ba4cacac2c 100644 --- a/services/web/frontend/js/features/project-list/components/notifications/groups/affiliation/reconfirm-affiliation.tsx +++ b/services/web/frontend/js/features/project-list/components/notifications/groups/affiliation/reconfirm-affiliation.tsx @@ -1,6 +1,5 @@ import { useState, useEffect } from 'react' import { useTranslation, Trans } from 'react-i18next' -import { Button } from 'react-bootstrap' import Icon from '../../../../../../shared/components/icon' import getMeta from '../../../../../../utils/meta' import useAsync from '../../../../../../shared/hooks/use-async' @@ -12,6 +11,8 @@ import { UserEmailData } from '../../../../../../../../types/user-email' import { Institution } from '../../../../../../../../types/institution' import { useLocation } from '../../../../../../shared/hooks/use-location' import { debugConsole } from '@/utils/debugging' +import OLButton from '@/features/ui/components/ol/ol-button' +import Notification from '@/features/project-list/components/notifications/notification' type ReconfirmAffiliationProps = { email: UserEmailData['email'] @@ -24,7 +25,6 @@ function ReconfirmAffiliation({ }: ReconfirmAffiliationProps) { const { t } = useTranslation() const { samlInitPath } = getMeta('ol-ExposedSettings') - const newNotificationStyle = getMeta('ol-newNotificationStyle') const { error, isLoading, isError, isSuccess, runAsync } = useAsync() const [hasSent, setHasSent] = useState(false) const [isPending, setIsPending] = useState(false) @@ -57,91 +57,108 @@ function ReconfirmAffiliation({ if (hasSent) { return ( -
- ]} // eslint-disable-line react/jsx-key - values={{ institutionName: institution.name }} - shouldUnescape - tOptions={{ interpolation: { escapeValue: true } }} - /> -   - {isLoading ? ( + - {t('sending')}… + ]} // eslint-disable-line react/jsx-key + values={{ institutionName: institution.name }} + shouldUnescape + tOptions={{ interpolation: { escapeValue: true } }} + /> +   + {isError && ( + <> +
+
+ {rateLimited + ? t('too_many_requests') + : t('generic_something_went_wrong')} +
+ + )} - ) : ( - - )} - {isError && ( - <> -
-
- {rateLimited - ? t('too_many_requests') - : t('generic_something_went_wrong')} -
- - )} -
+ + } + /> ) } return ( -
- {!newNotificationStyle && } - - ]} // eslint-disable-line react/jsx-key - values={{ institutionName: institution.name }} - shouldUnescape - tOptions={{ interpolation: { escapeValue: true } }} - /> -   - ]} - /> -   - - {t('learn_more')} - - {isError && ( + -
-
- {rateLimited - ? t('too_many_requests') - : t('generic_something_went_wrong')} -
+ ]} // eslint-disable-line react/jsx-key + values={{ institutionName: institution.name }} + shouldUnescape + tOptions={{ interpolation: { escapeValue: true } }} + /> +   + ]} + /> +   + + {t('learn_more')} + + {isError && ( + <> +
+
+ {rateLimited + ? t('too_many_requests') + : t('generic_something_went_wrong')} +
+ + )} - )} -
+ } + action={ + + {t('sending')}… + + ) : null, + }} + isLoading={isLoading || isPending} + disabled={isLoading || isPending} + onClick={handleRequestReconfirmation} + > + {t('confirm_affiliation')} + + } + /> ) } diff --git a/services/web/frontend/js/features/project-list/components/notifications/groups/affiliation/reconfirmation-info.tsx b/services/web/frontend/js/features/project-list/components/notifications/groups/affiliation/reconfirmation-info.tsx index 2fb07492ce..0af8667b0b 100644 --- a/services/web/frontend/js/features/project-list/components/notifications/groups/affiliation/reconfirmation-info.tsx +++ b/services/web/frontend/js/features/project-list/components/notifications/groups/affiliation/reconfirmation-info.tsx @@ -12,17 +12,10 @@ function ReconfirmationInfo() { <> {allInReconfirmNotificationPeriods.map(userEmail => userEmail.affiliation?.institution ? ( - - -
- } /> ) : null )} @@ -31,9 +24,9 @@ function ReconfirmationInfo() { userEmail.affiliation?.institution ? ( {}} - body={ + content={ diff --git a/services/web/frontend/js/features/project-list/components/notifications/groups/common.tsx b/services/web/frontend/js/features/project-list/components/notifications/groups/common.tsx index 95d8da2298..7b305af905 100644 --- a/services/web/frontend/js/features/project-list/components/notifications/groups/common.tsx +++ b/services/web/frontend/js/features/project-list/components/notifications/groups/common.tsx @@ -1,5 +1,4 @@ import { useTranslation, Trans } from 'react-i18next' -import { Button } from 'react-bootstrap' import Notification from '../notification' import Icon from '../../../../../shared/components/icon' import getMeta from '../../../../../utils/meta' @@ -13,6 +12,7 @@ import { import GroupInvitationNotification from './group-invitation/group-invitation' import IEEERetirementBanner from '../ieee-retirement-banner' import { debugConsole } from '@/utils/debugging' +import OLButton from '@/features/ui/components/ol/ol-button' function Common() { const notifications = getMeta('ol-notifications') || [] @@ -37,7 +37,6 @@ function CommonNotification({ notification }: CommonNotificationProps) { const { t } = useTranslation() const { samlInitPath } = getMeta('ol-ExposedSettings') const user = getMeta('ol-user') - const newNotificationStyle = getMeta('ol-newNotificationStyle') const { isLoading, isSuccess, error, runAsync } = useAsync< never, FetchError @@ -63,9 +62,9 @@ function CommonNotification({ notification }: CommonNotificationProps) { <> {templateKey === 'notification_project_invite' ? ( id && handleDismiss(id)} - body={ + content={ accepted ? ( {t('open_project')} - + ) : ( - + {t('join_project')} + ) } /> ) : templateKey === 'wfh_2020_upgrade_offer' ? ( id && handleDismiss(id)} - body={ + content={ <> Important notice: Your free WFH2020 upgrade came to an end on June 30th 2020. We're still providing a number of special initiatives @@ -132,21 +125,19 @@ function CommonNotification({ notification }: CommonNotificationProps) { } action={ - + } /> ) : templateKey === 'notification_ip_matched_affiliation' ? ( id && handleDismiss(id)} - body={ + content={ <> } action={ - + } /> ) : templateKey === 'notification_dropbox_duplicate_project_names' ? ( id && handleDismiss(id)} - body={ + content={ <>

id && handleDismiss(id)} - body={ + content={ <> ) : templateKey === 'notification_personal_and_group_subscriptions' ? ( id && handleDismiss(id)} - body={ + content={ ) : ( id && handleDismiss(id)} - body={html} + content={html} /> )} diff --git a/services/web/frontend/js/features/project-list/components/notifications/groups/confirm-email.tsx b/services/web/frontend/js/features/project-list/components/notifications/groups/confirm-email.tsx index 0c208726bb..737286255e 100644 --- a/services/web/frontend/js/features/project-list/components/notifications/groups/confirm-email.tsx +++ b/services/web/frontend/js/features/project-list/components/notifications/groups/confirm-email.tsx @@ -1,5 +1,4 @@ import { Trans, useTranslation } from 'react-i18next' -import { Button } from 'react-bootstrap' import Notification from '../notification' import Icon from '../../../../../shared/components/icon' import getMeta from '../../../../../utils/meta' @@ -11,6 +10,7 @@ import { } from '../../../../../infrastructure/fetch-json' import { UserEmailData } from '../../../../../../../types/user-email' import { debugConsole } from '@/utils/debugging' +import OLButton from '@/features/ui/components/ol/ol-button' const ssoAvailable = ({ samlProviderId, affiliation }: UserEmailData) => { const { hasSamlFeature, hasSamlBeta } = getMeta('ol-ExposedSettings') @@ -96,8 +96,8 @@ function ConfirmEmailNotification({ userEmail }: { userEmail: UserEmailData }) { if (emailHasLicenceAfterConfirming(userEmail) && isOnFreeOrIndividualPlan()) { return ( {isLoading ? ( <> @@ -112,12 +112,6 @@ function ConfirmEmailNotification({ userEmail }: { userEmail: UserEmailData }) { i18nKey="one_step_away_from_professional_features" components={[]} // eslint-disable-line react/jsx-key /> -
} + action={ + handleResendConfirmationEmail(userEmail)} + > + {t('resend_email')} + + } /> ) } return ( {isLoading ? ( <> @@ -154,13 +156,13 @@ function ConfirmEmailNotification({ userEmail }: { userEmail: UserEmailData }) { {t('please_confirm_email', { emailAddress: userEmail.email, })}{' '} - + {t('resend_confirmation_email')} + )}

diff --git a/services/web/frontend/js/features/project-list/components/notifications/groups/group-invitation/group-invitation-cancel-subscription.tsx b/services/web/frontend/js/features/project-list/components/notifications/groups/group-invitation/group-invitation-cancel-subscription.tsx index 5228afa85a..c21438185b 100644 --- a/services/web/frontend/js/features/project-list/components/notifications/groups/group-invitation/group-invitation-cancel-subscription.tsx +++ b/services/web/frontend/js/features/project-list/components/notifications/groups/group-invitation/group-invitation-cancel-subscription.tsx @@ -1,10 +1,9 @@ -import { Button } from 'react-bootstrap' import { useTranslation } from 'react-i18next' import type { Dispatch, SetStateAction } from 'react' import Notification from '../../notification' import { GroupInvitationStatus } from './hooks/use-group-invitation-notification' import type { NotificationGroupInvitation } from '../../../../../../../../types/project/dashboard/notification' -import getMeta from '@/utils/meta' +import OLButton from '@/features/ui/components/ol/ol-button' type GroupInvitationCancelIndividualSubscriptionNotificationProps = { setGroupInvitationStatus: Dispatch> @@ -20,37 +19,32 @@ export default function GroupInvitationCancelIndividualSubscriptionNotification( notification, }: GroupInvitationCancelIndividualSubscriptionNotificationProps) { const { t } = useTranslation() - const newNotificationStyle = getMeta('ol-newNotificationStyle') const { messageOpts: { inviterName }, } = notification return ( - - - + + } /> ) diff --git a/services/web/frontend/js/features/project-list/components/notifications/groups/group-invitation/group-invitation-join.tsx b/services/web/frontend/js/features/project-list/components/notifications/groups/group-invitation/group-invitation-join.tsx index fb1c5da6bb..e9710c04cf 100644 --- a/services/web/frontend/js/features/project-list/components/notifications/groups/group-invitation/group-invitation-join.tsx +++ b/services/web/frontend/js/features/project-list/components/notifications/groups/group-invitation/group-invitation-join.tsx @@ -1,8 +1,7 @@ -import { Button } from 'react-bootstrap' import { useTranslation, Trans } from 'react-i18next' import Notification from '../../notification' import type { NotificationGroupInvitation } from '../../../../../../../../types/project/dashboard/notification' -import getMeta from '@/utils/meta' +import OLButton from '@/features/ui/components/ol/ol-button' type GroupInvitationNotificationProps = { acceptGroupInvite: () => void @@ -18,16 +17,15 @@ export default function GroupInvitationNotificationJoin({ dismissGroupInviteNotification, }: GroupInvitationNotificationProps) { const { t } = useTranslation() - const newNotificationStyle = getMeta('ol-newNotificationStyle') const { messageOpts: { inviterName }, } = notification return ( } action={ - + } /> ) diff --git a/services/web/frontend/js/features/project-list/components/notifications/groups/group-invitation/group-invitation-successful.tsx b/services/web/frontend/js/features/project-list/components/notifications/groups/group-invitation/group-invitation-successful.tsx index bb6ef8ac51..3df96ea8e0 100644 --- a/services/web/frontend/js/features/project-list/components/notifications/groups/group-invitation/group-invitation-successful.tsx +++ b/services/web/frontend/js/features/project-list/components/notifications/groups/group-invitation/group-invitation-successful.tsx @@ -1,7 +1,5 @@ import Notification from '../../notification' import { useTranslation } from 'react-i18next' -import Icon from '../../../../../../shared/components/icon' -import getMeta from '@/utils/meta' type GroupInvitationSuccessfulNotificationProps = { hideNotification: () => void @@ -11,20 +9,12 @@ export default function GroupInvitationSuccessfulNotification({ hideNotification, }: GroupInvitationSuccessfulNotificationProps) { const { t } = useTranslation() - const newNotificationStyle = getMeta('ol-newNotificationStyle') return ( - {!newNotificationStyle && ( -