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

PORTALS-3308 - What's in Portals Component (GoalsV2) #1399

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

afwillia
Copy link
Contributor

@afwillia afwillia commented Nov 20, 2024

PORTALS-3308 This PR modifies the Goals component by creating cards for each panel, surrounded by a box.

@afwillia afwillia changed the title Portals 3308 - What's in Portals Component (GoalsV2) [Portals 3308](https://sagebionetworks.jira.com/browse/PORTALS-3308) - What's in Portals Component (GoalsV2) Nov 22, 2024
@afwillia afwillia changed the title [Portals 3308](https://sagebionetworks.jira.com/browse/PORTALS-3308) - What's in Portals Component (GoalsV2) PORTALS-3308 - What's in Portals Component (GoalsV2) Nov 22, 2024
@afwillia afwillia marked this pull request as ready for review December 2, 2024 18:03
@nickgros nickgros added the chromatic Deploys the latest commit on this PR to Chromatic and runs snapshot tests label Dec 4, 2024
Copy link
Collaborator

@nickgros nickgros left a comment

Choose a reason for hiding this comment

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

had some questions and suggestions, let me know if you have any questions!

@afwillia afwillia requested a review from nickgros December 12, 2024 17:35
Copy link
Collaborator

@nickgros nickgros left a comment

Choose a reason for hiding this comment

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

Looking good! Just a few more things to fix - remove an extra Link component, remove unused class names, fix setting up MSW to match our other tests. The rest of the comments are optional suggestions.

title,
}: GoalsV2DataProps) {
const titleElement = (
<div className="GoalsV2__Mobile__Header">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Go ahead and remove all classNames that are not being used for styling


const queryClient = new QueryClient()

const server = setupServer(
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to call setupServer, we do that already. You can import server from '../mocks/msw/server'

const queryClient = new QueryClient()

const server = setupServer(
rest.post(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Your handlers look good, but we have a utility generateAsyncJobHandlers that can abstract away setting up the async/start and async/get handlers that might reduce the amount of code here. Optionally consider using that here

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can delete this file, I'm trying to work towards removing these index files (for performance) and it's no longer true that the component must be exported this way to use it in a portal.

Comment on lines +189 to +196
<Link
href={dataLink}
target="_blank"
rel="noopener noreferrer"
fontFamily="Lato"
fontSize="18"
fontStyle="semi-bold"
>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this Link component since you're already using a Button with an href

sx={{
backgroundColor: '#5BA998',
border: '1px solid white',
boxShadow: 'none',
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can just remove the box shadow from all states (hover, active) with !important here. Should be safe since it only applies to this specific button.

That said, I think @kianamcc is moving these button styles to the EL Home Page theme override in #1456, so you might be able to remove some of these style overrides entirely

Suggested change
boxShadow: 'none',
boxShadow: 'none !important',

variant="headline1"
style={{
color: 'grey.1000',
fontFamily: 'Merriweather',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be unnecessary now that this is in the HomePageThemeProvider in the EL Portal

Suggested change
fontFamily: 'Merriweather',

setAssets(
files.requestedFiles
.filter(el => el.preSignedURL !== undefined)
.map(el => el.preSignedURL!),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am slightly concerned about these presigned URLs expiring, but this hasn't been an issue with the Goals v1 component, so I think it's fine for now.

Comment on lines +129 to +131
const goalsDataArray: GoalsV2DataProps[] = []

queryResultBundle?.queryResult!.queryResults.rows.forEach((el, index) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could use Array,map instead of forEach, but it's basically the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chromatic Deploys the latest commit on this PR to Chromatic and runs snapshot tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants