-
Notifications
You must be signed in to change notification settings - Fork 405
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
Fix #2812 parseInitialState function #2818
Changes from 4 commits
da8453a
412f054
5730bee
bfe9e2f
b19dd06
c66568c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
const { get, findIndex, isNil, fill} = require('lodash'); | ||
const { get, findIndex, isNil, fill, isArray} = require('lodash'); | ||
|
||
const {getFeatureTypeProperties, isGeometryType, isValid, isValidValueForPropertyName, findGeometryProperty, getPropertyDesciptor} = require('./ogc/WFS/base'); | ||
const getGeometryName = (describe) => get(findGeometryProperty(describe), "name"); | ||
|
@@ -35,13 +35,13 @@ const getRow = (i, rows) => rows[i]; | |
|
||
/* eslint-disable */ | ||
|
||
const toChangesMap = (changesArray) => changesArray.reduce((changes, c) => ({ | ||
const toChangesMap = (changesArray) => isArray(changesArray) ? changesArray.reduce((changes, c) => ({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's the reason of this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because moving the reducer default state of featuregrid caused that changesArray to passed as empty object initially, this makes the map loading forever There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may use a |
||
...changes, | ||
[c.id]: { | ||
...changes[c.id], | ||
...c.updated | ||
} | ||
}), {}); | ||
}), {}) : {}; | ||
const applyChanges = (feature, changes) => { | ||
const propChanges = Object.keys(changes).filter(k => k !== "geometry").reduce((acc, cur) => ({ | ||
...acc, | ||
|
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.
it doesn't return the recursive func:
It returns an object of the same structure of the
initialState
but replacing strings like"{someExpression}"
with the result of the expression between brackets.state the object to parse
context context for expression
return the modified object.