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-23 #5670

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3e63232
tweak: Rename some references to Lastpass -> Bitwarden (#5653)
rohan-bes May 20, 2024
c76262e
refactor(centralServer): Broke up surveyResponse file into functions …
rohan-bes May 20, 2024
5ad496c
refactor(datatrakWeb): Rename SubmitSurvey -> SubmitSurveyResponse (#…
rohan-bes May 21, 2024
e217fa5
Merge pull request #5660 from beyondessential/master
avaek May 21, 2024
12fc952
Merge pull request #5664 from beyondessential/master
rohan-bes May 22, 2024
937441b
feat(adminPanel): RN-1188: Edit survey on a new page (#5636)
alexd-bes May 23, 2024
eafc959
fix(adminPanel): RN-1294: Fix bug where new permission groups did not…
rohan-bes May 23, 2024
936fed9
tweak(logging): Log original error in handleError middleware (#5674)
rohan-bes May 24, 2024
237f693
tweak(adminPanel): RN-1317: Reduce nav panel width (#5675)
alexd-bes May 26, 2024
ec45a2d
tweak(adminPanel): RN-1319: Update breadcrumb styles (#5676)
alexd-bes May 26, 2024
489a10b
fix(LESMIS): Fix infinite reload on table on LESMIS admin panel (#5678)
alexd-bes May 26, 2024
e6be984
feat(adminPanel): RN-1318: Collapsible nav panel (#5677)
alexd-bes May 26, 2024
1751720
tweak(adminPanel): RN-1300: Update CTA buttons (#5673)
alexd-bes May 27, 2024
262777a
tweak(adminPanel): RN-1318: Change animation for nav menu (#5680)
alexd-bes May 27, 2024
38ae631
fix(vizBuilder): Fix duplicate ID issue on viz builder transforms (#5…
alexd-bes May 27, 2024
dc75651
fix(vizBuilder): Fix pre-filling entities not working (#5683)
alexd-bes May 27, 2024
5ce0438
feat(adminPanel): RN-1301: Enable column resizing (#5663)
alexd-bes May 27, 2024
49e5ea5
tweak(adminPanel): RN-1299: Move button columns into parent 'action' …
alexd-bes May 28, 2024
35b1d6c
refactor: Converted lesmis-server and psss-server to using the `@tupa…
rohan-bes May 28, 2024
833ffa9
fix(adminPanel): Fix env banner scroll (#5687)
alexd-bes May 29, 2024
0beffb2
fix(lesmis): Fix LESMIS nav layout (#5688)
alexd-bes May 29, 2024
f85dff2
fix(adminPanel): Stop no file message showing between import views (#…
alexd-bes May 30, 2024
7499c3a
fix(datatrakWeb): RN-1268: Fix error when skipping non-mandatory enti…
alexd-bes May 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/admin-panel-server/src/app/createApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
*/
import { Request } from 'express';
import { TupaiaDatabase } from '@tupaia/database';
import { OrchestratorApiBuilder, forwardRequest, handleWith } from '@tupaia/server-boilerplate';
import {
OrchestratorApiBuilder,
RequiresSessionAuthHandler,
forwardRequest,
handleWith,
} from '@tupaia/server-boilerplate';
import { getEnvVarOrDefault } from '@tupaia/utils';
import { AdminPanelSessionModel } from '../models';
import { hasTupaiaAdminPanelAccess } from '../utils';
Expand Down Expand Up @@ -45,8 +51,8 @@ import {
ExportEntityHierarchiesRequest,
ExportEntityHierarchiesRoute,
} from '../routes';
import { authHandlerProvider } from '../auth';

const authHandlerProvider = (req: Request) => new RequiresSessionAuthHandler(req);
/**
* Set up express server with middleware,
*/
Expand Down
20 changes: 0 additions & 20 deletions packages/admin-panel-server/src/auth/authHandlerProvider.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/admin-panel-server/src/auth/index.ts

This file was deleted.

19 changes: 6 additions & 13 deletions packages/admin-panel/public/admin-panel-logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 19 additions & 13 deletions packages/admin-panel/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { TabPageLayout } from './layout/TabPageLayout';

export const getFlattenedChildViews = (route, basePath = '') => {
return route.childViews.reduce((acc, childView) => {
const { nestedView } = childView;
const { nestedViews } = childView;

const childViewWithRoute = {
...childView,
Expand All @@ -26,23 +26,21 @@ export const getFlattenedChildViews = (route, basePath = '') => {
to: `${basePath}${route.path}${childView.path}`, // this is an absolute route so that the breadcrumbs work
};

if (!nestedView) return [...acc, childViewWithRoute];
if (!nestedViews) return [...acc, childViewWithRoute];
const updatedNestedViews = nestedViews.map(nestedView => ({
...nestedView,
path: `${route.path}${childView.path}${nestedView.path}`,

const updatedNestedView = nestedView
? {
...nestedView,
path: `${route.path}${childView.path}${nestedView.path}`,
parent: childViewWithRoute,
}
: null;
parent: childViewWithRoute,
}));

return [
...acc,
{
...childViewWithRoute,
nestedView: updatedNestedView,
nestedViews: updatedNestedViews,
},
updatedNestedView,
...updatedNestedViews,
];
}, []);
};
Expand Down Expand Up @@ -74,7 +72,15 @@ export const App = ({ user, hasBESAdminAccess }) => {
<Route path="/login" element={<LoginPage />} />
<Route path="/logout" element={<LogoutPage />} />
<Route path="/" element={<PrivateRoute />}>
<Route element={<AppPageLayout user={user} routes={accessibleRoutes} />}>
<Route
element={
<AppPageLayout
user={user}
routes={accessibleRoutes}
profileLink={{ label: 'Profile', to: '/profile' }}
/>
}
>
<Route index element={<Navigate to="/surveys" replace />} />
<Route path="*" element={<Navigate to="/surveys" replace />} />
{[...accessibleRoutes, ...PROFILE_ROUTES].map(route => (
Expand All @@ -95,7 +101,7 @@ export const App = ({ user, hasBESAdminAccess }) => {
path={childRoute.path}
element={
childRoute.Component ? (
<childRoute.Component />
<childRoute.Component {...childRoute} />
) : (
<ResourcePage {...childRoute} hasBESAdminAccess={hasBESAdminAccess} />
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export const useEntityByCode = (entityCode, onSuccess) =>
() =>
get('entities', {
params: {
filter: {
filter: JSON.stringify({
code: entityCode,
},
}),
},
}),
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ const transformToValue = transform =>
}));

const valueToTransform = value =>
value.map(({ id, code, isDisabled = false, ...restOfConfig }, index) => ({
id: id || `${code}-${index}`, // option from selectable options does not have id.
transform: code,
isDisabled,
...restOfConfig,
}));
value.map(({ id, code, isDisabled = false, ...restOfConfig }) => {
const uniqueId = Math.random() * 1000000; // unique id to add to the code
return {
id: id || `${code}-${uniqueId}`, // option from selectable options does not have id.
transform: code,
isDisabled,
...restOfConfig,
};
});

export const TransformDataLibrary = ({ transform, onTransformChange, onInvalidChange }) => {
const [dataType, setDataType] = useState(DATA_TYPES.TRANSFORM);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { HomeLink, UserLink } from '../../layout';

const Wrapper = styled.div`
background-color: ${props => props.theme.palette.secondary.main};
padding-block: 0.3rem;
padding-block: 1rem;
padding-inline: 1.25rem;
display: flex;
justify-content: space-between;
Expand Down
16 changes: 16 additions & 0 deletions packages/admin-panel/src/autocomplete/Autocomplete.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import React from 'react';
import PropTypes from 'prop-types';
import Close from '@material-ui/icons/Close';
import { createFilterOptions } from '@material-ui/lab/Autocomplete';
import styled from 'styled-components';
import MuiChip from '@material-ui/core/Chip';
Expand All @@ -15,6 +16,11 @@ const Chip = styled(MuiChip)`
&:first-child {
margin-left: 6px;
}
color: ${props => props.theme.palette.text.primary};
.MuiChip-deleteIcon {
color: ${props => props.theme.palette.text.secondary};
height: 1rem;
}
`;

export const Autocomplete = props => {
Expand All @@ -33,6 +39,8 @@ export const Autocomplete = props => {
allowMultipleValues,
optionLabelKey,
muiProps,
tooltip,
required,
} = props;
const [searchTerm, setSearchTerm] = React.useState('');
const debouncedSearchUpdate = React.useCallback(
Expand Down Expand Up @@ -75,6 +83,8 @@ export const Autocomplete = props => {
values.map((option, index) => (
<Chip
color="primary"
deleteIcon={<Close />}
variant="outlined"
label={optionLabelKey ? option[optionLabelKey] : option}
{...getTagProps({ index })}
/>
Expand Down Expand Up @@ -109,6 +119,8 @@ export const Autocomplete = props => {
placeholder={placeholder}
helperText={helperText}
muiProps={extraMuiProps}
tooltip={tooltip}
required={required}
/>
);
};
Expand All @@ -130,6 +142,8 @@ Autocomplete.propTypes = {
allowMultipleValues: PropTypes.bool,
optionLabelKey: PropTypes.string,
muiProps: PropTypes.object,
tooltip: PropTypes.string,
required: PropTypes.bool,
};

Autocomplete.defaultProps = {
Expand All @@ -144,4 +158,6 @@ Autocomplete.defaultProps = {
muiProps: {},
optionLabelKey: null,
onChangeSearchTerm: () => {},
tooltip: null,
required: false,
};
Loading
Loading