-
Notifications
You must be signed in to change notification settings - Fork 1
UILD-578: use separate profiles for Work and Instance #176
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
base: master
Are you sure you want to change the base?
Conversation
…file loading hooks
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.
Please update CHANGELOG.md.
Sorry, there's just not enough information here for me to usefully evaluate this work.
- The PR description is effectively blank
- The Jira feature is very high level, which is fine, but given the PR itself provides no additional details WRT an implementation plan, it is hard to understand
- There are no code comments aside from a few "TODO" entries
If you want a review from an external team, please provide more context generally, or point to a specific issue in the code that you think would benefit from scrutiny.
|
let ids: number[] = []; | ||
|
||
if (pageType === ResourceType.work) { | ||
ids = [api.work]; |
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.
Wanted to make sure that the following use case is considered -
When a Work with only one associated Instance is opened for editing, the UI should display the Work in edit mode on the left side and the Instance in read-only mode on the right. This means we'll need to fetch profiles for both the Work and the Instance, correct? Will this be handled later?
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.
Yes, this will be implemented in the next PRs.
As we discussed offline and how it was added to the Jira ticket, the scope of this PR is limited to the Create Work/Instance page. As for the Edit page, it will be handled separately (as well as Preview, Compare, Duplication functionality), it still uses the old composite profile, which includes both work and instance data. That's why we still need linked-data/profile/1
endpoint.
Loading separate profiles for Work and Instance on the Create resource page
https://folio-org.atlassian.net/browse/UILD-578
Technical details:
The Create Work page now makes a request for the Work profile. The Create Instance page makes two requests: one for the Instance profile to render the work form and another for the Work profile to render the preview section with the linked Work data.
To implement this, a new hook has been introduced to load profiles, along with a new configuration to determine the root entry of the Monograph profile. Additionally, the general logic has been updated to apply the configuration and load the required profiles.