Skip to content

Commit

Permalink
Merge pull request #484 from NeurodataWithoutBorders/fix-subject-table
Browse files Browse the repository at this point in the history
Allow editing sessions on new rows
  • Loading branch information
CodyCBakerPhD authored Oct 31, 2023
2 parents 11b6fc8 + 586bd7c commit 8161005
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/renderer/src/stories/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,8 @@ export class Table extends LitElement {
if (col === this.keyColumn) {
if (hasRow) value = row;
else return undefined;
} else
value =
(hasRow ? this.data[row][col] : undefined) ??
this.template[col] ??
// this.schema.properties[col].default ??
"";
} else value = (hasRow ? this.data[row][col] : undefined) ?? this.template[col];

return value;
});
}
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/stories/hot.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@ class ArrayEditor extends Handsontable.editors.TextEditor {
.split(",")
.map((str) => str.trim())
.filter((str) => str);

return this.cellProperties.uniqueItems ? Array.from(new Set(split)) : split; // Only unique values
}
}

setValue(newValue) {
if (Array.isArray(newValue)) return newValue.join(",");
if (Array.isArray(newValue)) newValue = newValue.join(",");
super.setValue(newValue);
}
}
Expand Down

0 comments on commit 8161005

Please sign in to comment.