@chat21/chat21-ionic 3.0.75 → 3.0.76-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/deploy_amazon_beta.sh +1 -1
  3. package/package.json +1 -1
  4. package/src/app/app.component.ts +1 -1
  5. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +1 -1
  6. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +22 -8
  7. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +9 -9
  8. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +9 -2
  9. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +5 -6
  10. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +12 -5
  11. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +5 -13
  12. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +4 -9
  13. package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +8 -3
  14. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +2 -2
  15. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +6 -1
  16. package/src/app/components/canned-response/canned-response.component.html +26 -0
  17. package/src/app/components/canned-response/canned-response.component.scss +141 -0
  18. package/src/app/components/canned-response/canned-response.component.spec.ts +24 -0
  19. package/src/app/components/canned-response/canned-response.component.ts +281 -0
  20. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +0 -2
  21. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +10 -9
  22. package/src/app/pages/conversation-detail/conversation-detail.module.ts +2 -0
  23. package/src/app/pages/conversation-detail/conversation-detail.page.html +42 -13
  24. package/src/app/pages/conversation-detail/conversation-detail.page.scss +16 -21
  25. package/src/app/pages/conversation-detail/conversation-detail.page.ts +111 -329
  26. package/src/app/pages/conversations-list/conversations-list.page.ts +28 -2
  27. package/src/app/pages/loader-preview/loader-preview.page.ts +8 -27
  28. package/src/app/services/canned-responses/canned-responses.service.ts +43 -7
  29. package/src/app/utils/scrollbar-theme.directive.ts +2 -1
  30. package/src/assets/i18n/ar.json +2 -0
  31. package/src/assets/i18n/az.json +2 -0
  32. package/src/assets/i18n/de.json +2 -0
  33. package/src/assets/i18n/en.json +2 -0
  34. package/src/assets/i18n/es.json +2 -0
  35. package/src/assets/i18n/fr.json +2 -0
  36. package/src/assets/i18n/it.json +2 -0
  37. package/src/assets/i18n/kk.json +2 -0
  38. package/src/assets/i18n/pt.json +2 -0
  39. package/src/assets/i18n/ru.json +2 -0
  40. package/src/assets/i18n/sr.json +2 -0
  41. package/src/assets/i18n/sv.json +2 -0
  42. package/src/assets/i18n/tr.json +2 -0
  43. package/src/assets/i18n/uk.json +2 -0
  44. package/src/assets/i18n/uz.json +2 -0
  45. package/src/chat-config-pre.json +1 -1
  46. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +14 -4
  47. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +1 -1
  48. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +22 -0
  49. package/src/chat21-core/utils/constants.ts +3 -1
  50. package/src/chat21-core/utils/utils.ts +14 -0
  51. package/src/global.scss +3 -113
package/CHANGELOG.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
- ### 3.0.75 in PROD
3
+ ### 3.0.76-rc.2
4
+ - added: canned component to manage canned responses
5
+ - bug-fixed: if more than oe '/' is present in message-text-area and a canned is selected, replace canned text on the last '/' character in the message string
6
+ - bug-fixed: close canned component if user click again on canned-icon-button
7
+
8
+ ### 3.0.76-rc.1
9
+ - changed: senderFullName in list conversation for guest users with guest#uuid[0..5]
10
+ - added: multi-language to MEMBER_LEFT_GROUP and LEAD_UPDATED info messages
11
+ - added: onElementRendered event to image/frame/mesagge-attachment to scroll content after element is rendered
12
+ - added: enabled possibility to edit or delete a canned response created by yourself
13
+ - added: disable footer component of an archived conversation if it's been more than 10 days
14
+ - removed: scrollBar from conversation-detail page
15
+
16
+ ## 3.0.75 in PROD
4
17
 
5
18
  ### 3.0.75-rc.2
6
19
  - bug-fixed: unserved request count not updated correctly after a request is assigned
@@ -12,7 +12,7 @@ sed -i -e "s/$URL_VER/g" src/utils/constants.ts
12
12
 
13
13
  ionic cordova platform add browser --save
14
14
  #ionic cordova build browser --prod --release
15
- ionic cordova build --env=pre browser #--prod --verbose
15
+ ionic cordova build --env=pre browser #--prod --verbose
16
16
 
17
17
  cp -p src/firebase-messaging-sw.js platforms/browser/www/
18
18
  cp -p src/manifest.json platforms/browser/www/
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
3
  "author": "Tiledesk SRL",
4
- "version": "3.0.75",
4
+ "version": "3.0.76-rc.2",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -798,7 +798,7 @@ export class AppComponent implements OnInit {
798
798
  pageUrl += IDConv + '/' + FullNameConv + '/' + Convtype
799
799
  }
800
800
  // replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
801
- this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'));
801
+ this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29').replace( /#/g, "%23" ));
802
802
 
803
803
 
804
804
  // const DASHBOARD_URL = this.appConfigProvider.getConfig().DASHBOARD_URL;
@@ -1,4 +1,4 @@
1
- <div class="c21-body" (click)="hideMenuOption()">
1
+ <div class="c21-body" (click)="hideOutsideElements()">
2
2
 
3
3
  <div class="c21-body-container">
4
4
 
@@ -256,36 +256,50 @@ export class ConversationContentComponent implements OnInit {
256
256
  return false;
257
257
  }
258
258
 
259
- hideMenuOption() {
259
+ isSameSender(senderId, index):boolean{
260
+ if(senderId && this.messages[index - 1] && (senderId === this.messages[index - 1].sender)){
261
+ return true;
262
+ }
263
+ return false;
264
+ }
265
+
266
+ isFirstMessage(senderId, index):boolean{
267
+ if(senderId && index == 0 && this.messages[index] && (this.messages[index] !== senderId)){
268
+ return true;
269
+ }
270
+ return false;
271
+ }
272
+
273
+ hideOutsideElements() {
260
274
  this.onMenuOptionShow.emit(false)
261
275
  }
262
276
 
263
277
 
264
278
  // ========= begin:: event emitter function ============//
265
279
 
266
- returnOnAttachmentButtonClicked(event: any) {
280
+ onAttachmentButtonClickedFN(event: any) {
267
281
  this.onAttachmentButtonClicked.emit(event)
268
282
  }
269
283
 
270
- returnOnBeforeMessageRender(event) {
284
+ onBeforeMessageRenderFN(event) {
271
285
  //decommentare se in html c'è solamente component tiledesk-text
272
286
  //const messageOBJ = { message: this.message, sanitizer: this.sanitizer, messageEl: event.messageEl, component: event.component}
273
287
  this.onBeforeMessageRender.emit(event)
274
288
  }
275
289
 
276
- returnOnAfterMessageRender(event) {
290
+ onAfterMessageRenderFN(event) {
277
291
  this.onAfterMessageRender.emit(event)
278
292
  }
279
293
 
280
- onImageRenderedFN(event) {
281
- const imageRendered = event;
282
- if (imageRendered && this.scrollMe) {
294
+ onElementRenderedFN(event) {
295
+ const elementRendered = event;
296
+ if (elementRendered.status && this.scrollMe) {
283
297
  const divScrollMe = this.scrollMe.nativeElement;
284
298
  const checkContentScrollPosition = this.checkContentScrollPosition(divScrollMe);
285
299
  this.scrollToBottom() // SCROLLO SEMPRE
286
300
  // if (!checkContentScrollPosition) { // SE NON SONO ALLA FINE, SCROLLO CONTENT
287
301
  // }
288
-
302
+
289
303
  }
290
304
  }
291
305
 
@@ -87,9 +87,9 @@
87
87
  [addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText"
88
88
  [areVisibleCAR]="areVisibleCAR"
89
89
  [supportMode]="supportMode"
90
- (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
91
- (onAfterMessageRender)="returnOnAfterMessageRender($event)"
92
- (onImageRendered)="onImageRenderedFN($event)">
90
+ (onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
91
+ (onAfterMessageRender)="onAfterMessageRenderFN($event)"
92
+ (onElementRendered)="onElementRenderedFN($event)">
93
93
  </chat-bubble-message>
94
94
 
95
95
  <!-- icon status message -->
@@ -102,7 +102,7 @@
102
102
  </div>
103
103
 
104
104
  <!-- message RECIPIENT:: -->
105
- <div role="messaggio" *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && isChannelTypeGroup(channelType)"
105
+ <div role="messaggio" *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && isChannelTypeGroup(channelType) && !isSameSender(message?.sender, i)"
106
106
  class="message_sender_fullname">
107
107
  {{message.sender_fullname}}
108
108
  </div>
@@ -126,10 +126,9 @@
126
126
  [addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText"
127
127
  [areVisibleCAR]="areVisibleCAR"
128
128
  [supportMode]="supportMode"
129
- (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
130
- (onAfterMessageRender)="returnOnAfterMessageRender($event)"
131
- (onImageRendered)="onImageRenderedFN($event)"
132
- >
129
+ (onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
130
+ (onAfterMessageRender)="onAfterMessageRenderFN($event)"
131
+ (onElementRendered)="onElementRenderedFN($event)">
133
132
  </chat-bubble-message>
134
133
  </div>
135
134
 
@@ -139,7 +138,8 @@
139
138
  [message]="message"
140
139
  [isLastMessage]="isLastMessage(message?.uid)"
141
140
  [stylesMap]="stylesMap"
142
- (onAttachmentButtonClicked)="returnOnAttachmentButtonClicked($event)">
141
+ (onElementRendered)="onElementRenderedFN($event)"
142
+ (onAttachmentButtonClicked)="onAttachmentButtonClickedFN($event)">
143
143
  </chat-message-attachment>
144
144
  </div>
145
145
  </div>
@@ -245,15 +245,22 @@ ion-item {
245
245
  // left: -26px;
246
246
  }
247
247
 
248
- :host .base_receive .msg_receive ::ng-deep div > div > ion-button {
248
+ :host .base_receive .msg_receive ::ng-deep div > div > div > ion-button.canned {
249
249
  display: none;
250
250
  position: absolute;
251
251
  top: -3px;
252
252
  right: -31px;
253
253
  }
254
254
 
255
+ :host .base_receive .msg_receive ::ng-deep div > div > div >ion-button.emoji {
256
+ display: none;
257
+ position: absolute;
258
+ top: -3px;
259
+ right: -51px;
260
+ }
261
+
255
262
  // :host .base_receive .msg_receive:hover ::ng-deep div > div > ion-button {
256
- :host .base_receive:hover .msg_receive ::ng-deep div > div > ion-button {
263
+ :host .base_receive:hover .msg_receive ::ng-deep div > div > div > ion-button {
257
264
  display: block;
258
265
  // position: absolute;
259
266
  // top: -11px;
@@ -24,7 +24,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
24
24
  @Input() channelType: string;
25
25
  @Input() areVisibleCAR: boolean;
26
26
  @Input() supportMode: boolean;
27
- @Output() onImageRendered = new EventEmitter<boolean>()
27
+ @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
28
28
  @Output() onAddUploadingBubble = new EventEmitter<boolean>();
29
29
 
30
30
  public public_Key: any
@@ -94,8 +94,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
94
94
  // this.translate.getTranslation(chat_lang).subscribe((labels: string) => {
95
95
  // console.log('[CONVS-DETAIL] translations: ', labels);
96
96
  // });
97
- this.translate.get('AddAsCannedResponse')
98
- .subscribe((text: string) => {
97
+ this.translate.get('AddAsCannedResponse').subscribe((text: string) => {
99
98
  // console.log('[CONVS-DETAIL] AddAsCannedResponse translated: ', text);
100
99
  this.addAsCannedResponseTooltipText = text
101
100
  })
@@ -132,9 +131,9 @@ export class IonConversationDetailComponent extends ConversationContentComponent
132
131
  this.onAddUploadingBubble.emit(value);
133
132
  }
134
133
 
135
- onImageRenderedFN(event) {
136
- this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - onImageRenderedFN:::ionic', event)
137
- this.onImageRendered.emit(event)
134
+ onElementRenderedFN(event) {
135
+ this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - onElementRenderedFN:::ionic', event)
136
+ this.onElementRendered.emit(event)
138
137
  }
139
138
 
140
139
  /**
@@ -3,7 +3,7 @@
3
3
  <!-- isImage >{{isImage(message) }} message.metadata.width {{message?.metadata?.width }} -->
4
4
  <div id="bubble-message"
5
5
  [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px', 'width': (isImage(message) || isFrame(message))? sizeImage?.width + 'px' : null }"
6
- class="messages primary-color" [class.emoticon]="message?.emoticon">
6
+ class="messages primary-color">
7
7
 
8
8
 
9
9
  <div>
@@ -22,7 +22,7 @@
22
22
  [metadata]="message.metadata"
23
23
  [width]="sizeImage?.width"
24
24
  [height]="sizeImage?.height"
25
- (onImageRendered)="onImageRenderedFN($event)">
25
+ (onElementRendered)="onElementRenderedFN($event)">
26
26
  </chat-image>
27
27
 
28
28
  <!-- [width]="getMetadataSize(message.metadata).width" -->
@@ -30,7 +30,8 @@
30
30
  <chat-frame *ngIf="isFrame(message)"
31
31
  [metadata]="message.metadata"
32
32
  [width]="message.metadata.width"
33
- [height]="message.metadata.height">
33
+ [height]="message.metadata.height"
34
+ (onElementRendered)="onElementRenderedFN($event)">
34
35
  </chat-frame>
35
36
 
36
37
  <!-- <chat-frame *ngIf="message.metadata && message.metadata.type && message.metadata.type.includes('video')"
@@ -51,7 +52,6 @@
51
52
  [text]="message?.text"
52
53
  [color]="textColor"
53
54
  [message]="message"
54
- [class.chat-text-emoticon]="message?.emoticon"
55
55
  (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
56
56
  (onAfterMessageRender)="returnOnAfterMessageRender($event)">
57
57
  </chat-text>
@@ -61,12 +61,19 @@
61
61
  </chat-html>
62
62
 
63
63
  <ng-container *ngIf="areVisibleCAR && supportMode">
64
- <ion-button shape="round" size="small" class="btn-add-msg-as-canned-response" ion-button fill="clear"
64
+ <ion-button shape="round" size="small" class="btn-add-msg canned" ion-button fill="clear"
65
65
  (click)="presentCreateCannedResponseModal()" tooltip="{{addAsCannedResponseTooltipText}}"
66
66
  [options]="tooltipOptions" placement="bottom">
67
67
  <ion-icon slot="icon-only" name="flash-outline" style="font-size: 1em;"> </ion-icon>
68
68
  </ion-button>
69
69
  </ng-container>
70
+ <!-- <ng-container *ngIf="supportMode">
71
+ <ion-button shape="round" size="small" class="btn-add-msg emoji" ion-button fill="clear"
72
+ (click)="presentEmojiiModal()" tooltip="{{addAsCannedResponseTooltipText}}"
73
+ [options]="tooltipOptions" placement="bottom">
74
+ <ion-icon slot="icon-only" name="happy-outline" style="font-size: 1em;"> </ion-icon>
75
+ </ion-button>
76
+ </ng-container> -->
70
77
  </div>
71
78
  </div>
72
79
 
@@ -46,26 +46,18 @@
46
46
  }
47
47
  }
48
48
 
49
- // &:hover .message-date{
50
- // display: flex;
51
- // }
52
-
53
- // .message-date {
54
- // display: none;
55
- // }
56
49
  }
57
50
  // > .button-native
58
- .btn-add-msg-as-canned-response {
59
- // padding-left: 5px ;
60
- // padding-right: 5px ;
51
+ .btn-add-msg {
61
52
  border-radius: 50%;
62
53
  --padding-end: 7px;
63
54
  --padding-start: 7px;
64
55
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.6);
56
+
57
+ ion-icon{
58
+ font-size: 1.2em;
59
+ }
65
60
  }
66
61
 
67
- // .emoticon {
68
- // padding: 35px 0px !important;
69
- // }
70
62
 
71
63
 
@@ -23,7 +23,7 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
23
23
  @Input() supportMode: boolean;
24
24
  @Output() onBeforeMessageRender = new EventEmitter();
25
25
  @Output() onAfterMessageRender = new EventEmitter();
26
- @Output() onImageRendered = new EventEmitter<boolean>()
26
+ @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
27
27
  isImage = isImage;
28
28
  isFile = isFile;
29
29
  isFrame = isFrame;
@@ -53,7 +53,7 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
53
53
  }
54
54
 
55
55
  ngOnInit() {
56
- this.setMomentLocale()
56
+ // this.setMomentLocale()
57
57
  }
58
58
 
59
59
 
@@ -140,14 +140,9 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
140
140
  sizeImage.width = MAX_WIDTH_IMAGES;
141
141
  sizeImage.height = MAX_WIDTH_IMAGES / ratio;
142
142
  }
143
- // metadata.width = sizeImage.width
144
- // metadata.height = sizeImage.height
145
143
  return sizeImage
146
144
  }
147
145
 
148
-
149
-
150
-
151
146
  /**
152
147
  * function customize tooltip
153
148
  */
@@ -195,8 +190,8 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
195
190
  this.onAfterMessageRender.emit(messageOBJ)
196
191
  }
197
192
 
198
- onImageRenderedFN(event) {
199
- this.onImageRendered.emit(event)
193
+ onElementRenderedFN(event){
194
+ this.onElementRendered.emit({element: event.element, status: event.status})
200
195
  }
201
196
 
202
197
  async presentCreateCannedResponseModal(): Promise<any> {
@@ -1,5 +1,5 @@
1
1
  import { DomSanitizer } from '@angular/platform-browser';
2
- import { Component, Input, OnInit } from '@angular/core';
2
+ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
3
3
 
4
4
  @Component({
5
5
  selector: 'chat-frame',
@@ -11,8 +11,10 @@ export class FrameComponent implements OnInit {
11
11
  @Input() metadata: any;
12
12
  @Input() width: string;
13
13
  @Input() height: string;
14
+ @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
14
15
 
15
16
  url: any;
17
+ loading: boolean = true
16
18
  constructor(private sanitizer: DomSanitizer) { }
17
19
 
18
20
  ngOnInit() {
@@ -23,11 +25,14 @@ export class FrameComponent implements OnInit {
23
25
  // this.height = this.getSizeImg(this.metadata).height;
24
26
  }
25
27
 
26
-
27
-
28
28
  ngOnDestroy(){
29
29
  this.url = null;
30
30
  }
31
31
 
32
+ onLoaded(event){
33
+ this.loading = false
34
+ this.onElementRendered.emit({element: "image", status:true})
35
+ }
36
+
32
37
 
33
38
  }
@@ -10,7 +10,7 @@ export class ImageComponent implements OnInit {
10
10
  @Input() metadata: any;
11
11
  @Input() width: string;
12
12
  @Input() height: number;
13
- @Output() onImageRendered = new EventEmitter<boolean>();
13
+ @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
14
14
 
15
15
  loading: boolean = true
16
16
  tooltipMessage: string;
@@ -44,7 +44,7 @@ export class ImageComponent implements OnInit {
44
44
 
45
45
  onLoaded(event) {
46
46
  this.loading = false
47
- this.onImageRendered.emit(true)
47
+ this.onElementRendered.emit({element: "image", status:true})
48
48
  }
49
49
 
50
50
  _downloadImage(url: string, fileName: string) {
@@ -11,10 +11,11 @@ import { MessageModel } from 'src/chat21-core/models/message';
11
11
  export class MessageAttachmentComponent implements OnInit {
12
12
 
13
13
  // ========= begin:: Input/Output values ============//
14
- @Output() onAttachmentButtonClicked = new EventEmitter<any>();
15
14
  @Input() message: MessageModel;
16
15
  @Input() isLastMessage: boolean;
17
16
  @Input() stylesMap: Map<string, string>;
17
+ @Output() onAttachmentButtonClicked = new EventEmitter<any>();
18
+ @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>()
18
19
  // ========= end:: Input/Output values ============//
19
20
 
20
21
  public type: string;
@@ -45,6 +46,10 @@ export class MessageAttachmentComponent implements OnInit {
45
46
  }
46
47
  }
47
48
 
49
+ ngAfterViewInit(){
50
+ this.onElementRendered.emit({element: 'attachment', status: true})
51
+ }
52
+
48
53
  returnOnAttachmentButtonClicked(event: any){
49
54
  if ( event && event.target ) {
50
55
  const ev = {target: event.target, message: this.message, currentTarget: this }
@@ -0,0 +1,26 @@
1
+ <div id="canned">
2
+ <ion-list class="canned-list" *ngIf="tagsCannedFilter.length > 0">
3
+ <ion-item button="true" [ngClass]="{'is_active_item': i == arrowkeyLocation}" lines="none"
4
+ class="canned-item no-ripple border" id="{{'canned-item_'+ i }}"
5
+ *ngFor="let canned of tagsCannedFilter; let i = index;"
6
+ (click)="onClickCannedFN(canned, $event)">
7
+ <div class="cannedContent">
8
+ <ion-input [(ngModel)]="canned.title" class="title" id="{{'titleCanned_'+canned._id}}" [disabled]="canned.disabled"></ion-input>
9
+ <ion-input [(ngModel)]="canned.text" *ngIf="canned.text" class="text" [disabled]="canned.disabled"></ion-input>
10
+ </div>
11
+ <ion-icon class="canned-item-icon" name="checkmark-sharp" slot=end *ngIf="canned.createdBy === loggedUser.uid && !canned.disabled" (click)="onConfirmEditCanned(canned, $event)"></ion-icon>
12
+ <ion-icon class="canned-item-icon" name="pencil-sharp" slot=end *ngIf="canned.createdBy === loggedUser.uid && canned.disabled" (click)="onEditCanned(canned, $event)"></ion-icon>
13
+ <ion-icon class="canned-item-icon" name="trash-bin-outline" slot=end *ngIf="canned.createdBy === loggedUser.uid" (click)="onDeleteCanned(canned, $event)"></ion-icon>
14
+ </ion-item>
15
+ <ion-item class="canned-item add-canned-response-wpr" button="true" lines="none" (click)="onClickAddCannedResponseFN()">
16
+ <ion-icon class="add-canned-response-icon" name="flash-outline"></ion-icon>
17
+ <span class="add-canned-response-add-icon">+</span>
18
+ <label class="add-canned-response-label" >{{translationMap?.get('AddNewCannedResponse')}}</label>
19
+ </ion-item>
20
+ </ion-list>
21
+ <!-- <ion-list class="canned-list" *ngIf="tagsCannedFilter.length === 0 && HIDE_CANNED_RESPONSES === false">
22
+ <ion-item button="true" >
23
+ There are no canned responses available
24
+ </ion-item>
25
+ </ion-list> -->
26
+ </div>
@@ -0,0 +1,141 @@
1
+ .canned-item.add-canned-response-wpr:hover > span {
2
+ color: #1877f2;
3
+ }
4
+
5
+ .canned-item.add-canned-response-wpr:hover > ion-icon {
6
+ color: #1877f2;
7
+ }
8
+
9
+ .canned-item.add-canned-response-wpr:hover > label {
10
+ color: #1877f2;
11
+ }
12
+
13
+ .is_active_item {
14
+ // background-color: #eaf1fd!important;
15
+ --background: #eaf1fd !important;
16
+ }
17
+
18
+
19
+
20
+ .header {
21
+ display: flex;
22
+ flex-direction: row;
23
+ -webkit-box-pack: start;
24
+ justify-content: flex-end;
25
+ -webkit-box-align: center;
26
+ align-items: center;
27
+ border-bottom: 1px solid rgb(239, 242, 246);
28
+ padding: 0px 10px;
29
+ background: white;
30
+ width: 100%;
31
+ box-shadow: rgb(0, 27, 71, .24) 0px 8px 20px;
32
+ .canned-response-icon-header{
33
+ color: #3880ff !important;
34
+ font-size: 1.4em;
35
+ margin: 8px 5px;
36
+ }
37
+
38
+ }
39
+
40
+ .add-canned-response-icon {
41
+ color: #b3bfd0;
42
+ cursor: pointer;
43
+ font-size: 18px;
44
+ }
45
+ .add-canned-response-label {
46
+ color: #b3bfd0;
47
+ cursor: pointer;
48
+ }
49
+ .add-canned-response-add-icon {
50
+ color: #b3bfd0;
51
+ cursor: pointer;
52
+ position: relative;
53
+ top: 4px;
54
+ left: -6px;
55
+ }
56
+
57
+ .canned-list {
58
+ // position: absolute;
59
+ // bottom: 0;
60
+ background-color: white !important;
61
+ width: 100%;
62
+ max-height: 310px;
63
+ overflow-y: auto;
64
+ // padding: 10px 0;
65
+ // margin: 0;
66
+ margin-bottom: 1px;
67
+ font-size: 14px;
68
+ line-height: 1.42857143;
69
+ color: #080f1a;
70
+ box-sizing: border-box;
71
+ -webkit-font-smoothing: antialiased;
72
+ // list-style: none;
73
+ z-index: 999999;
74
+
75
+ .cannedContent{
76
+ width: 100%;
77
+ }
78
+
79
+ ion-input {
80
+ --padding-bottom: 0px;
81
+ --padding-top: 0px;
82
+ &.text{
83
+ font-style: italic;
84
+ }
85
+ &.title {
86
+ font-weight: 500;
87
+ }
88
+ }
89
+ .native-input[disabled] {
90
+ opacity: 10 !important;
91
+ }
92
+ ion-icon {
93
+ zoom: 0.7;
94
+ }
95
+ .no-ripple {
96
+ --ripple-color: transparent;
97
+ --background-activated: transparent;
98
+ }
99
+
100
+ .border{
101
+ border-bottom: 1px dashed rgb(211, 219, 229) !important;
102
+ margin: 0px 4px
103
+ }
104
+
105
+
106
+ }
107
+
108
+ .canned-item {
109
+ -webkit-tap-highlight-color: transparent;
110
+ font-family: Lato, sans-serif;
111
+ font-size: 14px;
112
+ line-height: 1.42857143;
113
+ list-style: none;
114
+ box-sizing: border-box;
115
+ -webkit-font-smoothing: antialiased;
116
+ // margin: 0 10px;
117
+ position: relative;
118
+ outline: none;
119
+ color: #434a54;
120
+ // padding: 10px;
121
+ padding: 5px;
122
+ width: auto;
123
+ cursor: pointer;
124
+ // .item-inner{
125
+ // border: none!important;
126
+ // }
127
+ }
128
+
129
+ ion-item {
130
+ --background-hover: #1877f2 !important;
131
+
132
+ .nocannedTitle {
133
+ color: #f44336;
134
+ }
135
+ .no-canned-available-text {
136
+ color: #1877f2 !important;
137
+ }
138
+ .no-canned-available-text:hover {
139
+ text-decoration: underline;
140
+ }
141
+ }
@@ -0,0 +1,24 @@
1
+ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { IonicModule } from '@ionic/angular';
3
+
4
+ import { CannedResponseComponent } from './canned-response.component';
5
+
6
+ describe('CannedResponseComponent', () => {
7
+ let component: CannedResponseComponent;
8
+ let fixture: ComponentFixture<CannedResponseComponent>;
9
+
10
+ beforeEach(async(() => {
11
+ TestBed.configureTestingModule({
12
+ declarations: [ CannedResponseComponent ],
13
+ imports: [IonicModule.forRoot()]
14
+ }).compileComponents();
15
+
16
+ fixture = TestBed.createComponent(CannedResponseComponent);
17
+ component = fixture.componentInstance;
18
+ fixture.detectChanges();
19
+ }));
20
+
21
+ it('should create', () => {
22
+ expect(component).toBeTruthy();
23
+ });
24
+ });