Skip to content

Commit

Permalink
Merge pull request #380 from Beulah-Matt/issue#355/ft-moveEndBlockToB…
Browse files Browse the repository at this point in the history
…lockList

🎨 Move End Block to Block List #355
  • Loading branch information
ReaganCn committed Mar 28, 2023
2 parents e3fe179 + 33f9868 commit fbee8c2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion apps/conv-learning-manager/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
"KEYWORD-JUMP": "Keyword Jump",
"WEBHOOK": "Webhook",
"FAILBLOCK": "Fail Block",
"JUMP":"Jump"
"JUMP":"Jump",
"END-BLOCK":"End Block"
},
"PLACEHOLDER": {
"ANCHOR": "Start here",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div [id]="endAnchorId" class="anchor"> {{'PAGE-CONTENT.BLOCK.PLACEHOLDER.END-ANCHOR' | transloco}}</div>
<div [id]="id" class="anchor"> {{'PAGE-CONTENT.BLOCK.PLACEHOLDER.END-ANCHOR' | transloco}}</div>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class EndAnchorComponent implements OnInit {

private _decorateInput()
{
let input = document.getElementById(this.endAnchorId) as Element;
let input = document.getElementById(this.id) as Element;
if (this.jsPlumb)
{
input = _JsPlumbTargetLeftComponentDecorator(input, this.jsPlumb);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const iconsAndTitles: any = {
icon: 'fas fa-bullseye',
},
9999: {
title: '',
icon: '',
title: 'PAGE-CONTENT.BLOCK.TITLES.END-BLOCK',
icon: 'fas fa-stop',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
TextMessageBlock, EmailMessageBlock, PhoneMessageBlock, DocumentMessageBlock, StickerMessageBlock,
VoiceMessageBlock, VideoMessageBlock, ListMessageBlock, JumpBlock, MultipleInputMessageBlock, FailBlock,
ImageInputBlock, LocationInputBlock, AudioInputBlock, VideoInputBlock, WebhookBlock, OpenEndedQuestionBlock,
KeywordMessageBlock, MultiContentInputBlock
KeywordMessageBlock, MultiContentInputBlock, EndStoryAnchorBlock
} from '@app/model/convs-mgr/stories/blocks/messaging';

import { StoryEditorFrame } from '../../model/story-editor-frame.model';
Expand All @@ -37,6 +37,7 @@ export class BlocksLibraryComponent implements OnInit, OnDestroy {
blockTemplates: StoryBlock[] = [
{ id: 'input-message-block', type: StoryBlockTypes.TextMessage, message: 'Message', blockIcon: this.getBlockIcon(StoryBlockTypes.TextMessage) } as TextMessageBlock,
// { id: 'io-questions-block', type: StoryBlockTypes.Input, message: 'Input', blockIcon: this.getBlockIcon(StoryBlockTypes.Input) } as QuestionMessageBlock,
{ id: 'story-end-anchor', type:StoryBlockTypes.EndStoryAnchorBlock, message: 'End Story', blockIcon:this.getBlockIcon(StoryBlockTypes.EndStoryAnchorBlock)} as EndStoryAnchorBlock,
// { id: 'io-block', type: StoryBlockTypes.IO, message: 'IO', blockIcon: this.getBlockIcon(StoryBlockTypes.IO) } as QuestionMessageBlock,
{ id: 'input-location-block', type: StoryBlockTypes.Location, message: 'Location', blockIcon: this.getBlockIcon(StoryBlockTypes.Location) } as LocationMessageBlock,
{ id: 'input-image-block', type: StoryBlockTypes.Image, message: 'Image', blockIcon: this.getBlockIcon(StoryBlockTypes.Image) } as ImageMessageBlock,
Expand All @@ -62,7 +63,8 @@ export class BlocksLibraryComponent implements OnInit, OnDestroy {
{ id: 'webhook-block' , type: StoryBlockTypes.WebhookBlock, message: 'Webhook', blockIcon:this.getBlockIcon(StoryBlockTypes.WebhookBlock) } as WebhookBlock,
{ id: 'open-ended-question-block', type:StoryBlockTypes.OpenEndedQuestion, message: 'Open Ended Question', blockIcon:this.getBlockIcon(StoryBlockTypes.OpenEndedQuestion) } as OpenEndedQuestionBlock,
{ id: 'multi-content-input' , type:StoryBlockTypes.MultiContentInput, message:'Multi Content Input', blockIcon:this.getBlockIcon(StoryBlockTypes.MultiContentInput) } as MultiContentInputBlock,
{ id: 'keyword-jump-block', type:StoryBlockTypes.keyword, message: 'Keyword Jump', blockIcon:this.getBlockIcon(StoryBlockTypes.keyword) } as KeywordMessageBlock
{ id: 'keyword-jump-block', type:StoryBlockTypes.keyword, message: 'Keyword Jump', blockIcon:this.getBlockIcon(StoryBlockTypes.keyword) } as KeywordMessageBlock,
{ id: 'end-anchor-block', type:StoryBlockTypes.EndStoryAnchorBlock, message: 'End Story', blockIcon:this.getBlockIcon(StoryBlockTypes.EndStoryAnchorBlock)} as EndStoryAnchorBlock
];
blockTemplate$: Observable<StoryBlock[]> = of(this.blockTemplates);
constructor(private _logger: Logger) { }
Expand All @@ -75,6 +77,9 @@ export class BlocksLibraryComponent implements OnInit, OnDestroy {
}
addBlock(type: number) {
switch (type) {
case StoryBlockTypes.EndStoryAnchorBlock:
this.frame.newBlock(StoryBlockTypes.EndStoryAnchorBlock);
break;
case StoryBlockTypes.TextMessage:
this.frame.newBlock(StoryBlockTypes.TextMessage);
break;
Expand Down

0 comments on commit fbee8c2

Please sign in to comment.