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

Refactor response parsers (aka. MIME Types) #541

Draft
wants to merge 26 commits into
base: dev
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a3b0935
Refactor file: `src/utils/parsers/index.js`
Raruto Jan 11, 2024
df1e374
merge regexes
Raruto Jan 12, 2024
ce99af4
Merge branch 'dev' into refactor-response-parsers
Raruto Jan 12, 2024
0491ff4
Merge branch 'dev' into refactor-response-parsers
Raruto Jan 16, 2024
3629dd5
Merge branch 'dev' into refactor-response-parsers
Raruto Jan 18, 2024
be6195b
Merge branch 'dev' into refactor-response-parsers
Raruto Jan 18, 2024
644864f
Merge branch 'dev' into refactor-response-parsers
Raruto Jan 23, 2024
1247a9e
remove space
Raruto Jan 23, 2024
098cc91
single import statement
Raruto Jan 23, 2024
6dc0b45
add server error to response parser
Raruto Jan 23, 2024
5b4c2fe
Merge branch 'dev' into refactor-response-parsers
Raruto Jan 23, 2024
2be8e45
Merge branch 'dev' into refactor-response-parsers
Raruto Feb 1, 2024
e9a2dd0
Merge branch 'dev' into refactor-response-parsers
Raruto Feb 1, 2024
353d85e
Merge branch 'dev' into refactor-response-parsers
Raruto Feb 6, 2024
f12a523
same as: https://github.com/g3w-suite/g3w-client/pull/566/commits/e79…
Raruto Feb 6, 2024
56c1cb6
same as: https://github.com/g3w-suite/g3w-client/pull/566/commits/c60…
Raruto Feb 7, 2024
389caab
Merge branch 'dev' into refactor-response-parsers
Raruto Feb 7, 2024
4adf238
Merge branch 'dev' into refactor-response-parsers
Raruto Feb 7, 2024
80010b5
Merge branch 'dev' into refactor-response-parsers
Raruto Feb 7, 2024
f78b20e
Remoce ChartsFactory
volterra79 Feb 7, 2024
6852f23
Import right ResponseParser
volterra79 Feb 7, 2024
6562b6f
Clean code
volterra79 Feb 7, 2024
5d88a11
Merge branch 'dev' into refactor-response-parsers
volterra79 Feb 7, 2024
df52cb2
Change name of query layer aligned with Admin project Query control m…
volterra79 Feb 8, 2024
a5b905a
Need to set G3W_ID property to each layer feature. It need to works w…
volterra79 Feb 8, 2024
1759a48
Merge branch 'dev' into refactor-response-parsers
Raruto Feb 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/utils/parsers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,12 @@ export const ResponseParser = {
const fname = originalFeatureMember.filter(f => f[name]); // features with same name
let features = fname.filter(f => Array.isArray(f[name])).map(f => f[name]).pop(); // feature member array
let prefix = fname.filter(f => Array.isArray(f[name])).map(f => f.__prefix).pop();// feature member prefix

fname
.forEach(f => {
f[name][G3W_FID] = {
__prefix: f.__prefix,
__text: f[name]._fid && f[name]._fid.split('.')[1]
};
.forEach(fn => {
if (fn[name]._fid) {
olfeatures.find(f => fn[name]._fid === f.getId()).set(G3W_FID, fn[name]._fid.split('.')[1])
}
});

// check if features have the same fields. If not group the features with the same fields
const grouped = features && groupBy(features, f => Object.keys(f));
const is_grouped = grouped && Object.keys(grouped).length > 1;
Expand All @@ -331,10 +328,9 @@ export const ResponseParser = {
return result;
}, { __prefix: prefix })
: fname.filter(feature => !Array.isArray(feature[name]));

// Remove Z values due a incorrect addition when using
// Remove Z values due an incorrect addition when using
// ol.format.WMSGetFeatureInfo readFeatures method from XML
// (eg. WMS getFeatureInfo);
// (ex. WMS getFeatureInfo);
volterra79 marked this conversation as resolved.
Show resolved Hide resolved
if (layer.isGeoLayer() && !is3DGeometry(layer.getGeometryType())) {
olfeatures.forEach(f => removeZValueToOLFeatureGeometry({ feature: f }));
}
Expand Down