@chat21/chat21-web-widget 5.1.4 → 5.1.7-rc14
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 +53 -0
- package/Dockerfile +4 -5
- package/angular.json +2 -1
- package/package.json +1 -1
- package/src/app/app.component.html +11 -4
- package/src/app/app.component.scss +60 -1
- package/src/app/app.component.ts +83 -36
- package/src/app/app.module.ts +16 -10
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +1 -1
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +20 -5
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +1 -0
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +8 -11
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +25 -0
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +57 -23
- package/src/app/component/{network-offline/network-offline.component.html → error-alert/error-alert.component.html} +4 -2
- package/src/app/component/{network-offline/network-offline.component.scss → error-alert/error-alert.component.scss} +3 -1
- package/src/app/component/{network-offline/network-offline.component.spec.ts → error-alert/error-alert.component.spec.ts} +8 -6
- package/src/app/component/error-alert/error-alert.component.ts +47 -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/message/buttons/action-button/action-button.component.scss +6 -6
- package/src/app/component/message/buttons/action-button/action-button.component.ts +1 -1
- package/src/app/component/message/buttons/link-button/link-button.component.scss +5 -5
- package/src/app/component/message/buttons/link-button/link-button.component.ts +2 -2
- package/src/app/component/message/buttons/text-button/text-button.component.scss +9 -12
- package/src/app/component/message/buttons/text-button/text-button.component.ts +4 -4
- package/src/app/component/message-attachment/message-attachment.component.html +3 -7
- package/src/app/providers/global-settings.service.ts +3 -3
- package/src/app/providers/translator.service.ts +8 -2
- package/src/app/sass/_variables.scss +1 -1
- package/src/app/utils/constants.ts +3 -0
- package/src/app/utils/globals.ts +2 -2
- package/src/app/utils/utils.ts +10 -12
- package/src/assets/i18n/en.json +4 -1
- package/src/assets/i18n/es.json +6 -1
- package/src/assets/i18n/fr.json +6 -1
- package/src/assets/i18n/it.json +6 -3
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +2 -2
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +22 -11
- package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts +1 -1
- package/src/chat21-core/utils/utils.ts +15 -4
- package/src/iframe-style.css +6 -6
- package/deploy_amazon_beta.sh +0 -47
- package/deploy_amazon_prod.sh +0 -41
- package/src/app/component/network-offline/network-offline.component.ts +0 -24
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
--button-in-msg-max-width: 280px;
|
|
25
25
|
--button-in-msg-padding: 8px 16px;
|
|
26
26
|
--button-color: #5c6c73;
|
|
27
|
-
--button-background-color: #f5f5f5; // #f9fcff;
|
|
27
|
+
--button-background-color: #ffffff;//#f5f5f5; // #f9fcff;
|
|
28
28
|
--button-border-color: #0000000f; //#e4ebf2;
|
|
29
29
|
--button-font-size: 13px;
|
|
30
30
|
|
package/src/app/utils/globals.ts
CHANGED
|
@@ -247,7 +247,7 @@ export class Globals {
|
|
|
247
247
|
|
|
248
248
|
// ============ BEGIN: SET EXTERNAL PARAMETERS ==============//
|
|
249
249
|
this.baseLocation = 'https://widget.tiledesk.com/v2';
|
|
250
|
-
this.autoStart =
|
|
250
|
+
this.autoStart = false;
|
|
251
251
|
/** start Authentication and startUI */
|
|
252
252
|
this.startHidden = false;
|
|
253
253
|
/** show/hide all widget -> js call: showAllWidget */
|
|
@@ -406,7 +406,7 @@ export class Globals {
|
|
|
406
406
|
/**enable user to set a telegram number to chat with */
|
|
407
407
|
this.telegramUsername = ''
|
|
408
408
|
/**enable auto disconnect from messaging after a defined amount of time (s)*/
|
|
409
|
-
this.fileUploadAccept =
|
|
409
|
+
this.fileUploadAccept = "image/*,.pdf,.txt,.mp3,.xls,.xlsx"
|
|
410
410
|
this.disconnetTime = 0
|
|
411
411
|
|
|
412
412
|
this.showWaitTime = true;
|
package/src/app/utils/utils.ts
CHANGED
|
@@ -380,10 +380,10 @@ export function getUnique(arr, comp) {
|
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
export function checkAcceptedFile(nameFile, fileType, fileUploadAccept): boolean {
|
|
383
|
-
console.log('checkAcceptedFile ------------>', fileType, fileUploadAccept);
|
|
383
|
+
// console.log('checkAcceptedFile ------------>', fileType, fileUploadAccept);
|
|
384
384
|
|
|
385
385
|
const fileExtension = getFileExtension(nameFile);
|
|
386
|
-
console.log('[CONV-FOOTER] fileExtension: ', fileExtension);
|
|
386
|
+
// console.log('[CONV-FOOTER] fileExtension: ', fileExtension);
|
|
387
387
|
|
|
388
388
|
if (fileUploadAccept === '*/*') {
|
|
389
389
|
return true;
|
|
@@ -396,7 +396,7 @@ export function checkAcceptedFile(nameFile, fileType, fileUploadAccept): boolean
|
|
|
396
396
|
return acceptedTypes.some((accept) => {
|
|
397
397
|
accept = accept.trim();
|
|
398
398
|
|
|
399
|
-
// Controlla
|
|
399
|
+
// Controlla wildcard MIME type (es. "image/*")
|
|
400
400
|
if (accept.endsWith('/*')) {
|
|
401
401
|
const baseMimeType = fileType.split('/')[0]; // Ottieni la parte principale del MIME type
|
|
402
402
|
return accept.replace('/*', '') === baseMimeType;
|
|
@@ -413,19 +413,17 @@ export function checkAcceptedFile(nameFile, fileType, fileUploadAccept): boolean
|
|
|
413
413
|
return true;
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
-
//
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
416
|
+
// Controlla estensione con punto (es. ".pdf")
|
|
417
|
+
if (accept.startsWith('.')) {
|
|
418
|
+
return fileExtension === accept.slice(1);
|
|
419
|
+
}
|
|
420
420
|
|
|
421
|
-
// Controlla se
|
|
422
|
-
|
|
423
|
-
const acceptedTypes = fileUploadAccept.split(',');
|
|
424
|
-
//verifica se l'estensione del file è accettata
|
|
425
|
-
if (acceptedTypes.includes(fileExtension)) {
|
|
421
|
+
// Controlla se accept è un'estensione senza punto (es. "pdf")
|
|
422
|
+
if (!accept.includes('/') && fileExtension === accept) {
|
|
426
423
|
return true;
|
|
427
424
|
}
|
|
428
425
|
|
|
426
|
+
|
|
429
427
|
return false;
|
|
430
428
|
});
|
|
431
429
|
}
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -94,5 +94,8 @@
|
|
|
94
94
|
"SWITCH_TO": "Or switch to:",
|
|
95
95
|
"CONNECTION_NETWORK_ERROR": "Our apologies. There was some trouble connecting to network",
|
|
96
96
|
"EMOJI_NOT_ELLOWED":"Emoji not allowed",
|
|
97
|
-
"DOMAIN_NOT_ALLOWED":"URL contains a non-allowed domain"
|
|
97
|
+
"DOMAIN_NOT_ALLOWED":"URL contains a non-allowed domain",
|
|
98
|
+
"MAX_ATTACHMENT": "Max allowed size {{FILE_SIZE_LIMIT}}Mb",
|
|
99
|
+
"MAX_ATTACHMENT_ERROR": "The file exceeds the maximum allowed size",
|
|
100
|
+
"EMOJI": "Emoji"
|
|
98
101
|
}
|
package/src/assets/i18n/es.json
CHANGED
|
@@ -92,5 +92,10 @@
|
|
|
92
92
|
|
|
93
93
|
"LABEL_PREVIEW": "Avance",
|
|
94
94
|
"SWITCH_TO":"O cambiar a:",
|
|
95
|
-
"CONNECTION_NETWORK_ERROR": "Nuestras disculpas. Hubo algunos problemas para conectarse a la red"
|
|
95
|
+
"CONNECTION_NETWORK_ERROR": "Nuestras disculpas. Hubo algunos problemas para conectarse a la red",
|
|
96
|
+
"EMOJI_NOT_ELLOWED":"Emoji no permitido",
|
|
97
|
+
"DOMAIN_NOT_ALLOWED":"La URL contiene un dominio no permitido",
|
|
98
|
+
"MAX_ATTACHMENT": "Tamaño máximo permitido {{FILE_SIZE_LIMIT}}Mb",
|
|
99
|
+
"MAX_ATTACHMENT_ERROR": "El archivo supera el tamaño máximo permitido",
|
|
100
|
+
"EMOJI": "Emoji"
|
|
96
101
|
}
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -92,5 +92,10 @@
|
|
|
92
92
|
|
|
93
93
|
"LABEL_PREVIEW": "Aperçu",
|
|
94
94
|
"SWITCH_TO":"Ou passer à:",
|
|
95
|
-
"CONNECTION_NETWORK_ERROR": "Nos excuses. Il y a eu des problèmes de connexion au réseau"
|
|
95
|
+
"CONNECTION_NETWORK_ERROR": "Nos excuses. Il y a eu des problèmes de connexion au réseau",
|
|
96
|
+
"EMOJI_NOT_ELLOWED":"Emoji non autorisé",
|
|
97
|
+
"DOMAIN_NOT_ALLOWED":"L'URL contient un domaine non autorisé",
|
|
98
|
+
"MAX_ATTACHMENT": "Taille maximale autorisée {{FILE_SIZE_LIMIT}}Mo",
|
|
99
|
+
"MAX_ATTACHMENT_ERROR": "Le fichier dépasse la taille maximale autorisée",
|
|
100
|
+
"EMOJI": "Emoji"
|
|
96
101
|
}
|
package/src/assets/i18n/it.json
CHANGED
|
@@ -86,11 +86,14 @@
|
|
|
86
86
|
"LABEL_LAST_ACCESS": "ultimo accesso",
|
|
87
87
|
"LABEL_TO": "a",
|
|
88
88
|
"ARRAY_DAYS": ["Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato", "Domenica"],
|
|
89
|
-
|
|
90
89
|
"SENT_AN_ATTACHMENT": "ha inviato un allegato",
|
|
91
90
|
"SENT_AN_IMAGE":"ha inviato un'immagine",
|
|
92
|
-
|
|
93
91
|
"LABEL_PREVIEW": "Anteprima",
|
|
94
92
|
"SWITCH_TO":"Oppure passa a:",
|
|
95
|
-
"CONNECTION_NETWORK_ERROR": "Ci scusiamo. Si sono verificati problemi di connessione di rete"
|
|
93
|
+
"CONNECTION_NETWORK_ERROR": "Ci scusiamo. Si sono verificati problemi di connessione di rete",
|
|
94
|
+
"EMOJI_NOT_ELLOWED":"Emoji non consentiti",
|
|
95
|
+
"DOMAIN_NOT_ALLOWED":"L'URL contiene un dominio non consentito",
|
|
96
|
+
"MAX_ATTACHMENT": "Dimensione massima consentita {{FILE_SIZE_LIMIT}}Mb",
|
|
97
|
+
"MAX_ATTACHMENT_ERROR": "Il file supera la dimensione massima consentita",
|
|
98
|
+
"EMOJI": "Emoji"
|
|
96
99
|
}
|
|
@@ -413,8 +413,8 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
413
413
|
message.text = INFO_SUPPORT_LEAD_UPDATED;
|
|
414
414
|
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.MEMBER_LEFT_GROUP) {
|
|
415
415
|
let subject: string = '';
|
|
416
|
-
if (message.attributes.messagelabel.parameters.
|
|
417
|
-
subject = message.attributes.messagelabel.parameters.
|
|
416
|
+
if (message.attributes.messagelabel.parameters.firstname) {
|
|
417
|
+
subject = message.attributes.messagelabel.parameters.firstname;
|
|
418
418
|
}else{
|
|
419
419
|
subject = message.attributes.messagelabel.parameters.member_id;
|
|
420
420
|
}
|
|
@@ -410,8 +410,8 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
410
410
|
message.text = INFO_SUPPORT_LEAD_UPDATED;
|
|
411
411
|
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.MEMBER_LEFT_GROUP) {
|
|
412
412
|
let subject: string;
|
|
413
|
-
if (message.attributes.messagelabel.parameters.
|
|
414
|
-
subject = message.attributes.messagelabel.parameters.
|
|
413
|
+
if (message.attributes.messagelabel.parameters.firstname) {
|
|
414
|
+
subject = message.attributes.messagelabel.parameters.firstname;
|
|
415
415
|
}else{
|
|
416
416
|
subject = message.attributes.messagelabel.parameters.member_id;
|
|
417
417
|
}
|
|
@@ -464,16 +464,17 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
464
464
|
private async addCommandMessage(msg: MessageModel): Promise<boolean>{
|
|
465
465
|
const that = this;
|
|
466
466
|
const commands = msg.attributes.commands;
|
|
467
|
+
that.logger.debug('[MQTTConversationHandlerSERVICE] addCommandMessage: ', commands)
|
|
467
468
|
let i=0;
|
|
468
469
|
if(commands.length === 0) return;
|
|
469
470
|
return new Promise((resolve, reject)=>{
|
|
470
471
|
function execute(command){
|
|
472
|
+
that.logger.debug('[MQTTConversationHandlerSERVICE] command: ', command, i)
|
|
471
473
|
if(command.type === "message"){
|
|
472
474
|
that.logger.debug('[MQTTConversationHandlerSERVICE] addCommandMessage --> type="message"', command, i)
|
|
473
475
|
if (i >= 2) {
|
|
474
|
-
|
|
475
476
|
//check if previus wait message type has time value, otherwize set to 1000ms
|
|
476
|
-
!commands[i-1].time? commands[i-1].time= 1000 : commands[i-1].time
|
|
477
|
+
!commands[i-1].time? commands[i-1].time= 1000 : commands[i-1].time;
|
|
477
478
|
command.message.timestamp = commands[i-2].message.timestamp + commands[i-1].time;
|
|
478
479
|
|
|
479
480
|
/** CHECK IF MESSAGE IS JUST RECEIVED: IF false, set next message time (if object exist) to 0 -> this allow to show it immediately */
|
|
@@ -483,12 +484,14 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
483
484
|
command.message.timestamp = previewsTimeMsg + 100
|
|
484
485
|
commands[i+1]? commands[i+1].time = 0 : null
|
|
485
486
|
}
|
|
486
|
-
}
|
|
487
|
+
}
|
|
488
|
+
else { /**MANAGE FIRST MESSAGE */
|
|
487
489
|
command.message.timestamp = msg.timestamp;
|
|
488
490
|
if(!isJustRecived(that.startTime.getTime(), msg.timestamp)){
|
|
489
491
|
commands[i+1]? commands[i+1].time = 0 : null
|
|
490
492
|
}
|
|
491
493
|
}
|
|
494
|
+
|
|
492
495
|
that.generateMessageObject(msg, command.message, i, function () {
|
|
493
496
|
i += 1
|
|
494
497
|
if (i < commands.length) {
|
|
@@ -499,28 +502,36 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
499
502
|
resolve(true)
|
|
500
503
|
}
|
|
501
504
|
})
|
|
502
|
-
}else if(command.type === "wait"){
|
|
503
|
-
that.logger.debug('[MQTTConversationHandlerSERVICE] addCommandMessage --> type="wait"', command, i, commands.length)
|
|
505
|
+
} else if(command.type === "wait"){
|
|
504
506
|
//publish waiting event to simulate user typing
|
|
505
507
|
if(isJustRecived(that.startTime.getTime(), msg.timestamp)){
|
|
506
508
|
// console.log('message just received::', command, i, commands)
|
|
507
509
|
that.messageWait.next({uid: that.conversationWith, uidUserTypingNow: msg.sender, nameUserTypingNow: msg.sender_fullname, waitTime: command.time, command: command})
|
|
508
510
|
}
|
|
509
|
-
|
|
511
|
+
that.logger.debug('[MQTTConversationHandlerSERVICE] addCommandMessage: --> msg.status: ', msg.status)
|
|
512
|
+
|
|
513
|
+
const executeNext = () => {
|
|
510
514
|
i += 1
|
|
511
515
|
if (i < commands.length) {
|
|
512
516
|
execute(commands[i])
|
|
513
|
-
}
|
|
514
|
-
else {
|
|
517
|
+
} else {
|
|
515
518
|
that.logger.debug('[MQTTConversationHandlerSERVICE] addCommandMessage --> last command executed (send message), exit')
|
|
516
519
|
resolve(true)
|
|
517
520
|
}
|
|
518
|
-
}
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
if(msg.status === MSG_STATUS_RECEIVED){
|
|
524
|
+
executeNext()
|
|
525
|
+
} else {
|
|
526
|
+
setTimeout(executeNext, command.time)
|
|
527
|
+
}
|
|
519
528
|
}
|
|
520
529
|
}
|
|
521
530
|
execute(commands[0]) //START render first message
|
|
522
531
|
})
|
|
523
532
|
}
|
|
533
|
+
|
|
534
|
+
|
|
524
535
|
|
|
525
536
|
private generateMessageObject(message, command_message, index, callback) {
|
|
526
537
|
let parentUid = message.uid
|
|
@@ -71,7 +71,7 @@ export class TiledeskRequestsService {
|
|
|
71
71
|
|
|
72
72
|
public getMyRequests(): Promise<{ requests: Array<any>}> {
|
|
73
73
|
this.tiledeskToken = this.appStorage.getItem('tiledeskToken')
|
|
74
|
-
const url = this.URL_TILEDESK_REQUEST + '
|
|
74
|
+
const url = this.URL_TILEDESK_REQUEST + 'me?preflight=true'
|
|
75
75
|
this.logger.log('[TILEDESK-SERVICE] - GET REQUEST url ', url);
|
|
76
76
|
const httpOptions = {
|
|
77
77
|
headers: new HttpHeaders({
|
|
@@ -661,11 +661,22 @@ export function isAllowedUrlInText(text: string, allowedUrls: string[]) {
|
|
|
661
661
|
return nonWhitelistedDomains.length === 0;
|
|
662
662
|
}
|
|
663
663
|
|
|
664
|
+
// function extractUrls(text: string): string[] {
|
|
665
|
+
// const urlRegex = /https?:\/\/[^\s]+/g;
|
|
666
|
+
// return text.match(urlRegex) || [];
|
|
667
|
+
// }
|
|
668
|
+
|
|
664
669
|
function extractUrls(text: string): string[] {
|
|
665
|
-
|
|
666
|
-
|
|
670
|
+
// Rileva URL con o senza protocollo (http/https)
|
|
671
|
+
const urlRegex = /\b((https?:\/\/)?(www\.)?[a-z0-9.-]+\.[a-z]{2,})(\/[^\s]*)?/gi;
|
|
672
|
+
const matches = text.match(urlRegex) || [];
|
|
673
|
+
// Normalizza: aggiunge https:// se manca, così il parsing con new URL() funziona
|
|
674
|
+
return matches.map((url) => {
|
|
675
|
+
if (!/^https?:\/\//i.test(url)) {
|
|
676
|
+
return 'https://' + url;
|
|
677
|
+
}
|
|
678
|
+
return url;
|
|
679
|
+
});
|
|
667
680
|
}
|
|
668
681
|
|
|
669
682
|
|
|
670
|
-
|
|
671
|
-
|
package/src/iframe-style.css
CHANGED
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
bottom: 0px;
|
|
14
14
|
width: auto;
|
|
15
15
|
height: auto;
|
|
16
|
-
display:
|
|
16
|
+
display: block;
|
|
17
17
|
z-index: 3000000000; /*999999*/;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
#tiledesk-container.open.overlay--popup {
|
|
21
21
|
background-color: rgba(0, 0, 0, 0.4);
|
|
22
|
-
position:
|
|
22
|
+
position: fixed;
|
|
23
23
|
width: 100%;
|
|
24
24
|
height: 100vh;
|
|
25
25
|
}
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
max-width: 1024px;
|
|
67
67
|
max-height: 100%;
|
|
68
68
|
|
|
69
|
-
transition:
|
|
69
|
+
/* transition:
|
|
70
70
|
width 300ms,
|
|
71
71
|
height 300ms,
|
|
72
72
|
max-height 300ms,
|
|
73
73
|
transform 300ms cubic-bezier(0, 1.2, 1, 1),
|
|
74
|
-
opacity 300ms ease-out;
|
|
74
|
+
opacity 300ms ease-out; */
|
|
75
75
|
/* per migliorare le prestazioni quando si usa transform */
|
|
76
76
|
will-change: transform, opacity, width, height;
|
|
77
77
|
}
|
|
@@ -151,14 +151,14 @@
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
#tiledesk-container.open #tiledeskdiv.min-size {
|
|
154
|
-
transition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out;
|
|
154
|
+
/* transition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out; */
|
|
155
155
|
width: var(--iframeMinWidth);
|
|
156
156
|
height: var(--iframeMinHeight);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
#tiledesk-container.open #tiledeskdiv.max-size {
|
|
160
160
|
/* transition: width 1s, height 1s; */
|
|
161
|
-
transition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out;
|
|
161
|
+
/* transition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out; */
|
|
162
162
|
width: var(--iframeMaxWidth);
|
|
163
163
|
height: var(--iframeMaxHeight);
|
|
164
164
|
}
|
package/deploy_amazon_beta.sh
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# npm version prerelease --preid=beta
|
|
2
|
-
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
|
-
echo "version $version"
|
|
4
|
-
|
|
5
|
-
ng build --configuration="pre" --aot=true --base-href
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# ########## --->>>> NATIVE-MQTT folder START <<<<<------ ########## #
|
|
9
|
-
|
|
10
|
-
# cd dist
|
|
11
|
-
# aws s3 sync . s3://tiledesk-widget-pre/native-mqtt/widget/$version/
|
|
12
|
-
# aws s3 sync . s3://tiledesk-widget-pre/native-mqtt/widget/
|
|
13
|
-
# cd ..
|
|
14
|
-
|
|
15
|
-
# #aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
|
|
16
|
-
# # echo new version deployed $NEW_VER/$NEW_BUILD/ on s3://tiledesk-widget-pre/v2
|
|
17
|
-
# echo new version deployed $version/ on s3://tiledesk-widget-pre/native-mqtt/widget/ and s3://tiledesk-widget-pre/native-mqtt/widget/$version/
|
|
18
|
-
# echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget-pre/native-mqtt/widget/index.html
|
|
19
|
-
# echo https://widget-pre.tiledesk.com/v5/index.html
|
|
20
|
-
# echo https://widget-pre.tiledesk.com/v5/$version/index.html
|
|
21
|
-
|
|
22
|
-
# ########## --->>>> NATIVE-MQTT folder END <<<<<------ ########## #
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# ########## --->>>> 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 max-age=300
|
|
29
|
-
cd ..
|
|
30
|
-
|
|
31
|
-
#aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
|
|
32
|
-
cd ..
|
|
33
|
-
|
|
34
|
-
aws cloudfront create-invalidation --distribution-id E2V5O0YPR61V8P --paths "/*"
|
|
35
|
-
# echo new version deployed $NEW_VER/$NEW_BUILD/ on s3://tiledesk-widget-pre/v2
|
|
36
|
-
echo new version deployed $version/ on s3://tiledesk-widget-pre/v5 and s3://tiledesk-widget-pre/v5/$version/
|
|
37
|
-
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget-pre/v5/index.html
|
|
38
|
-
echo https://widget-pre.tiledesk.com/v5/index.html
|
|
39
|
-
echo https://widget-pre.tiledesk.com/v5/$version/index.html
|
|
40
|
-
|
|
41
|
-
# ########## --->>>> FIREBASE folder END <<<<<------ ########## #
|
|
42
|
-
|
|
43
|
-
## AZIONI per committare:
|
|
44
|
-
## 1) modificare package.json e package-lock.json aggiungendo il num di versione nuovo
|
|
45
|
-
## 2) aggiornare il CHANGELOG
|
|
46
|
-
## 3) fare il commit tramite sourcetree
|
|
47
|
-
## 4) da terminale richiamare ./deploy_pre.sh
|
package/deploy_amazon_prod.sh
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# npm version patch
|
|
2
|
-
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
|
-
echo "version $version"
|
|
4
|
-
|
|
5
|
-
npm i
|
|
6
|
-
|
|
7
|
-
cp src/environments/real_data/environment.prod.ts src/environments/environment.prod.ts
|
|
8
|
-
|
|
9
|
-
# --build-optimizer=false if localstorage is disabled (webview) appears https://github.com/firebase/angularfire/issues/970
|
|
10
|
-
ng build --configuration="prod" --aot=true
|
|
11
|
-
##--base-href='./v5/' --output-hashing none
|
|
12
|
-
|
|
13
|
-
### SET HASHING : START ###
|
|
14
|
-
cp ./src/launch_template.js ./dist/browser/launch.js
|
|
15
|
-
node ./src/build_launch.js
|
|
16
|
-
### SET HASHING : END ###
|
|
17
|
-
|
|
18
|
-
#### FIREBASE #####
|
|
19
|
-
# cd dist
|
|
20
|
-
# # aws s3 sync . s3://tiledesk-widget/v5/latest/
|
|
21
|
-
# aws s3 sync . s3://tiledesk-widget/v5/$version/ --cache-control max-age=300
|
|
22
|
-
# aws s3 sync . s3://tiledesk-widget/v5/ --cache-control max-age=300
|
|
23
|
-
# cd ..
|
|
24
|
-
|
|
25
|
-
# #### MQTT #####
|
|
26
|
-
cd dist/browser
|
|
27
|
-
# aws s3 sync . s3://tiledesk-widget/v5/latest/
|
|
28
|
-
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control max-age=86400 --exclude='launch.js' #8days
|
|
29
|
-
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
30
|
-
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control max-age=86400 --exclude='launch.js' #8days
|
|
31
|
-
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
32
|
-
cd ../..
|
|
33
|
-
|
|
34
|
-
aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
|
|
35
|
-
|
|
36
|
-
git restore src/environments/environment.pre.ts
|
|
37
|
-
|
|
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
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit } from '@angular/core';
|
|
2
|
-
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'chat-network-offline',
|
|
6
|
-
templateUrl: './network-offline.component.html',
|
|
7
|
-
styleUrls: ['./network-offline.component.scss']
|
|
8
|
-
})
|
|
9
|
-
export class NetworkOfflineComponent implements OnInit {
|
|
10
|
-
|
|
11
|
-
translationMap: Map< string, string>;
|
|
12
|
-
|
|
13
|
-
constructor(
|
|
14
|
-
private customTranslateService: CustomTranslateService
|
|
15
|
-
){}
|
|
16
|
-
|
|
17
|
-
ngOnInit(): void {
|
|
18
|
-
let keys = [
|
|
19
|
-
'CONNECTION_NETWORK_ERROR'
|
|
20
|
-
]
|
|
21
|
-
this.translationMap = this.customTranslateService.translateLanguage(keys)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
}
|