@chat21/chat21-web-widget 5.0.55 → 5.0.56-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build.yml +1 -0
- package/CHANGELOG.md +16 -0
- package/angular.json +6 -7
- package/package.json +5 -4
- package/src/app/app.component.html +1 -11
- package/src/app/app.component.scss +12 -13
- package/src/app/app.component.spec.ts +0 -2
- package/src/app/app.component.ts +29 -35
- package/src/app/app.module.ts +4 -5
- package/src/app/component/conversation-detail/conversation/conversation.component.html +1 -10
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +5 -428
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +23 -25
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +7 -66
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +11 -81
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.spec.ts +0 -3
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +6 -6
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +7 -32
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +11 -11
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +8 -8
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +4 -25
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +5 -5
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.ts +4 -88
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.html +7 -16
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.ts +2 -26
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.html +1 -11
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.scss +5 -5
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts +2 -19
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.html +10 -42
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +1 -2
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.ts +2 -3
- package/src/app/component/form/form-builder/form-builder.component.html +0 -1
- package/src/app/component/form/form-builder/form-builder.component.scss +1 -1
- package/src/app/component/form/form-builder/form-builder.component.ts +4 -5
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.scss +1 -2
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.ts +2 -3
- package/src/app/component/form/inputs/form-label/form-label.component.ts +0 -1
- package/src/app/component/form/inputs/form-text/form-text.component.scss +3 -13
- package/src/app/component/form/inputs/form-text/form-text.component.ts +1 -2
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.html +0 -13
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +4 -4
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.ts +0 -10
- package/src/app/component/form/prechat-form/prechat-form.component.html +0 -2
- package/src/app/component/form/prechat-form/prechat-form.component.scss +2 -2
- package/src/app/component/form/prechat-form/prechat-form.component.ts +2 -2
- package/src/app/component/home/home.component.scss +7 -7
- package/src/app/component/home/home.component.ts +1 -4
- package/src/app/component/home-conversations/home-conversations.component.scss +7 -7
- package/src/app/component/home-conversations/home-conversations.component.ts +9 -12
- package/src/app/component/last-message/last-message.component.scss +4 -4
- package/src/app/component/last-message/last-message.component.ts +4 -7
- package/src/app/component/launcher-button/launcher-button.component.ts +3 -3
- package/src/app/component/list-all-conversations/list-all-conversations.component.scss +2 -2
- package/src/app/component/list-all-conversations/list-all-conversations.component.ts +3 -3
- package/src/app/component/list-conversations/list-conversations.component.html +1 -1
- package/src/app/component/list-conversations/list-conversations.component.scss +3 -3
- package/src/app/component/list-conversations/list-conversations.component.ts +3 -6
- package/src/app/component/menu-options/menu-options.component.html +1 -8
- package/src/app/component/menu-options/menu-options.component.scss +4 -4
- package/src/app/component/menu-options/menu-options.component.ts +1 -1
- package/src/app/component/message/bubble-message/bubble-message.component.html +3 -4
- package/src/app/component/message/bubble-message/bubble-message.component.scss +3 -3
- package/src/app/component/message/bubble-message/bubble-message.component.spec.ts +0 -2
- package/src/app/component/message/bubble-message/bubble-message.component.ts +10 -15
- package/src/app/component/message/buttons/action-button/action-button.component.scss +6 -6
- package/src/app/component/message/buttons/link-button/link-button.component.scss +7 -7
- package/src/app/component/message/buttons/text-button/text-button.component.scss +8 -8
- package/src/app/component/message/frame/frame.component.scss +1 -1
- package/src/app/component/message/frame/frame.component.ts +1 -1
- package/src/app/component/message/html/html.component.scss +4 -4
- package/src/app/component/message/html/html.component.ts +1 -2
- package/src/app/component/message/image/image.component.scss +1 -1
- package/src/app/component/message/image/image.component.ts +2 -3
- package/src/app/component/message/info-message/info-message.component.html +2 -1
- package/src/app/component/message/info-message/info-message.component.scss +6 -6
- package/src/app/component/message/like-unlike/like-unlike.component.scss +1 -1
- package/src/app/component/message/like-unlike/like-unlike.component.ts +2 -2
- package/src/app/component/message/text/text.component.scss +2 -2
- package/src/app/component/message/text/text.component.ts +1 -1
- package/src/app/component/message-attachment/message-attachment.component.ts +1 -1
- package/src/app/component/selection-department/selection-department.component.scss +6 -6
- package/src/app/component/selection-department/selection-department.component.ts +2 -2
- package/src/app/component/send-button/send-button.component.ts +1 -2
- package/src/app/component/star-rating-widget/star-rating-widget.component.scss +6 -6
- package/src/app/component/star-rating-widget/star-rating-widget.component.ts +2 -2
- package/src/app/pipe/date-ago.pipe.spec.ts +8 -0
- package/src/app/pipe/date-ago.pipe.ts +42 -0
- package/src/app/providers/app-config.service.ts +0 -1
- package/src/app/providers/global-settings.service.ts +3 -31
- package/src/app/providers/star-rating-widget.service.ts +4 -4
- package/src/app/providers/translator.service.ts +3 -11
- package/src/app/providers/waiting.service.ts +2 -2
- package/src/app/sass/_variables.scss +29 -26
- package/src/app/utils/globals.ts +4 -34
- package/src/app/utils/rules.ts +5 -7
- package/src/app/utils/utils.ts +47 -37
- package/src/assets/i18n/en.json +0 -2
- package/src/assets/i18n/es.json +0 -2
- package/src/assets/i18n/fr.json +0 -2
- package/src/assets/i18n/it.json +0 -2
- package/src/assets/twp/index.html +6 -60
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +15 -23
- package/src/chat21-core/providers/firebase/firebase-auth-service.ts +21 -20
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +15 -13
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +16 -23
- package/src/chat21-core/providers/firebase/firebase-groups-handler.ts +15 -11
- package/src/chat21-core/providers/firebase/firebase-image-repo.ts +13 -4
- package/src/chat21-core/providers/firebase/firebase-init-service.ts +3 -3
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +11 -9
- package/src/chat21-core/providers/firebase/firebase-presence.service.ts +14 -11
- package/src/chat21-core/providers/firebase/firebase-typing.service.ts +17 -11
- package/src/chat21-core/providers/firebase/firebase-upload.service.ts +12 -9
- package/src/chat21-core/providers/localSessionStorage.ts +2 -15
- package/src/chat21-core/providers/mqtt/chat-service.ts +12 -2
- package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +1 -34
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +4 -6
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +1 -11
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +13 -7
- package/src/chat21-core/providers/mqtt/mqtt-presence.service.ts +3 -3
- package/src/chat21-core/providers/mqtt/mqtt-typing.service.ts +3 -3
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +0 -1
- package/src/chat21-core/utils/user-typing/user-typing.component.scss +3 -3
- package/src/chat21-core/utils/utils.ts +47 -163
- package/src/launch.js +42 -12
- package/src/models/message.ts +0 -23
- package/src/test-new.html +0 -6
- package/src/app/providers/settings-saver.service.spec.ts +0 -17
- package/src/app/providers/settings-saver.service.ts +0 -56
- package/src/app/providers/storage.service.spec.ts +0 -16
- package/src/app/providers/storage.service.ts +0 -220
- package/src/app/utils/translations.ts +0 -122
package/src/models/message.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
// firebase
|
|
2
|
-
import * as firebase from 'firebase/app';
|
|
3
|
-
import 'firebase/database';
|
|
4
|
-
|
|
5
2
|
export class MessageModel {
|
|
6
3
|
public sender_urlImage: string;
|
|
7
4
|
constructor(
|
|
@@ -21,24 +18,4 @@ export class MessageModel {
|
|
|
21
18
|
public projectid: string,
|
|
22
19
|
public emoticon?: boolean
|
|
23
20
|
) { }
|
|
24
|
-
|
|
25
|
-
// asFirebaseMessage(): Object {
|
|
26
|
-
// const message = {
|
|
27
|
-
// language: this.language,
|
|
28
|
-
// recipient: this.recipient,
|
|
29
|
-
// recipient_fullname: this.recipient_fullname,
|
|
30
|
-
// sender: this.sender,
|
|
31
|
-
// sender_fullname: this.sender_fullname,
|
|
32
|
-
// status: this.status,
|
|
33
|
-
// metadata: this.metadata,
|
|
34
|
-
// text: this.text,
|
|
35
|
-
// timestamp: firebase.database.ServerValue.TIMESTAMP,
|
|
36
|
-
// type: this.type,
|
|
37
|
-
// attributes: this.attributes,
|
|
38
|
-
// channel_type: this.channel_type
|
|
39
|
-
// // projectid: this.projectid // removed by sponziello
|
|
40
|
-
// };
|
|
41
|
-
|
|
42
|
-
// return message;
|
|
43
|
-
// }
|
|
44
21
|
}
|
package/src/test-new.html
CHANGED
|
@@ -70,12 +70,6 @@
|
|
|
70
70
|
window.Tiledesk('open');
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
setTimeout(function() {
|
|
74
|
-
console.log("window.Tiledesk", window.Tiledesk);
|
|
75
|
-
// window.Tiledesk('close')
|
|
76
|
-
// window.Tiledesk('signInWithCustomToken', 'TOKENNNNN');
|
|
77
|
-
},10000);
|
|
78
|
-
|
|
79
73
|
|
|
80
74
|
|
|
81
75
|
// window.tileDeskAsyncInit = function() {
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Globals } from './../utils/globals';
|
|
2
|
-
import { TestBed, inject } from '@angular/core/testing';
|
|
3
|
-
|
|
4
|
-
import { SettingsSaverService } from './settings-saver.service';
|
|
5
|
-
import { AppStorageService } from '../../chat21-core/providers/abstract/app-storage.service';
|
|
6
|
-
|
|
7
|
-
describe('SettingsSaverService', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
TestBed.configureTestingModule({
|
|
10
|
-
providers: [SettingsSaverService, Globals, AppStorageService]
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('should be created', inject([SettingsSaverService], (service: SettingsSaverService) => {
|
|
15
|
-
expect(service).toBeTruthy();
|
|
16
|
-
}));
|
|
17
|
-
});
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { AppStorageService } from '../../chat21-core/providers/abstract/app-storage.service';
|
|
3
|
-
import { Globals } from '../utils/globals';
|
|
4
|
-
import { stringToBoolean } from '../utils/utils';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@Injectable()
|
|
8
|
-
export class SettingsSaverService {
|
|
9
|
-
|
|
10
|
-
constructor(
|
|
11
|
-
private g: Globals,
|
|
12
|
-
private appStorageService: AppStorageService
|
|
13
|
-
) {}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* recupero dallo storage globals e lo assegno a globalsParameters
|
|
17
|
-
* ogni successiva modifica di globals verrà salvata in appStorageService
|
|
18
|
-
*/
|
|
19
|
-
initialize() {
|
|
20
|
-
// if (this.appStorageService.getItem('globals')) {
|
|
21
|
-
// this.globalsParameters = this.appStorageService.getItem('globals');
|
|
22
|
-
// }
|
|
23
|
-
this.setGlobalsSubscription();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
public setGlobalsSubscription() {
|
|
30
|
-
const that = this;
|
|
31
|
-
this.g.obsObjChanged.subscribe((obj) => {
|
|
32
|
-
if (obj) {
|
|
33
|
-
that.setVariable(obj.key, obj.val);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* modifico il valore di un parametro e lo salvo nel dizionario
|
|
40
|
-
* pubblico il dizionario modificato
|
|
41
|
-
* salvo il dictionary in local
|
|
42
|
-
* @param key
|
|
43
|
-
* @param value
|
|
44
|
-
*/
|
|
45
|
-
public setVariable(key: string, value: any) {
|
|
46
|
-
const val = JSON.stringify(value);
|
|
47
|
-
// console.log('========================================');
|
|
48
|
-
// console.log('key: ', key);
|
|
49
|
-
// console.log('val: ', val);
|
|
50
|
-
// console.log('========================================');
|
|
51
|
-
// this.appStorageService.setItem(key, stringToBoolean(value));
|
|
52
|
-
|
|
53
|
-
//this.g.wdLog(['SET key: ', key, ' - VAL: ', stringToBoolean(value), ' ---------->', JSON.stringify(value) ]);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Globals } from './../utils/globals';
|
|
2
|
-
import { TestBed, inject } from '@angular/core/testing';
|
|
3
|
-
|
|
4
|
-
import { StorageService } from './storage.service';
|
|
5
|
-
|
|
6
|
-
describe('StorageService', () => {
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
TestBed.configureTestingModule({
|
|
9
|
-
providers: [StorageService, Globals]
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should be created', inject([StorageService], (service: StorageService) => {
|
|
14
|
-
expect(service).toBeTruthy();
|
|
15
|
-
}));
|
|
16
|
-
});
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { Globals } from '../utils/globals';
|
|
3
|
-
import { supports_html5_storage, supports_html5_session } from '../utils/utils';
|
|
4
|
-
import { STORAGE_PREFIX } from '../utils/constants';
|
|
5
|
-
import { environment } from '../../environments/environment';
|
|
6
|
-
import { LoggerService } from '../../chat21-core/providers/abstract/logger.service';
|
|
7
|
-
import { LoggerInstance } from '../../chat21-core/providers/logger/loggerInstance';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@Injectable()
|
|
11
|
-
export class StorageService {
|
|
12
|
-
|
|
13
|
-
private logger: LoggerService = LoggerInstance.getInstance()
|
|
14
|
-
constructor(public g: Globals) { }
|
|
15
|
-
|
|
16
|
-
// globals.setParameter(key, globalVar.key.value);
|
|
17
|
-
// globals.getParameters('windowContext');
|
|
18
|
-
|
|
19
|
-
public getItem (key: string): any {
|
|
20
|
-
let prefix = STORAGE_PREFIX;
|
|
21
|
-
try {
|
|
22
|
-
// const sv = 'sv' + environment.shemaVersion + '_';
|
|
23
|
-
// prefix = prefix + sv;
|
|
24
|
-
prefix = environment.storage_prefix + '_';
|
|
25
|
-
} catch (e) {
|
|
26
|
-
this.logger.error('[STORAGE-SERV] > Error :' + e);
|
|
27
|
-
}
|
|
28
|
-
const newKey = prefix + this.g.projectid + '_' + key;
|
|
29
|
-
return this.getValueForKey(newKey);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** */
|
|
33
|
-
public getItemWithoutProjectId (key) {
|
|
34
|
-
let prefix = STORAGE_PREFIX;
|
|
35
|
-
try {
|
|
36
|
-
// const sv = 'sv' + environment.shemaVersion + '_';
|
|
37
|
-
// prefix = prefix + sv;
|
|
38
|
-
prefix = environment.storage_prefix + '_';
|
|
39
|
-
} catch (e) {
|
|
40
|
-
this.logger.error('[STORAGE-SERV] > Error :' + e);
|
|
41
|
-
}
|
|
42
|
-
const newKey = prefix + key;
|
|
43
|
-
return this.getValueForKey(newKey);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** */
|
|
47
|
-
private getValueForKey(key) {
|
|
48
|
-
if (this.g.persistence === 'local') {
|
|
49
|
-
if (supports_html5_storage()) {
|
|
50
|
-
return localStorage.getItem(key);
|
|
51
|
-
} else {
|
|
52
|
-
this.logger.warn('[STORAGE-SERV] localStorage is not defind. Storage disabled');
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
// } else if (this.g.persistence === 'session') {
|
|
56
|
-
} else if (this.g.persistence === 'session') {
|
|
57
|
-
if (supports_html5_session()) {
|
|
58
|
-
return sessionStorage.getItem(key);
|
|
59
|
-
} else {
|
|
60
|
-
this.logger.warn('[STORAGE-SERV] sessionStorage is not defind. Storage disabled');
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
// } else if (this.g.persistence === 'none') {
|
|
64
|
-
} else if (this.g.persistence === 'none') {
|
|
65
|
-
return null;
|
|
66
|
-
} else {
|
|
67
|
-
if (supports_html5_storage()) {
|
|
68
|
-
return localStorage.getItem(key);
|
|
69
|
-
} else {
|
|
70
|
-
this.logger.warn('[STORAGE-SERV] localStorage is not defind. Storage disabled');
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/** */
|
|
78
|
-
public setItem (key, value) {
|
|
79
|
-
this.removeItem(key);
|
|
80
|
-
let prefix = STORAGE_PREFIX;
|
|
81
|
-
try {
|
|
82
|
-
// const sv = 'sv' + environment.shemaVersion + '_';
|
|
83
|
-
// prefix = prefix + sv;
|
|
84
|
-
prefix = environment.storage_prefix + '_';
|
|
85
|
-
} catch (e) {
|
|
86
|
-
this.logger.error('[STORAGE-SERV] > Error :' + e);
|
|
87
|
-
}
|
|
88
|
-
const newKey = prefix + this.g.projectid + '_' + key; // this.g.projectid + '_' + key;
|
|
89
|
-
this.saveValueForKey(newKey, value);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** */
|
|
93
|
-
public setItemWithoutProjectId (key, value) {
|
|
94
|
-
this.removeItem(key);
|
|
95
|
-
let prefix = STORAGE_PREFIX;
|
|
96
|
-
try {
|
|
97
|
-
// const sv = 'sv' + environment.shemaVersion + '_';
|
|
98
|
-
// prefix = prefix + sv;
|
|
99
|
-
prefix = environment.storage_prefix + '_';
|
|
100
|
-
|
|
101
|
-
} catch (e) {
|
|
102
|
-
this.logger.error('[STORAGE-SERV] > Error :' + e);
|
|
103
|
-
}
|
|
104
|
-
const newKey = prefix + key;
|
|
105
|
-
this.saveValueForKey(newKey, value);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/** */
|
|
109
|
-
private saveValueForKey(key, value) {
|
|
110
|
-
if (this.g.persistence === 'local') {
|
|
111
|
-
if (supports_html5_storage()) {
|
|
112
|
-
return localStorage.setItem(key, value);
|
|
113
|
-
} else {
|
|
114
|
-
this.logger.warn('[STORAGE-SERV] localStorage is not defind. Storage disabled');
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
// } else if (this.g.persistence === 'session') {
|
|
118
|
-
} else if (this.g.persistence === 'session') {
|
|
119
|
-
if (supports_html5_session()) {
|
|
120
|
-
return sessionStorage.setItem(key, value);
|
|
121
|
-
} else {
|
|
122
|
-
this.logger.warn('[STORAGE-SERV] sessionStorage is not defind. Storage disabled');
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
// } else if (this.g.persistence === 'none') {
|
|
126
|
-
} else if (this.g.persistence === 'none') {
|
|
127
|
-
return null;
|
|
128
|
-
} else {
|
|
129
|
-
if (supports_html5_storage()) {
|
|
130
|
-
return localStorage.setItem(key, value);
|
|
131
|
-
} else {
|
|
132
|
-
this.logger.warn('[STORAGE-SERV] localStorage is not defind. Storage disabled');
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
public removeItem(key: string) {
|
|
139
|
-
let prefix = STORAGE_PREFIX;
|
|
140
|
-
try {
|
|
141
|
-
// const sv = 'sv' + environment.shemaVersion + '_';
|
|
142
|
-
// prefix = prefix + sv;
|
|
143
|
-
prefix = environment.storage_prefix + '_';
|
|
144
|
-
} catch (e) {
|
|
145
|
-
this.logger.error('[STORAGE-SERV] > Error :' + e);
|
|
146
|
-
}
|
|
147
|
-
// const newKey = this.g.projectid + '_' + key;
|
|
148
|
-
const newKey = prefix + this.g.projectid + '_' + key; // this.g.projectid + '_' + key;
|
|
149
|
-
// console.log('removeItem:: ', newKey);
|
|
150
|
-
// if (this.g.persistence === 'local') {
|
|
151
|
-
return this.removeItemForKey(newKey);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
public removeItemForSuffix(suffix: string) {
|
|
155
|
-
for (let i = 0; i < localStorage.length; i++) {
|
|
156
|
-
const key = localStorage.key(i);
|
|
157
|
-
if (key.indexOf(suffix) !== -1) {
|
|
158
|
-
localStorage.removeItem(key);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
public removeItemForKey(key: string) {
|
|
165
|
-
// console.log('removeItemForKey:: ', key);
|
|
166
|
-
if (this.g.persistence === 'local') {
|
|
167
|
-
if (supports_html5_storage()) {
|
|
168
|
-
return localStorage.removeItem(key);
|
|
169
|
-
} else {
|
|
170
|
-
this.logger.warn('[STORAGE-SERV] localStorage is not defind. Storage disabled');
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
} else if (this.g.persistence === 'session') {
|
|
174
|
-
if (supports_html5_session()) {
|
|
175
|
-
return sessionStorage.removeItem(key);
|
|
176
|
-
} else {
|
|
177
|
-
this.logger.warn('[STORAGE-SERV] sessionStorage is not defind. Storage disabled');
|
|
178
|
-
return null;
|
|
179
|
-
}
|
|
180
|
-
} else if (this.g.persistence === 'none') {
|
|
181
|
-
return null;
|
|
182
|
-
} else {
|
|
183
|
-
if (supports_html5_storage()) {
|
|
184
|
-
return localStorage.removeItem(key);
|
|
185
|
-
} else {
|
|
186
|
-
this.logger.warn('[STORAGE-SERV] localStorage is not defind. Storage disabled');
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
public clear () {
|
|
193
|
-
let prefix = STORAGE_PREFIX;
|
|
194
|
-
try {
|
|
195
|
-
// const sv = 'sv' + environment.shemaVersion + '_';
|
|
196
|
-
// prefix = prefix + sv;
|
|
197
|
-
prefix = environment.storage_prefix + '_';
|
|
198
|
-
} catch (e) {
|
|
199
|
-
this.logger.error('[STORAGE-SERV] > Error :' + e);
|
|
200
|
-
}
|
|
201
|
-
// if (this.g.persistence === 'local') {
|
|
202
|
-
const prefixKey = prefix + this.g.projectid;
|
|
203
|
-
const arrayKey: Array<string> = [];
|
|
204
|
-
for (let i = 0; i < localStorage.length; i++) {
|
|
205
|
-
const key = localStorage.key(i);
|
|
206
|
-
if (key.indexOf(prefixKey) !== -1) {
|
|
207
|
-
arrayKey.push(key);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
for (let i = 0; i < arrayKey.length; i++) {
|
|
212
|
-
// console.log('CLAER KEY: ', arrayKey[i]);
|
|
213
|
-
// localStorage.removeItem(arrayKey[i]);
|
|
214
|
-
this.removeItemForKey(arrayKey[i]);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
// 'LABEL_START_NW_CONV' : 'START A NEW CONVERSATION',
|
|
2
|
-
export const en = {
|
|
3
|
-
'LABEL_TU': 'you ',
|
|
4
|
-
'LABEL_PLACEHOLDER': 'type your message..',
|
|
5
|
-
'LABEL_START_NW_CONV': 'New conversation',
|
|
6
|
-
'LABEL_FIRST_MSG': 'Describe shortly your problem, you will be contacted by an agent.',
|
|
7
|
-
// tslint:disable-next-line:max-line-length
|
|
8
|
-
'LABEL_FIRST_MSG_NO_AGENTS': '🤔 All operators are offline at the moment. You can anyway describe your problem. It will be assigned to the support team who will answer you as soon as possible.',
|
|
9
|
-
'LABEL_SELECT_TOPIC': 'Select a topic',
|
|
10
|
-
'LABEL_COMPLETE_FORM': 'Complete the form to start a conversation with the next available agent.',
|
|
11
|
-
'LABEL_FIELD_NAME': 'Name',
|
|
12
|
-
'LABEL_ERROR_FIELD_NAME': 'Required field (minimum 5 characters).',
|
|
13
|
-
'LABEL_FIELD_EMAIL': 'Email',
|
|
14
|
-
'LABEL_ERROR_FIELD_EMAIL': 'Enter a valid email address.',
|
|
15
|
-
'LABEL_ERROR_FIELD_REQUIRED':'Required field',
|
|
16
|
-
'LABEL_WRITING': 'is writing...',
|
|
17
|
-
'LABEL_SEND_NEW_MESSAGE': 'Send a new message',
|
|
18
|
-
'AGENT_NOT_AVAILABLE': ' Offline',
|
|
19
|
-
'AGENT_AVAILABLE': ' Online',
|
|
20
|
-
'GUEST_LABEL': 'Guest',
|
|
21
|
-
'ALL_AGENTS_OFFLINE_LABEL': 'All operators are offline at the moment',
|
|
22
|
-
'LABEL_LOADING': 'Loading...',
|
|
23
|
-
'CALLOUT_TITLE_PLACEHOLDER': 'Need Help?',
|
|
24
|
-
'CALLOUT_MSG_PLACEHOLDER': 'Click here and start chatting with us!',
|
|
25
|
-
'CUSTOMER_SATISFACTION': 'Customer satisfaction',
|
|
26
|
-
'YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE': 'your opinion on our customer service',
|
|
27
|
-
'DOWNLOAD_TRANSCRIPT': 'Download transcript',
|
|
28
|
-
'BACK': 'Back',
|
|
29
|
-
'YOUR_RATING': 'your rating',
|
|
30
|
-
'WRITE_YOUR_OPINION': 'Write your opinion ... (optional)',
|
|
31
|
-
'SUBMIT': 'Submit',
|
|
32
|
-
'THANK_YOU_FOR_YOUR_EVALUATION': 'Thank you for your evaluation',
|
|
33
|
-
'YOUR_RATING_HAS_BEEN_RECEIVED' : 'your rating has been received',
|
|
34
|
-
|
|
35
|
-
'ALERT_LEAVE_CHAT': 'Do you want to leave the chat?',
|
|
36
|
-
'YES': 'Yes',
|
|
37
|
-
'NO': 'No',
|
|
38
|
-
'BUTTON_CLOSE_TO_ICON': 'Minimize chat',
|
|
39
|
-
'BUTTON_EDIT_PROFILE': 'Update profile',
|
|
40
|
-
'RATE_CHAT': 'Rate chat',
|
|
41
|
-
'WELCOME_TITLE': 'Hi, welcome to Tiledesk',
|
|
42
|
-
'WELCOME_MSG': 'How can we help?',
|
|
43
|
-
'WELCOME': 'Welcome',
|
|
44
|
-
'OPTIONS': 'options',
|
|
45
|
-
|
|
46
|
-
'SOUND_OFF': 'sound off',
|
|
47
|
-
'SOUND_ON': 'sound on',
|
|
48
|
-
'LOGOUT': 'logout',
|
|
49
|
-
'CLOSE': 'close',
|
|
50
|
-
'PREV_CONVERSATIONS': 'Your conversations',
|
|
51
|
-
'YOU': 'You',
|
|
52
|
-
'SHOW_ALL_CONV': 'show all',
|
|
53
|
-
'START_A_CONVERSATION': 'Start a conversation',
|
|
54
|
-
'NO_CONVERSATION': 'No conversation',
|
|
55
|
-
'SEE_PREVIOUS': 'see previous',
|
|
56
|
-
'WAITING_TIME_FOUND': 'The team typically replies in ',
|
|
57
|
-
'WAITING_TIME_NOT_FOUND': 'The team will reply as soon as possible',
|
|
58
|
-
'CLOSED': 'CLOSED',
|
|
59
|
-
'LABEL_PREVIEW':'Preview'
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
// 'LABEL_START_NW_CONV': 'INIZIA UNA NUOVA CONVERSAZIONE',
|
|
64
|
-
export const it = {
|
|
65
|
-
'LABEL_TU': 'tu ',
|
|
66
|
-
'LABEL_PLACEHOLDER': 'Scrivi la tua domanda...',
|
|
67
|
-
'LABEL_START_NW_CONV': 'Nuova conversazione',
|
|
68
|
-
'LABEL_FIRST_MSG': 'Descrivi sinteticamente il tuo problema, ti metteremo in contatto con un operatore specializzato.',
|
|
69
|
-
// tslint:disable-next-line:max-line-length
|
|
70
|
-
'LABEL_FIRST_MSG_NO_AGENTS': '🤔 Tutti gli operatori sono offline al momento.Puoi comunque descrivere il tuo problema. Sarà assegnato al team di supporto che ti risponderà appena possibile.',
|
|
71
|
-
'LABEL_SELECT_TOPIC': 'Seleziona un argomento',
|
|
72
|
-
'LABEL_COMPLETE_FORM': 'Completa il form per iniziare una conversazione con il prossimo agente disponibile.',
|
|
73
|
-
'LABEL_FIELD_NAME': 'Nome',
|
|
74
|
-
'LABEL_ERROR_FIELD_NAME': 'Nome richiesto (minimo 2 caratteri).',
|
|
75
|
-
'LABEL_FIELD_EMAIL': 'Email',
|
|
76
|
-
'LABEL_ERROR_FIELD_EMAIL': 'Inserisci un indirizzo email valido.',
|
|
77
|
-
'LABEL_ERROR_FIELD_REQUIRED':'Campo obbligatorio',
|
|
78
|
-
'LABEL_WRITING': 'sta scrivendo...',
|
|
79
|
-
'LABEL_SEND_NEW_MESSAGE': 'Invia un nuovo messaggio',
|
|
80
|
-
'AGENT_NOT_AVAILABLE': ' Offline',
|
|
81
|
-
'AGENT_AVAILABLE': ' Online',
|
|
82
|
-
'GUEST_LABEL': 'Ospite',
|
|
83
|
-
'ALL_AGENTS_OFFLINE_LABEL': 'Tutti gli operatori sono offline al momento',
|
|
84
|
-
'LABEL_LOADING': 'Caricamento...',
|
|
85
|
-
'CALLOUT_TITLE_PLACEHOLDER': 'Bisogno di aiuto?',
|
|
86
|
-
'CALLOUT_MSG_PLACEHOLDER': 'Clicca qui e inizia a chattare con noi!',
|
|
87
|
-
'CUSTOMER_SATISFACTION': 'Valutazione servizio',
|
|
88
|
-
'YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE': 'il tuo giudizio sul nostro servizio clienti',
|
|
89
|
-
'DOWNLOAD_TRANSCRIPT': 'Scarica transcript',
|
|
90
|
-
'BACK': 'Indietro',
|
|
91
|
-
'YOUR_RATING': 'il tuo voto',
|
|
92
|
-
'WRITE_YOUR_OPINION': 'Scrivi la tua opinione...(opzionale)',
|
|
93
|
-
'SUBMIT': 'Invia',
|
|
94
|
-
'THANK_YOU_FOR_YOUR_EVALUATION': 'Grazie per la tua valutazione',
|
|
95
|
-
'YOUR_RATING_HAS_BEEN_RECEIVED' : 'il tuo voto è stato ricevuto',
|
|
96
|
-
|
|
97
|
-
'ALERT_LEAVE_CHAT': 'Vuoi abbandonare la conversazione?',
|
|
98
|
-
'YES': 'Yes',
|
|
99
|
-
'NO': 'No',
|
|
100
|
-
'BUTTON_CLOSE_TO_ICON': 'Riduci a icona la chat',
|
|
101
|
-
'BUTTON_EDIT_PROFILE': 'Modifica profilo',
|
|
102
|
-
'RATE_CHAT': 'Valuta chat',
|
|
103
|
-
'WELCOME_TITLE': 'Ciao, benvenuto su Tiledesk',
|
|
104
|
-
'WELCOME_MSG': 'Come possiamo aiutarti?',
|
|
105
|
-
'OPTIONS': 'opzioni',
|
|
106
|
-
'WELCOME': 'Benvenuto',
|
|
107
|
-
|
|
108
|
-
'SOUND_OFF': 'suono spento',
|
|
109
|
-
'SOUND_ON': 'suono acceso',
|
|
110
|
-
'LOGOUT': 'disconnetti',
|
|
111
|
-
'CLOSE': 'Chiudi',
|
|
112
|
-
'PREV_CONVERSATIONS': 'Le tue conversazioni',
|
|
113
|
-
'YOU': 'Tu',
|
|
114
|
-
'SHOW_ALL_CONV': 'vedi tutte',
|
|
115
|
-
'START_A_CONVERSATION': 'Inizia una conversazione',
|
|
116
|
-
'NO_CONVERSATION': 'Nessuna conversazione attiva',
|
|
117
|
-
'SEE_PREVIOUS': 'vedi precedenti',
|
|
118
|
-
'WAITING_TIME_FOUND': 'Il team tipicamente risponde in ',
|
|
119
|
-
'WAITING_TIME_NOT_FOUND': 'Vi risponderemo appena possibile',
|
|
120
|
-
'CLOSED': 'CHIUSA',
|
|
121
|
-
'LABEL_PREVIEW':'Anteprima'
|
|
122
|
-
};
|