Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2024-38 #5907

Merged
merged 29 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e6b5f80
Merge pull request #5845 from beyondessential/master
avaek Aug 18, 2024
056ffdc
fix(adminPanel): RN-1424: Fix max payload error when saving map overl…
tcaiger Aug 19, 2024
3738408
deps(security): RN-1096: Update version of `decode-uri-component` (#5…
alexd-bes Aug 20, 2024
0dc06e4
deps(security): RN-1096: Update version of `jsonwebtoken` (#5851)
alexd-bes Aug 20, 2024
ab44e44
deps(security): RN-1096: Update XLSX version (#5849)
alexd-bes Aug 20, 2024
ad3d6fa
tweak(types): RN-1418: Update EntityType type (#5871)
alexd-bes Sep 3, 2024
422c4c2
tweak(adminPanel): RN-1393: Minor Admin panel updates (#5867)
alexd-bes Sep 3, 2024
013a2e5
deps(root): RN-1417: Update storybook version (#5878)
alexd-bes Sep 6, 2024
6a5520f
tweak(centralServer): RN-1351: Handle bad DHIS2 sync requests (#5887)
alexd-bes Sep 10, 2024
314cf36
tweak(datatrakWeb): RN-1438: Upgrade React Query to V4 (#5868)
hrazasalman Sep 10, 2024
a4bede0
tweak(adminPanel): RN-1439: Upgrade React Query to V4 (#5875)
hrazasalman Sep 10, 2024
72329be
tweak(psss): RN-1442: Upgrade React Query to V4 (#5874)
hrazasalman Sep 10, 2024
7834a55
tweak(lesmis): RN-1441: Upgrade React Query to V4 (#5873)
hrazasalman Sep 10, 2024
aece138
tweak(tupaiaWeb): RN-1440: Upgrade React Query to V4 (#5870)
hrazasalman Sep 10, 2024
5ec3ab9
fix(adminPanel): Miscellaneous Bug fixes (Tiny) (#5891)
hrazasalman Sep 11, 2024
b7939ac
tweak(tupaiaWeb): RN-1437: Download files visual restyle (#5889)
alexd-bes Sep 11, 2024
147dbe8
feat(datatrakWeb): RN-1335: Tasks Epic (#5863)
alexd-bes Sep 16, 2024
c16337d
fix(centralServer): Handle request access without project code
alexd-bes Sep 17, 2024
a8f97ea
fix(tupaiaWeb): Fix button styling
alexd-bes Sep 17, 2024
afacbdf
fix(centralServer): Disable automatic cell conversion
hrazasalman Sep 18, 2024
88f89dd
fix(lesmis): Fix blank dashboard
hrazasalman Sep 18, 2024
22ce0a5
fix(lesmis): fix blank dashboard
hrazasalman Sep 18, 2024
40444a4
fix project detail loader
hrazasalman Sep 19, 2024
b8ff7ed
fix(adminPanel): Fix colours in admin panel filter tables
alexd-bes Sep 20, 2024
876e996
fix(adminPanel): Fix import modal in viz builder
alexd-bes Sep 20, 2024
4a737f4
fix(adminPanel): Fix entity type for measure level
alexd-bes Sep 20, 2024
abfda67
fix(datatrakWeb): Fix report survey filtering
alexd-bes Sep 20, 2024
9c6d757
fix(datatrakWeb): Fix changing search value
alexd-bes Sep 20, 2024
798e313
Update buildDeployablePackages.sh
tcaiger Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
/*
* Tupaia
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import React from 'react';
import { MuiThemeProvider, StylesProvider } from '@material-ui/core/styles';
import { ThemeProvider } from 'styled-components';
import CssBaseline from '@material-ui/core/CssBaseline';
import PropTypes from 'prop-types';
import { lightTheme, darkTheme } from '../stories/theme';
import { lightTheme, darkTheme } from './theme';

export const AppProviders = ({ params, children }) => {
export const AppProviders = ({
params,
children,
}: {
params?: { theme?: 'light' | 'dark' };
children: React.ReactNode;
}) => {
const theme = params?.theme === 'dark' ? darkTheme : lightTheme;

return (
<StylesProvider injectFirst>
<MuiThemeProvider theme={theme}>
Expand All @@ -23,12 +29,3 @@ export const AppProviders = ({ params, children }) => {
</StylesProvider>
);
};

AppProviders.propTypes = {
params: PropTypes.object,
children: PropTypes.any.isRequired,
};

AppProviders.defaultProps = {
params: null,
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { action } from '@storybook/addon-actions';
import { ReactNode } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import { Args } from '@storybook/react';
Expand Down
62 changes: 62 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import fs from 'fs';
import path, { join, dirname } from 'path';
import type { StorybookConfig } from '@storybook/react-vite';

const getStoriesDir = () => {
const currentDir = process.cwd();
return join(currentDir, 'stories/**/*.stories.@(js|jsx|ts|tsx)');
};

const getStaticDir = () => {
const currentDir = process.cwd();
const publicPath = join(currentDir, 'public');

if (!fs.existsSync(publicPath)) return [];
return [publicPath];
};

const config: StorybookConfig = {
stories: [getStoriesDir()],
addons: ['@storybook/addon-essentials'],
framework: {
name: '@storybook/react-vite',
options: {},
},
typescript: {
reactDocgen: 'react-docgen-typescript',
},
core: {
builder: '@storybook/builder-vite',
},
staticDirs: getStaticDir(),
viteFinal: async (config, { configType }) => {
// Merge custom configuration into the default config
const { mergeConfig, loadEnv } = await import('vite');
// Load the environment variables, whether or not they are prefixed with REACT_APP_
const env = loadEnv(configType || 'DEVELOPMENT', process.cwd(), ['REACT_APP_', '']);

return mergeConfig(config, {
define: {
'process.env': env,
},
server: {
watch: {
// Ignore the .env files because for some reason vite is detecting changes in them and restarting the server multiple times
ignored: '**/.env*',
},
},
resolve: {
preserveSymlinks: true, // use the yarn workspace symlinks
alias: {
http: path.resolve(__dirname, '../moduleMock.js'),
winston: path.resolve(__dirname, '../moduleMock.js'),
jsonwebtoken: path.resolve(__dirname, '../moduleMock.js'),
'node-fetch': path.resolve(__dirname, '../moduleMock.js'),
// This is a workaround for us using react-16 in the monorepo
'@storybook/react-dom-shim': '@storybook/react-dom-shim/dist/react-16',
},
},
});
},
};
export default config;
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700&display=swap"
/>

<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.1.0/leaflet.css"
/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.1.0/leaflet.css" />

<style>
html {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import type { Preview } from '@storybook/react';
import { AppProviders } from '../src/AppProviders';
import { AppProviders } from './AppProviders';
import ReactRouterDecorator from './ReactRouterDecorator';
import ReactHookFormDecorator from './ReactHookFormDecorator';

const preview: Preview = {
parameters: {
backgrounds: {
default: 'Dark',
default: 'Light',
values: [
{ name: 'Dark', value: '#262834' },
{ name: 'Light', value: '#ffffff' },
Expand All @@ -24,9 +24,9 @@ const preview: Preview = {
decorators: [
ReactRouterDecorator,
ReactHookFormDecorator,
Story => {
(Story, { parameters }) => {
return (
<AppProviders>
<AppProviders params={parameters}>
<Story />
</AppProviders>
);
Expand Down
29 changes: 29 additions & 0 deletions .storybook/theme/darkTheme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Tupaia
* Copyright (c) 2017 - 2020 Beyond Essential Systems Pty Ltd
*
*/

import { createMuiTheme } from '@material-ui/core';

export const darkTheme = createMuiTheme({
palette: {
type: 'dark',
primary: {
main: '#1978D4', // Main blue (as seen on primary buttons)
},
secondary: {
main: '#ee6230',
},
background: {
default: '#262834', // Dark blue background
paper: '#262834', // Dark blue to match background
},
text: {
secondary: '#9ba0a6',
},
form: {
border: '#d9d9d9',
},
},
});
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as COLORS from './colors';

const themeName = 'Tupaia-Storybook';
const palette = {
type: 'light',
primary: {
main: COLORS.BLUE,
light: COLORS.LIGHT_BLUE,
Expand Down Expand Up @@ -44,9 +45,12 @@ const palette = {
600: COLORS.GREY_72,
},
background: {
default: 'transparent', // use background addon to switch colors
default: COLORS.WHITE,
paper: COLORS.WHITE,
},
form: {
border: COLORS.GREY_DE,
},
};
const typography = {
h1: {
Expand Down
4 changes: 4 additions & 0 deletions env/platform.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TUPAIA_FRONT_END_URL=
DATATRAK_FRONT_END_URL=
LESMIS_FRONT_END_URL=
ADMIN_PANEL_FRONT_END_URL=
28 changes: 18 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,34 @@
"package:test:withdb": "cd $INIT_CWD && yarn workspace @tupaia/database check-test-database-exists && jest --runInBand",
"package:start:backend-start-dev": "cd $INIT_CWD && LOG_LEVEL=debug ../../scripts/bash/backendStartDev.sh",
"package:start:vite": "cd $INIT_CWD && vite --config \"../../vite.config.js\"",
"package:start-stack": "scripts/bash/pm2startInline.sh"
"package:start-stack": "scripts/bash/pm2startInline.sh",
"package:storybook:start": "cd $INIT_CWD && storybook dev -p 6006 -c ../../.storybook",
"package:storybook:build": "cd $INIT_CWD && storybook build -c .storybook"
},
"resolutions": {
"@typescript-eslint/eslint-plugin": "^4.18.0",
"@babel/types": "7.23.3"
"@babel/types": "7.25.6"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
"@babel/core": "^7.23.3",
"@babel/node": "^7.10.5",
"@babel/cli": "^7.25.6",
"@babel/core": "^7.25.2",
"@babel/node": "^7.25.0",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-export-default-from": "^7.22.17",
"@babel/plugin-proposal-export-default-from": "^7.24.7",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-transform-runtime": "^7.18.10",
"@babel/preset-env": "^7.23.3",
"@babel/preset-react": "^7.23.3",
"@babel/types": "^7.23.0",
"@babel/plugin-transform-runtime": "^7.25.4",
"@babel/preset-env": "^7.25.4",
"@babel/preset-react": "^7.24.7",
"@babel/types": "^7.25.6",
"@beyondessential/eslint-config-jest": "^1.0.0",
"@beyondessential/eslint-config-js": "^1.1.1",
"@beyondessential/eslint-config-ts": "^2.0.0",
"@storybook/addon-essentials": "^8.2.9",
"@storybook/builder-vite": "^8.2.9",
"@storybook/react": "^8.2.9",
"@storybook/react-vite": "^8.2.9",
"@vitejs/plugin-react": "^4.0.4",
"babel-eslint": "^10.1.0",
"babel-jest": "^29.7.0",
Expand All @@ -84,6 +90,8 @@
"nodemon": "^2.0.4",
"npm-package-json-lint": "5.1.0",
"pm2": "^5.3.0",
"react-docgen-typescript-plugin": "^1.0.8",
"storybook": "^8.2.9",
"ts-jest": "^29.1.2",
"ts-node": "^10.7.0",
"typescript": "^5.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/admin-panel-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lodash": "^4.17.4",
"multer": "^1.4.3",
"winston": "^3.3.3",
"xlsx": "^0.10.9"
"xlsx": "^0.18.5"
},
"devDependencies": {
"@types/multer": "^1.4.7"
Expand Down
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
Loading