@chat21/chat21-web-widget 5.1.18 → 5.1.20-rc2
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/docker-community-push-latest.yml +23 -13
- package/.github/workflows/docker-image-tag-community-tag-push.yml +22 -12
- package/CHANGELOG.md +68 -2
- package/Dockerfile +4 -5
- package/angular.json +2 -1
- package/deploy_amazon_beta.sh +17 -7
- package/deploy_amazon_prod.sh +4 -4
- package/package.json +1 -1
- package/src/app/app.component.html +8 -1
- package/src/app/app.component.scss +60 -4
- package/src/app/app.component.ts +63 -28
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +84 -10
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +4 -0
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +27 -1
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +6 -6
- package/src/app/component/home-conversations/home-conversations.component.html +16 -6
- package/src/app/component/home-conversations/home-conversations.component.ts +29 -0
- package/src/app/component/launcher-button/launcher-button.component.html +1 -1
- package/src/app/component/launcher-button/launcher-button.component.ts +3 -2
- package/src/app/component/list-conversations/list-conversations.component.html +8 -3
- package/src/app/component/list-conversations/list-conversations.component.ts +29 -0
- package/src/app/component/message/html/html.component.html +5 -1
- package/src/app/component/message/html/html.component.scss +9 -0
- package/src/app/component/message/text/text.component.scss +4 -0
- package/src/app/pipe/marked.pipe.ts +31 -4
- package/src/app/providers/translator.service.ts +2 -0
- package/src/app/sass/normalize.scss +1 -0
- package/src/app/utils/globals.ts +1 -1
- package/src/assets/i18n/en.json +1 -0
- package/src/assets/i18n/es.json +1 -0
- package/src/assets/i18n/fr.json +1 -0
- package/src/assets/i18n/it.json +1 -0
- package/src/chat21-core/providers/abstract/upload.service.ts +5 -1
- package/src/chat21-core/providers/firebase/firebase-upload.service.ts +141 -12
- package/src/chat21-core/providers/native/native-image-repo.ts +1 -1
- package/src/chat21-core/providers/native/native-upload-service.ts +143 -46
- package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts +1 -1
- package/src/chat21-core/utils/utils.ts +5 -2
- package/src/iframe-style.css +36 -12
- package/.vscode/settings.json +0 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
name: Docker Image Community latest CI
|
|
2
2
|
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
5
|
branches: [ master ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ master ]
|
|
8
8
|
|
|
9
9
|
jobs:
|
|
10
10
|
push_to_registry:
|
|
@@ -12,12 +12,22 @@ jobs:
|
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
13
|
|
|
14
14
|
steps:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
- name: Check out the repo
|
|
16
|
+
uses: actions/checkout@v2
|
|
17
|
+
|
|
18
|
+
- name: Set up Docker Buildx
|
|
19
|
+
uses: docker/setup-buildx-action@v2
|
|
20
|
+
|
|
21
|
+
- name: Log in to Docker Hub
|
|
22
|
+
uses: docker/login-action@v2
|
|
23
|
+
with:
|
|
24
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
25
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
26
|
+
|
|
27
|
+
- name: Build and push multiarch Docker image
|
|
28
|
+
uses: docker/build-push-action@v3
|
|
29
|
+
with:
|
|
30
|
+
context: .
|
|
31
|
+
push: true
|
|
32
|
+
platforms: linux/amd64,linux/arm64
|
|
33
|
+
tags: chat21/chat21-web-widget:latest
|
|
@@ -3,20 +3,30 @@ name: Publish Docker Community image tags
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
tags:
|
|
6
|
-
- '**'
|
|
7
|
-
jobs:
|
|
6
|
+
- '**' # Trigger su qualsiasi tag
|
|
8
7
|
|
|
8
|
+
jobs:
|
|
9
9
|
push_to_registry:
|
|
10
10
|
name: Push Docker image to Docker Hub
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
|
+
|
|
12
13
|
steps:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
- name: Check out the repo
|
|
15
|
+
uses: actions/checkout@v2
|
|
16
|
+
|
|
17
|
+
- name: Set up Docker Buildx
|
|
18
|
+
uses: docker/setup-buildx-action@v2
|
|
19
|
+
|
|
20
|
+
- name: Log in to Docker Hub
|
|
21
|
+
uses: docker/login-action@v2
|
|
22
|
+
with:
|
|
23
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
24
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
25
|
+
|
|
26
|
+
- name: Build and push multiarch Docker image
|
|
27
|
+
uses: docker/build-push-action@v3
|
|
28
|
+
with:
|
|
29
|
+
context: .
|
|
30
|
+
push: true
|
|
31
|
+
platforms: linux/amd64,linux/arm64
|
|
32
|
+
tags: chat21/chat21-web-widget:${{ github.ref_name }}
|
package/CHANGELOG.md
CHANGED
|
@@ -6,18 +6,42 @@
|
|
|
6
6
|
### **Copyrigth**:
|
|
7
7
|
*Tiledesk SRL*
|
|
8
8
|
|
|
9
|
+
# 5.1.20-rc2
|
|
10
|
+
- **changed**: API for upload a file/iamges
|
|
11
|
+
- **changed**: marked pipe do not render /n
|
|
12
|
+
|
|
13
|
+
# 5.1.20-rc1
|
|
14
|
+
- **changed**: API for upload a file/iamges
|
|
15
|
+
|
|
16
|
+
# 5.1.19
|
|
17
|
+
|
|
18
|
+
# 5.1.19-rc1
|
|
19
|
+
- **bug fixed**: show bottom scroll button and unread message badge only when I'm not at the bottom of the page
|
|
20
|
+
- **changed**: allow HTML code to be inserted into messages, but do not parse the code. Ensure coexistence with Markdown.
|
|
21
|
+
- **bug fixed**: after sending a multi-line message, the text area remains open on multiple lines.
|
|
22
|
+
- **bug fixed**: fixed widget animation when opened
|
|
23
|
+
- **bug-fixed**: line-height in markdown
|
|
24
|
+
- **bug-fixed**: when i move to top mode and close the widget, the balloon moves to the right
|
|
25
|
+
- **changed**: saved the widget's size state to local storage. The parameter flow is (default → storage → settings → URL)
|
|
26
|
+
|
|
9
27
|
# 5.1.18
|
|
28
|
+
# 5.1.15-rc3
|
|
10
29
|
- **added**: Implemented Shadow DOM in the text component to isolate HTML and Markdown rendering in a safe and protected context
|
|
11
30
|
- **changed**: Adapted text component styles to support Shadow DOM (removed ::ng-deep, added styles for common markdown elements)
|
|
12
31
|
- **security**: HTML/Markdown content is now rendered in an isolated Shadow DOM, improving security and preventing interference with the rest of the application
|
|
13
32
|
|
|
14
|
-
|
|
15
33
|
# 5.1.17
|
|
16
34
|
- **bug-fixed**: set the maximum width on a message with iframe
|
|
17
35
|
|
|
18
36
|
# 5.1.16
|
|
19
37
|
- **changed**: "close chat" header conversation menu button enabled in chatbot-panel.html
|
|
20
38
|
|
|
39
|
+
# 5.1.15-rc2
|
|
40
|
+
- **bug-fixed**: Bug fix for ifame message width
|
|
41
|
+
|
|
42
|
+
# 5.1.15-rc1
|
|
43
|
+
- **changed**: Load local translations before remote ones
|
|
44
|
+
|
|
21
45
|
# 5.1.15
|
|
22
46
|
- **changed**: Load local translations before remote ones
|
|
23
47
|
|
|
@@ -26,14 +50,56 @@
|
|
|
26
50
|
|
|
27
51
|
# 5.1.13
|
|
28
52
|
- **bug-fixed**: set default widget size
|
|
53
|
+
|
|
54
|
+
# 5.1.7-rc16
|
|
55
|
+
- **bug-fixed**: set default widget size
|
|
56
|
+
|
|
57
|
+
# 5.1.7-rc15
|
|
58
|
+
- **bug-fixed**: set the color of the buttons with visibility control to the font color
|
|
59
|
+
|
|
60
|
+
# 5.1.7-rc14
|
|
61
|
+
- **bug-fixed**: departmentId and departmentName is incorrect in attributes
|
|
62
|
+
|
|
63
|
+
# 5.1.7-rc13
|
|
64
|
+
- **changed**: Force authentication if ageChangeVisibilityDesktop or PageChangeVisibilityMobile is OPEN
|
|
65
|
+
|
|
66
|
+
# 5.1.7-rc12
|
|
67
|
+
- **changed**: Set the default autoStart value to false
|
|
68
|
+
- **added**: Added the open widget loading spinner
|
|
69
|
+
- **changed**: Load the widget without authentication and display the speech bubble
|
|
70
|
+
|
|
71
|
+
# 5.1.7-rc11
|
|
72
|
+
- **changed**: set default value autoStart false
|
|
73
|
+
- **added**:added loading spinner
|
|
74
|
+
|
|
75
|
+
# 5.1.7-rc10
|
|
76
|
+
- **changed**: load widget without authentication and display the balloon
|
|
77
|
+
|
|
78
|
+
# 5.1.7-rc9
|
|
79
|
+
- **removed**: 'DOMAIN_NOT_ALLOWED' in textarea footer component
|
|
80
|
+
|
|
81
|
+
# 5.1.7-rc8
|
|
82
|
+
# changes in the branch
|
|
83
|
+
- **changed**: Load local translations before remote ones
|
|
84
|
+
- **bug-fixed**: set default widget size
|
|
29
85
|
- **changed**: Updated the translations of the tooltips in the footer-component
|
|
30
86
|
- **changed**: Refactored the network-offline component and made it generic for displaying errors (now error-alert.component)
|
|
31
|
-
|
|
87
|
+
|
|
88
|
+
# 5.1.7-rc7
|
|
89
|
+
- **bug-fixed**: button new_conversation always appear. added subscription to conversationAdded
|
|
90
|
+
|
|
91
|
+
# 5.1.7-rc6
|
|
92
|
+
- **added**: Added MAX_ATTACHMENT_ERROR error message when uploading a file larger than 10 MB
|
|
32
93
|
|
|
33
94
|
# 5.1.12
|
|
34
95
|
- **bug-fixed**: check showEmojiFooterButton to enable/disable emojii
|
|
35
96
|
- **bug-fixed**: markdown is fired as an emojii and blocked by isEmojii check fn
|
|
36
97
|
|
|
98
|
+
# 5.1.7-rc7
|
|
99
|
+
- **bug-fixed**: button new_conversation always appear. added subscription to conversationAdded
|
|
100
|
+
|
|
101
|
+
# 5.1.7-rc6
|
|
102
|
+
- **added**: Added MAX_ATTACHMENT_ERROR error message when uploading a file larger than 10 MB
|
|
37
103
|
|
|
38
104
|
# 5.1.7-rc5
|
|
39
105
|
- **bug-fixed**: bug fixed BUTTON STYLES
|
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:20.12.2-alpine3.19 as builder
|
|
4
|
+
FROM --platform=$BUILDPLATFORM node:20.12.2-alpine3.19 as builder
|
|
5
5
|
|
|
6
6
|
COPY package.json package-lock.json ./
|
|
7
7
|
|
|
@@ -15,12 +15,11 @@ COPY . .
|
|
|
15
15
|
|
|
16
16
|
## Build the angular app in production mode and store the artifacts in dist folder
|
|
17
17
|
|
|
18
|
-
RUN npx ng build --configuration="prod" --output-path=dist --base-href=./ --output-hashing=none
|
|
19
18
|
|
|
19
|
+
RUN npx ng build --configuration="prod" --output-path=dist --base-href=./ --output-hashing=none
|
|
20
20
|
|
|
21
21
|
### STAGE 2: Setup ###
|
|
22
|
-
|
|
23
|
-
FROM nginx:1.14.1-alpine
|
|
22
|
+
FROM --platform=$BUILDPLATFORM nginx:1.14.1-alpine
|
|
24
23
|
|
|
25
24
|
## Copy our default nginx config
|
|
26
25
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
@@ -33,4 +32,4 @@ COPY --from=builder /ng-app/dist/browser /usr/share/nginx/html
|
|
|
33
32
|
|
|
34
33
|
RUN echo "Chat21 Web Widget Started!!"
|
|
35
34
|
|
|
36
|
-
CMD ["/bin/sh",
|
|
35
|
+
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/widget-config-template.json > /usr/share/nginx/html/widget-config.json && exec nginx -g 'daemon off;'"]
|
package/angular.json
CHANGED
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
"src/environments/real_data/widget-config-docker.json",
|
|
45
45
|
"src/environments/real_data/widget-config-native-mqtt.json",
|
|
46
46
|
"src/environments/real_data/widget-config-native-prod.json",
|
|
47
|
-
"src/environments/real_data/widget-config-aws-stage.json"
|
|
47
|
+
"src/environments/real_data/widget-config-aws-stage.json",
|
|
48
|
+
"src/environments/real_data/widget-config-aws-aruba.json"
|
|
48
49
|
],
|
|
49
50
|
"styles": [
|
|
50
51
|
"src/app/sass/styles.scss"
|
package/deploy_amazon_beta.sh
CHANGED
|
@@ -2,8 +2,16 @@
|
|
|
2
2
|
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
3
|
echo "version $version"
|
|
4
4
|
|
|
5
|
+
npm i
|
|
6
|
+
|
|
7
|
+
cp src/environments/real_data/environment.pre.ts src/environments/environment.pre.ts
|
|
8
|
+
|
|
5
9
|
ng build --configuration="pre" --aot=true --base-href
|
|
6
10
|
|
|
11
|
+
### SET HASHING : START ###
|
|
12
|
+
cp ./src/launch_template.js ./dist/browser/launch.js
|
|
13
|
+
node ./src/build_launch.js
|
|
14
|
+
### SET HASHING : END ###
|
|
7
15
|
|
|
8
16
|
# ########## --->>>> NATIVE-MQTT folder START <<<<<------ ########## #
|
|
9
17
|
|
|
@@ -23,15 +31,17 @@ ng build --configuration="pre" --aot=true --base-href
|
|
|
23
31
|
|
|
24
32
|
|
|
25
33
|
# ########## --->>>> FIREBASE folder START <<<<<------ ########## #
|
|
26
|
-
cd dist
|
|
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
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
cd ..
|
|
34
|
+
cd dist/browser
|
|
35
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control max-age=300 --exclude='launch.js' #7days
|
|
36
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
37
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control max-age=300 --exclude='launch.js' #7days
|
|
38
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
39
|
+
cd ../..
|
|
33
40
|
|
|
34
41
|
aws cloudfront create-invalidation --distribution-id E2V5O0YPR61V8P --paths "/*"
|
|
42
|
+
|
|
43
|
+
git restore src/environments/environment.pre.ts
|
|
44
|
+
|
|
35
45
|
# echo new version deployed $NEW_VER/$NEW_BUILD/ on s3://tiledesk-widget-pre/v2
|
|
36
46
|
echo new version deployed $version/ on s3://tiledesk-widget-pre/v5 and s3://tiledesk-widget-pre/v5/$version/
|
|
37
47
|
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget-pre/v5/index.html
|
package/deploy_amazon_prod.sh
CHANGED
|
@@ -35,7 +35,7 @@ aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*
|
|
|
35
35
|
|
|
36
36
|
git restore src/environments/environment.prod.ts
|
|
37
37
|
|
|
38
|
-
echo new version deployed $version on s3://tiledesk-widget/
|
|
39
|
-
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget/
|
|
40
|
-
echo https://widget.tiledesk.com/
|
|
41
|
-
echo https://widget.tiledesk.com/
|
|
38
|
+
echo new version deployed $version on s3://tiledesk-widget/v5
|
|
39
|
+
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget/v5/index.html
|
|
40
|
+
echo https://widget.tiledesk.com/v5/index.html
|
|
41
|
+
echo https://widget.tiledesk.com/v5/$version/index.html
|
package/package.json
CHANGED
|
@@ -145,5 +145,12 @@
|
|
|
145
145
|
<chat-launcher-button *ngIf="isInitialized"
|
|
146
146
|
(onButtonClicked)="onOpenCloseWidget($event)">
|
|
147
147
|
</chat-launcher-button>
|
|
148
|
-
|
|
148
|
+
|
|
149
|
+
<!-- Loading Spinner -->
|
|
150
|
+
<div *ngIf="loading" class="tiledesk-loading-overlay">
|
|
151
|
+
<div class="tiledesk-loading-spinner">
|
|
152
|
+
<div class="spinner-circle"></div>
|
|
153
|
+
<div class="loading-text">{{ translationMap.get('LABEL_LOADING') }}</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
149
156
|
</div>
|
|
@@ -488,14 +488,11 @@ chat-root {
|
|
|
488
488
|
right: 0px;
|
|
489
489
|
top: 0px;
|
|
490
490
|
bottom: 0px;
|
|
491
|
-
// border-radius: 16px;
|
|
492
491
|
overflow: hidden;
|
|
493
492
|
background-color: transparent;
|
|
494
|
-
// border: 1px solid #cccccc; //NEW GAB
|
|
495
493
|
margin: 0px;
|
|
496
494
|
padding: 0px;
|
|
497
|
-
|
|
498
|
-
|
|
495
|
+
opacity: 0;
|
|
499
496
|
&.full-screen-mode {
|
|
500
497
|
width: 100%;
|
|
501
498
|
height: 100%;
|
|
@@ -764,4 +761,63 @@ chat-root {
|
|
|
764
761
|
}
|
|
765
762
|
}
|
|
766
763
|
|
|
764
|
+
// ========= BEGIN: LOADING SPINNER ========= //
|
|
765
|
+
.tiledesk-loading-overlay {
|
|
766
|
+
position: absolute;
|
|
767
|
+
top: 0;
|
|
768
|
+
left: 0;
|
|
769
|
+
width: 100%;
|
|
770
|
+
height: 100%;
|
|
771
|
+
background-color: rgba(248, 249, 250, 0.95);
|
|
772
|
+
display: flex;
|
|
773
|
+
justify-content: center;
|
|
774
|
+
align-items: center;
|
|
775
|
+
z-index: 9999;
|
|
776
|
+
backdrop-filter: blur(2px);
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
.tiledesk-loading-spinner {
|
|
780
|
+
display: flex;
|
|
781
|
+
flex-direction: column;
|
|
782
|
+
align-items: center;
|
|
783
|
+
gap: 16px;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
.spinner-circle {
|
|
787
|
+
width: 50px;
|
|
788
|
+
height: 50px;
|
|
789
|
+
border: 4px solid rgba(59, 130, 246, 0.2);
|
|
790
|
+
border-top-color: #3b82f6;
|
|
791
|
+
border-radius: 50%;
|
|
792
|
+
animation: spin 0.8s linear infinite;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
@keyframes spin {
|
|
796
|
+
0% {
|
|
797
|
+
transform: rotate(0deg);
|
|
798
|
+
}
|
|
799
|
+
100% {
|
|
800
|
+
transform: rotate(360deg);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
.loading-text {
|
|
805
|
+
font-family: var(--font-family-bubble-message, 'Roboto', 'Google Sans', Helvetica, Arial, sans-serif);
|
|
806
|
+
font-size: 14px;
|
|
807
|
+
font-weight: 500;
|
|
808
|
+
color: #3b82f6;
|
|
809
|
+
letter-spacing: 0.5px;
|
|
810
|
+
animation: pulse 1.5s ease-in-out infinite;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
@keyframes pulse {
|
|
814
|
+
0%, 100% {
|
|
815
|
+
opacity: 1;
|
|
816
|
+
}
|
|
817
|
+
50% {
|
|
818
|
+
opacity: 0.5;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
// ========= END: LOADING SPINNER ========= //
|
|
822
|
+
|
|
767
823
|
}
|
package/src/app/app.component.ts
CHANGED
|
@@ -106,6 +106,10 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
106
106
|
|
|
107
107
|
forceDisconnect: boolean = false;
|
|
108
108
|
|
|
109
|
+
//network status
|
|
110
|
+
isOnline: boolean = true;
|
|
111
|
+
loading: boolean = false;
|
|
112
|
+
|
|
109
113
|
// alert error message
|
|
110
114
|
isShowErrorMessage: boolean = false;
|
|
111
115
|
errorMessage: string = '';
|
|
@@ -149,7 +153,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
149
153
|
this.logger.info('[APP-CONF]---------------- ngAfterViewInit: APP.COMPONENT ---------------- ')
|
|
150
154
|
|
|
151
155
|
// Initialize translation map and enable buttons
|
|
152
|
-
const keys = ['MAXIMIZE', 'MINIMIZE', 'CENTER', 'BUTTON_CLOSE_TO_ICON'];
|
|
156
|
+
const keys = ['MAXIMIZE', 'MINIMIZE', 'CENTER', 'BUTTON_CLOSE_TO_ICON', 'LABEL_LOADING'];
|
|
153
157
|
this.translationMap = this.translateService.translateLanguage(keys);
|
|
154
158
|
this.isButtonsDisabled = false;
|
|
155
159
|
|
|
@@ -262,7 +266,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
262
266
|
this.tiledeskRequestsService.initialize(this.appConfigService.getConfig().apiUrl, this.g.projectid)
|
|
263
267
|
this.messagingAuthService.initialize();
|
|
264
268
|
this.chatManager.initialize();
|
|
265
|
-
this.uploadService.initialize();
|
|
269
|
+
this.uploadService.initialize(this.g.projectid);
|
|
266
270
|
}
|
|
267
271
|
|
|
268
272
|
|
|
@@ -316,8 +320,15 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
316
320
|
this.g.setIsOpen(isOpen)
|
|
317
321
|
this.appStorageService.setItem('isOpen', isOpen)
|
|
318
322
|
}
|
|
319
|
-
|
|
320
|
-
|
|
323
|
+
|
|
324
|
+
if(this.g.onPageChangeVisibilityDesktop === 'last'){
|
|
325
|
+
this.logger.debug('[APP-COMP2] ------this.g.isOpen: ', this.g.isOpen)
|
|
326
|
+
if(this.g.isOpen){
|
|
327
|
+
this.g.autoStart = true;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
|
|
321
332
|
/**CHECK IF JWT IS IN URL PARAMETERS */
|
|
322
333
|
this.logger.debug('[APP-COMP] check if token is passed throw url: ', this.g.jwt);
|
|
323
334
|
if (this.g.jwt) {
|
|
@@ -354,10 +365,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
354
365
|
this.subscriptions.push(obsSettingsService);
|
|
355
366
|
this.globalSettingsService.initWidgetParamiters(this.g, this.el);
|
|
356
367
|
|
|
357
|
-
// SET AUDIO
|
|
358
|
-
this.audio = new Audio();
|
|
359
|
-
this.audio.src = this.g.baseLocation + URL_SOUND_LIST_CONVERSATION;
|
|
360
|
-
this.audio.load();
|
|
361
368
|
}
|
|
362
369
|
|
|
363
370
|
private initAll() {
|
|
@@ -448,7 +455,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
448
455
|
that.triggerOnAuthStateChanged(that.stateLoggedUser);
|
|
449
456
|
that.logger.debug('[APP-COMP] 1 - IMPOSTO STATO CONNESSO UTENTE ', autoStart);
|
|
450
457
|
|
|
451
|
-
|
|
458
|
+
this.initAudioNotification()
|
|
452
459
|
|
|
453
460
|
new Promise(async (resolve, reject)=> {
|
|
454
461
|
that.typingService.initialize(this.g.tenant);
|
|
@@ -474,26 +481,30 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
474
481
|
that.listenToWidgetClick()
|
|
475
482
|
}
|
|
476
483
|
|
|
484
|
+
/** DDP IF AUTOSTART IS FALSE, SHOW WIDGET */
|
|
485
|
+
if(!autoStart){
|
|
486
|
+
that.logger.info('[APP-COMP] AUTOSTART IS FALSE AND LOGGED SUCCESSFULLY ');
|
|
487
|
+
this.g.setParameter('isShown', true, true);
|
|
488
|
+
}
|
|
477
489
|
|
|
478
490
|
|
|
479
491
|
} else if (state && state === AUTH_STATE_OFFLINE && !this.forceDisconnect) {
|
|
480
492
|
/** non sono loggato */
|
|
481
493
|
that.logger.info('[APP-COMP] OFFLINE - NO CURRENT USER AUTENTICATE: ');
|
|
482
494
|
that.g.setParameter('isLogged', false);
|
|
483
|
-
that.hideWidget();
|
|
495
|
+
// that.hideWidget();
|
|
484
496
|
// that.g.setParameter('isShown', false, true);
|
|
485
497
|
that.triggerOnAuthStateChanged(that.stateLoggedUser);
|
|
486
|
-
if (autoStart) {
|
|
498
|
+
if (autoStart || this.g.onPageChangeVisibilityDesktop === 'open' || this.g.onPageChangeVisibilityMobile === 'open') {
|
|
487
499
|
that.authenticate();
|
|
488
500
|
}
|
|
489
|
-
}else if(state && state === AUTH_STATE_CLOSE ){
|
|
501
|
+
} else if(state && state === AUTH_STATE_CLOSE ){
|
|
490
502
|
that.logger.info('[APP-COMP] CLOSE - CHANNEL CLOSED: ', this.chatManager);
|
|
491
503
|
if(this.g.recipientId){
|
|
492
504
|
this.chatManager.removeConversationHandler(this.g.recipientId)
|
|
493
505
|
this.g.recipientId = null;
|
|
494
506
|
}
|
|
495
|
-
}
|
|
496
|
-
|
|
507
|
+
}
|
|
497
508
|
|
|
498
509
|
});
|
|
499
510
|
this.subscriptions.push(subAuthStateChanged);
|
|
@@ -738,6 +749,8 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
738
749
|
// divWidgetContainer.style.display = 'block';
|
|
739
750
|
// }
|
|
740
751
|
// }, 500);
|
|
752
|
+
|
|
753
|
+
this.loading = false;
|
|
741
754
|
}
|
|
742
755
|
// ========= end:: START UI ============//
|
|
743
756
|
|
|
@@ -846,7 +859,13 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
846
859
|
this.appStorageService.setItem('attributes', JSON.stringify(attributes));
|
|
847
860
|
return attributes;
|
|
848
861
|
}
|
|
849
|
-
|
|
862
|
+
|
|
863
|
+
// SET AUDIO
|
|
864
|
+
private initAudioNotification(){
|
|
865
|
+
this.audio = new Audio();
|
|
866
|
+
this.audio.src = this.g.baseLocation + URL_SOUND_LIST_CONVERSATION;
|
|
867
|
+
this.audio.load();
|
|
868
|
+
}
|
|
850
869
|
|
|
851
870
|
private async initConversationsHandler(tenant: string, senderId: string) {
|
|
852
871
|
this.logger.debug('[APP-COMP] initialize: ListConversationsComponent');
|
|
@@ -1605,23 +1624,46 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
1605
1624
|
this.f21_close();
|
|
1606
1625
|
}
|
|
1607
1626
|
|
|
1627
|
+
|
|
1628
|
+
/** DDP reload widget */
|
|
1629
|
+
async reloadWidget() {
|
|
1630
|
+
this.openCloseWidget();
|
|
1631
|
+
this.logger.debug('[APP-COMP-1] AAA - hideWidget');
|
|
1632
|
+
await Promise.all([
|
|
1633
|
+
this.authenticate(),
|
|
1634
|
+
// this.initAll()
|
|
1635
|
+
]);
|
|
1636
|
+
this.logger.debug('[APP-COMP-1] CCC - showWidget');
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
|
|
1608
1640
|
/**
|
|
1609
1641
|
* LAUNCHER BUTTON:
|
|
1610
1642
|
* onClick button open/close widget
|
|
1611
1643
|
*/
|
|
1612
1644
|
onOpenCloseWidget($event) {
|
|
1645
|
+
this.logger.debug('[APP-COMP] onOpenCloseWidget', $event, this.g.isLogged);
|
|
1646
|
+
if(!this.g.isLogged){
|
|
1647
|
+
this.reloadWidget();
|
|
1648
|
+
} else {
|
|
1649
|
+
this.openCloseWidget();
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
/** DDP show widget */
|
|
1654
|
+
openCloseWidget() {
|
|
1613
1655
|
this.g.setParameter('displayEyeCatcherCard', 'none');
|
|
1614
1656
|
// const conversationActive: ConversationModel = JSON.parse(this.appStorageService.getItem('activeConversation'));
|
|
1615
1657
|
const recipientId : string = this.appStorageService.getItem('recipientId')
|
|
1616
1658
|
this.g.setParameter('recipientId', recipientId);
|
|
1617
1659
|
this.logger.debug('[APP-COMP] openCloseWidget', recipientId, this.g.isOpen, this.g.startFromHome);
|
|
1660
|
+
|
|
1618
1661
|
if (this.g.isOpen === false) {
|
|
1619
1662
|
if(this.forceDisconnect){
|
|
1620
1663
|
this.logger.log('[FORCE] onOpenCloseWidget --> reconnect', this.forceDisconnect)
|
|
1621
1664
|
this.messagingAuthService.createCustomToken(this.g.tiledeskToken)
|
|
1622
1665
|
this.forceDisconnect = false;
|
|
1623
1666
|
}
|
|
1624
|
-
|
|
1625
1667
|
if (!recipientId) {
|
|
1626
1668
|
if(this.g.singleConversation){
|
|
1627
1669
|
this.isOpenHome = false;
|
|
@@ -1641,29 +1683,22 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
1641
1683
|
this.isOpenHome = false;
|
|
1642
1684
|
this.isOpenConversation = true;
|
|
1643
1685
|
this.startUI()
|
|
1644
|
-
// this.isOpenSelectionDepartment = false;
|
|
1645
1686
|
}
|
|
1646
|
-
// if (!conversationActive && !this.g.startFromHome) {
|
|
1647
|
-
// this.isOpenHome = false;
|
|
1648
|
-
// this.isOpenConversation = true;
|
|
1649
|
-
// this.startNwConversation();
|
|
1650
|
-
// } else if (conversationActive) {
|
|
1651
|
-
// this.isOpenHome = false;
|
|
1652
|
-
// this.isOpenConversation = true;
|
|
1653
|
-
// }
|
|
1654
|
-
// this.g.startFromHome = true;
|
|
1655
1687
|
this.triggerOnOpenEvent();
|
|
1656
|
-
|
|
1657
1688
|
} else {
|
|
1658
1689
|
this.triggerOnCloseEvent();
|
|
1659
1690
|
}
|
|
1660
1691
|
//change status to the widget
|
|
1661
1692
|
this.g.setIsOpen(!this.g.isOpen);
|
|
1662
1693
|
this.appStorageService.setItem('isOpen', this.g.isOpen);
|
|
1663
|
-
|
|
1694
|
+
//show loading if widget is open and user is not logged
|
|
1695
|
+
if(this.g.isOpen === true && !this.g.isLogged){
|
|
1696
|
+
this.loading = true;
|
|
1697
|
+
}
|
|
1664
1698
|
// this.saveBadgeNewConverstionNumber();
|
|
1665
1699
|
}
|
|
1666
1700
|
|
|
1701
|
+
|
|
1667
1702
|
/**
|
|
1668
1703
|
* MODAL SELECTION DEPARTMENT:
|
|
1669
1704
|
* selected department
|