-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5731 from beyondessential/release-2024-25
Release 2024-25
- Loading branch information
Showing
204 changed files
with
2,516 additions
and
1,937 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
module.exports = { | ||
"arrowParens": "avoid", | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
packages/admin-panel/src/VizBuilderApp/api/queries/useUser.js
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
packages/admin-panel/src/VizBuilderApp/components/NavPanel.jsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Tupaia | ||
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
export { useLogout } from './useLogout'; | ||
export { useLogin } from './useLogin'; | ||
export { useUpdateProfile } from './useUpdateProfile'; | ||
export { useResetPassword } from './useResetPassword'; | ||
export { useRequestResetPassword } from './useRequestResetPassword'; | ||
export { useOneTimeLogin } from './useOneTimeLogin'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Tupaia | ||
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
import { useMutation, useQueryClient } from 'react-query'; | ||
import { useLocation, useNavigate } from 'react-router-dom'; | ||
import { post } from '../../VizBuilderApp/api'; | ||
|
||
export const useLogin = homeLink => { | ||
const queryClient = useQueryClient(); | ||
const navigate = useNavigate(); | ||
const location = useLocation(); | ||
const from = location.state?.from; | ||
|
||
return useMutation( | ||
({ email, password }) => { | ||
return post('login', { | ||
data: { | ||
emailAddress: email, | ||
password, | ||
}, | ||
}); | ||
}, | ||
{ | ||
onSuccess: async () => { | ||
await queryClient.invalidateQueries(); | ||
if (from) { | ||
navigate(from, { | ||
state: null, | ||
}); | ||
} else { | ||
navigate(homeLink, { | ||
state: null, | ||
}); | ||
} | ||
}, | ||
}, | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Tupaia | ||
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
import { useMutation, useQueryClient } from 'react-query'; | ||
import { post } from '../../VizBuilderApp/api'; | ||
|
||
export const useLogout = onSuccess => { | ||
const queryClient = useQueryClient(); | ||
|
||
return useMutation('logout', () => post('logout'), { | ||
onSuccess: () => { | ||
queryClient.invalidateQueries(); | ||
if (onSuccess) onSuccess(); | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Tupaia | ||
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
import { useMutation, useQueryClient } from 'react-query'; | ||
import { post } from '../../VizBuilderApp/api'; | ||
|
||
export const useOneTimeLogin = () => { | ||
const queryClient = useQueryClient(); | ||
return useMutation( | ||
token => { | ||
return post('login/oneTimeLogin', { | ||
data: { | ||
token, | ||
}, | ||
}); | ||
}, | ||
{ | ||
onSuccess: () => { | ||
queryClient.invalidateQueries(); | ||
}, | ||
}, | ||
); | ||
}; |
18 changes: 18 additions & 0 deletions
18
packages/admin-panel/src/api/mutations/useRequestResetPassword.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Tupaia | ||
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
import { useMutation } from 'react-query'; | ||
import { post } from '../../VizBuilderApp/api'; | ||
|
||
export const useRequestResetPassword = () => { | ||
return useMutation(({ emailAddress }) => { | ||
return post('requestResetPassword', { | ||
data: { | ||
emailAddress, | ||
resetPasswordUrl: window.location.origin, | ||
}, | ||
}); | ||
}); | ||
}; |
Oops, something went wrong.