fixes propertyDescriptor is potentially undefined (#1649)
This commit is contained in:
parent
3986d9294c
commit
e7743144fe
|
|
@ -110,7 +110,7 @@ export class ElsaWorkflowBlueprintViewerScreen {
|
|||
const activityDescriptor = activityDescriptors.find(x => x.type == source.type);
|
||||
const properties: Array<ActivityDefinitionProperty> = collection.map(source.inputProperties.data, (value, key) => {
|
||||
const propertyDescriptor = activityDescriptor.inputProperties.find(x => x.name == key);
|
||||
const defaultSyntax = propertyDescriptor.defaultSyntax || SyntaxNames.Literal;
|
||||
const defaultSyntax = propertyDescriptor?.defaultSyntax || SyntaxNames.Literal;
|
||||
const expressions = {};
|
||||
expressions[defaultSyntax] = value;
|
||||
return ({name: key, expressions: expressions, syntax: defaultSyntax});
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ export class ElsaWorkflowInstanceViewerScreen {
|
|||
|
||||
const properties: Array<ActivityDefinitionProperty> = collection.map(activityBlueprint.inputProperties.data, (value, key) => {
|
||||
const propertyDescriptor = activityDescriptor.inputProperties.find(x => x.name == key) || activityDescriptor.outputProperties.find(x => x.name == key);
|
||||
const defaultSyntax = propertyDescriptor.defaultSyntax || SyntaxNames.Literal;
|
||||
const defaultSyntax = propertyDescriptor?.defaultSyntax || SyntaxNames.Literal;
|
||||
const expressions = {};
|
||||
const v = activityData[key] || value;
|
||||
expressions[defaultSyntax] = v;
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@
|
|||
const propertyEditor = document.createElement('elsa-property-editor');
|
||||
const propertyDescriptor = activityDescriptor.inputProperties.find(x => x.name === 'Text');
|
||||
const propertyModel = getOrCreateProperty(activityModel, propertyDescriptor.name);
|
||||
const defaultSyntax = propertyDescriptor.defaultSyntax || 'Literal';
|
||||
const defaultSyntax = propertyDescriptor?.defaultSyntax || 'Literal';
|
||||
const currentValue = propertyModel.expressions[defaultSyntax] || '';
|
||||
const editorHtml = `<textarea class="focus:elsa-ring-blue-500 focus:elsa-border-blue-500 elsa-block elsa-w-full elsa-min-w-0 elsa-rounded-md sm:elsa-text-sm elsa-border-gray-300" rows="5">${currentValue}</textarea>`;
|
||||
const editorElement = htmlToElement(editorHtml);
|
||||
|
|
|
|||
Loading…
Reference in a new issue