Skip to content

Commit

Permalink
Code Export: Support generating metadata filters #259
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed May 23, 2022
1 parent 57310f3 commit 76892b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"dependencies": {
"@musement/iso-duration": "^1.0.0",
"@openeo/js-client": "^2.5.1",
"@openeo/js-commons": "^1.4.0",
"@openeo/js-commons": "^1.4.1",
"@openeo/js-processgraphs": "^1.3.0",
"@openeo/vue-components": "^2.8.0",
"ajv": "^6.12.6",
Expand Down
11 changes: 9 additions & 2 deletions src/export/exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,14 @@ export default class Exporter extends ProcessGraph {
}

async resolveCallback(node, key) {
let callback = node.getArgument(key);
let callback;
if (node.process_id === 'load_collection') {
let properties = node.getArgument('properties');
callback = properties[key];
}
else {
callback = node.getArgument(key);
}
let parameters = callback.getCallbackParameters();
await callback.execute(parameters);
let fnName = this.var(`${key}${this.fnCounter++}`, 'fn_');
Expand Down Expand Up @@ -253,7 +260,7 @@ export default class Exporter extends ProcessGraph {
return `${id}_`;
}
if (!id.match(/^[a-z_]\w*$/)) {
return `${prefix}${id}`;
return prefix + id.replace(/[^\w]+/g, '_');
}
else {
return id;
Expand Down

0 comments on commit 76892b5

Please sign in to comment.