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
Add Hero widget #1077
Add Hero widget #1077
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.
I have a few minor comments on initial pass
...screens/ProjectHomePage/components/Hero/helpers/fetchWorkflowsHelper/fetchWorkflowsHelper.js
Outdated
Show resolved
Hide resolved
packages/app-project/src/screens/ProjectHomePage/components/Hero/HeroContainer.js
Show resolved
Hide resolved
.../app-project/src/screens/ProjectHomePage/components/Hero/components/Background/Background.js
Show resolved
Hide resolved
packages/app-project/src/helpers/GrommetWrapper/GrommetWrapperContainer.js
Outdated
Show resolved
Hide resolved
...ect/src/screens/ProjectHomePage/components/Hero/components/Background/BackgroundContainer.js
Outdated
Show resolved
Hide resolved
...-project/src/screens/ProjectHomePage/components/Hero/components/Introduction/Introduction.js
Outdated
Show resolved
Hide resolved
...src/screens/ProjectHomePage/components/Hero/components/Introduction/IntroductionContainer.js
Outdated
Show resolved
Hide resolved
.../src/screens/ProjectHomePage/components/Hero/components/WorkflowSelector/WorkflowSelector.js
Show resolved
Hide resolved
...nts/Hero/components/WorkflowSelector/components/WorkflowSelectButton/WorkflowSelectButton.js
Outdated
Show resolved
Hide resolved
|
||
const as = workflow.default | ||
? `${router.asPath}/classify` | ||
: `${router.asPath}/classify/workflow/${workflow.id}` |
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.
Woohoo! This is going to make building out workflow selection easier I think having a project home page to actually use for manual testing.
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'm actually thinking that all workflows should be routed to /classify/workflow/${workflow.id}
, and that /classify
simply does a redirect.
/project/[owner]/[project]/classify/workflow/[workflow_id]
becomes our new classify page- No ambiguity in what resource lives at the
classify
url - No duplicated content at different urls
Thoughts / feelings?
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.
Yeah, I'm fine with /classify
redirecting to /classify/workflow/:workflow_id
each time, but this should be in an ADR (if it's not already).
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.
Sounds good to me but /classify
should redirect to the stored workflow ID from project preferences for logged-in volunteers, rather than just redirecting to the default workflow.
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.
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.
Yeah, the same ordering of selection would exist: user stored UPP workflow id --> project set workflow id in UPP --> project default --> random active selection. Any one of those would result in the id that gets redirected to.
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.
also #1107
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.
Also - for the purposes of this PR, I propose leaving as is for now
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 think you can get rid of the ternary here and always route to the workflow ID when linking to a specific workflow (assuming these links are the same as the 'Choose a workflow' links on the current home page.)
On |
6a4f5fe
to
3354016
Compare
@srallen would you mind taking another look? |
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 have a few more comments. Thanks!
packages/app-project/src/helpers/GrommetWrapper/GrommetWrapperContainer.js
Outdated
Show resolved
Hide resolved
...-project/src/screens/ProjectHomePage/components/Hero/components/Introduction/Introduction.js
Outdated
Show resolved
Hide resolved
.../src/screens/ProjectHomePage/components/Hero/components/WorkflowSelector/WorkflowSelector.js
Outdated
Show resolved
Hide resolved
|
||
const as = workflow.default | ||
? `${router.asPath}/classify` | ||
: `${router.asPath}/classify/workflow/${workflow.id}` |
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.
Yeah, I'm fine with /classify
redirecting to /classify/workflow/:workflow_id
each time, but this should be in an ADR (if it's not already).
...ero/components/WorkflowSelector/components/WorkflowSelectButton/WorkflowSelectButton.spec.js
Show resolved
Hide resolved
...ns/ProjectHomePage/components/Hero/helpers/fetchWorkflowsHelper/fetchWorkflowsHelper.spec.js
Show resolved
Hide resolved
.../app-project/src/screens/ProjectHomePage/components/Hero/components/Background/Background.js
Outdated
Show resolved
Hide resolved
packages/app-project/src/screens/ProjectHomePage/components/Hero/HeroContainer.spec.js
Show resolved
Hide resolved
packages/app-project/src/screens/ProjectHomePage/components/Hero/Hero.spec.js
Outdated
Show resolved
Hide resolved
- Set default screen size to 'small' - Update React to match other apps - Add Hero component - Add background - Add about link and intro - Add workflow loader
- Filter workflows response to only include requested fields - Filter workflows response to only include incomplete workflows - Move translations request to work in series, as `activeWorkflows` may include redundant translations and these can get big - Create a map of display names, rather than do an array search for performance
8eac666
to
ef97a51
Compare
* Make Hero widget responsive with SSR - Install @artsy/fresnel - Move grommet theme merger to its own helper - Add fresnel helper components - Add media queries to Hero widget - Update tests * Update packages/app-project/src/helpers/theme/README.md Co-Authored-By: Jim O'Donnell <jim@zooniverse.org> * Add per-layout tests
okay, i've added the final set of tests - thanks to @srallen and @eatyourgreens for the help |
With #1107 merging, this is going to need to change (specifically the default |
@rogerhutchings the > is quite large, any way to adjust so it's the same height as the 'learn more' text? Other than that design looks great |
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.
LGTM. I have one non-blocking inline comment for the error state test. Additionally, I'm wondering about the Img
component used to render the background. I had written the Media
component in the shared components library to use the thumbnail service because we found that some projects were upload massively sized media. I think we have limits in place in the lab now, but for consistency in practice with keeping file sizes small, I think we will want to consider using Media
for the purposes of leveraging the thumbnail service. This is non-blocking because I know the Media
component needs some work. Let's add an issue to keep track of this and discuss it further?
scope = nock('https://panoptes-staging.zooniverse.org/api') | ||
.get('/translations') | ||
.query(true) | ||
.reply(200, { |
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.
Non-blocking, but if returning an error, just for consistency in mocking, this probably shouldn't be a 200 status.
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.
Only the workflows endpoint is returning an error in this test, but both requests need to be successful in order to show the content (as currently written)
@beckyrother this will be ready for a design review when this merges and deploys to our staging instance (branch deployments are still WIP) |
Sorry. Please tag me when it's ready. |
@beckyrother no worries! I thought you might want to check it out as an actual app and not just screenshots. |
I've opened #1133 to discuss the |
Closes #1018
Closes #49 🎉
Mobile
Desktop
Review Checklist
General
Apps
rm -rf node_modules/ && yarn bootstrap
and app works as expected?