@chat21/chat21-web-widget 5.1.0-rc1 → 5.1.0-rc10
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/CHANGELOG.md +31 -2
- package/Dockerfile +3 -3
- package/angular.json +21 -17
- package/deploy_amazon_beta.sh +6 -11
- package/deploy_amazon_prod.sh +4 -11
- package/deploy_beta.sh +2 -1
- package/deploy_prod.sh +3 -3
- package/package.json +18 -20
- package/src/app/app.component.spec.ts +13 -13
- package/src/app/app.module.ts +11 -13
- package/src/app/component/conversation-detail/conversation/conversation.component.html +1 -2
- package/src/app/component/conversation-detail/conversation/conversation.component.spec.ts +11 -13
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +4 -2
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +22 -6
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +45 -3
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +60 -8
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +2 -2
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.spec.ts +10 -11
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.ts +0 -1
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.ts +5 -1
- package/src/app/component/home-conversations/home-conversations.component.spec.ts +9 -11
- package/src/app/component/message/audio/audio.component.ts +30 -16
- package/src/app/component/star-rating-widget/star-rating-widget.component.spec.ts +10 -11
- package/src/app/pipe/date-ago.pipe.ts +2 -2
- package/src/app/providers/app-config.service.spec.ts +5 -6
- package/src/app/providers/global-settings.service.spec.ts +7 -8
- package/src/app/providers/global-settings.service.ts +1 -14
- package/src/app/providers/star-rating-widget.service.spec.ts +7 -8
- package/src/app/providers/translator.service.spec.ts +7 -9
- package/src/app/providers/waiting.service.spec.ts +7 -8
- package/src/app/sass/_variables.scss +6 -1
- package/src/app/sass/animations.scss +1 -0
- package/src/app/utils/globals.ts +1 -4
- package/src/app/utils/utils.ts +0 -9
- package/src/assets/i18n/en.json +3 -1
- package/src/assets/twp/chatbot-panel.html +8 -1
- package/src/assets/twp/index-dev.html +8 -18
- package/src/assets/twp/index.html +13 -3
- package/src/build_launch.js +9 -8
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.spec.ts +8 -7
- package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.spec.ts +10 -6
- package/src/chat21-core/utils/utils-message.ts +20 -0
- package/src/chat21-core/utils/utils.ts +85 -2
- package/src/launch.js +11 -4
- package/src/launch_template.js +11 -4
- package/src/models/project.ts +4 -1
- package/tsconfig.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,8 +6,37 @@
|
|
|
6
6
|
### **Copyrigth**:
|
|
7
7
|
*Tiledesk SRL*
|
|
8
8
|
|
|
9
|
-
# 5.1.0-
|
|
10
|
-
- **
|
|
9
|
+
# 5.1.0-rc10
|
|
10
|
+
- **bug-fixed**: minor fix allowed urls
|
|
11
|
+
|
|
12
|
+
# 5.1.0-rc9
|
|
13
|
+
- **bug-fixed**: minor fix allowed urls
|
|
14
|
+
|
|
15
|
+
# 5.1.0-rc8
|
|
16
|
+
- **added**: ability to filter on urls attached to message textarea
|
|
17
|
+
|
|
18
|
+
# 5.1.0-rc7
|
|
19
|
+
- **added**: ability to allows emoji after message is sent
|
|
20
|
+
|
|
21
|
+
# 5.1.0-rc6
|
|
22
|
+
- **removed**: hideRestartConversationOptionsMenu
|
|
23
|
+
|
|
24
|
+
# 5.1.0-rc5
|
|
25
|
+
# 5.1.0-rc4
|
|
26
|
+
- **bug-fixed**: Dockerfile for angular 18
|
|
27
|
+
|
|
28
|
+
# 5.1.0-rc3
|
|
29
|
+
- **added**: angular 18
|
|
30
|
+
|
|
31
|
+
# 5.1.0-rc2
|
|
32
|
+
- **added**: angular 17
|
|
33
|
+
|
|
34
|
+
# 5.0.96
|
|
35
|
+
|
|
36
|
+
# 5.0.95
|
|
37
|
+
- **bug-fixed**: first message is fired twice ( from /event and from /messages with hiddenMesage)
|
|
38
|
+
|
|
39
|
+
# 5.0.94
|
|
11
40
|
|
|
12
41
|
# 5.0.94-rc7
|
|
13
42
|
- **added**: touchstart and touchend events for mobile mic footer button
|
package/Dockerfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
### STAGE 1: Build ###
|
|
2
2
|
|
|
3
3
|
# We label our stage as ‘builder’
|
|
4
|
-
FROM node:
|
|
4
|
+
FROM node:20.12.2-alpine3.19 as builder
|
|
5
5
|
|
|
6
6
|
COPY package.json package-lock.json ./
|
|
7
7
|
|
|
@@ -15,7 +15,7 @@ COPY . .
|
|
|
15
15
|
|
|
16
16
|
## Build the angular app in production mode and store the artifacts in dist folder
|
|
17
17
|
|
|
18
|
-
RUN
|
|
18
|
+
RUN npx ng build --configuration="prod" --output-path=dist --base-href=./ --output-hashing=none
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
### STAGE 2: Setup ###
|
|
@@ -29,7 +29,7 @@ COPY nginx.conf /etc/nginx/nginx.conf
|
|
|
29
29
|
RUN rm -rf /usr/share/nginx/html/*
|
|
30
30
|
|
|
31
31
|
## From ‘builder’ stage copy over the artifacts in dist folder to default nginx public folder
|
|
32
|
-
COPY --from=builder /ng-app/dist /usr/share/nginx/html
|
|
32
|
+
COPY --from=builder /ng-app/dist/browser /usr/share/nginx/html
|
|
33
33
|
|
|
34
34
|
RUN echo "Chat21 Web Widget Started!!"
|
|
35
35
|
|
package/angular.json
CHANGED
|
@@ -15,13 +15,17 @@
|
|
|
15
15
|
},
|
|
16
16
|
"architect": {
|
|
17
17
|
"build": {
|
|
18
|
-
"builder": "@angular-devkit/build-angular:
|
|
18
|
+
"builder": "@angular-devkit/build-angular:application",
|
|
19
19
|
"options": {
|
|
20
|
-
"outputPath":
|
|
20
|
+
"outputPath": {
|
|
21
|
+
"base": "dist"
|
|
22
|
+
},
|
|
21
23
|
"baseHref":"/",
|
|
22
24
|
"index": "src/index.html",
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
+
"polyfills": [
|
|
26
|
+
"src/polyfills.ts",
|
|
27
|
+
"@angular/localize/init",
|
|
28
|
+
],
|
|
25
29
|
"tsConfig": "tsconfig.app.json",
|
|
26
30
|
"assets": [
|
|
27
31
|
"src/assets",
|
|
@@ -39,7 +43,8 @@
|
|
|
39
43
|
"src/environments/real_data/widget-config-mqtt.json",
|
|
40
44
|
"src/environments/real_data/widget-config-docker.json",
|
|
41
45
|
"src/environments/real_data/widget-config-native-mqtt.json",
|
|
42
|
-
"src/environments/real_data/widget-config-native-prod.json"
|
|
46
|
+
"src/environments/real_data/widget-config-native-prod.json",
|
|
47
|
+
"src/environments/real_data/widget-config-aws-stage.json"
|
|
43
48
|
],
|
|
44
49
|
"styles": [
|
|
45
50
|
"src/app/sass/styles.scss"
|
|
@@ -47,11 +52,8 @@
|
|
|
47
52
|
"scripts": [
|
|
48
53
|
"src/assets/js/mqtt/4.2.6/mqtt.min.js",
|
|
49
54
|
"node_modules/bootstrap/dist/js/bootstrap.min.js",
|
|
50
|
-
"node_modules/popper.js/dist/umd/popper.min.js"
|
|
51
55
|
],
|
|
52
|
-
"vendorChunk": true,
|
|
53
56
|
"extractLicenses": false,
|
|
54
|
-
"buildOptimizer": false,
|
|
55
57
|
"allowedCommonJsDependencies": [
|
|
56
58
|
"rxjs-compat",
|
|
57
59
|
"idb",
|
|
@@ -61,7 +63,13 @@
|
|
|
61
63
|
],
|
|
62
64
|
"sourceMap": true,
|
|
63
65
|
"optimization": false,
|
|
64
|
-
"namedChunks": true
|
|
66
|
+
"namedChunks": true,
|
|
67
|
+
"browser": "src/main.ts",
|
|
68
|
+
"stylePreprocessorOptions": {
|
|
69
|
+
"includePaths": [
|
|
70
|
+
"."
|
|
71
|
+
]
|
|
72
|
+
}
|
|
65
73
|
},
|
|
66
74
|
"configurations": {
|
|
67
75
|
"prod": {
|
|
@@ -77,8 +85,6 @@
|
|
|
77
85
|
"namedChunks": false,
|
|
78
86
|
"aot": true,
|
|
79
87
|
"extractLicenses": true,
|
|
80
|
-
"vendorChunk": false,
|
|
81
|
-
"buildOptimizer": true,
|
|
82
88
|
"budgets": [
|
|
83
89
|
{
|
|
84
90
|
"type": "initial",
|
|
@@ -104,8 +110,6 @@
|
|
|
104
110
|
"namedChunks": false,
|
|
105
111
|
"aot": true,
|
|
106
112
|
"extractLicenses": true,
|
|
107
|
-
"vendorChunk": true,
|
|
108
|
-
"buildOptimizer": true,
|
|
109
113
|
"budgets": [
|
|
110
114
|
{
|
|
111
115
|
"type": "initial",
|
|
@@ -124,13 +128,13 @@
|
|
|
124
128
|
},
|
|
125
129
|
"configurations": {
|
|
126
130
|
"prod": {
|
|
127
|
-
"
|
|
131
|
+
"buildTarget": "widget:build:prod"
|
|
128
132
|
},
|
|
129
133
|
"pre": {
|
|
130
|
-
"
|
|
134
|
+
"buildTarget": "widget:build:pre"
|
|
131
135
|
},
|
|
132
136
|
"development": {
|
|
133
|
-
"
|
|
137
|
+
"buildTarget": "widget:build:development"
|
|
134
138
|
}
|
|
135
139
|
},
|
|
136
140
|
"defaultConfiguration": "development"
|
|
@@ -138,7 +142,7 @@
|
|
|
138
142
|
"extract-i18n": {
|
|
139
143
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
|
140
144
|
"options": {
|
|
141
|
-
"
|
|
145
|
+
"buildTarget": "widget:build"
|
|
142
146
|
}
|
|
143
147
|
},
|
|
144
148
|
"test": {
|
package/deploy_amazon_beta.sh
CHANGED
|
@@ -2,14 +2,8 @@
|
|
|
2
2
|
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
3
|
echo "version $version"
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
ng build --configuration="pre" --aot=true --base-href
|
|
6
6
|
|
|
7
|
-
ng build --configuration="pre" --aot=true --base-href --build-optimizer=true
|
|
8
|
-
|
|
9
|
-
### SET HASHING : START ###
|
|
10
|
-
cp ./src/launch_template.js ./dist/launch.js
|
|
11
|
-
node ./src/build_launch.js
|
|
12
|
-
### SET HASHING : END ###
|
|
13
7
|
|
|
14
8
|
# ########## --->>>> NATIVE-MQTT folder START <<<<<------ ########## #
|
|
15
9
|
|
|
@@ -30,10 +24,11 @@ node ./src/build_launch.js
|
|
|
30
24
|
|
|
31
25
|
# ########## --->>>> FIREBASE folder START <<<<<------ ########## #
|
|
32
26
|
cd dist
|
|
33
|
-
aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control max-age=300
|
|
34
|
-
aws s3 sync . s3://tiledesk-widget-pre/v5
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control max-age=300
|
|
28
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control max-age=300
|
|
29
|
+
cd ..
|
|
30
|
+
|
|
31
|
+
#aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
|
|
37
32
|
cd ..
|
|
38
33
|
|
|
39
34
|
aws cloudfront create-invalidation --distribution-id E2V5O0YPR61V8P --paths "/*"
|
package/deploy_amazon_prod.sh
CHANGED
|
@@ -3,13 +3,7 @@ version=`node -e 'console.log(require("./package.json").version)'`
|
|
|
3
3
|
echo "version $version"
|
|
4
4
|
|
|
5
5
|
# --build-optimizer=false if localstorage is disabled (webview) appears https://github.com/firebase/angularfire/issues/970
|
|
6
|
-
ng build --configuration="prod" --aot=true
|
|
7
|
-
##--base-href='./v5/' --output-hashing none
|
|
8
|
-
|
|
9
|
-
### SET HASHING : START ###
|
|
10
|
-
cp ./src/launch_template.js ./dist/launch.js
|
|
11
|
-
node ./src/build_launch.js
|
|
12
|
-
### SET HASHING : END ###
|
|
6
|
+
ng build --configuration="prod" --aot=true
|
|
13
7
|
|
|
14
8
|
#### FIREBASE #####
|
|
15
9
|
# cd dist
|
|
@@ -21,12 +15,11 @@ node ./src/build_launch.js
|
|
|
21
15
|
# #### MQTT #####
|
|
22
16
|
cd dist
|
|
23
17
|
# aws s3 sync . s3://tiledesk-widget/v5/latest/
|
|
24
|
-
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control max-age=
|
|
25
|
-
aws s3 sync . s3://tiledesk-widget/v6
|
|
26
|
-
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control max-age=86400 --exclude='launch.js' #8days
|
|
27
|
-
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
18
|
+
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control max-age=300
|
|
19
|
+
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control max-age=300
|
|
28
20
|
cd ..
|
|
29
21
|
|
|
22
|
+
|
|
30
23
|
aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
|
|
31
24
|
echo new version deployed $version on s3://tiledesk-widget/v5
|
|
32
25
|
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget/v5/index.html
|
package/deploy_beta.sh
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# npm version prerelease --preid=beta
|
|
2
2
|
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
3
|
echo "version $version"
|
|
4
|
-
|
|
4
|
+
echo "____________WIDGET-V5______________"
|
|
5
|
+
echo "CREATING TAG ON GIT FOR version: $version"
|
|
5
6
|
|
|
6
7
|
# Get curent branch name
|
|
7
8
|
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
package/deploy_prod.sh
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# npm version
|
|
1
|
+
# npm version prerelease --preid=beta
|
|
2
2
|
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
|
-
|
|
3
|
+
echo "version $version"
|
|
4
|
+
echo "____________WIDGET-V5______________"
|
|
4
5
|
echo "CREATING TAG ON GIT FOR version: $version"
|
|
5
|
-
# echo "version $version"
|
|
6
6
|
|
|
7
7
|
# Get curent branch name
|
|
8
8
|
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chat21/chat21-web-widget",
|
|
3
3
|
"author": "Tiledesk SRL",
|
|
4
|
-
"version": "5.1.0-
|
|
4
|
+
"version": "5.1.0-rc10",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://www.tiledesk.com",
|
|
7
7
|
"repository": {
|
|
@@ -19,20 +19,19 @@
|
|
|
19
19
|
},
|
|
20
20
|
"private": false,
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@angular/animations": "^
|
|
22
|
+
"@angular/animations": "^18.2.13",
|
|
23
23
|
"@angular/cdk": "^17.3.10",
|
|
24
|
-
"@angular/common": "^
|
|
25
|
-
"@angular/compiler": "^
|
|
26
|
-
"@angular/core": "^
|
|
27
|
-
"@angular/forms": "^
|
|
28
|
-
"@angular/localize": "^
|
|
29
|
-
"@angular/platform-browser": "^
|
|
30
|
-
"@angular/platform-browser-dynamic": "^
|
|
31
|
-
"@angular/router": "^
|
|
32
|
-
"@ctrl/ngx-emoji-mart": "^
|
|
33
|
-
"@ngx-translate/core": "^
|
|
34
|
-
"@ngx-translate/http-loader": "^
|
|
35
|
-
"@popperjs/core": "^2.11.5",
|
|
24
|
+
"@angular/common": "^18.2.13",
|
|
25
|
+
"@angular/compiler": "^18.2.13",
|
|
26
|
+
"@angular/core": "^18.2.13",
|
|
27
|
+
"@angular/forms": "^18.2.13",
|
|
28
|
+
"@angular/localize": "^18.2.13",
|
|
29
|
+
"@angular/platform-browser": "^18.2.13",
|
|
30
|
+
"@angular/platform-browser-dynamic": "^18.2.13",
|
|
31
|
+
"@angular/router": "^18.2.13",
|
|
32
|
+
"@ctrl/ngx-emoji-mart": "^9.2.0",
|
|
33
|
+
"@ngx-translate/core": "^16.0.4",
|
|
34
|
+
"@ngx-translate/http-loader": "^16.0.1",
|
|
36
35
|
"@types/marked": "^4.0.3",
|
|
37
36
|
"accept-language-parser": "^1.5.0",
|
|
38
37
|
"bootstrap": "^5.1.3",
|
|
@@ -42,19 +41,18 @@
|
|
|
42
41
|
"humanize-duration-ts": "^2.1.1",
|
|
43
42
|
"marked": "^4.0.16",
|
|
44
43
|
"ngx-logger": "^5.0.11",
|
|
45
|
-
"popper.js": "^1.16.1",
|
|
46
44
|
"replace": "^1.2.2",
|
|
47
|
-
"rxjs": "
|
|
45
|
+
"rxjs": "^7.8.2",
|
|
48
46
|
"source-map-explorer": "^2.5.3",
|
|
49
47
|
"tslib": "^2.0.0",
|
|
50
48
|
"uuid": "^8.3.2",
|
|
51
49
|
"zone.js": "~0.14.10"
|
|
52
50
|
},
|
|
53
51
|
"devDependencies": {
|
|
54
|
-
"@angular-devkit/build-angular": "^
|
|
55
|
-
"@angular/cli": "^
|
|
56
|
-
"@angular/compiler-cli": "^
|
|
57
|
-
"@angular/language-service": "^
|
|
52
|
+
"@angular-devkit/build-angular": "^18.2.19",
|
|
53
|
+
"@angular/cli": "^18.2.19",
|
|
54
|
+
"@angular/compiler-cli": "^18.2.13",
|
|
55
|
+
"@angular/language-service": "^18.2.13",
|
|
58
56
|
"@types/jasmine": "^3.6.11",
|
|
59
57
|
"@types/jasminewd2": "~2.0.3",
|
|
60
58
|
"@types/node": "^12.11.1",
|
|
@@ -3,7 +3,7 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
|
3
3
|
import { RouterTestingModule } from '@angular/router/testing';
|
|
4
4
|
import { AppComponent } from './app.component';
|
|
5
5
|
import { GlobalSettingsService } from './providers/global-settings.service';
|
|
6
|
-
import {
|
|
6
|
+
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
|
7
7
|
import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
|
|
8
8
|
import { TranslatorService } from './providers/translator.service';
|
|
9
9
|
import { TranslateModule } from '@ngx-translate/core';
|
|
@@ -23,6 +23,7 @@ import { ChatManager } from 'src/chat21-core/providers/chat-manager';
|
|
|
23
23
|
import { NGXLogger } from 'ngx-logger';
|
|
24
24
|
import { CustomLogger } from 'src/chat21-core/providers/logger/customLogger';
|
|
25
25
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
26
|
+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
26
27
|
|
|
27
28
|
describe('AppComponent', () => {
|
|
28
29
|
let component: AppComponent;
|
|
@@ -32,12 +33,12 @@ describe('AppComponent', () => {
|
|
|
32
33
|
|
|
33
34
|
beforeEach(waitForAsync(() => {
|
|
34
35
|
TestBed.configureTestingModule({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
declarations: [
|
|
37
|
+
AppComponent
|
|
38
|
+
],
|
|
39
|
+
imports: [RouterTestingModule,
|
|
40
|
+
TranslateModule.forRoot()],
|
|
41
|
+
providers: [
|
|
41
42
|
Triggerhandler,
|
|
42
43
|
GlobalSettingsService,
|
|
43
44
|
AppStorageService,
|
|
@@ -54,12 +55,11 @@ describe('AppComponent', () => {
|
|
|
54
55
|
ImageRepoService,
|
|
55
56
|
TypingService,
|
|
56
57
|
PresenceService,
|
|
57
|
-
UploadService
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}).compileComponents();
|
|
58
|
+
UploadService,
|
|
59
|
+
provideHttpClient(withInterceptorsFromDi()),
|
|
60
|
+
provideHttpClientTesting()
|
|
61
|
+
]
|
|
62
|
+
}).compileComponents();
|
|
63
63
|
}));
|
|
64
64
|
|
|
65
65
|
beforeEach(() => {
|
package/src/app/app.module.ts
CHANGED
|
@@ -54,7 +54,7 @@ import { AppConfigService } from './providers/app-config.service';
|
|
|
54
54
|
import { BrowserModule } from '@angular/platform-browser';
|
|
55
55
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
56
56
|
import { APP_INITIALIZER, NgModule } from '@angular/core';
|
|
57
|
-
import { HttpClient,
|
|
57
|
+
import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
58
58
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
59
59
|
import { environment } from 'src/environments/environment';
|
|
60
60
|
|
|
@@ -303,21 +303,18 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
|
|
|
303
303
|
NetworkOfflineComponent,
|
|
304
304
|
ConfirmCloseComponent
|
|
305
305
|
],
|
|
306
|
-
imports: [
|
|
307
|
-
BrowserModule,
|
|
306
|
+
imports: [BrowserModule,
|
|
308
307
|
BrowserAnimationsModule,
|
|
309
|
-
// AppRoutingModule,
|
|
310
|
-
HttpClientModule,
|
|
311
308
|
FormsModule,
|
|
312
309
|
ReactiveFormsModule,
|
|
313
310
|
PickerModule,
|
|
314
311
|
TranslateModule.forRoot(//),
|
|
315
312
|
{
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
313
|
+
// loader: {
|
|
314
|
+
// provide: TranslateLoader,
|
|
315
|
+
// useFactory: (createTranslateLoader),
|
|
316
|
+
// deps: [HttpClient]
|
|
317
|
+
// }
|
|
321
318
|
}),
|
|
322
319
|
LoggerModule.forRoot({
|
|
323
320
|
level: NgxLoggerLevel.DEBUG,
|
|
@@ -349,7 +346,7 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
|
|
|
349
346
|
{
|
|
350
347
|
provide: MessagingAuthService,
|
|
351
348
|
useFactory: authenticationFactory,
|
|
352
|
-
deps: [HttpClient, AppConfigService, Chat21Service, AppStorageService
|
|
349
|
+
deps: [HttpClient, AppConfigService, Chat21Service, AppStorageService]
|
|
353
350
|
},
|
|
354
351
|
{
|
|
355
352
|
provide: ConversationsHandlerService,
|
|
@@ -389,7 +386,7 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
|
|
|
389
386
|
{
|
|
390
387
|
provide: UploadService,
|
|
391
388
|
useFactory: uploadFactory,
|
|
392
|
-
deps: [HttpClient, AppConfigService, AppStorageService
|
|
389
|
+
deps: [HttpClient, AppConfigService, AppStorageService]
|
|
393
390
|
},
|
|
394
391
|
TiledeskAuthService,
|
|
395
392
|
TiledeskRequestsService,
|
|
@@ -398,7 +395,8 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
|
|
|
398
395
|
Triggerhandler,
|
|
399
396
|
WaitingService,
|
|
400
397
|
ScriptService,
|
|
401
|
-
BrandService
|
|
398
|
+
BrandService,
|
|
399
|
+
provideHttpClient(withInterceptorsFromDi())
|
|
402
400
|
],
|
|
403
401
|
bootstrap: [AppComponent]
|
|
404
402
|
})
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
[hideHeaderCloseButton]="g?.hideHeaderCloseButton"
|
|
16
16
|
[hideHeaderBackButton]="g?.singleConversation"
|
|
17
17
|
[hideCloseConversationOptionMenu]="(isConversationArchived || g?.hideCloseConversationOptionMenu)"
|
|
18
|
-
[hideRestartConversationOptionsMenu]="(isConversationArchived || (!g?.singleConversation && !hideTextAreaContent) || g?.hideRestartConversationOptionsMenu)"
|
|
19
18
|
[hideHeaderConversationOptionsMenu]="g?.hideHeaderConversationOptionsMenu"
|
|
20
19
|
[hideSignOutOptionMenu]="(!g?.singleConversation || !g?.showLogoutOption)"
|
|
21
20
|
[hideChatDetailOptionMenu]="(!g?.isDevMode)"
|
|
@@ -113,7 +112,7 @@
|
|
|
113
112
|
[attributes]="g?.attributes"
|
|
114
113
|
[senderId]="senderId"
|
|
115
114
|
[tenant]="g?.tenant"
|
|
116
|
-
[
|
|
115
|
+
[project]="g?.project"
|
|
117
116
|
[channelType]="g?.channelType"
|
|
118
117
|
[userFullname]="g?.userFullname"
|
|
119
118
|
[userEmail]="g?.userEmail"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TiledeskRequestsService } from './../../../../chat21-core/providers/tiledesk/tiledesk-requests.service';
|
|
2
2
|
import { StarRatingWidgetService } from './../../../providers/star-rating-widget.service';
|
|
3
3
|
import { StarRatingWidgetComponent } from './../../star-rating-widget/star-rating-widget.component';
|
|
4
|
-
import {
|
|
4
|
+
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
|
5
5
|
|
|
6
6
|
import { Triggerhandler } from './../../../../chat21-core/utils/triggerHandler';
|
|
7
7
|
import { AppComponent } from './../../../app.component';
|
|
@@ -13,7 +13,6 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
|
13
13
|
|
|
14
14
|
import { ConversationComponent } from './conversation.component';
|
|
15
15
|
import { GlobalSettingsService } from '../../../providers/global-settings.service';
|
|
16
|
-
import { SettingsSaverService } from '../../../providers/settings-saver.service';
|
|
17
16
|
import { TranslatorService } from '../../../providers/translator.service';
|
|
18
17
|
|
|
19
18
|
import { AppStorageService } from '../../../../chat21-core/providers/abstract/app-storage.service';
|
|
@@ -33,6 +32,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
|
|
33
32
|
import { NGXLogger } from 'ngx-logger';
|
|
34
33
|
import { CustomLogger } from 'src/chat21-core/providers/logger/customLogger';
|
|
35
34
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
35
|
+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
36
36
|
|
|
37
37
|
describe('ConversationComponent', () => {
|
|
38
38
|
let component: ConversationComponent;
|
|
@@ -43,18 +43,15 @@ describe('ConversationComponent', () => {
|
|
|
43
43
|
|
|
44
44
|
beforeEach(waitForAsync(() => {
|
|
45
45
|
TestBed.configureTestingModule({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
],
|
|
51
|
-
providers: [
|
|
46
|
+
declarations: [ConversationComponent],
|
|
47
|
+
schemas: [NO_ERRORS_SCHEMA],
|
|
48
|
+
imports: [TranslateModule.forRoot()],
|
|
49
|
+
providers: [
|
|
52
50
|
Globals,
|
|
53
51
|
AppConfigService,
|
|
54
52
|
AppComponent,
|
|
55
53
|
{ provide: ElementRef, useClass: MockElementRef },
|
|
56
54
|
GlobalSettingsService,
|
|
57
|
-
SettingsSaverService,
|
|
58
55
|
Triggerhandler,
|
|
59
56
|
TranslatorService,
|
|
60
57
|
AppConfigService,
|
|
@@ -72,10 +69,11 @@ describe('ConversationComponent', () => {
|
|
|
72
69
|
UploadService,
|
|
73
70
|
StarRatingWidgetService,
|
|
74
71
|
TiledeskRequestsService,
|
|
75
|
-
NGXLogger
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
NGXLogger,
|
|
73
|
+
provideHttpClient(withInterceptorsFromDi()),
|
|
74
|
+
provideHttpClientTesting()
|
|
75
|
+
]
|
|
76
|
+
})
|
|
79
77
|
.compileComponents();
|
|
80
78
|
}));
|
|
81
79
|
|
|
@@ -118,7 +118,7 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
118
118
|
|
|
119
119
|
// devo inserirle nel globals
|
|
120
120
|
subscriptions: Array<any> = [];
|
|
121
|
-
private unsubscribe$: Subject<
|
|
121
|
+
private unsubscribe$: Subject<void> = new Subject<void>();
|
|
122
122
|
showMessageWelcome: boolean;
|
|
123
123
|
|
|
124
124
|
// ========= begin::agent availability
|
|
@@ -231,7 +231,9 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
231
231
|
'LABEL_PLACEHOLDER',
|
|
232
232
|
'GUEST_LABEL',
|
|
233
233
|
'LABEL_START_NW_CONV',
|
|
234
|
-
'CONTINUE'
|
|
234
|
+
'CONTINUE',
|
|
235
|
+
'EMOJI_NOT_ELLOWED',
|
|
236
|
+
'DOMAIN_NOT_ALLOWED'
|
|
235
237
|
];
|
|
236
238
|
|
|
237
239
|
const keysContent = [
|
package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
[class.hideTextReply]="hideTextReply">
|
|
4
|
-
|
|
1
|
+
<div class="footerContainerAlert">
|
|
2
|
+
<!-- LOGO-->
|
|
3
|
+
<div id="hiddenFooter" *ngIf="!hideTextAreaContent && poweredBy" class="fade-in-bottom" [class.hideTextReply]="hideTextReply">
|
|
4
|
+
<div tabindex="-1" class="c21-powered-by" [innerHTML]="poweredBy" (click)="managePoweredBy($event)"></div>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<!-- ALERT EMOJI & URLS -->
|
|
8
|
+
<div id="textAlert" *ngIf="!hideTextAreaContent && showAlertEmoji" class="fade-in-bottom" [class.hideTextReply]="hideTextReply">
|
|
9
|
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" version="1.1" viewBox="0 0 110 135">
|
|
10
|
+
<path d="M55,25.8c-23,0-41.7,18.7-41.7,41.7s18.7,41.7,41.7,41.7,41.7-18.7,41.7-41.7-18.7-41.7-41.7-41.7ZM55,91.5c-3.4,0-6.2-2.8-6.2-6.2s2.8-6.2,6.2-6.2,6.2,2.8,6.2,6.2-2.8,6.2-6.2,6.2ZM60.3,70.1c-.2,2.8-2.5,4.9-5.3,4.9s-5.1-2.2-5.3-4.9l-1.6-22.3c-.3-4,2.9-7.4,6.9-7.4s7.2,3.4,6.9,7.4l-1.6,22.3Z"/>
|
|
11
|
+
</svg>
|
|
12
|
+
<div tabindex="-1" class="alertText">{{translationMap.get('EMOJI_NOT_ELLOWED')}}</div>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div id="textAlert" *ngIf="!hideTextAreaContent && showAlertUrl" class="fade-in-bottom" [class.hideTextReply]="hideTextReply">
|
|
16
|
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" version="1.1" viewBox="0 0 110 135">
|
|
17
|
+
<path d="M55,25.8c-23,0-41.7,18.7-41.7,41.7s18.7,41.7,41.7,41.7,41.7-18.7,41.7-41.7-18.7-41.7-41.7-41.7ZM55,91.5c-3.4,0-6.2-2.8-6.2-6.2s2.8-6.2,6.2-6.2,6.2,2.8,6.2,6.2-2.8,6.2-6.2,6.2ZM60.3,70.1c-.2,2.8-2.5,4.9-5.3,4.9s-5.1-2.2-5.3-4.9l-1.6-22.3c-.3-4,2.9-7.4,6.9-7.4s7.2,3.4,6.9,7.4l-1.6,22.3Z"/>
|
|
18
|
+
</svg>
|
|
19
|
+
<div tabindex="-1" class="alertText">{{translationMap.get('DOMAIN_NOT_ALLOWED')}}</div>
|
|
20
|
+
</div>
|
|
5
21
|
</div>
|
|
6
22
|
|
|
7
23
|
<!-- TEXTAREA + ICONS: conv active-->
|
|
@@ -44,7 +60,7 @@
|
|
|
44
60
|
|
|
45
61
|
|
|
46
62
|
|
|
47
|
-
<div *ngIf="!isStopRec" class="visible-text-area"
|
|
63
|
+
<div *ngIf="!isStopRec" class="visible-text-area" [class.hasError]="showAlertEmoji || showAlertUrl" [class.disabled] = "( isConversationArchived || hideTextReply)? true : null">
|
|
48
64
|
<!-- isFilePendingToUpload || -->
|
|
49
65
|
<textarea
|
|
50
66
|
[attr.disabled] = "(hideTextReply)? true : null"
|
|
@@ -67,7 +83,7 @@
|
|
|
67
83
|
</div>
|
|
68
84
|
|
|
69
85
|
<!-- ICON SEND -->
|
|
70
|
-
<div *ngIf="(textInputTextArea !== '' && !isStopRec) || !showAudioRecorderFooterButton" tabindex="-1" class="chat21-textarea-button" [class.active]="textInputTextArea && !hideTextReply" id="chat21-button-send" (click)="onSendPressed($event)">
|
|
86
|
+
<div *ngIf="(textInputTextArea !== '' && !isStopRec) || !showAudioRecorderFooterButton" tabindex="-1" class="chat21-textarea-button" [class.disabled]="showAlertEmoji || showAlertUrl" [class.active]="textInputTextArea && !hideTextReply" id="chat21-button-send" (click)="onSendPressed($event)">
|
|
71
87
|
<span class="v-align-center">
|
|
72
88
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="24" width="24" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
|
73
89
|
<path d="M1.8,18.9V1.7L22,10.3L1.8,18.9z M3.9,15.6l12.6-5.4L3.9,4.9v3.7l6.4,1.6l-6.4,1.6V15.6z M3.9,15.6V4.9v7V15.6z"/>
|