@chat21/chat21-web-widget 5.1.26 → 5.1.30-rc1
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 +97 -13
- package/Dockerfile +4 -5
- package/angular.json +2 -1
- package/deploy_amazon_beta.sh +17 -7
- package/docs/changelog/badge_Bot_Umano.md +85 -0
- package/docs/changelog/this-branch.md +36 -0
- package/package.json +1 -1
- package/src/app/app.component.html +9 -2
- package/src/app/app.component.scss +59 -0
- package/src/app/app.component.ts +144 -36
- package/src/app/component/conversation-detail/conversation/conversation.component.html +13 -2
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +30 -2
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +85 -5
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.ts +16 -3
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +12 -9
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +15 -1
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +1 -1
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +103 -80
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +40 -13
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +40 -1
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +3 -3
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.ts +1 -0
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.ts +0 -18
- package/src/app/component/home/home.component.html +3 -3
- package/src/app/component/last-message/last-message.component.ts +4 -1
- 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/providers/global-settings.service.ts +26 -0
- package/src/app/providers/translator.service.ts +2 -0
- package/src/app/sass/_variables.scss +1 -0
- package/src/app/utils/conversation-sender-classifier.ts +116 -0
- package/src/app/utils/globals.ts +33 -5
- package/src/assets/i18n/en.json +2 -0
- package/src/assets/i18n/es.json +2 -0
- package/src/assets/i18n/fr.json +2 -0
- package/src/assets/i18n/it.json +2 -0
- 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 +5 -5
- package/deploy_amazon_prod.sh +0 -41
|
@@ -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,29 +6,63 @@
|
|
|
6
6
|
### **Copyrigth**:
|
|
7
7
|
*Tiledesk SRL*
|
|
8
8
|
|
|
9
|
-
# 5.1.
|
|
10
|
-
- **bug fixed**:
|
|
9
|
+
# 5.1.30-rc1
|
|
10
|
+
- **bug fixed**: startHidden is not working properly
|
|
11
11
|
|
|
12
|
-
# 5.1.
|
|
12
|
+
# 5.1.27-rc3
|
|
13
|
+
- **bug fixed**: fixed Bot/Human conversation detection by correctly classifying bot replies
|
|
14
|
+
|
|
15
|
+
# 5.1.27-rc2
|
|
16
|
+
- **bug fixed**: centralized fullscreen management on mobile and handled the case of the closed widget that remained fullscreen
|
|
17
|
+
|
|
18
|
+
# 5.1.27-rc1
|
|
19
|
+
- **added**: closeChatInConversation parameters
|
|
20
|
+
- **added**: close chat button under textarea footer component
|
|
21
|
+
|
|
22
|
+
# 5.1.26-rc6
|
|
23
|
+
- **changed**: mobile always opens fullscreen and ignores legacy stored size”.
|
|
24
|
+
- **changed**: changed user-typing
|
|
25
|
+
|
|
26
|
+
# 5.1.26-rc5
|
|
27
|
+
- **changed**: Hide the resize-widget button when on mobile
|
|
28
|
+
- **added**: added "I'm thinking" when the bot responds
|
|
29
|
+
|
|
30
|
+
# 5.1.26-rc4
|
|
31
|
+
- **changed**: decoupled callout from signin
|
|
32
|
+
|
|
33
|
+
# 5.1.26-rc3
|
|
34
|
+
- **changed**: start with authentication if a proactive message has been set, so if a rule has been set on at one chatbot in the project
|
|
35
|
+
|
|
36
|
+
# 5.1.26-rc2
|
|
37
|
+
- **changed**: start with authentication if hasCalloutInWidgetConfig is true
|
|
38
|
+
|
|
39
|
+
# 5.1.26-rc1
|
|
40
|
+
- **bug fixed**: improved audio recording/upload flow by ignoring empty recorder chunks, preserving the recorder MIME type when creating the audio blob/file, and uploading audio directly without Base64 conversion
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# 5.1.25-rc1
|
|
13
44
|
- **bug fixed**: attachment buttons in messages now respect the container max width and wrap/break long labels instead of being clipped
|
|
14
45
|
|
|
15
|
-
# 5.1.24
|
|
46
|
+
# 5.1.24-rc2
|
|
47
|
+
- **bug fixed**: minor fix in marked pipe to avoid rendering html tags
|
|
48
|
+
|
|
49
|
+
# 5.1.24-rc1
|
|
16
50
|
- **security**: hardened Markdown link rendering by blocking dangerous protocols (e.g. `javascript:`, `data:`, `vbscript:`) and preventing unsafe links from being rendered as anchors
|
|
17
51
|
- **changed**: refactored `MarkedPipe` to simplify Markdown parsing, improve link rendering via a custom `marked` renderer, and streamline newline handling (`\\n` → `\n`)
|
|
18
52
|
|
|
19
|
-
# 5.1.
|
|
20
|
-
- **changed**: API for upload a file/iamges
|
|
21
|
-
|
|
22
|
-
# 5.1.22
|
|
23
|
-
- **changed**: Updated Launch.js for Wix and Shopify by bypassing scrdoc
|
|
24
|
-
|
|
25
|
-
# 5.1.21
|
|
53
|
+
# 5.1.20-rc3
|
|
26
54
|
- **bug fixed**: saved the widget's size state to local storage (in HP conversations)
|
|
27
55
|
|
|
28
|
-
# 5.1.20
|
|
56
|
+
# 5.1.20-rc2
|
|
57
|
+
- **changed**: API for upload a file/iamges
|
|
29
58
|
- **changed**: marked pipe do not render /n
|
|
30
59
|
|
|
60
|
+
# 5.1.20-rc1
|
|
61
|
+
- **changed**: API for upload a file/iamges
|
|
62
|
+
|
|
31
63
|
# 5.1.19
|
|
64
|
+
|
|
65
|
+
# 5.1.19-rc1
|
|
32
66
|
- **bug fixed**: show bottom scroll button and unread message badge only when I'm not at the bottom of the page
|
|
33
67
|
- **changed**: allow HTML code to be inserted into messages, but do not parse the code. Ensure coexistence with Markdown.
|
|
34
68
|
- **bug fixed**: after sending a multi-line message, the text area remains open on multiple lines.
|
|
@@ -38,6 +72,7 @@
|
|
|
38
72
|
- **changed**: saved the widget's size state to local storage. The parameter flow is (default → storage → settings → URL)
|
|
39
73
|
|
|
40
74
|
# 5.1.18
|
|
75
|
+
# 5.1.15-rc3
|
|
41
76
|
- **added**: Implemented Shadow DOM in the text component to isolate HTML and Markdown rendering in a safe and protected context
|
|
42
77
|
- **changed**: Adapted text component styles to support Shadow DOM (removed ::ng-deep, added styles for common markdown elements)
|
|
43
78
|
- **security**: HTML/Markdown content is now rendered in an isolated Shadow DOM, improving security and preventing interference with the rest of the application
|
|
@@ -48,6 +83,12 @@
|
|
|
48
83
|
# 5.1.16
|
|
49
84
|
- **changed**: "close chat" header conversation menu button enabled in chatbot-panel.html
|
|
50
85
|
|
|
86
|
+
# 5.1.15-rc2
|
|
87
|
+
- **bug-fixed**: Bug fix for ifame message width
|
|
88
|
+
|
|
89
|
+
# 5.1.15-rc1
|
|
90
|
+
- **changed**: Load local translations before remote ones
|
|
91
|
+
|
|
51
92
|
# 5.1.15
|
|
52
93
|
- **changed**: Load local translations before remote ones
|
|
53
94
|
|
|
@@ -56,14 +97,57 @@
|
|
|
56
97
|
|
|
57
98
|
# 5.1.13
|
|
58
99
|
- **bug-fixed**: set default widget size
|
|
100
|
+
|
|
101
|
+
# 5.1.7-rc16
|
|
102
|
+
- **bug-fixed**: set default widget size
|
|
103
|
+
|
|
104
|
+
# 5.1.7-rc15
|
|
105
|
+
- **bug-fixed**: set the color of the buttons with visibility control to the font color
|
|
106
|
+
|
|
107
|
+
# 5.1.7-rc14
|
|
108
|
+
- **bug-fixed**: departmentId and departmentName is incorrect in attributes
|
|
109
|
+
|
|
110
|
+
# 5.1.7-rc13
|
|
111
|
+
- **changed**: Force authentication if ageChangeVisibilityDesktop or PageChangeVisibilityMobile is OPEN
|
|
112
|
+
|
|
113
|
+
# 5.1.7-rc12
|
|
114
|
+
- **changed**: Force authentication if ageChangeVisibilityDesktop or PageChangeVisibilityMobile is OPEN
|
|
115
|
+
- **changed**: Set the default autoStart value to false
|
|
116
|
+
- **added**: Added the open widget loading spinner
|
|
117
|
+
- **changed**: Load the widget without authentication and display the speech bubble
|
|
118
|
+
|
|
119
|
+
# 5.1.7-rc11
|
|
120
|
+
- **changed**: set default value autoStart false
|
|
121
|
+
- **added**:added loading spinner
|
|
122
|
+
|
|
123
|
+
# 5.1.7-rc10
|
|
124
|
+
- **changed**: load widget without authentication and display the balloon
|
|
125
|
+
|
|
126
|
+
# 5.1.7-rc9
|
|
127
|
+
- **removed**: 'DOMAIN_NOT_ALLOWED' in textarea footer component
|
|
128
|
+
|
|
129
|
+
# 5.1.7-rc8
|
|
130
|
+
# changes in the branch
|
|
131
|
+
- **changed**: Load local translations before remote ones
|
|
132
|
+
- **bug-fixed**: set default widget size
|
|
59
133
|
- **changed**: Updated the translations of the tooltips in the footer-component
|
|
60
134
|
- **changed**: Refactored the network-offline component and made it generic for displaying errors (now error-alert.component)
|
|
61
|
-
|
|
135
|
+
|
|
136
|
+
# 5.1.7-rc7
|
|
137
|
+
- **bug-fixed**: button new_conversation always appear. added subscription to conversationAdded
|
|
138
|
+
|
|
139
|
+
# 5.1.7-rc6
|
|
140
|
+
- **added**: Added MAX_ATTACHMENT_ERROR error message when uploading a file larger than 10 MB
|
|
62
141
|
|
|
63
142
|
# 5.1.12
|
|
64
143
|
- **bug-fixed**: check showEmojiFooterButton to enable/disable emojii
|
|
65
144
|
- **bug-fixed**: markdown is fired as an emojii and blocked by isEmojii check fn
|
|
66
145
|
|
|
146
|
+
# 5.1.7-rc7
|
|
147
|
+
- **bug-fixed**: button new_conversation always appear. added subscription to conversationAdded
|
|
148
|
+
|
|
149
|
+
# 5.1.7-rc6
|
|
150
|
+
- **added**: Added MAX_ATTACHMENT_ERROR error message when uploading a file larger than 10 MB
|
|
67
151
|
|
|
68
152
|
# 5.1.7-rc5
|
|
69
153
|
- **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
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Questo branch: UX bot/umano + disaccoppiamento callout
|
|
2
|
+
|
|
3
|
+
## Contesto
|
|
4
|
+
|
|
5
|
+
Questo branch migliora il feedback in conversazione e rende il comportamento del callout indipendente dal sign-in del widget.
|
|
6
|
+
|
|
7
|
+
## Modifiche incluse
|
|
8
|
+
|
|
9
|
+
- Aggiunto un **badge Bot/Umano** nella vista conversazione.
|
|
10
|
+
- All'apertura della conversazione (e ad ogni nuovo messaggio) analizza i messaggi e determina il tipo conversazione.
|
|
11
|
+
|
|
12
|
+
## Come viene identificato Bot/Umano
|
|
13
|
+
|
|
14
|
+
La logica vive in `ConversationComponent` e in un modulo pure di supporto (`src/app/utils/conversation-sender-classifier.ts`).
|
|
15
|
+
|
|
16
|
+
### Regole (in ordine)
|
|
17
|
+
|
|
18
|
+
1) **Selezione del messaggio “server” più recente**
|
|
19
|
+
- Si considerano solo i messaggi **non inviati dal client corrente** (si scartano quelli con `sender === senderId`).
|
|
20
|
+
- L’“ultimo” messaggio server viene determinato in modo robusto usando `timestamp` (equivalente a ordinare per timestamp decrescente).
|
|
21
|
+
|
|
22
|
+
2) **Regola speciale: handoff a operatore (Umano)**
|
|
23
|
+
- Se l’ultimo messaggio server è `system` e rappresenta un handoff verso umano:
|
|
24
|
+
- `attributes.subtype === "info"`
|
|
25
|
+
- `attributes.updateconversation === true`
|
|
26
|
+
- `attributes.messagelabel.key === "MEMBER_JOINED_GROUP"`
|
|
27
|
+
- `attributes.messagelabel.parameters.member_id` **non** è `system`, **non** inizia con `bot_`, e **non** coincide con il `senderId` del client
|
|
28
|
+
- allora la conversazione viene forzata a **Umano**.
|
|
29
|
+
|
|
30
|
+
3) **Se l’ultimo messaggio server non è system**
|
|
31
|
+
- viene classificato come **Bot** se:
|
|
32
|
+
- è presente `attributes.flowAttributes.chatbot_id` (segnale forte, anche se diverso da `sender`), oppure
|
|
33
|
+
- euristiche legacy: `sender` contiene `bot_` oppure `sender_fullname` contiene “bot”
|
|
34
|
+
- altrimenti come **Umano**.
|
|
35
|
+
|
|
36
|
+
4) **Se l’ultimo messaggio server è system (ma non handoff umano)**
|
|
37
|
+
- si cerca il messaggio server **precedente non-system** e si applica la classificazione Bot/Umano su quello.
|
|
38
|
+
|
|
39
|
+
### Risultato in UI
|
|
40
|
+
- Il badge mostra **Bot** o **Umano** in base all’ultimo responder server **non-system**, con precedenza della regola handoff.
|
|
41
|
+
|
|
42
|
+
- Aggiunto il feedback temporaneo **"sto pensando..."** dopo l'invio del messaggio da parte del client.
|
|
43
|
+
- Mostrato solo quando la conversazione e' classificata come **Bot**.
|
|
44
|
+
- Nascosto alla prima risposta server (nessuna durata minima).
|
|
45
|
+
|
|
46
|
+
- Rimossa l'implementazione temporanea del toast "ciao" nel footer e relativo wiring.
|
|
47
|
+
|
|
48
|
+
- Abilitato il percorso di avvio widget per i casi guidati da bot quando sono presenti `botsRules`.
|
|
49
|
+
|
|
50
|
+
## Disaccoppiamento callout (step completati)
|
|
51
|
+
|
|
52
|
+
- **Step 1**: rimossa la dipendenza da `g.senderId` nel rendering del componente callout in `app.component.html`.
|
|
53
|
+
- Prima: render solo con `g.senderId && !g.isOpenNewMessage`
|
|
54
|
+
- Dopo: render con `!g.isOpenNewMessage`
|
|
55
|
+
|
|
56
|
+
- **Step 2**: scheduling del callout al caricamento delle impostazioni widget in `AppComponent`.
|
|
57
|
+
- Aggiunto `scheduleCalloutFromSettings()` basato su `g.calloutTimer`.
|
|
58
|
+
- Invocato subito dopo la disponibilita' delle settings (non legato al login).
|
|
59
|
+
- Aggiunta la pulizia del timeout in `ngOnDestroy()`.
|
|
60
|
+
|
|
61
|
+
- **Step 3**: introdotte precedenze UI e rimossa la duplicazione dello scheduling callout.
|
|
62
|
+
- Aggiunta guardia `canShowCalloutNow()` in `AppComponent`:
|
|
63
|
+
- widget chiuso
|
|
64
|
+
- nessuna preview nuovo messaggio attiva
|
|
65
|
+
- stato callout abilitato
|
|
66
|
+
- callout presente nella configurazione widget
|
|
67
|
+
- Aggiornato `showCallout()` per aprire il callout solo quando le guardie passano e il componente esiste.
|
|
68
|
+
- Rimosso il timer interno (`openIfCallOutTimer`) da `EyeeyeCatcherCardComponent` per evitare doppi trigger.
|
|
69
|
+
|
|
70
|
+
## Comportamento atteso dopo questo branch
|
|
71
|
+
|
|
72
|
+
- Il callout puo' essere innescato da configurazione anche senza sign-in.
|
|
73
|
+
- Il callout non compare quando il widget e' aperto o quando la preview nuovo messaggio e' attiva.
|
|
74
|
+
- La UI della conversazione indica chiaramente se l'ultimo responder e' bot o umano.
|
|
75
|
+
- "Sto pensando..." compare solo nelle conversazioni bot e ha un comportamento prevedibile.
|
|
76
|
+
|
|
77
|
+
## Checklist regressioni (bot/umano)
|
|
78
|
+
- **Bot con `flowAttributes.chatbot_id` diverso da `sender`** (caso reale):
|
|
79
|
+
- Atteso: classificazione **Bot** (non Human).
|
|
80
|
+
- **System → bot joined** (`MEMBER_JOINED_GROUP` con `member_id` che inizia per `bot_`):
|
|
81
|
+
- Atteso: non forzare Umano (non è handoff verso operatore).
|
|
82
|
+
- **System → handoff umano** (`MEMBER_JOINED_GROUP` con `member_id` umano):
|
|
83
|
+
- Atteso: forzare **Umano** anche se messaggi precedenti indicavano bot.
|
|
84
|
+
- **Conversazione con soli messaggi system** (dopo aver escluso quelli del client):
|
|
85
|
+
- Atteso: nessun crash; badge Bot/Umano può essere nascosto, ma la classificazione dell’ultimo messaggio server deve restare coerente.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# This branch: identificazione bot o umano
|
|
2
|
+
|
|
3
|
+
## Obiettivo
|
|
4
|
+
|
|
5
|
+
In questo branch e' stata introdotta una logica esplicita per capire, all'apertura della conversazione, se l'ultimo responder lato server e' un **bot** oppure un **umano**.
|
|
6
|
+
|
|
7
|
+
## Come viene fatta l'identificazione
|
|
8
|
+
|
|
9
|
+
- La valutazione parte dai messaggi gia' caricati in conversazione.
|
|
10
|
+
- Viene cercato l'**ultimo messaggio ricevuto dal server** (non inviato dal client corrente).
|
|
11
|
+
- Quel messaggio viene classificato con una funzione dedicata (`classifyMessageSenderKind`) che usa piu' segnali:
|
|
12
|
+
- `attributes.flowAttributes.chatbot_id` (quando presente indica bot)
|
|
13
|
+
- pattern del mittente (es. `senderId` con prefisso bot, quando applicabile)
|
|
14
|
+
- informazioni del mittente (`sender_fullname` e metadati associati)
|
|
15
|
+
|
|
16
|
+
## Regola speciale per messaggi di sistema
|
|
17
|
+
|
|
18
|
+
Se l'ultimo messaggio utile e' di tipo `system`, viene fatto un controllo aggiuntivo:
|
|
19
|
+
|
|
20
|
+
- se in `attributes` e' presente un evento con `messagelabel.key = MEMBER_JOINED_GROUP`
|
|
21
|
+
- e rappresenta il passaggio della conversazione a un operatore
|
|
22
|
+
|
|
23
|
+
allora la conversazione viene forzata a **Umano** anche se altri indizi potrebbero suggerire bot.
|
|
24
|
+
|
|
25
|
+
## Risultato in UI
|
|
26
|
+
|
|
27
|
+
- In apertura conversazione viene mostrato un badge con stato:
|
|
28
|
+
- `Bot`
|
|
29
|
+
- `Umano`
|
|
30
|
+
- Questo stato viene ricalcolato al variare dei messaggi ricevuti.
|
|
31
|
+
|
|
32
|
+
## Effetto sui feedback utente
|
|
33
|
+
|
|
34
|
+
- Il messaggio temporaneo `"sto pensando..."` viene mostrato solo quando la conversazione risulta di tipo **Bot**.
|
|
35
|
+
- Alla ricezione della prima risposta dal server, `"sto pensando..."` viene nascosto **immediatamente**.
|
|
36
|
+
- Non e' previsto alcun tempo minimo di visualizzazione del messaggio.
|
package/package.json
CHANGED
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
******* EYE-CATCHER (aka CALLOUT) *********
|
|
121
121
|
*******************************************
|
|
122
122
|
tabindex -> 20 -->
|
|
123
|
-
<chat-eyeeye-catcher-card *ngIf="
|
|
123
|
+
<chat-eyeeye-catcher-card *ngIf="!g.isOpenNewMessage"
|
|
124
124
|
(onOpenChat)="onOpenCloseWidget($event)"
|
|
125
125
|
(onCloseEyeCatcherCard)="onCloseEyeCatcherCard($event)">
|
|
126
126
|
</chat-eyeeye-catcher-card>
|
|
@@ -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>
|
|
@@ -761,4 +761,63 @@ chat-root {
|
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
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
|
+
|
|
764
823
|
}
|