Skip to content

Commit

Permalink
merge: dev -> rn-249 (#5895)
Browse files Browse the repository at this point in the history
* tweak(centralServer): RN-1351: Handle bad DHIS2 sync requests (#5887)

Throw an error and register bad requests on dhis sync queue

* tweak(datatrakWeb): RN-1438: Upgrade React Query to V4 (#5868)

* Bumping react-query

* Update render.tsx

* fixing Reports.test.tsx

* navigation bug fix

* removed logging

* tweak(adminPanel): RN-1439: Upgrade React Query to V4 (#5875)

* bumping to v4

* Update yarn.lock

* tweak(psss): RN-1442: Upgrade React Query to V4 (#5874)

* upgrade

* Update yarn.lock

* tweak(lesmis): RN-1441: Upgrade React Query to V4 (#5873)

* upgrade

* Update yarn.lock

* tweak(tupaiaWeb): RN-1440: Upgrade React Query to V4 (#5870)

* Bumping react-query

* Bumping react-query to v4

* Update render.tsx

* GitAction fix

* fixing Reports.test.tsx

* navigation bug fix

* review update

* removed logging

* Update yarn.lock

* Update yarn.lock

* Update VerifyEmailPage.tsx

* Update useReportPreview.js

* fix(adminPanel): Miscellaneous Bug fixes (Tiny) (#5891)

* bugfix

* update

* updates

* tweak(tupaiaWeb): RN-1437: Download files visual restyle (#5889)

* Common download files component

* PR fix

---------

Co-authored-by: Salman <114740396+hrazasalman@users.noreply.github.com>
  • Loading branch information
alexd-bes and hrazasalman authored Sep 12, 2024
1 parent f0d30e7 commit ab1ec2a
Show file tree
Hide file tree
Showing 157 changed files with 445 additions and 621 deletions.
3 changes: 2 additions & 1 deletion packages/admin-panel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.47",
"@material-ui/styles": "^4.9.10",
"@tanstack/react-query": "4.36.1",
"@tanstack/react-query-devtools": "4.36.1",
"@tupaia/access-policy": "workspace:*",
"@tupaia/types": "workspace:*",
"@tupaia/ui-chart-components": "workspace:*",
Expand Down Expand Up @@ -64,7 +66,6 @@
"react-hook-form": "^6.8.3",
"react-icons": "^2.2.7",
"react-password-strength-bar": "^0.3.2",
"react-query": "^3.19.0",
"react-redux": "^5.0.6",
"react-router": "6.3.0",
"react-router-dom": "6.3.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';
import { download } from '../api';

export const useExportDashboardVisualisation = config =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';
import { download } from '../api';

export const useExportMapOverlayVisualisation = config =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Tupaia
* Copyright (c) 2017 - 20211Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*
*/
import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';
import { post, put } from '../api';

export const useSaveDashboardVisualisation = config =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Tupaia
* Copyright (c) 2017 - 20211Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*
*/
import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';
import { post, put } from '../api';

export const useSaveMapOverlayVisualisation = config =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';
import { upload } from '../api';

// Must match the file name expected by the back-end
const FILE_NAME = 'testData';

export const useUploadTestData = () =>
useMutation('uploadTestData', file => upload('uploadTestData', {}, FILE_NAME, file));
useMutation(['uploadTestData'], file => upload('uploadTestData', {}, FILE_NAME, file));
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Tupaia
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { stringifyQuery } from '@tupaia/utils';
import { get } from '../api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { useEffect } from 'react';
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import debounce from 'lodash.debounce';

import { get } from '../api';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';

export const useMapOverlays = () =>
useQuery('mapOverlays', () => get('mapOverlays'), {
useQuery(['mapOverlays'], () => get('mapOverlays'), {
...DEFAULT_REACT_QUERY_OPTIONS,
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Tupaia
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';

import { stringifyQuery } from '@tupaia/utils';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';

import { stringifyQuery } from '@tupaia/utils';

Expand All @@ -11,7 +11,7 @@ import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';

export const useProjects = columns =>
useQuery(
'projects',
['projects'],
async () => {
const defaultColumns = ['project.code', 'entity.name'];
const endpoint = stringifyQuery(undefined, 'projects', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
*/
import moment from 'moment';
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { post } from '../api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { stringifyQuery } from '@tupaia/utils';
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Tupaia
* Copyright (c) 2017 - 2022 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { stringifyQuery } from '@tupaia/utils';
import { useQuery, QueryClient } from 'react-query';
import { useQuery, QueryClient } from '@tanstack/react-query';
import { get } from '../api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useMutation, useQueryClient } from 'react-query';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { useApiContext } from '../../utilities/ApiProvider';

export const useEditSurveyResponse = (surveyResponseId, updatedSurveyResponse) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/admin-panel/src/api/mutations/useLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useMutation, useQueryClient } from 'react-query';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { useLocation, useNavigate } from 'react-router-dom';
import { post } from '../../VizBuilderApp/api';

Expand Down
4 changes: 2 additions & 2 deletions packages/admin-panel/src/api/mutations/useLogout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useMutation, useQueryClient } from 'react-query';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { post } from '../../VizBuilderApp/api';

export const useLogout = onSuccess => {
const queryClient = useQueryClient();

return useMutation('logout', () => post('logout'), {
return useMutation(['logout'], () => post('logout'), {
onSuccess: () => {
queryClient.invalidateQueries();
if (onSuccess) onSuccess();
Expand Down
4 changes: 2 additions & 2 deletions packages/admin-panel/src/api/mutations/useOneTimeLogin.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Tupaia
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useMutation, useQueryClient } from 'react-query';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { post } from '../../VizBuilderApp/api';

export const useOneTimeLogin = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';
import { post } from '../../VizBuilderApp/api';

export const useRequestResetPassword = () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/admin-panel/src/api/mutations/useResetPassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';
import { useLocation, useNavigate, useSearchParams } from 'react-router-dom';
import { post } from '../../VizBuilderApp/api';
import { PASSWORD_RESET_TOKEN_PARAM } from '../../authentication';
Expand Down
2 changes: 1 addition & 1 deletion packages/admin-panel/src/api/mutations/useUpdateProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useMutation, useQueryClient } from 'react-query';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { put } from '../../VizBuilderApp/api';

export const useUpdateProfile = () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/admin-panel/src/api/queries/useResourceDetails.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Tupaia
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../../VizBuilderApp/api/api';

export const useItemDetails = (params, parent) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/admin-panel/src/api/queries/useSurveyResponses.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Tupaia
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../../VizBuilderApp/api/api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../../VizBuilderApp/api/constants';

Expand Down
2 changes: 1 addition & 1 deletion packages/admin-panel/src/api/queries/useUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../../VizBuilderApp/api';

export const useUser = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Tupaia
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { post } from '../../VizBuilderApp/api/api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../../VizBuilderApp/api/constants';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Tupaia
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../../VizBuilderApp/api/api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../../VizBuilderApp/api/constants';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Tupaia
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../../VizBuilderApp/api/api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../../VizBuilderApp/api/constants';

Expand Down
4 changes: 2 additions & 2 deletions packages/admin-panel/src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import React, { lazy, Suspense } from 'react';
import { QueryClient, QueryClientProvider } from 'react-query';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import { render as renderReactApp } from 'react-dom';
import styled, { ThemeProvider } from 'styled-components';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import React from 'react';
import styled from 'styled-components';
import { HorizontalTree } from '@tupaia/ui-components';
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { PageHeader, PageBody } from '../../widgets';
import { LogsModal } from '../../logsTable';
import { get } from '../../VizBuilderApp/api';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Tupaia
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../VizBuilderApp/api/api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../VizBuilderApp/api/constants';

Expand Down
2 changes: 1 addition & 1 deletion packages/admin-panel/src/surveys/useSuggestSurveyCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd
*/

import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';

/**
* @param {TupaiaApi} api
Expand Down
Loading

0 comments on commit ab1ec2a

Please sign in to comment.