Render step name in workflow editor

[MAILPOET-4445]
This commit is contained in:
David Remer
2022-08-10 08:54:36 +03:00
committed by Veljko V
parent 4a19e4db46
commit b5690f3d6c
2 changed files with 7 additions and 3 deletions

View File

@ -33,11 +33,14 @@ function getIcon(step: StepData): JSX.Element | null {
function getTitle(step: StepData): string {
// mocked data
if (step.type === 'trigger') {
return 'Trigger';
if (step.key === 'mailpoet:segment:subscribed') {
return 'Subscribed to segment';
}
if (step.name) {
return step.name;
}
const selectedStepType = select(store).getStepType(step.key);
return selectedStepType ? selectedStepType.title : '';
return selectedStepType.title;
}
function getSubtitle(step: StepData): JSX.Element | string {

View File

@ -1,6 +1,7 @@
export type Step = {
id: string;
type: 'trigger' | 'action';
name: string | null;
key: string;
next_step_id?: string;
args: Record<string, unknown>;