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-17 #5584

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tupaia",
"private": true,
"description": "Mono-repo for the Tupaia project, mapping health data across the Pacific",
"description": "Monorepo for the Tupaia project, mapping health data across the Pacific",
"homepage": "https://github.com/beyondessential/tupaia",
"bugs": {
"url": "https://github.com/beyondessential/tupaia-backlog/issues"
Expand All @@ -11,7 +11,7 @@
"url": "git+https://github.com/beyondessential/tupaia.git"
},
"license": "SEE LICENSE IN LICENSE",
"author": "Beyond Essential Systems <admin@tupaia.org> (https://beyondessential.com.au)",
"author": "Beyond Essential Systems <admin@tupaia.org> (https://bes.au)",
"workspaces": {
"packages": [
"packages/*"
Expand Down
2 changes: 1 addition & 1 deletion packages/access-policy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "git+https://github.com/beyondessential/tupaia.git",
"directory": "packages/access-policy"
},
"author": "Beyond Essential Systems <admin@tupaia.org> (https://beyondessential.com.au)",
"author": "Beyond Essential Systems <admin@tupaia.org> (https://bes.au)",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
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 @@ -10,7 +10,7 @@
"type": "git",
"url": "git+https://github.com/beyondessential/tupaia"
},
"author": "Beyond Essential Systems <admin@tupaia.org> (https://beyondessential.com.au)",
"author": "Beyond Essential Systems <admin@tupaia.org> (https://bes.au)",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export class FetchReportPreviewDataRoute extends Route<FetchReportPreviewDataReq
if (hierarchy) parameters.hierarchy = hierarchy;
if (entityCode) parameters.organisationUnitCodes = entityCode;
if (startDate) parameters.startDate = startDate;
if (startDate) parameters.startDate = startDate;
if (endDate) parameters.endDate = endDate;
if (permissionGroup) parameters.permissionGroup = permissionGroup;

Expand Down
1 change: 1 addition & 0 deletions packages/admin-panel/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ REACT_APP_API_URL=
REACT_APP_CLIENT_BASIC_AUTH_HEADER=
REACT_APP_VIZ_BUILDER_API_URL=
SKIP_PREFLIGHT_CHECK=
PARSE_LINK_HEADER_MAXLEN=
4 changes: 2 additions & 2 deletions packages/admin-panel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "git+https://github.com/beyondessential/tupaia.git",
"directory": "packages/admin-panel"
},
"author": "Beyond Essential Systems <admin@tupaia.org> (https://beyondessential.com.au)",
"author": "Beyond Essential Systems <admin@tupaia.org> (https://bes.au)",
"main": "./lib/library.js",
"scripts": {
"build": "run-s -c \"build:* {@}\" --",
Expand Down Expand Up @@ -37,7 +37,7 @@
"@tupaia/ui-components": "workspace:*",
"@tupaia/utils": "workspace:*",
"ace-builds": "^1.10.1",
"axios": "^0.21.1",
"axios": "^1.6.8",
"case": "^1.5.3",
"content-disposition-header": "^0.6.0",
"date-fns": "^2.29.2",
Expand Down

This file was deleted.

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

import React, { useState } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { IconButton } from '@material-ui/core';
import DownArrow from '@material-ui/icons/ArrowDropDown';
import CheckBoxOutlinedIcon from '@material-ui/icons/CheckBoxOutlined';
import styled from 'styled-components';
Expand All @@ -26,38 +27,27 @@ const OptionPanelWithEditor = styled.div`
overflow: hidden;
`;

const DownArrowIconWrapper = styled.div`
const DownArrowIconButton = styled(IconButton)`
display: flex;

.icon-wrapper {
cursor: pointer;
}

padding: 0.2rem;
.MuiSvgIcon-root {
transition: transform 0.3s ease;
transform: rotate(${({ $expanded }) => ($expanded ? '0deg' : '-90deg')});
}
`;

export const SelectedOption = ({
export const SelectedOptionWithEditor = ({
option, // **************************************************
basicOption, // Option panel configs (title, description etc)
supportsTitleEditing,
onRemove, // ************************************************
onChange,
editor,
children,
isExpanded,
onToggleExpanded,
onOpenModal,
isModal,
}) => {
const [isExpanded, setIsExpanded] = useState(false);

const handleToggleExpanded = newIsExpanded => {
if (!newIsExpanded) {
// When collapsing, any invalid state is thrown away. To tell our parents
// this we have to trigger an onChange event
onChange(option);
}
setIsExpanded(newIsExpanded);
};

return (
<OptionPanelWithEditor>
<FlexBetweenPanel>
Expand All @@ -72,33 +62,45 @@ export const SelectedOption = ({
}}
size="small"
/>
<DownArrowIconWrapper
$expanded={isExpanded}
className="icon-wrapper"
onClick={() => handleToggleExpanded(!isExpanded)}
>
<DownArrow />
</DownArrowIconWrapper>
{!isModal && (
<DownArrowIconButton
$expanded={isExpanded}
className="icon-wrapper"
onClick={onToggleExpanded}
title={`Open ${basicOption.title || basicOption.code} editor`}
>
<DownArrow />
</DownArrowIconButton>
)}

{supportsTitleEditing ? (
<EditableSelectedOption
option={basicOption}
onRemove={onRemove}
onTitleChange={title => {
onChange({ ...option, title });
}}
onOpenModal={onOpenModal}
/>
) : (
<BaseSelectedOption option={basicOption} onRemove={onRemove} />
)}
</FlexBetweenPanel>
{isExpanded && editor}
{isExpanded && children}
</OptionPanelWithEditor>
);
};

SelectedOption.defaultProps = { optionMetaData: null, supportsTitleEditing: false };
SelectedOptionWithEditor.defaultProps = {
optionMetaData: null,
supportsTitleEditing: false,
isExpanded: false,
isModal: false,
onToggleExpanded: null,
onOpenModal: null,
};

SelectedOption.propTypes = {
SelectedOptionWithEditor.propTypes = {
option: PropTypes.shape({
id: PropTypes.string.isRequired,
code: PropTypes.string.isRequired,
Expand All @@ -114,5 +116,9 @@ SelectedOption.propTypes = {
description: PropTypes.string,
}),
basicOption: PropTypes.object.isRequired,
editor: PropTypes.element.isRequired,
isExpanded: PropTypes.bool,
onToggleExpanded: PropTypes.func,
onOpenModal: PropTypes.func,
isModal: PropTypes.bool,
children: PropTypes.node.isRequired,
};
Loading