</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="functionRadioInline" name="functionRadioInline"
+ [checked]="!currentFuncion['inputs']['artifact-prefix-names']?.get_input"
+ (click)="setArtifact(true)"
class="custom-control-input">
<label class="custom-control-label" for="functionRadioInline">Pre-defined
Template</label>
this.toNodeProcess(this.designerState.template.node_templates[this.functionName], this.functionName);
const type = this.designerState.template.node_templates[this.functionName].type;
this.getNodeType(type);
+ this.onInitMapping();
}
});
});
});
+ }
+
+ onInitMapping() {
+ // selectedTemplates , templateAndMappingMap
+ this.selectedTemplates = new Map<string, TemplateAndMapping>();
+ try {
+ const functionMap = this.designerState.template.node_templates[this.functionName].artifacts;
+ console.log(this.templateAndMappingMap);
+
+ Object.keys(functionMap).forEach((file) => {
+ const filename = file.substring(0, file.lastIndexOf('-'));
+ console.log(filename);
+ if (this.templateAndMappingMap.has(filename)) {
+ this.selectedTemplates.set(filename, this.templateAndMappingMap.get(filename));
+ }
+ });
+
+ } catch (e) { }
}
toNodeProcess(nodeTemplate, functionName) {
this.selectedTemplates.forEach((value, key) => {
console.log(key);
console.log(value);
+ console.log(finalFunctionData.inputs['artifact-prefix-names']);
+
+ if (Array.isArray(finalFunctionData.inputs['artifact-prefix-names'])) {
+ finalFunctionData.inputs['artifact-prefix-names'].push(key);
+ }
if (value.isMapping) {
this.nodeTemplates.artifacts[key + '-mapping'] = {
addTemplates() { }
setArtifact(predefined: boolean) {
if (predefined) {
-
+ this.currentFuncion.inputs['artifact-prefix-names'] = [];
} else {
this.currentFuncion.inputs['artifact-prefix-names'] = { get_input: 'template-prefix' };
}