Skip to content
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

CSV drag-and-drop bugfixes #904

Merged
merged 2 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/actions/filesDropped/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const handleMetadata = async (dispatch, getState, file) => {
try {
({data: csvData, errors, meta: csvMeta} = await parseCsv(file));
if (errors.length) {
console.error("Encountered the following errors during CSV parsing:", errors);
console.error(errors);
throw new Error(errors.map((e) => e.message).join(", "));
}
} catch (err) {
return dispatch(errorNotification({
Expand Down
3 changes: 2 additions & 1 deletion src/reducers/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ const Tree = (state = getDefaultTreeState(), action) => {
// modify the node data in place, which will not trigger any redux updates
state.nodes.forEach((node) => {
if (action.strains.has(node.name)) {
if (!node.node_attrs) node.node_attrs = {};
for (const [trait, obj] of Object.entries(action.traits[node.name])) {
node.traits[trait] = obj;
node.node_attrs[trait] = obj;
}
}
});
Expand Down