Skip to content

Commit 76892b5

Browse files
committed
Code Export: Support generating metadata filters #259
1 parent 57310f3 commit 76892b5

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"dependencies": {
4444
"@musement/iso-duration": "^1.0.0",
4545
"@openeo/js-client": "^2.5.1",
46-
"@openeo/js-commons": "^1.4.0",
46+
"@openeo/js-commons": "^1.4.1",
4747
"@openeo/js-processgraphs": "^1.3.0",
4848
"@openeo/vue-components": "^2.8.0",
4949
"ajv": "^6.12.6",

src/export/exporter.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,14 @@ export default class Exporter extends ProcessGraph {
190190
}
191191

192192
async resolveCallback(node, key) {
193-
let callback = node.getArgument(key);
193+
let callback;
194+
if (node.process_id === 'load_collection') {
195+
let properties = node.getArgument('properties');
196+
callback = properties[key];
197+
}
198+
else {
199+
callback = node.getArgument(key);
200+
}
194201
let parameters = callback.getCallbackParameters();
195202
await callback.execute(parameters);
196203
let fnName = this.var(`${key}${this.fnCounter++}`, 'fn_');
@@ -253,7 +260,7 @@ export default class Exporter extends ProcessGraph {
253260
return `${id}_`;
254261
}
255262
if (!id.match(/^[a-z_]\w*$/)) {
256-
return `${prefix}${id}`;
263+
return prefix + id.replace(/[^\w]+/g, '_');
257264
}
258265
else {
259266
return id;

0 commit comments

Comments
 (0)