Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
valueText -> valueData migration
Browse files Browse the repository at this point in the history
debounce wrapper utility method
refreshed autogen
new filer APIs
runFunction fix
CRUD operations added to IM vocab
  • Loading branch information
Richard Collier committed Aug 26, 2022
1 parent 587f158 commit a00ef2c
Show file tree
Hide file tree
Showing 7 changed files with 239 additions and 177 deletions.
4 changes: 3 additions & 1 deletion src/helpers/Helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import TypeGuards from "./modules/TypeGuards";
import EntityValidator from "./modules/EntityValidator";
import EclSearchBuilderMethods from "./modules/EclSearchBuilderMethods.ts";
import QueryBuilderMethods from "./modules/QueryBuilderMethods";
import UtililityMethods from "./modules/UtilityMethods"

export default {
ChartRescale,
Expand All @@ -31,5 +32,6 @@ export default {
TypeGuards,
EntityValidator,
EclSearchBuilderMethods,
QueryBuilderMethods
QueryBuilderMethods,
UtililityMethods
};
14 changes: 9 additions & 5 deletions src/helpers/modules/EditorMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ export function processArguments(property: PropertyShape, valueVariableMap?: Map
property.argument.forEach(arg => {
let key = "";
let value: any;
if (arg.parameter === "this" && !arg.valueIri) key = property.path["@id"];
else key = arg.parameter;
if (arg.valueIri) value = arg.valueIri["@id"];
if (arg.parameter === "this" && !arg.valueIri)
key = property.path["@id"];
else
key = arg.parameter;
if (arg.valueIri)
value = arg.valueIri["@id"];
else if (arg.valueVariable) {
if (!valueVariableMap) throw new Error("missing valueVariableMap while processing arguments with a valueProperty");
if (!valueVariableMap)
throw new Error("missing valueVariableMap while processing arguments with a valueProperty");
if (property.builderChild && valueVariableMap && valueVariableMap.has(arg.valueVariable + property.order)) {
value = valueVariableMap.get(arg.valueVariable + property.order);
} else {
value = valueVariableMap.get(arg.valueVariable);
}
} else if (arg.valueText) value = arg.valueText;
} else if (arg.valueData) value = arg.valueData;
result.set(key, value);
});
return result;
Expand Down
11 changes: 11 additions & 0 deletions src/helpers/modules/UtilityMethods.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export function debounce(fn: Function, ms = 300) {
let timeoutId: ReturnType<typeof setTimeout>;
return function (this: any, ...args: any[]) {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => fn.apply(this, args), ms);
}
}

export default {
debounce
}
Loading

0 comments on commit a00ef2c

Please sign in to comment.