-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
🪟 🐛 Fix direct job linking to work with pagination #16517
Conversation
@@ -48,7 +48,7 @@ export const JobItem: React.FC<JobItemProps> = ({ job }) => { | |||
const didSucceed = didJobSucceed(job); | |||
|
|||
const onExpand = () => { | |||
setIsOpen(!isOpen); | |||
setIsOpen((prevIsOpen) => !prevIsOpen); |
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.
Just updating this to use the best practice of using the arrow function for a change to a state value that depends on itself
c57a400
to
ed71403
Compare
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.
Tested locally. The code looks good but had a few comments.
airbyte-webapp/src/locales/en.json
Outdated
@@ -361,6 +361,8 @@ | |||
"connection.cancelSync": "Cancel Sync", | |||
"connection.cancelReset": "Cancel Reset", | |||
"connection.canceling": "Canceling...", | |||
"connection.linkedJobNotFound": "The linked job could not be found", |
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.
Could also be "Job not found"
) : linkedJobNotFound ? ( | ||
<EmptyResource | ||
text={<FormattedMessage id="connection.linkedJobNotFound" />} | ||
description={ | ||
<Link to={pathname}> | ||
<FormattedMessage id="connection.returnToSyncHistory" /> | ||
</Link> | ||
} | ||
/> |
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 wonder if instead of showing this, what if it showed an error notification at the bottom of the screen but still showed the jobs list? I suppose that in this case, the API would need to still return the jobs as usual.
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 that was how I had originally implemented the backend API, but the backend team pushed back on that a bit saying it made the endpoint somewhat confusing to return results even if the specific job ID could not be found (it was basically behaving in two different ways depending on that), which I kind of agreed with.
I don't expect users to run into this situation very often, since it would require them to manually edit the job ID in the URL, so hopefully having this separate view with a single click to get back to the main job view is not too cumbersome
4878e2c
to
ac7e103
Compare
Co-authored-by: Edmundo Ruiz Ghanem <168664+edmundito@users.noreply.github.com>
* master: (200 commits) 🪟 🧹 Display returned error messages on replication view (#16280) 🎉 Source mixpanel: Use "Retry-After" header for backoff (#16770) 🐛 Source google ads: mark custom query fields required (#15858) 🪟 🔧Remove useRouter hook (#16598) CDK: improve TypeTransformer to convert simple types to array of simple types (#16636) CDK: TypeTransformer - warning message more informative (#16695) Source MySQL: Add Python SAT to detect backwards breaking changes (#16445) remove eager (#16756) bump com.networknt:json-schema-validator to latest version (#16619) Remove Cloud from Kafka docs (#16753) Normalization Summaries table and read/write methods (#16655) comment out flaky test suite while it is being investigated (#16752) Update ConfigRepository to read protocol version (#16670) Use LOG4J2 to wrap connectors logs to JSON format (#15668) Update connector catalog (#16749) 🪟 🎨 Remove feedback modal from UI (#16548) Add missing env var for Kube overlays (#16747) Prepare for React v18 upgrade (#16694) 🪟 🐛 Fix direct job linking to work with pagination (#16517) Fix formatting (#16743) ...
* start implementation of new persistence method * add includingJobId and totalJobCount to job list request * format * update local openapi as well * refactor queries into JOOQ and return empty list if target job cannot be found * fix descriptions and undo changes from other branch * switch including job to starting job * fix job history handler tests * rewrite jobs subqueries in jooq * fix multiple config type querying * remove unnecessary casts * switch back to 'including' and return multiple of page size necessary to include job * undo webapp changes * fix test description * format * save progress * use list job api changes to retrieve linked job if linked * change job not found wording * Update airbyte-webapp/src/services/job/JobService.tsx Co-authored-by: Edmundo Ruiz Ghanem <168664+edmundito@users.noreply.github.com> Co-authored-by: Edmundo Ruiz Ghanem <168664+edmundito@users.noreply.github.com>
* start implementation of new persistence method * add includingJobId and totalJobCount to job list request * format * update local openapi as well * refactor queries into JOOQ and return empty list if target job cannot be found * fix descriptions and undo changes from other branch * switch including job to starting job * fix job history handler tests * rewrite jobs subqueries in jooq * fix multiple config type querying * remove unnecessary casts * switch back to 'including' and return multiple of page size necessary to include job * undo webapp changes * fix test description * format * save progress * use list job api changes to retrieve linked job if linked * change job not found wording * Update airbyte-webapp/src/services/job/JobService.tsx Co-authored-by: Edmundo Ruiz Ghanem <168664+edmundito@users.noreply.github.com> Co-authored-by: Edmundo Ruiz Ghanem <168664+edmundito@users.noreply.github.com>
What
Resolves #16369
See above linked issue for context.
How
This PR solves the problem by utilizing the list job API improvements made in #16415 to directly fetch the desired list of jobs when a job ID is linked to in the URL. This means that if someone links to a job outside of the first page of jobs, this view will immediately load the necessary number of pages required to include the linked job, as demonstrated in this screen recording:
Screen.Recording.2022-09-08.at.5.50.06.PM.mov
This PR also adds a fallback view for the edge case where someone puts an invalid job ID into the URL, with a link back to the normal sync history:
Screen.Recording.2022-09-08.at.5.52.42.PM.mov
Lastly, this PR also contains a small fix to utilize the new
totalJobCount
property in the list jobs response, to decide if there are more jobs to load and therefore whether the Load more button should be shown.Recommended reading order
StatusView.tsx
- main changes to the sync history viewJobService.tsx
- adding theincludingJobId
to the react-query keys, so that jobs are properly fetched when this is changed🚨 User Impact 🚨
Direct job linking should now work as expected again.