Skip to content

Commit

Permalink
Merge pull request #361 from ChildMindInstitute/dev2.5
Browse files Browse the repository at this point in the history
Dev2.5
  • Loading branch information
vmkhitaryanscn authored Feb 1, 2024
2 parents c2a0da2 + 09f9796 commit 416d584
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Automated tests
on: [pull_request]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
npm install -g yarn
yarn
- name: Running tests
run: yarn test
2 changes: 1 addition & 1 deletion src/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"failed": "Failed",
"backToLogin": "Back to Log in",
"backToSettings": "Back to Settings",
"invalidLink": "Link is invalid"
"invalidLink": "This link is invalid or expired. Please click <a href='/forgotpassword'>here</a> to reset your password."
},
"Landing": {
"title": "Welcome to MindLogger",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"password": "le mot de passe",
"backToLogin": "Back to Log in",
"backToSettings": "Back to Settings",
"invalidLink": "Link is invalid"
"invalidLink": "Ce lien est invalide ou expiré. Veuillez cliquer <a href='/forgotpassword'>ici</a> pour réinitialiser votre mot de passe."
},
"Landing": {
"title": "Bienvenue dans MindLogger",
Expand Down
12 changes: 9 additions & 3 deletions src/pages/RecoveryPassword/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useSearchParams } from "react-router-dom"

import { useRecoveryPasswordLinkHealthcheckQuery } from "~/entities/user"
import { RecoveryPasswordForm, useRecoveryPasswordTranslation } from "~/features/RecoveryPassword"
import { PageMessage } from "~/shared/ui"
import Loader from "~/shared/ui/Loader"
import { Text } from "~/shared/ui/Text"

export default function RecoveryPasswordPage() {
const [searchParams] = useSearchParams()
Expand All @@ -13,14 +13,20 @@ export default function RecoveryPasswordPage() {
const key = searchParams.get("key")
const email = searchParams.get("email")

const { isError, isLoading, error } = useRecoveryPasswordLinkHealthcheckQuery({ email: email!, key: key! })
const { isError, isLoading } = useRecoveryPasswordLinkHealthcheckQuery({ email: email!, key: key! })

if (isLoading) {
return <Loader />
}

if (isError) {
return <PageMessage message={error.evaluatedMessage!} />
return (
<Box display="flex" flex={1} justifyContent="center" alignItems="center" textAlign="center">
<Text variant="body1" fontSize="24px" margin="16px 0px">
<Box dangerouslySetInnerHTML={{ __html: t("invalidLink") }} />
</Text>
</Box>
)
}

return (
Expand Down
1 change: 1 addition & 0 deletions src/shared/api/services/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const axiosService = axios.create({
})

axiosService.defaults.headers.common["Content-Type"] = "application/json"
axiosService.defaults.headers.common["Mindlogger-Content-Source"] = "web"

axiosService.interceptors.request.use(
config => {
Expand Down

0 comments on commit 416d584

Please sign in to comment.