Skip to content

Commit

Permalink
Merge branch 'nickakhmetov/hmp-194-lint-config' into nickakhmetov/hmp…
Browse files Browse the repository at this point in the history
…-194-lint-fixes
  • Loading branch information
NickAkhmetov committed Jul 5, 2023
2 parents 639673a + 74b7316 commit f7f6779
Show file tree
Hide file tree
Showing 51 changed files with 462 additions and 130 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-fair-data-messaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add messaging for fair data principles to homepage, vitessce, and the dataset file browser.
1 change: 1 addition & 0 deletions CHANGELOG-fix-homepage-vitessce-link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed homepage Vitessce demonstration link.
1 change: 1 addition & 0 deletions CHANGELOG-fix-provenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix flask data context destructuring to restore provenance features.
2 changes: 0 additions & 2 deletions CHANGELOG-hmp-103-add-tests.md

This file was deleted.

4 changes: 0 additions & 4 deletions CHANGELOG-hmp-154.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Update workspaces landing page messaging to instruct users without membership in the workspaces Globus group to request access.
4 changes: 0 additions & 4 deletions CHANGELOG-hmp-181-remove-search-feature.md

This file was deleted.

1 change: 0 additions & 1 deletion CHANGELOG-hmp-182-lineup.md

This file was deleted.

1 change: 0 additions & 1 deletion CHANGELOG-hmp-20-trim-sub-header.md

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG-hmp-207-fix-line-break.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Adjusted publication header to appear on one line only.
1 change: 1 addition & 0 deletions CHANGELOG-hotfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed changelog file format.
6 changes: 3 additions & 3 deletions CHANGELOG-lint-updates.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- Updated project ESLint configuration and dependencies
- Removed Babel
- Introduced TypeScript
- Update project ESLint configuration and dependencies.
- Remove Babel.
- Introduce TypeScript.
1 change: 0 additions & 1 deletion CHANGELOG-remove-non-datasets-from-datasets-charts.md

This file was deleted.

1 change: 0 additions & 1 deletion CHANGELOG-remove-support-files-from-publications.md

This file was deleted.

21 changes: 21 additions & 0 deletions context/app/markdown/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## v0.73.1 - 2023-06-28

- Adjust page-wide error boundary to prevent error messages from overflowing
- Add error boundary around Vitessce visualization to keep Vitessce errors from crashing full page
- Update Cypress testing suite.
- Add end-to-end tests for publication pages.
- Upgrade from Webpack 4 -> 5
- Upgrade from Storybook 6 -> 7
- Migrate from babel-loader -> swc-loader
- Migrate to @swc/jest test runner
- Removed search feature from home page.
- Added vertical padding to the count section.
- Formatted 10k+ homepage entity counts to nearest thousands place. (10,500 -> 10.5k)
- Added tooltip hover feature on count entities.
- Ensure that lineup pages' data all have necessary keys and report any incomplete metadata in console
- Trim publication sub header characters to 100 max with trailing ellisis.
- Bump `portal-visualization` to 0.0.12.
- Remove publications and other dataset subtypes from dataset charts.
- Remove globus link for lifted publication ancillary entities on publication pages.


## v0.73.0 - 2023-06-20

- Fix donor metadata table display.
Expand Down
9 changes: 6 additions & 3 deletions context/app/markdown/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The services the portal relies on are [listed separately](/services).
## Git submodules

```
79cab515ee56184a824c6755ff25fc6e2d1a3a65 context/ingest-validation-tools (v0.0.13-23-g79cab51)
79cab515ee56184a824c6755ff25fc6e2d1a3a65 context/ingest-validation-tools (v0.0.13-23-g79cab515)
```

## Python packages
Expand All @@ -27,7 +27,7 @@ hubmap-api-py-client>=0.0.9
hubmap-commons>=2.0.12
# Plain "git+https://github.com/..." references can't be hashed, so we point to a release zip instead.
https://github.com/hubmapconsortium/portal-visualization/archive/refs/tags/0.0.11.zip
https://github.com/hubmapconsortium/portal-visualization/archive/refs/tags/0.0.12.zip
# Security warning for older versions;
# Can be removed when commons drops prov dependency.
Expand Down Expand Up @@ -69,7 +69,7 @@ lxml>=4.9.1
"date-fns": "^2.27.0",
"fast-deep-equal": "^3.1.3",
"fromentries": "^1.2.0",
"html-webpack-plugin": "^4.3.0",
"html-webpack-plugin": "^5.5.3",
"immer": "^9.0.6",
"intersection-observer": "^0.11.0",
"lineupjsx": "^4.0.0",
Expand All @@ -93,8 +93,11 @@ lxml>=4.9.1
"react-vega": "^7.3.0",
"sass": "^1.53.0",
"searchkit": "^2.4.1-alpha.4",
"stream-browserify": "^3.0.0",
"styled-components": "^5.1.0",
"swc-loader": "^0.2.3",
"swr": "^2.1.5",
"timers-browserify": "^2.0.12",
"typeface-inter": "^3.12.0",
"universal-cookie": "^4.0.3",
"use-debounce": "^8.0.1",
Expand Down
2 changes: 1 addition & 1 deletion context/app/static/js/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function App(props) {
const { endpoints, globalAlertMd } = flaskData;
delete flaskData.endpoints;
delete flaskData.globalAlertMd;
const isWorkspacesUser = userGroups.includes('Workspaces') || workspacesUsers.includes(userEmail);
const isWorkspacesUser = userGroups?.includes('Workspaces') || workspacesUsers.includes(userEmail);

return (
<Providers
Expand Down
4 changes: 2 additions & 2 deletions context/app/static/js/components/Header/Dropdown/Dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import MenuList from '@material-ui/core/MenuList';

import { OffsetPopper } from './style';

function Dropdown({ title, children, menuListId }) {
function Dropdown({ title, children, menuListId, ...rest }) {
const [open, toggle] = useReducer((v) => !v, false);
const anchorRef = useRef(null);

return (
<>
<Button ref={anchorRef} onClick={toggle} style={{ color: 'white' }}>
<Button ref={anchorRef} onClick={toggle} style={{ color: 'white' }} {...rest}>
{title}
{open ? <ArrowDropUpIcon /> : <ArrowDropDownIcon />}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@ function UserLinks({ isAuthenticated, userEmail }) {
const { isWorkspacesUser } = useAppContext();

return (
<Dropdown title={<TruncatedSpan>{isAuthenticated ? userEmail || 'User' : 'User Profile'}</TruncatedSpan>}>
<Dropdown
title={<TruncatedSpan>{isAuthenticated ? userEmail || 'User' : 'User Profile'}</TruncatedSpan>}
data-testid="user-profile-dropdown"
>
<DropdownLink href="/my-lists">My Lists</DropdownLink>
{isWorkspacesUser && <DropdownLink href="/workspaces">My Workspaces</DropdownLink>}
<StyledDivider />
{isAuthenticated ? (
<WarningDropdownLink href="/logout">Log Out</WarningDropdownLink>
) : (
<DropdownLink href="/login">Log In</DropdownLink>
<DropdownLink href="/login" data-testid="login-link">
Log In
</DropdownLink>
)}
</Dropdown>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import TableRow from '@material-ui/core/TableRow';
import TableBody from '@material-ui/core/TableBody';
import Chip from '@material-ui/core/Chip';

import HubmapDataFooter from 'js/components/detailPage/files/HubmapDataFooter';
import { useFlaskDataContext } from 'js/components/Contexts';
import useFilesStore from 'js/stores/useFilesStore';
import { relativeFilePathsToTree } from './utils';
import FileBrowserNode from '../FileBrowserNode';
Expand All @@ -19,6 +21,9 @@ const filesStoreSelector = (state) => ({

function FileBrowser({ files }) {
const { displayOnlyQaQc, toggleDisplayOnlyQaQc } = useFilesStore(filesStoreSelector);
const {
entity: { entity_type },
} = useFlaskDataContext();

const fileTrees = useMemo(
() => ({
Expand All @@ -29,31 +34,34 @@ function FileBrowser({ files }) {
);

return (
<StyledTableContainer component={Paper}>
<ChipWrapper>
<Chip
label="Show QA Files Only"
clickable
onClick={toggleDisplayOnlyQaQc}
color={displayOnlyQaQc ? 'primary' : undefined}
icon={displayOnlyQaQc ? <DoneIcon /> : undefined}
component="button"
disabled={Object.keys(fileTrees.qa).length === 0}
/>
</ChipWrapper>
<Table data-testid="file-browser">
<HiddenTableHead>
<TableRow>
<td>Name</td>
<td>Type</td>
<td>Size</td>
</TableRow>
</HiddenTableHead>
<TableBody>
<FileBrowserNode fileSubTree={displayOnlyQaQc ? fileTrees.qa : fileTrees.all} depth={0} />
</TableBody>
</Table>
</StyledTableContainer>
<>
<StyledTableContainer component={Paper}>
<ChipWrapper>
<Chip
label="Show QA Files Only"
clickable
onClick={toggleDisplayOnlyQaQc}
color={displayOnlyQaQc ? 'primary' : undefined}
icon={displayOnlyQaQc ? <DoneIcon /> : undefined}
component="button"
disabled={Object.keys(fileTrees.qa).length === 0}
/>
</ChipWrapper>
<Table data-testid="file-browser">
<HiddenTableHead>
<TableRow>
<td>Name</td>
<td>Type</td>
<td>Size</td>
</TableRow>
</HiddenTableHead>
<TableBody>
<FileBrowserNode fileSubTree={displayOnlyQaQc ? fileTrees.qa : fileTrees.all} depth={0} />
</TableBody>
</Table>
</StyledTableContainer>
{['Dataset', 'Support'].includes(entity_type) && <HubmapDataFooter />}
</>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import userEvent from '@testing-library/user-event';
import { render, screen } from 'test-utils/functions';

import { FlaskDataContext } from 'js/components/Contexts';
import DetailContext from 'js/components/detailPage/context';
import FileBrowser from './FileBrowser';
import FilesContext from '../Files/context';
Expand All @@ -12,12 +13,15 @@ const uuid = 'fakeuuid';

const detailContext = { uuid };
const filesContext = { openDUA: fakeOpenDUA, hasAgreedToDUA: 'fakedua' };
const flaskDataContext = { entity: { entity_type: 'Dataset' } };

function FilesProviders({ children }) {
return (
<DetailContext.Provider value={detailContext}>
<FilesContext.Provider value={filesContext}>{children}</FilesContext.Provider>
</DetailContext.Provider>
<FlaskDataContext.Provider value={flaskDataContext}>
<DetailContext.Provider value={detailContext}>
<FilesContext.Provider value={filesContext}>{children}</FilesContext.Provider>
</DetailContext.Provider>
</FlaskDataContext.Provider>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { render, screen, waitForElementToBeRemoved, appProviderEndpoints } from
import { rest } from 'msw';
import { setupServer } from 'msw/node';

import { FlaskDataContext } from 'js/components/Contexts';
import DetailContext from 'js/components/detailPage/context';
import Files from './Files';

Expand Down Expand Up @@ -65,9 +66,11 @@ test('handles DUA flow', async () => {
];

render(
<DetailProvider>
<Files files={testFiles} uuid={uuid} hubmap_id="fakedoi" />
</DetailProvider>,
<FlaskDataContext.Provider value={{ entity: { entity_type: 'Dataset' } }}>
<DetailProvider>
<Files files={testFiles} uuid={uuid} hubmap_id="fakedoi" />
</DetailProvider>
</FlaskDataContext.Provider>,
);

userEvent.click(screen.getByRole('button', { name: 'fake5.txt' }));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';

import SectionFooter from 'js/shared-styles/sections/SectionFooter';
import { SecondaryBackgroundTooltip } from 'js/shared-styles/tooltips';
import { StyledInfoIcon } from './style';

const tooltipText =
'HuBMAP data is managed and published in the Data Portal and Human Reference Atlas according to FAIR Principles, including standardized processing with reproducible pipelines. HuBMAP data may also be processed by other methods in scientific results published by HuBMAP consortium collaborations.';

function DataCaptionWithTooltip() {
return (
<>
About this Data
<SecondaryBackgroundTooltip title={tooltipText}>
<StyledInfoIcon color="primary" />
</SecondaryBackgroundTooltip>
</>
);
}

function HubmapDataFooter({ items = [] }) {
return (
<SectionFooter
items={[
...items,
{
key: 'hubmap-data-tooltip',
component: <DataCaptionWithTooltip />,
},
]}
/>
);
}

export default HubmapDataFooter;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import HubmapDataFooter from './HubmapDataFooter';

export default HubmapDataFooter;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import styled from 'styled-components';
import { InfoIcon } from 'js/shared-styles/icons';

const StyledInfoIcon = styled(InfoIcon)`
margin-left: ${(props) => props.theme.spacing(0.5)}px;
`;

export { StyledInfoIcon };
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import ProvAnalysisDetails from '../ProvAnalysisDetails';
import { hasDataTypes } from './utils';

function ProvTabs({ provData }) {
const { uuid, metadata, entity_type, ancestors, data_types } = useFlaskDataContext();
const {
entity: { uuid, metadata, entity_type, ancestors, data_types },
} = useFlaskDataContext();

const [open, setOpen] = React.useState(0);
const handleChange = (event, newValue) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,19 @@ function SummaryData({
children,
mapped_external_group_name,
}) {
const isPublication = entity_type === 'Publication';
const LeftTextContainer = isPublication ? React.Fragment : 'div';
return (
<>
<SummaryTitle data-testid="entity-type">{entity_type}</SummaryTitle>
<SpacedSectionButtonRow
leftText={
<div>
<LeftTextContainer>
<StyledTypography variant="h2" data-testid="entity-title">
{title}
</StyledTypography>
{children && <FlexEnd data-testid="summary-data-parent">{children}</FlexEnd>}
</div>
</LeftTextContainer>
}
buttons={
<FlexEnd>
Expand Down
Loading

0 comments on commit f7f6779

Please sign in to comment.