feat: metadata import (updated for v14)#80
Conversation
Co-authored-by: Kevin Shenk <kevin@avu.nu>
Co-authored-by
Bug FixesContributorsCommit-Lint commandsYou can trigger Commit-Lint actions by commenting on this PR:
|
Co-authored-by: Kevin Shenk <kevin@avu.nu>
|
@batonac, I just tested this out locally, and I think we'll still need to address some UX points I had made on the v13 PR:
I'll do another pass of testing once we've answered these. |
|
Hey @Alchez, thanks for the review. Sorry for not being more proactive on issues from the v13 thread...
This is mostly implemented. On the client side, the following code captures deleted fields and stores them in the session locals: On the server side, this code removes the custom fields: What we're missing is validating the options import table. Noted!
I don't have strong feelings one way or another about this. In my mind, the checkbox helps to make it obvious what the second table is for, which seems like a usability perk. In other words, new custom fields might not be entirely necessary to utilize the metadata import feature, depending on the scenario, and it seems like a good idea to make that clear. I'd be glad to just let the button go, moving the "Update Custom Fields" functionality to the "Save form" event entirely. |
…in use before delete.
|
Hey @Alchez, please review again! |
|
Your PR is merged and I dropped the section break. Hopefully we're ready to merge now! |
|
Hey @Alchez, any more thoughts on merging this? I'd love to drop my fork and re-align my client's site with your upstream branch, if possible. Thanks! |
Here's a fresh port of the metadata import functionality to the v14 branch.
Most notably, the child table field that links Shipstation Order Item Options to "Sales Order Item" fields has been refactored considerably compared to the last PR. Instead of trying to override a "Link" field and/or use a Virtual DocType, we now have JS which pushes field labels and names to a special-purpose "Select" field directly.
The code which keeps track of custom fields to delete is also moved client side, which eliminates another "hack" using frappe.flags.
Overall, this merge request is cleaner than the v13 PR, and I feel reasonably confident that the functionality is solid. Please give it a review and let me know what you think!