@chat21/chat21-web-widget 5.0.56-rc.1 → 5.0.56-rc.3
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.
- package/.github/workflows/build.yml +1 -0
- package/CHANGELOG.md +13 -0
- package/angular.json +6 -7
- package/package.json +5 -4
- package/src/app/app.component.html +1 -11
- package/src/app/app.component.scss +12 -13
- package/src/app/app.component.spec.ts +0 -2
- package/src/app/app.component.ts +29 -35
- package/src/app/app.module.ts +4 -5
- package/src/app/component/conversation-detail/conversation/conversation.component.html +1 -10
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +5 -428
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +23 -25
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +4 -63
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +11 -81
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.spec.ts +0 -3
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +6 -6
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +7 -32
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +11 -11
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +8 -8
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +4 -25
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +5 -5
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.ts +4 -88
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.html +7 -16
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.ts +2 -26
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.html +1 -11
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.scss +5 -5
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts +2 -19
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.html +10 -42
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +1 -2
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.ts +2 -3
- package/src/app/component/form/form-builder/form-builder.component.html +0 -1
- package/src/app/component/form/form-builder/form-builder.component.scss +1 -1
- package/src/app/component/form/form-builder/form-builder.component.ts +4 -5
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.scss +1 -2
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.ts +2 -3
- package/src/app/component/form/inputs/form-label/form-label.component.ts +0 -1
- package/src/app/component/form/inputs/form-text/form-text.component.scss +3 -13
- package/src/app/component/form/inputs/form-text/form-text.component.ts +1 -2
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.html +0 -13
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +4 -4
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.ts +0 -10
- package/src/app/component/form/prechat-form/prechat-form.component.html +0 -2
- package/src/app/component/form/prechat-form/prechat-form.component.scss +2 -2
- package/src/app/component/form/prechat-form/prechat-form.component.ts +2 -2
- package/src/app/component/home/home.component.scss +7 -7
- package/src/app/component/home/home.component.ts +1 -4
- package/src/app/component/home-conversations/home-conversations.component.scss +7 -7
- package/src/app/component/home-conversations/home-conversations.component.ts +9 -12
- package/src/app/component/last-message/last-message.component.scss +4 -4
- package/src/app/component/last-message/last-message.component.ts +4 -7
- package/src/app/component/launcher-button/launcher-button.component.ts +3 -3
- package/src/app/component/list-all-conversations/list-all-conversations.component.scss +2 -2
- package/src/app/component/list-all-conversations/list-all-conversations.component.ts +3 -3
- package/src/app/component/list-conversations/list-conversations.component.html +1 -1
- package/src/app/component/list-conversations/list-conversations.component.scss +3 -3
- package/src/app/component/list-conversations/list-conversations.component.ts +3 -6
- package/src/app/component/menu-options/menu-options.component.html +1 -8
- package/src/app/component/menu-options/menu-options.component.scss +4 -4
- package/src/app/component/menu-options/menu-options.component.ts +1 -1
- package/src/app/component/message/bubble-message/bubble-message.component.html +1 -2
- package/src/app/component/message/bubble-message/bubble-message.component.scss +3 -3
- package/src/app/component/message/bubble-message/bubble-message.component.spec.ts +0 -2
- package/src/app/component/message/bubble-message/bubble-message.component.ts +1 -14
- package/src/app/component/message/buttons/action-button/action-button.component.scss +6 -6
- package/src/app/component/message/buttons/link-button/link-button.component.scss +7 -7
- package/src/app/component/message/buttons/text-button/text-button.component.scss +8 -8
- package/src/app/component/message/frame/frame.component.scss +1 -1
- package/src/app/component/message/frame/frame.component.ts +1 -1
- package/src/app/component/message/html/html.component.scss +4 -4
- package/src/app/component/message/html/html.component.ts +1 -2
- package/src/app/component/message/image/image.component.scss +1 -1
- package/src/app/component/message/image/image.component.ts +2 -3
- package/src/app/component/message/info-message/info-message.component.html +2 -1
- package/src/app/component/message/info-message/info-message.component.scss +6 -6
- package/src/app/component/message/like-unlike/like-unlike.component.scss +1 -1
- package/src/app/component/message/like-unlike/like-unlike.component.ts +2 -2
- package/src/app/component/message/text/text.component.scss +1 -1
- package/src/app/component/message/text/text.component.ts +1 -1
- package/src/app/component/message-attachment/message-attachment.component.ts +1 -1
- package/src/app/component/selection-department/selection-department.component.scss +6 -6
- package/src/app/component/selection-department/selection-department.component.ts +2 -2
- package/src/app/component/send-button/send-button.component.ts +1 -2
- package/src/app/component/star-rating-widget/star-rating-widget.component.scss +6 -6
- package/src/app/component/star-rating-widget/star-rating-widget.component.ts +2 -2
- package/src/app/pipe/date-ago.pipe.spec.ts +8 -0
- package/src/app/pipe/date-ago.pipe.ts +42 -0
- package/src/app/providers/app-config.service.ts +0 -1
- package/src/app/providers/global-settings.service.ts +3 -31
- package/src/app/providers/star-rating-widget.service.ts +4 -4
- package/src/app/providers/translator.service.ts +3 -11
- package/src/app/providers/waiting.service.ts +2 -2
- package/src/app/sass/_variables.scss +29 -26
- package/src/app/utils/globals.ts +4 -34
- package/src/app/utils/rules.ts +5 -7
- package/src/app/utils/utils.ts +47 -37
- package/src/assets/i18n/en.json +0 -2
- package/src/assets/i18n/es.json +0 -2
- package/src/assets/i18n/fr.json +0 -2
- package/src/assets/i18n/it.json +0 -2
- package/src/assets/twp/chatbot-panel.html +4 -0
- package/src/assets/twp/index.html +2 -57
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +15 -23
- package/src/chat21-core/providers/firebase/firebase-auth-service.ts +21 -20
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +15 -13
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +16 -23
- package/src/chat21-core/providers/firebase/firebase-groups-handler.ts +15 -11
- package/src/chat21-core/providers/firebase/firebase-image-repo.ts +13 -4
- package/src/chat21-core/providers/firebase/firebase-init-service.ts +3 -3
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +11 -9
- package/src/chat21-core/providers/firebase/firebase-presence.service.ts +14 -11
- package/src/chat21-core/providers/firebase/firebase-typing.service.ts +17 -11
- package/src/chat21-core/providers/firebase/firebase-upload.service.ts +12 -9
- package/src/chat21-core/providers/localSessionStorage.ts +2 -15
- package/src/chat21-core/providers/mqtt/chat-service.ts +12 -2
- package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +1 -34
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +4 -6
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +1 -11
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +13 -7
- package/src/chat21-core/providers/mqtt/mqtt-presence.service.ts +3 -3
- package/src/chat21-core/providers/mqtt/mqtt-typing.service.ts +3 -3
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +0 -1
- package/src/chat21-core/utils/user-typing/user-typing.component.scss +3 -3
- package/src/chat21-core/utils/utils.ts +46 -118
- package/src/launch.js +42 -12
- package/src/models/message.ts +0 -23
- package/src/test-new.html +0 -6
- package/src/app/providers/settings-saver.service.spec.ts +0 -17
- package/src/app/providers/settings-saver.service.ts +0 -56
- package/src/app/providers/storage.service.spec.ts +0 -16
- package/src/app/providers/storage.service.ts +0 -220
- package/src/app/utils/translations.ts +0 -122
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
2
|
+
import { saveAs } from 'file-saver';
|
|
3
3
|
import { popupUrl } from 'src/chat21-core/utils/utils';
|
|
4
|
-
import { saveAs} from 'file-saver';
|
|
5
4
|
|
|
6
5
|
@Component({
|
|
7
6
|
selector: 'chat-image',
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
8
|
<div style="max-width: 70%;">
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
<span class="base_info" [innerHTML]="message?.text | marked" tooltip="{{message.timestamp | dateAgo}} ({{message.timestamp | date:'shortDate'}} {{message.timestamp | date:'HH:mm:ss'}})" placement="left" contentType="template"></span>
|
|
10
11
|
<!-- <ng-template #timeTooltipLeft>
|
|
11
12
|
<span>{{message.timestamp | amTimeAgo}} ({{message.timestamp | amLocal | amDateFormat: 'L HH:mm:ss'}})</span>
|
|
12
13
|
</ng-template> -->
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import 'src/app/sass/variables';
|
|
1
|
+
// @import 'src/app/sass/variables';
|
|
2
2
|
|
|
3
3
|
.info-container{
|
|
4
4
|
display: flex;
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
padding-right: 4px;
|
|
15
15
|
padding: 6px 10px;
|
|
16
16
|
display: inline-block;
|
|
17
|
-
background:
|
|
17
|
+
background: var(--bkg-color-info-message);
|
|
18
18
|
font-size: 10px;
|
|
19
|
-
color:
|
|
19
|
+
color: var(--base-gray);
|
|
20
20
|
margin-left: 5px; //32px;
|
|
21
21
|
margin-right: 5px; //32px;
|
|
22
22
|
}
|
|
@@ -50,15 +50,15 @@
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.spinner .bounce1 {
|
|
53
|
-
background-color:
|
|
53
|
+
background-color: var(--bkg-color-info-message);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.spinner .bounce2 {
|
|
57
|
-
background-color
|
|
57
|
+
background-color:var(--bkg-color-info-message);
|
|
58
58
|
opacity: 0.6
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.spinner .bounce3 {
|
|
62
|
-
background-color
|
|
62
|
+
background-color:var(--bkg-color-info-message);
|
|
63
63
|
opacity: 0.4
|
|
64
64
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LoggerInstance } from './../../../../chat21-core/providers/logger/loggerInstance';
|
|
2
|
-
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
3
1
|
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
3
|
+
import { LoggerInstance } from './../../../../chat21-core/providers/logger/loggerInstance';
|
|
4
4
|
|
|
5
5
|
@Component({
|
|
6
6
|
selector: 'chat-like-unlike',
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
@import 'src/app/sass/variables';
|
|
1
|
+
// @import 'src/app/sass/variables';
|
|
2
2
|
// @import '../../../sass/normalize.css';
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
#chat21-selection-department {
|
|
6
6
|
|
|
7
|
-
--backgroundColor: #{
|
|
8
|
-
--textColor: #{
|
|
9
|
-
--hoverBackgroundColor: #{
|
|
10
|
-
--hoverTextColor: #{
|
|
7
|
+
--backgroundColor: #{var(--light-white)};
|
|
8
|
+
--textColor: #{var(--blue)};
|
|
9
|
+
--hoverBackgroundColor: #{var(--blue)};
|
|
10
|
+
--hoverTextColor: #{var(--light-white)};
|
|
11
11
|
|
|
12
12
|
background-color: #ffffff;
|
|
13
13
|
width: 100%;
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
padding: 0;
|
|
73
73
|
margin: 0;
|
|
74
74
|
line-height: 1.2em;
|
|
75
|
-
color:
|
|
75
|
+
color: var(--gray);
|
|
76
76
|
font-size: 1.6em;
|
|
77
77
|
text-align: center;
|
|
78
78
|
word-wrap: break-word;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { AfterViewInit, Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
|
|
1
2
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
2
|
-
import { Component, OnInit, Output, EventEmitter, ViewChild, ElementRef, AfterViewInit } from '@angular/core';
|
|
3
3
|
import { Globals } from '../../utils/globals';
|
|
4
4
|
|
|
5
|
-
import { DepartmentModel } from 'src/models/department';
|
|
6
5
|
import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
|
|
7
6
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
7
|
+
import { DepartmentModel } from 'src/models/department';
|
|
8
8
|
|
|
9
9
|
@Component({
|
|
10
10
|
selector: 'chat-selection-department',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Component, OnInit, EventEmitter, Output } from '@angular/core';
|
|
1
|
+
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
|
|
3
2
|
import { Globals } from '../../utils/globals';
|
|
4
3
|
|
|
5
4
|
@Component({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @import url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css);
|
|
2
2
|
// @import url(https://use.fontawesome.com/releases/v5.5.0/css/all.css);
|
|
3
|
-
@import 'src/app/sass/variables';
|
|
3
|
+
// @import 'src/app/sass/variables';
|
|
4
4
|
|
|
5
5
|
#chat21-star-rating-widget {
|
|
6
6
|
background-color: #ffffff;
|
|
@@ -85,13 +85,13 @@
|
|
|
85
85
|
.default-title {
|
|
86
86
|
font-size: 2em;
|
|
87
87
|
font-family:'Roboto';
|
|
88
|
-
color
|
|
88
|
+
color:var(--black);
|
|
89
89
|
}
|
|
90
90
|
.default-text {
|
|
91
91
|
font-size: 1.4em;
|
|
92
92
|
font-family:'Roboto';
|
|
93
93
|
// line-height: 1.2em;
|
|
94
|
-
color
|
|
94
|
+
color:var(--black);
|
|
95
95
|
margin: 0 0 4px 0;
|
|
96
96
|
}
|
|
97
97
|
.step-rate{
|
|
@@ -233,12 +233,12 @@
|
|
|
233
233
|
-webkit-box-sizing: border-box;
|
|
234
234
|
box-sizing: border-box;
|
|
235
235
|
padding: 10px;
|
|
236
|
-
color:
|
|
236
|
+
color: var(--black);
|
|
237
237
|
width: calc(100% - 40px);
|
|
238
238
|
height: 110px;
|
|
239
239
|
resize: none;
|
|
240
240
|
font-size: 13px;
|
|
241
|
-
border-radius:
|
|
241
|
+
border-radius: var(--chat-footer-border-radius);
|
|
242
242
|
background-color: #fafafa;
|
|
243
243
|
text-align: left;
|
|
244
244
|
font-weight: 300;
|
|
@@ -285,4 +285,4 @@
|
|
|
285
285
|
color: rgb(42, 106, 193);
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
}
|
|
288
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
|
1
|
+
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
3
2
|
import { StarRatingWidgetService } from 'src/app/providers/star-rating-widget.service';
|
|
4
3
|
import { Globals } from 'src/app/utils/globals';
|
|
5
4
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
5
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
@Component({
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import * as dayjs from 'dayjs'
|
|
4
|
+
import * as relativeTime from 'dayjs/plugin/relativeTime'
|
|
5
|
+
dayjs.extend(relativeTime)
|
|
6
|
+
|
|
7
|
+
@Pipe({
|
|
8
|
+
name: 'dateAgo',
|
|
9
|
+
pure: true
|
|
10
|
+
})
|
|
11
|
+
export class DateAgoPipe implements PipeTransform {
|
|
12
|
+
|
|
13
|
+
transform(value: any, args?: any): any {
|
|
14
|
+
if (value) {
|
|
15
|
+
// const seconds = Math.floor((+new Date() - +new Date(value)) / 1000);
|
|
16
|
+
// if (seconds < 29) // less than 30 seconds ago will show as 'Just now'
|
|
17
|
+
// return 'Just now';
|
|
18
|
+
// const intervals: { [key: string]: number } = {
|
|
19
|
+
// 'year': 31536000,
|
|
20
|
+
// 'month': 2592000,
|
|
21
|
+
// 'week': 604800,
|
|
22
|
+
// 'day': 86400,
|
|
23
|
+
// 'hour': 3600,
|
|
24
|
+
// 'minute': 60,
|
|
25
|
+
// 'second': 1
|
|
26
|
+
// };
|
|
27
|
+
// let counter;
|
|
28
|
+
// for (const i in intervals) {
|
|
29
|
+
// counter = Math.floor(seconds / intervals[i]);
|
|
30
|
+
// if (counter > 0)
|
|
31
|
+
// if (counter === 1) {
|
|
32
|
+
// return counter + ' ' + i + ' ago'; // singular (1 day ago)
|
|
33
|
+
// } else {
|
|
34
|
+
// return counter + ' ' + i + 's ago'; // plural (2 days ago)
|
|
35
|
+
// }
|
|
36
|
+
// }
|
|
37
|
+
value = dayjs(value).fromNow()
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
2
|
-
import { LogLevel } from './../../chat21-core/utils/constants';
|
|
3
2
|
import { ElementRef, Injectable } from '@angular/core';
|
|
4
3
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
5
4
|
|
|
6
5
|
// services
|
|
7
6
|
import { Globals } from '../utils/globals';
|
|
8
|
-
import {
|
|
7
|
+
import { convertColorToRGBA, detectIfIsMobile, getImageUrlThumb, getParameterByName, stringToBoolean } from '../utils/utils';
|
|
9
8
|
|
|
10
9
|
import { TemplateBindingParseResult } from '@angular/compiler';
|
|
11
|
-
import { AppConfigService } from './app-config.service';
|
|
12
|
-
import { __core_private_testing_placeholder__ } from '@angular/core/testing';
|
|
13
|
-
import { ProjectModel } from '../../models/project';
|
|
14
10
|
import { AppStorageService } from '../../chat21-core/providers/abstract/app-storage.service';
|
|
15
11
|
import { LoggerService } from '../../chat21-core/providers/abstract/logger.service';
|
|
16
12
|
import { LoggerInstance } from '../../chat21-core/providers/logger/loggerInstance';
|
|
17
|
-
import { invertColor, isJsonArray
|
|
13
|
+
import { invertColor, isJsonArray } from '../../chat21-core/utils/utils';
|
|
14
|
+
import { AppConfigService } from './app-config.service';
|
|
18
15
|
|
|
19
16
|
|
|
20
17
|
@Injectable()
|
|
@@ -1749,21 +1746,8 @@ export class GlobalSettingsService {
|
|
|
1749
1746
|
this.globals.departments = departments;
|
|
1750
1747
|
if (departments.length === 1) {
|
|
1751
1748
|
// UN SOLO DEPARTMENT
|
|
1752
|
-
const department = departments[0];
|
|
1753
1749
|
this.logger.debug('[GLOBAL-SET] initDepartments DEPARTMENT FIRST ::::', departments[0]);
|
|
1754
1750
|
this.globals.setParameter('departmentDefault', departments[0]);
|
|
1755
|
-
if (department && department.online_msg && department.online_msg !== '') {
|
|
1756
|
-
this.globals.online_msg = department.online_msg;
|
|
1757
|
-
}
|
|
1758
|
-
if (department && department.offline_msg && department.offline_msg !== '') {
|
|
1759
|
-
this.globals.offline_msg = department.offline_msg;
|
|
1760
|
-
}
|
|
1761
|
-
// if (department['offline_msg']) {
|
|
1762
|
-
// this.globals.offline_msg = department['offline_msg'];
|
|
1763
|
-
// }
|
|
1764
|
-
// if (department['online_msg']) {
|
|
1765
|
-
// this.globals.online_msg = department['online_msg'];
|
|
1766
|
-
// }
|
|
1767
1751
|
this.setDepartment(departments[0]);
|
|
1768
1752
|
// return false;
|
|
1769
1753
|
} else if (departments.length > 1) {
|
|
@@ -1773,18 +1757,6 @@ export class GlobalSettingsService {
|
|
|
1773
1757
|
departments.forEach(department => {
|
|
1774
1758
|
if (department['default'] === true) {
|
|
1775
1759
|
// this.globals.departmentDefault = department;
|
|
1776
|
-
if (department && department.online_msg && department.online_msg !== '') {
|
|
1777
|
-
this.globals.online_msg = department.online_msg;
|
|
1778
|
-
}
|
|
1779
|
-
if (department && department.offline_msg && department.offline_msg !== '') {
|
|
1780
|
-
this.globals.offline_msg = department.offline_msg;
|
|
1781
|
-
}
|
|
1782
|
-
// if (department['offline_msg']) {
|
|
1783
|
-
// this.globals.offline_msg = department['offline_msg'];
|
|
1784
|
-
// }
|
|
1785
|
-
// if (department['online_msg']) {
|
|
1786
|
-
// this.globals.online_msg = department['online_msg'];
|
|
1787
|
-
// }
|
|
1788
1760
|
// console.log('this.globals.offline_msg ::::', department['offline_msg']);
|
|
1789
1761
|
// console.log('this.globals.online_msg ::::', department['online_msg']);
|
|
1790
1762
|
// departments.splice(i, 1);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
2
2
|
import { Injectable } from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
4
4
|
|
|
5
5
|
// services
|
|
6
|
-
import {
|
|
6
|
+
import { map } from 'rxjs/operators';
|
|
7
7
|
import { AppConfigService } from 'src/app/providers/app-config.service';
|
|
8
|
-
import {
|
|
8
|
+
import { Globals } from 'src/app/utils/globals';
|
|
9
9
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
10
|
-
import {
|
|
10
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
@Injectable()
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
2
|
import { Injectable } from '@angular/core';
|
|
3
|
-
// import * as translations from '../utils/translations';
|
|
4
3
|
import { TranslateService } from '@ngx-translate/core';
|
|
5
4
|
import { environment } from '../../environments/environment';
|
|
6
5
|
|
|
7
|
-
import { throwError as observableThrowError
|
|
8
|
-
import { catchError
|
|
6
|
+
import { throwError as observableThrowError } from 'rxjs';
|
|
7
|
+
import { catchError } from 'rxjs/operators';
|
|
9
8
|
// import 'rxjs/add/observable/throw';
|
|
10
9
|
// import 'rxjs/add/operator/catch';
|
|
11
10
|
import { Globals } from '../utils/globals';
|
|
12
11
|
|
|
13
|
-
import { AppConfigService } from './app-config.service';
|
|
14
12
|
import { LoggerService } from '../../chat21-core/providers/abstract/logger.service';
|
|
15
13
|
import { LoggerInstance } from '../../chat21-core/providers/logger/loggerInstance';
|
|
14
|
+
import { AppConfigService } from './app-config.service';
|
|
16
15
|
|
|
17
16
|
@Injectable()
|
|
18
17
|
export class TranslatorService {
|
|
@@ -20,7 +19,6 @@ export class TranslatorService {
|
|
|
20
19
|
private defaultLanguage = 'en'; // default language
|
|
21
20
|
private language: string; // user language
|
|
22
21
|
private logger: LoggerService = LoggerInstance.getInstance()
|
|
23
|
-
// private translations: Object;
|
|
24
22
|
|
|
25
23
|
translated_string: any;
|
|
26
24
|
baseLocation: string;
|
|
@@ -215,8 +213,6 @@ export class TranslatorService {
|
|
|
215
213
|
'LABEL_TU',
|
|
216
214
|
'LABEL_PLACEHOLDER',
|
|
217
215
|
'LABEL_START_NW_CONV',
|
|
218
|
-
'LABEL_FIRST_MSG',
|
|
219
|
-
'LABEL_FIRST_MSG_NO_AGENTS',
|
|
220
216
|
'LABEL_SELECT_TOPIC',
|
|
221
217
|
'LABEL_COMPLETE_FORM',
|
|
222
218
|
'LABEL_FIELD_NAME',
|
|
@@ -271,8 +267,6 @@ export class TranslatorService {
|
|
|
271
267
|
globals.LABEL_TU = res['LABEL_TU']
|
|
272
268
|
globals.LABEL_PLACEHOLDER = res['LABEL_PLACEHOLDER']
|
|
273
269
|
globals.LABEL_START_NW_CONV = res['LABEL_START_NW_CONV'];
|
|
274
|
-
globals.LABEL_FIRST_MSG = res['LABEL_FIRST_MSG'];
|
|
275
|
-
globals.LABEL_FIRST_MSG_NO_AGENTS = res['LABEL_FIRST_MSG_NO_AGENTS'];
|
|
276
270
|
globals.LABEL_SELECT_TOPIC = res['LABEL_SELECT_TOPIC'];
|
|
277
271
|
globals.LABEL_COMPLETE_FORM = res['LABEL_COMPLETE_FORM'];
|
|
278
272
|
globals.LABEL_FIELD_NAME = res['LABEL_FIELD_NAME'];
|
|
@@ -342,8 +336,6 @@ export class TranslatorService {
|
|
|
342
336
|
// console.log('»»»»» globals', globals)
|
|
343
337
|
// globals.LABEL_PLACEHOLDER = this.translateForKey('LABEL_PLACEHOLDER') // done
|
|
344
338
|
// globals.LABEL_START_NW_CONV = this.translateForKey('LABEL_START_NW_CONV'); // done
|
|
345
|
-
// globals.LABEL_FIRST_MSG = this.translateForKey('LABEL_FIRST_MSG'); // done
|
|
346
|
-
// globals.LABEL_FIRST_MSG_NO_AGENTS = this.translateForKey('LABEL_FIRST_MSG_NO_AGENTS'); // done
|
|
347
339
|
// globals.LABEL_SELECT_TOPIC = this.translateForKey('LABEL_SELECT_TOPIC'); // done
|
|
348
340
|
// globals.LABEL_COMPLETE_FORM = this.translateForKey('LABEL_COMPLETE_FORM'); // done
|
|
349
341
|
// globals.LABEL_FIELD_NAME = this.translateForKey('LABEL_FIELD_NAME'); // done
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
2
2
|
import { Injectable } from '@angular/core';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
-
import { Globals } from '../utils/globals';
|
|
5
|
-
import { AppConfigService } from '../providers/app-config.service';
|
|
6
4
|
import { map } from 'rxjs/operators';
|
|
5
|
+
import { AppConfigService } from '../providers/app-config.service';
|
|
6
|
+
import { Globals } from '../utils/globals';
|
|
7
7
|
|
|
8
8
|
@Injectable()
|
|
9
9
|
export class WaitingService {
|
|
@@ -1,36 +1,39 @@
|
|
|
1
1
|
// =========== COLORS =============== //
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
$trasp-black:rgba(0,0,0,0.8);
|
|
14
|
-
|
|
2
|
+
:root{
|
|
3
|
+
--black: #1a1a1a;
|
|
4
|
+
--light-white: #f7f7f7;
|
|
5
|
+
--gray: #aaaaaa;
|
|
6
|
+
--dark-gray: #5f6368;
|
|
7
|
+
--light-gray: #eeeeee;
|
|
8
|
+
--base-gray: #666666;
|
|
9
|
+
--danger: #a94442;
|
|
10
|
+
--blue: rgb(42, 106, 193);
|
|
11
|
+
|
|
12
|
+
--trasp-light-gray: rgba(191, 191, 191, 0.2);
|
|
13
|
+
$trasp-black:rgba(0,0,0,0.8);
|
|
14
|
+
--trasp-light-black:rgba(0,0,0,0.2);
|
|
15
15
|
|
|
16
|
-
// $theme-color: rgb(42, 106, 193);
|
|
17
|
-
/** conversation **/
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
// $theme-color: rgb(42, 106, 193);
|
|
17
|
+
/** conversation **/
|
|
18
|
+
--bck-msg-sent: rgb(98, 168, 234);
|
|
19
|
+
--col-msg-sent: #ffffff;
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
--border-radius-bubble-message: 20px;
|
|
22
|
+
--button-in-msg-font-size: 15px;
|
|
23
|
+
--button-in-msg-max-width: 280px;
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
--max-width-images: 230px; //change also MAX_WIDTH_IMAGES in constants.ts
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
--bkg-color-info-message: rgba(24, 119, 242, 0.1);
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
--chat-footer-height: 56px;
|
|
30
|
+
--chat-footer-border-radius: 16px;
|
|
31
|
+
--chat-footer-background-color: #f6f7fb;
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
--icon-fill-color: #5f6368
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
$trasp-black:rgba(0,0,0,0.8);
|
|
34
37
|
|
|
35
38
|
|
|
36
39
|
|
package/src/app/utils/globals.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
|
-
import { environment } from '../../environments/environment';
|
|
3
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { environment } from '../../environments/environment';
|
|
4
4
|
|
|
5
5
|
/** CONSTANTS */
|
|
6
6
|
import { CHANNEL_TYPE_GROUP } from 'src/chat21-core/utils/constants';
|
|
7
7
|
|
|
8
8
|
/** MODELS */
|
|
9
|
+
import { DepartmentModel } from 'src/models/department';
|
|
9
10
|
import { ProjectModel } from 'src/models/project';
|
|
10
11
|
import { UserAgent } from 'src/models/userAgent';
|
|
11
|
-
import { DepartmentModel } from 'src/models/department';
|
|
12
12
|
|
|
13
13
|
/** UTILS FUNCTIONS */
|
|
14
14
|
import { avatarPlaceholder, detectIfIsMobile, getParameterByName, setColorFromString } from 'src/app/utils/utils';
|
|
@@ -21,17 +21,13 @@ import { Rule } from 'src/models/rule';
|
|
|
21
21
|
})
|
|
22
22
|
export class Globals {
|
|
23
23
|
|
|
24
|
-
obsObjChanged = new BehaviorSubject<any>(null);
|
|
25
|
-
obsIsOpen = new BehaviorSubject<boolean>(null);
|
|
26
|
-
|
|
27
24
|
BASE_LOCATION = 'https://widget.tiledesk.com/v2';
|
|
28
25
|
POWERED_BY ='<a tabindex="-1" target="_blank" href="http://www.tiledesk.com/?utm_source=widget"><img src="https://support-pre.tiledesk.com/dashboard/assets/img/logos/tiledesk-logo_new_gray.svg"/></a>'
|
|
29
26
|
DEFAULT_LOGO_CHAT = '/assets/images/tiledesk_logo_white_small.svg';
|
|
30
|
-
WIDGET_TITLE = 'Tiledesk';
|
|
31
27
|
|
|
32
28
|
// ============ BEGIN: SET FUNCTION BY UTILS ==============//
|
|
33
29
|
// getParameterByName = getParameterByName;
|
|
34
|
-
convertColorToRGBA = convertColorToRGBA;
|
|
30
|
+
// convertColorToRGBA = convertColorToRGBA;
|
|
35
31
|
// ============ BEGIN: SET INTERNAL PARAMETERS ==============//
|
|
36
32
|
|
|
37
33
|
project = new ProjectModel();
|
|
@@ -43,11 +39,9 @@ export class Globals {
|
|
|
43
39
|
isLogged: boolean;
|
|
44
40
|
soundEnabled: boolean;
|
|
45
41
|
BUILD_VERSION: String;
|
|
46
|
-
filterSystemMsg: boolean; /** se è true i messaggi inviati da system non vengono visualizzati */
|
|
47
42
|
baseLocation: string;
|
|
48
43
|
availableAgents: Array<UserAgent> = [];
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
|
|
51
45
|
attributes: any;
|
|
52
46
|
preChatFormJson: any; // ******* new ********
|
|
53
47
|
token: string;
|
|
@@ -70,20 +64,16 @@ export class Globals {
|
|
|
70
64
|
// areAgentsAvailable = false;
|
|
71
65
|
areAgentsAvailableText: string;
|
|
72
66
|
availableAgentsStatus = false; // indica quando è impostato lo stato degli agenti nel subscribe
|
|
73
|
-
signInWithCustomToken: boolean;
|
|
74
67
|
displayEyeCatcherCard: string;
|
|
75
68
|
|
|
76
69
|
firstOpen = true;
|
|
77
70
|
departmentID = null;
|
|
78
71
|
privacyApproved = false;
|
|
79
|
-
startedAt = new Date();
|
|
80
72
|
|
|
81
73
|
// ============ BEGIN: LABELS ==============//
|
|
82
74
|
LABEL_TU: string;
|
|
83
75
|
LABEL_PLACEHOLDER: string;
|
|
84
76
|
LABEL_START_NW_CONV: string;
|
|
85
|
-
LABEL_FIRST_MSG: string;
|
|
86
|
-
LABEL_FIRST_MSG_NO_AGENTS: string;
|
|
87
77
|
LABEL_SELECT_TOPIC: string;
|
|
88
78
|
LABEL_COMPLETE_FORM: string;
|
|
89
79
|
LABEL_FIELD_NAME: string;
|
|
@@ -188,9 +178,6 @@ export class Globals {
|
|
|
188
178
|
showLogoutOption: boolean;
|
|
189
179
|
supportMode: boolean;
|
|
190
180
|
|
|
191
|
-
online_msg: string;
|
|
192
|
-
offline_msg: string;
|
|
193
|
-
|
|
194
181
|
customAttributes: any;
|
|
195
182
|
showAttachmentButton: boolean;
|
|
196
183
|
showAllConversations: boolean;
|
|
@@ -232,7 +219,6 @@ export class Globals {
|
|
|
232
219
|
*/
|
|
233
220
|
initDefafultParameters() {
|
|
234
221
|
this.globalsParameters = {};
|
|
235
|
-
this.filterSystemMsg = true;
|
|
236
222
|
|
|
237
223
|
let wContext: any = window;
|
|
238
224
|
if (window.frameElement && window.frameElement.getAttribute('tiledesk_context') === 'parent') {
|
|
@@ -406,9 +392,6 @@ export class Globals {
|
|
|
406
392
|
|
|
407
393
|
this.showLogoutOption = false;
|
|
408
394
|
|
|
409
|
-
this.offline_msg = this.LABEL_FIRST_MSG_NO_AGENTS;
|
|
410
|
-
this.online_msg = this.LABEL_FIRST_MSG;
|
|
411
|
-
|
|
412
395
|
this.isOpenNewMessage = false;
|
|
413
396
|
this.showAttachmentButton = true;
|
|
414
397
|
this.showAllConversations = true;
|
|
@@ -443,11 +426,6 @@ export class Globals {
|
|
|
443
426
|
// this.parameters['BUILD_VERSION'] = 'v.' + environment.version;
|
|
444
427
|
// this.parameters.push({'BUILD_VERSION': 'v.' + environment.version});
|
|
445
428
|
|
|
446
|
-
this.filterSystemMsg = true;
|
|
447
|
-
/** ???? scolpito in MessagingService. se è true i messaggi inviati da system non vengono visualizzati */
|
|
448
|
-
// this.parameters['filterSystemMsg'] = true;
|
|
449
|
-
// this.parameters.push({'filterSystemMsg': true});
|
|
450
|
-
|
|
451
429
|
this.soundEnabled = true;
|
|
452
430
|
// this.parameters['soundEnabled'] = true;
|
|
453
431
|
// this.parameters.push({'soundEnabled': true});
|
|
@@ -459,10 +437,6 @@ export class Globals {
|
|
|
459
437
|
this.isOpenMenuOptions = false;
|
|
460
438
|
// this.parameters['isOpenMenuOptions'] = false;
|
|
461
439
|
// this.parameters.push({'isOpenMenuOptions': false});
|
|
462
|
-
/** open/close menu options */
|
|
463
|
-
this.signInWithCustomToken = false;
|
|
464
|
-
// this.parameters['signInWithCustomToken'] = false;
|
|
465
|
-
// this.parameters.push({'signInWithCustomToken': false});
|
|
466
440
|
|
|
467
441
|
this.displayEyeCatcherCard = 'none';
|
|
468
442
|
// this.parameters['displayEyeCatcherCard'] = 'none';
|
|
@@ -622,7 +596,6 @@ export class Globals {
|
|
|
622
596
|
this.isOpen = val;
|
|
623
597
|
this.setParentBodyStyleMobile(val, this.isMobile)
|
|
624
598
|
this.setElementStyle(val)
|
|
625
|
-
this.obsIsOpen.next(val);
|
|
626
599
|
}
|
|
627
600
|
|
|
628
601
|
/**
|
|
@@ -634,9 +607,6 @@ export class Globals {
|
|
|
634
607
|
// storage = true;
|
|
635
608
|
this[key] = val;
|
|
636
609
|
const obj = {'key': key, 'val': val};
|
|
637
|
-
if (storage === true) {
|
|
638
|
-
this.obsObjChanged.next(obj);
|
|
639
|
-
}
|
|
640
610
|
}
|
|
641
611
|
|
|
642
612
|
/**
|
package/src/app/utils/rules.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
1
2
|
import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
|
|
2
|
-
import { Globals } from './globals';
|
|
3
|
-
import { UserModel } from './../../chat21-core/models/user';
|
|
4
|
-
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
5
3
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
6
|
-
import {
|
|
4
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
7
5
|
import { TiledeskRequestsService } from 'src/chat21-core/providers/tiledesk/tiledesk-requests.service';
|
|
8
|
-
import { Inject, Injectable } from '@angular/core';
|
|
9
|
-
import { IRules, Rule } from 'src/models/rule';
|
|
10
6
|
import { getDateDifference } from 'src/chat21-core/utils/utils';
|
|
7
|
+
import { Rule } from 'src/models/rule';
|
|
8
|
+
import { UserModel } from './../../chat21-core/models/user';
|
|
9
|
+
import { Globals } from './globals';
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
@Injectable({
|
|
@@ -60,7 +59,6 @@ export class Rules {
|
|
|
60
59
|
message[0]['message'].sourcePage = this.g.attributes['sourcePage']
|
|
61
60
|
message[0]['message'].language = this.g.lang
|
|
62
61
|
message[0]['message'].departmentid = this.g.attributes.departmentId
|
|
63
|
-
console.log('message[0]', message[0]['message'])
|
|
64
62
|
this.tiledeskRequestsService.sendMessageToRequest(this.request_id, this.tiledeskToken, message[0]['message'])
|
|
65
63
|
}
|
|
66
64
|
}
|