Fix activity body display
This commit is contained in:
parent
178a408668
commit
bc0a10c0ef
|
|
@ -27,7 +27,7 @@ export interface ActivityPickedEventArgs {
|
|||
export interface ActivityDesignDisplayContext {
|
||||
activityModel: ActivityModel;
|
||||
activityIcon: any;
|
||||
bodyDisplay: any;
|
||||
bodyDisplay: string;
|
||||
outcomes: Array<string>;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,6 @@ export class CronPlugin implements ElsaPlugin {
|
|||
const props = activityModel.properties || [];
|
||||
const condition = props.find(x => x.name == 'CronExpression') || { name: 'CronExpression', expressions: {'Literal': ''}, syntax: 'Literal'};
|
||||
const expression = condition.expressions[condition.syntax] || '';
|
||||
context.bodyDisplay = <p>{expression}</p>;
|
||||
context.bodyDisplay = `<p>${expression}</p>`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import {ElsaPlugin} from "../services/elsa-plugin";
|
||||
import {eventBus} from '../services/event-bus';
|
||||
import {ActivityDesignDisplayContext, EventTypes} from "../models";
|
||||
import {ActivityDesignDisplayContext, EventTypes, SyntaxNames} from "../models";
|
||||
import {h} from "@stencil/core";
|
||||
|
||||
export class HttpEndpointPlugin implements ElsaPlugin {
|
||||
|
|
@ -15,7 +15,8 @@ export class HttpEndpointPlugin implements ElsaPlugin {
|
|||
return;
|
||||
|
||||
const props = activityModel.properties || [];
|
||||
const path = props.find(x => x.name == 'Path') || { name: 'Path', expressions: { 'Literal': '', syntax: 'Literal' } };
|
||||
context.bodyDisplay = <p>{path.expressions[path.syntax]}</p>;
|
||||
const path = props.find(x => x.name == 'Path') || { name: 'Path', expressions: { 'Literal': '', syntax: SyntaxNames.Literal } };
|
||||
const syntax = path.syntax || SyntaxNames.Literal;
|
||||
context.bodyDisplay = `<p>${path.expressions[syntax]}</p>`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,6 @@ export class IfPlugin implements ElsaPlugin {
|
|||
const expression = condition.expressions[condition.syntax] || '';
|
||||
const description = activityModel.description;
|
||||
const bodyText = description && description.length > 0 ? description : expression;
|
||||
context.bodyDisplay = <p>{bodyText}</p>;
|
||||
context.bodyDisplay = `<p>${bodyText}</p>`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,6 @@ export class SendEmailPlugin implements ElsaPlugin {
|
|||
const expression = to.expressions[to.syntax || SyntaxNames.Json] || '';
|
||||
const description = activityModel.description;
|
||||
const bodyText = description && description.length > 0 ? description : expression;
|
||||
context.bodyDisplay = <p>To: {bodyText}</p>;
|
||||
context.bodyDisplay = `<p>To: ${bodyText}</p>`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,6 @@ export class StartAtPlugin implements ElsaPlugin {
|
|||
const props = activityModel.properties || [];
|
||||
const condition = props.find(x => x.name == 'Instant') || { name: 'Instant', expressions: {'Literal': ''}, syntax: 'Literal'};
|
||||
const expression = condition.expressions[condition.syntax] || '';
|
||||
context.bodyDisplay = <p>{expression}</p>;
|
||||
context.bodyDisplay = `<p>${expression}</p>`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,6 @@ export class TimerPlugin implements ElsaPlugin {
|
|||
const props = activityModel.properties || [];
|
||||
const condition = props.find(x => x.name == 'Timeout') || { name: 'Timeout', expressions: {'Literal': ''}, syntax: 'Literal'};
|
||||
const expression = condition.expressions[condition.syntax] || '';
|
||||
context.bodyDisplay = <p>{expression}</p>;
|
||||
context.bodyDisplay = `<p>${expression}</p>`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,6 @@ export class WhilePlugin implements ElsaPlugin {
|
|||
const expression = condition.expressions[condition.syntax] || '';
|
||||
const description = activityModel.description;
|
||||
const bodyText = description && description.length > 0 ? description : expression;
|
||||
context.bodyDisplay = <p>{bodyText}</p>;
|
||||
context.bodyDisplay = `<p>${bodyText}</p>`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,6 @@ export class WriteLinePlugin implements ElsaPlugin {
|
|||
const props = activityModel.properties || [];
|
||||
const condition = props.find(x => x.name == 'Text') || { name: 'Text', expressions: {'Literal': ''}, syntax: SyntaxNames.Literal };
|
||||
const expression = condition.expressions[condition.syntax || 'Literal'] || '';
|
||||
context.bodyDisplay = <p>{expression}</p>;
|
||||
context.bodyDisplay = `<p>${expression}</p>`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue