-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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!
packages/synapse-react-client/src/components/GoalsV2/GoalsV2.tsx
Outdated
Show resolved
Hide resolved
packages/synapse-react-client/src/components/GoalsV2/GoalsV2.tsx
Outdated
Show resolved
Hide resolved
packages/synapse-react-client/src/components/GoalsV2/GoalsV2.tsx
Outdated
Show resolved
Hide resolved
packages/synapse-react-client/src/components/GoalsV2/GoalsV2.tsx
Outdated
Show resolved
Hide resolved
packages/synapse-react-client/src/style/components/_goalsv2.scss
Outdated
Show resolved
Hide resolved
packages/synapse-react-client/src/components/GoalsV2/GoalsV2.test.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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"> |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
<Link | ||
href={dataLink} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
fontFamily="Lato" | ||
fontSize="18" | ||
fontStyle="semi-bold" | ||
> |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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
boxShadow: 'none', | |
boxShadow: 'none !important', |
variant="headline1" | ||
style={{ | ||
color: 'grey.1000', | ||
fontFamily: 'Merriweather', |
There was a problem hiding this comment.
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
fontFamily: 'Merriweather', |
setAssets( | ||
files.requestedFiles | ||
.filter(el => el.preSignedURL !== undefined) | ||
.map(el => el.preSignedURL!), |
There was a problem hiding this comment.
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.
const goalsDataArray: GoalsV2DataProps[] = [] | ||
|
||
queryResultBundle?.queryResult!.queryResults.rows.forEach((el, index) => { |
There was a problem hiding this comment.
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
PORTALS-3308 This PR modifies the Goals component by creating cards for each panel, surrounded by a box.