diff --git a/src/app/dashboard/dashboard.component.scss b/src/app/dashboard/dashboard.component.scss index 421c749..a3d76e8 100644 --- a/src/app/dashboard/dashboard.component.scss +++ b/src/app/dashboard/dashboard.component.scss @@ -57,7 +57,7 @@ .tfw-messages { // Check whether the layout contains a web component div[class*="web"] & { - border: 2px solid $tao-base-color; + border: 2px solid $tao-base-color; border-top: 0; border-left: 0; border-bottom: 0; diff --git a/src/app/message-types/bot-messages.ts b/src/app/message-types/bot-messages.ts index 1defaf4..484e512 100644 --- a/src/app/message-types/bot-messages.ts +++ b/src/app/message-types/bot-messages.ts @@ -1,17 +1,15 @@ import { WebSocketMessage } from './websocket-message'; +export type MessageButton = 'yes' | 'no' | 'fix' | 'hint' | 'solution' | 'next'; +export type MessageButtonMap = Record; + export interface MessageData { originator?: string; timestamp?: Date; typing?: boolean; - buttons?: Array<'yes'|'no'|'solution'|'hint'|'fix'>; + buttons?: MessageButton[]; command?: any; message: string; } -export interface MessageButton { - [Key: string]: string; -} - - export interface Message extends MessageData, WebSocketMessage {} diff --git a/src/app/messages/messages.component.html b/src/app/messages/messages.component.html index 278e6e2..70ffe8a 100644 --- a/src/app/messages/messages.component.html +++ b/src/app/messages/messages.component.html @@ -15,7 +15,7 @@ diff --git a/src/app/messages/messages.component.scss b/src/app/messages/messages.component.scss index 608a97a..6c01006 100644 --- a/src/app/messages/messages.component.scss +++ b/src/app/messages/messages.component.scss @@ -12,7 +12,7 @@ padding: $hair; border-radius: $tao-panel-border-radius-sm; font-size: $font-size-base; - margin-bottom: 8px; + margin-bottom: $hair; animation-name: inflate; animation-duration: 0.5s; @@ -131,6 +131,7 @@ .tfw-grid-message-body { @include word-break(); + line-height: 26px; & p { margin-bottom: $tiny !important; diff --git a/src/app/messages/messages.component.ts b/src/app/messages/messages.component.ts index f1a3b7e..86cb161 100644 --- a/src/app/messages/messages.component.ts +++ b/src/app/messages/messages.component.ts @@ -1,5 +1,5 @@ import { ChangeDetectorRef, Component, OnInit, EventEmitter, Output, ElementRef } from '@angular/core'; -import { MessageData, Message, MessageButton } from '../message-types/bot-messages'; +import {MessageData, Message, MessageButton, MessageButtonMap} from '../message-types/bot-messages'; import { MarkdownService } from '../services/markdown.service'; import { WebSocketService } from '../services/websocket.service'; import { Subject } from 'rxjs'; @@ -14,13 +14,13 @@ export class MessagesComponent implements OnInit { newMessage: Subject = new Subject(); showTypingIndicator = false; messages: MessageData[] = []; - buttons: MessageButton = { - 'yes' : 'Yes', - 'no' : 'No', - 'fix' : 'Ready to fix', - 'solution' : 'Show solution', - 'hint' : 'Hint', - 'next' : 'Next', + buttonMap: MessageButtonMap = { + fix: {caption: 'Ready to fix'}, + solution: {caption: 'Show solution'}, + hint: {caption: 'Hint'}, + next: {caption: 'Next'}, + yes: {caption: 'Yes'}, + no: {caption: 'No'}, }; constructor(