-
Notifications
You must be signed in to change notification settings - Fork 3
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
UIQM-716: Consolidate bib and authority routes to avoid page refresh after redirecting from the create/derive page to the edit one. #756
Conversation
… records to avoid page refresh after redirecting from the create page to the edit one.
Jest Unit Test Results 1 files ±0 46 suites - 2 2m 30s ⏱️ -15s Results for commit 0faccc5. ± Comparison against base commit 311d033. This pull request removes 34 and adds 27 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Hey @Dmytro-Melnyshyn, regarding this point:
Can we save a reference to a field name, instead of the field input itself? Field name will stay constant between renders and mounts/unmounts and we won't need to many changes. |
Hey @BogdanDenis, I choose to delete files for the following reasons:
I can also create one hook that will have three hooks, each responsible for different actions (Create, Edit, Derive), like we have in deleted files. |
@Dmytro-Melnyshyn ok let's continue with your approach. |
@BogdanDenis, it doesn't work, React detects the order of hooks and crashes the page. The I get the following error:
|
'edit-bibliographic': 'ui-quick-marc.quick-marc-editor.all', | ||
'derive-bibliographic': 'ui-quick-marc.quick-marc-editor.derive.execute', | ||
'create-authority': 'ui-quick-marc.quick-marc-authorities-editor.create', | ||
'edit-authority': '', // ui-quick-marc.quick-marc-authorities-editor.all |
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.
is this comment intentional?
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.
This permission was commented in the previous implementation, and I decided to leave it too.
Quality Gate passedIssues Measures |
Purpose
Add a "Save & keep editing" button to the bibliographic and authority record creation and deriving pages. After hitting the button, redirect to the editing page without refreshing it and retain the focus.
Approach
QuickMarcCreateWrapper.js
,QuickMarcEdiitWrapper.js
andQuickMarcDeriveWrapper.js
. Their functionality has been carried over to a newuseSaveRecord
hook. They use the same UI that should be used directly inQuickMarcEditorContainer
to avoid remounting fields after redirecting to the edit page, which prevents having the same ref for focusing;Issues
UIQM-716
TODOS and Open Questions
Screencasts
2024-11-12_10h34_17.mp4
Learning
Pre-Merge Checklist
Before merging this PR, please go through the following list and take appropriate actions.
If there are breaking changes, please STOP and consider the following:
Ideally all of the PRs involved in breaking changes would be merged in the same day to avoid breaking the folio-testing environment. Communication is paramount if that is to be achieved, especially as the number of intermodule and inter-team dependencies increase.
While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.