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

[DT-788] Footer: Apply for Access to selected Studies and Datasets #2723

Merged
merged 9 commits into from
Nov 14, 2024

Conversation

rjohanek
Copy link
Contributor

@rjohanek rjohanek commented Nov 12, 2024

Addresses

https://broadworkbench.atlassian.net/browse/DT-788

Summary

Moves the apply for access button to the new footer component that is optionally rendered if any datasets/studies are selected. Also displays text about the number of datasets and studies selected.

footer.mov

Have you read Terra's Contributing Guide lately? If not, do that first.

  • Label PR with a Jira ticket number and include a link to the ticket
  • Label PR with a security risk modifier [no, low, medium, high]
  • PR describes scope of changes
  • Get a minimum of one thumbs worth of review, preferably two if enough team members are available
  • Get PO sign-off for all non-trivial UI or workflow changes
  • Verify all tests go green
  • Test this change deployed correctly and works on dev environment after deployment

@rjohanek rjohanek requested a review from a team as a code owner November 12, 2024 19:12
@rjohanek rjohanek requested review from pshapiro4broad and cinyecai and removed request for a team November 12, 2024 19:12
# Conflicts:
#	src/components/data_search/DatasetSearchTable.jsx
@lstrano-broad
Copy link

LGTM - thx

Copy link
Contributor

@cinyecai cinyecai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, thanks for including the video!

Copy link
Contributor

@fboulnois fboulnois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One early suggestion:

border: '1px solid #DEDEDE',
alignItems: 'center'
}}>
{selectedDatasets.length > 1 && selectedStudies.length > 1 && (<div style={{paddingRight: 15}}> {selectedDatasets.length} Datasets selected from {selectedStudies.length} Studies </div>)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about something like:

// at top of component
const datasetText = selectedDatasets.length > 1 ? 'datasets' : 'dataset';
const studyText = selectedStudies.length > 1 ? 'studies' : 'study';

{selectedDatasets.length > 0 && (<div>{selectedDatasets.length} {datasetText} selected from {selectedStudies.length} {studyText}</div>)}

@@ -0,0 +1,51 @@
import {Styles} from '../../libs/theme';

export const styles = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another approach to this is to use modular css. We have several examples in the codebase for this. If the style objects are being manipulated by components, then I think that approach wouldn't work.

Copy link
Contributor

@rushtong rushtong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice 👍🏽

@@ -1,6 +1,6 @@
import React from 'react';
import style from '../../pages/DACDatasets.module.css';
import {styles} from './DACDatasetsTable';
import {styles} from './DACDatasetConstants';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing circular dependency discovered when testing

@@ -79,7 +79,7 @@ export const makeStudyTableHeaders = (datasets: DatasetTerm[], selected: number[
const selectableDatasetIds = datasets.filter(isSelectable).map(dataset => dataset.datasetId);
return [
{
label: <Checkbox checked={datasets.length === selected.length}
label: <Checkbox id='header-checkbox' checked={datasets.length === selected.length}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the id here so the element is easily retrievable in testing

@rjohanek rjohanek requested a review from fboulnois November 14, 2024 15:52
Copy link
Contributor

@rushtong rushtong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very nice, thank you 👍🏽

Copy link
Contributor

@fboulnois fboulnois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great 👍

@rjohanek rjohanek merged commit 433d17e into develop Nov 14, 2024
9 checks passed
@rjohanek rjohanek deleted the rj/dt-788-footer branch November 14, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants