diff --git a/e2e/cypress/common/apiCalls/common.ts b/e2e/cypress/common/apiCalls/common.ts index 371417c520..95a24ed266 100644 --- a/e2e/cypress/common/apiCalls/common.ts +++ b/e2e/cypress/common/apiCalls/common.ts @@ -353,14 +353,14 @@ export const getParsedEmailVerification = () => }); export const getParsedEmailVerificationByIndex = (index: number) => - getAllEmails().then((r) => { - return { - verifyEmailLink: r[index].html.replace(/.*(http:\/\/[\w:/]*).*/gs, '$1'), - fromAddress: r[index].from.value[0].address, - toAddress: r[index].to.value[0].address, - text: r[index].text, - }; - }); + getAllEmails().then((r) => { + return { + verifyEmailLink: r[index].html.replace(/.*(http:\/\/[\w:/]*).*/gs, '$1'), + fromAddress: r[index].from.value[0].address, + toAddress: r[index].to.value[0].address, + text: r[index].text, + }; + }); export const getParsedEmailInvitationLink = () => getAllEmails().then( diff --git a/e2e/cypress/e2e/security/signUp.cy.ts b/e2e/cypress/e2e/security/signUp.cy.ts index 7f86f60ed6..a3b8ea2856 100644 --- a/e2e/cypress/e2e/security/signUp.cy.ts +++ b/e2e/cypress/e2e/security/signUp.cy.ts @@ -1,33 +1,33 @@ import {HOST} from '../../common/constants'; import { - createProject, - deleteAllEmails, - deleteUserSql, - disableEmailVerification, - disableRegistration, - enableEmailVerification, - enableRegistration, - getParsedEmailVerification, - getParsedEmailVerificationByIndex, - getRecaptchaSiteKey, - getUser, - login, - logout, - releaseForcedDate, - setProperty, - setRecaptchaSecretKey, - setRecaptchaSiteKey, - v2apiFetch, + createProject, + deleteAllEmails, + deleteUserSql, + disableEmailVerification, + disableRegistration, + enableEmailVerification, + enableRegistration, + getParsedEmailVerification, + getParsedEmailVerificationByIndex, + getRecaptchaSiteKey, + getUser, + login, + logout, + releaseForcedDate, + setProperty, + setRecaptchaSecretKey, + setRecaptchaSiteKey, + v2apiFetch, } from '../../common/apiCalls/common'; import {assertMessage, gcy} from '../../common/shared'; import { - checkAnonymousIdSet, - checkAnonymousIdUnset, - checkAnonymousUserIdentified, - fillAndSubmitSignUpForm, - loginWithFakeGithub, - signUpAfter, - visitSignUp, + checkAnonymousIdSet, + checkAnonymousIdUnset, + checkAnonymousUserIdentified, + fillAndSubmitSignUpForm, + loginWithFakeGithub, + signUpAfter, + visitSignUp, } from '../../common/login'; import {ProjectDTO} from '../../../../webapp/src/service/response.types'; import {waitForGlobalLoading} from '../../common/loading'; diff --git a/webapp/src/component/layout/TopBanner/Announcement.tsx b/webapp/src/component/layout/TopBanner/Announcement.tsx index a3abfcf755..cfe5e9115a 100644 --- a/webapp/src/component/layout/TopBanner/Announcement.tsx +++ b/webapp/src/component/layout/TopBanner/Announcement.tsx @@ -20,7 +20,8 @@ const StyledTitle = styled('div')` display: flex; gap: 12px; align-items: center; - color: ${({ theme }) => theme.palette.tokens._components.noticeBar.importantColor}; + color: ${({ theme }) => + theme.palette.tokens._components.noticeBar.importantColor}; `; const StyledWrappableContent = styled('div')` diff --git a/webapp/src/component/layout/TopBanner/TopBanner.tsx b/webapp/src/component/layout/TopBanner/TopBanner.tsx index 1d701777e1..1411895950 100644 --- a/webapp/src/component/layout/TopBanner/TopBanner.tsx +++ b/webapp/src/component/layout/TopBanner/TopBanner.tsx @@ -5,9 +5,9 @@ import {useAnnouncement} from './useAnnouncement'; import {useIsEmailVerified} from 'tg.globalContext/helpers'; import {Close} from '@mui/icons-material'; import {useResizeObserver} from 'usehooks-ts'; -import {Announcement} from "tg.component/layout/TopBanner/Announcement"; -import {useTranslate} from "@tolgee/react"; -import {tokenService} from "tg.service/TokenService"; +import {Announcement} from 'tg.component/layout/TopBanner/Announcement'; +import {useTranslate} from '@tolgee/react'; +import {tokenService} from 'tg.service/TokenService'; const StyledContainer = styled('div')` position: fixed; @@ -24,8 +24,10 @@ const StyledContainer = styled('div')` } &.email-not-verified { - color: ${(props) => props.theme.palette.tokens._components.noticeBar.importantLink}; - background: ${(props) => props.theme.palette.tokens._components.noticeBar.importantFill}; + color: ${(props) => + props.theme.palette.tokens._components.noticeBar.importantLink}; + background: ${(props) => + props.theme.palette.tokens._components.noticeBar.importantFill}; } font-size: 15px; font-weight: 700; @@ -60,9 +62,14 @@ export function TopBanner() { const isEmailVerified = useIsEmailVerified(); const announcement = bannerType && getAnnouncement(bannerType); const showCloseButton = isEmailVerified; - const containerClassName = isEmailVerified ? 'email-verified' : 'email-not-verified'; + const containerClassName = isEmailVerified + ? 'email-verified' + : 'email-not-verified'; const theme = useTheme(); - const mailImage = theme.palette.mode === 'dark' ? "/images/mailDark.svg" : "/images/mailLight.svg"; + const mailImage = + theme.palette.mode === 'dark' + ? '/images/mailDark.svg' + : '/images/mailLight.svg'; const { t } = useTranslate(); useResizeObserver({ @@ -83,20 +90,22 @@ export function TopBanner() { return (
- { - !isEmailVerified ? ( - } - /> - ) : announcement - } + + {!isEmailVerified ? ( + } + /> + ) : ( + announcement + )} + {showCloseButton && ( { if (r.status >= 500) { const message = @@ -29,7 +29,6 @@ export const handleApiError = ( return; } if (r.status == 403) { - if (resObject?.code === 'email_not_verified') { globalContext.actions?.redirectToUnverifiedView(); return;