mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Refactor more value parsing code into common
Summary: Following discussion in https://phab.getgrist.com/D3164: - Change createParser to accept docData and one or two metadata row IDs and let it extract the metadata, so it's more easily usable in the server. - Change ViewFieldRec.valueParser observable to a function createValueParser. Test Plan: Existing tests. Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D3172
This commit is contained in:
@@ -372,7 +372,7 @@ BaseView.prototype._parsePasteForView = function(data, fields) {
|
||||
});
|
||||
const updateColIds = updateCols.map(c => c && c.colId());
|
||||
const updateColTypes = updateCols.map(c => c && c.type());
|
||||
const parsers = fields.map(field => field && field.valueParser() || (x => x));
|
||||
const parsers = fields.map(field => field && field.createValueParser() || (x => x));
|
||||
const docIdHash = tableUtil.getDocIdHash();
|
||||
|
||||
const richData = data.map((col, idx) => {
|
||||
|
||||
Reference in New Issue
Block a user