-
Notifications
You must be signed in to change notification settings - Fork 2
COMPASS-3851: ability to add fields when exporting collection #17
Conversation
@imlucas this is the PR that has the three step flow for export! |
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.
Currently I am finding one document and grabbing the initial fields to render from that document. Should I instead do a collection sample and run schema-parser over that to get a more accurate selection of fields. I can't determine if that's an overkill, or, in fact, a more detailed solution.
I've been thinking the same for import
Help! I can't figure out why my export-select-fields component is not rerendering. At this point I am being very impolite towards React, but I am sure there is a simple thing I am not seeing.
Let's pair up. Nothing sticking out cause.
I am thinking I will do + ADD FIELD button in another PR, so people can play around with this for now and tell me if everything works ok.
Sounds good
Hang on, so are you sampling or doing a find one? Thanks for a kick-ass review, btw! |
…port-select-fields styles
|
Oh and I was thinking more about "export-select-fields component is not rerendering" last night. If this is still a problem w/ not rerendering make it an array of |
// } | ||
|
||
handleFieldCheckboxChange = (evt) => { | ||
const fields = Object.assign({}, this.props.fields); |
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.
@imlucas solved the re-render issue, and oh my god was is it the most nuanced react thing.
so what i had before here was:
const fields = this.props.fields;
which I then modified and updated the redux state with. So this is considered a mutation by redux, so it will just give up and not fire a re-render apparently \o/
using Object.assign()
gets rid of the mutation and creates a brand new thing i can rewrite.
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.
Ah! Sweet! Nice find
@imlucas i fixed everything we talked about IRL yesterday, let me know if it looks good to merge! |
Cutting master so all of your export improvements from the past few days can be upstreamed into compass asap with @mongodb-js/compass-import-export@^4.2.0. The import type casting stuff in #18 is complex enough that I don't want it blocking so it will go as 5.0.0. We can keep this 4.x-releases branch ref around just in case casting performance is a real dud and we want to take another stab at it. Now that this release has been published, a PR to mongodb-js/compass 📦 @mongodb-js/compass-import-export@^4.2.0 has changelog: UX improvements: display doc count, do not display line numbers #20 COMPASS-3961: allow adding missing fields #19 COMPASS-3851: ability to add fields when exporting collection #17
Now that this release has been published, a PR to mongodb-js/compass 📦 `@mongodb-js/compass-import-export@^4.2.0` has changelog: - UX improvements: display doc count, do not display line numbers mongodb-js/compass-import-export#20 - Closes COMPASS-3961: allow adding missing fields mongodb-js/compass-import-export#19 - Closes COMPASS-3851: ability to add fields when exporting collection mongodb-js/compass-import-export#17
) Now that this release has been published, a PR to mongodb-js/compass 📦 `@mongodb-js/compass-import-export@^4.2.0` has changelog: - UX improvements: display doc count, do not display line numbers mongodb-js/compass-import-export#20 - Closes COMPASS-3961: allow adding missing fields mongodb-js/compass-import-export#19 - Closes COMPASS-3851: ability to add fields when exporting collection mongodb-js/compass-import-export#17
Description
Current work going into being able to
Select Fields
when exporting.So far this PR:
Back
,Close
,{PROCEED}
buttonsfields
selected are kept in props, so when a user goes back to selecting fields, their previously selected/disselected fields are still thereSELECT FIELDS
modal state after having exported, they can edit fields, and export again (dunno if anyone will actually do this, but just in case)Checklist
Open Questions
Currently I am finding one document and grabbing the initial fields to render from that document. Should I instead do a collection sample and run schema-parser over that to get a more accurate selection of fields. I can't determine if that's an overkill, or, in fact, a more detailed solution.
Help! I can't figure out why my export-select-fields component is not rerendering. At this point I am being very impolite towards React, but I am sure there is a simple thing I am not seeing.
I am thinking I will do
+ ADD FIELD
button in another PR, so people can play around with this for now and tell me if everything works ok.Types of changes