@chat21/chat21-ionic 3.0.61-rc5 → 3.0.61-rc7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/config.xml +5 -5
- package/deploy_pre.sh +10 -10
- package/deploy_prod.sh +5 -1
- package/package.json +6 -6
- package/resources/{Android → android}/icon/drawable-hdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-ldpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-mdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xxhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xxxhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash.png +0 -0
- package/src/app/app.component.html +2 -2
- package/src/app/app.component.scss +2 -1
- package/src/app/app.component.ts +22 -11
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +78 -15
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +4 -3
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +1 -1
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +3 -3
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +12 -2
- package/src/app/components/sidebar/sidebar.component.html +119 -66
- package/src/app/components/sidebar/sidebar.component.scss +41 -3
- package/src/app/components/sidebar/sidebar.component.ts +108 -30
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +9 -1
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +25 -17
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +92 -34
- package/src/app/pages/conversation-detail/conversation-detail.page.html +2 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +1289 -783
- package/src/app/pages/conversations-list/conversations-list.page.html +3 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +28 -18
- package/src/app/pages/loader-preview/loader-preview.page.ts +235 -166
- package/src/app/pages/profile-info/profile-info.page.scss +1 -1
- package/src/app/services/tiledesk/tiledesk.service.ts +19 -0
- package/src/assets/i18n/de.json +9 -7
- package/src/assets/i18n/en.json +5 -3
- package/src/assets/i18n/es.json +4 -2
- package/src/assets/i18n/fr.json +7 -5
- package/src/assets/i18n/it.json +4 -2
- package/src/assets/i18n/pt.json +4 -2
- package/src/assets/i18n/ru.json +5 -3
- package/src/assets/i18n/tr.json +4 -2
- package/src/chat21-core/utils/constants.ts +4 -1
- package/src/global.scss +32 -67
- package/publish_pre.sh +0 -33
- package/publish_prod.sh +0 -33
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
OnInit,
|
|
4
|
+
Input,
|
|
5
|
+
Output,
|
|
6
|
+
ViewChild,
|
|
7
|
+
ElementRef,
|
|
8
|
+
EventEmitter,
|
|
9
|
+
HostListener,
|
|
10
|
+
AfterViewInit,
|
|
11
|
+
} from '@angular/core'
|
|
12
|
+
import { TYPE_MSG_IMAGE } from 'src/chat21-core/utils/constants'
|
|
13
|
+
import { NavParams, ModalController } from '@ionic/angular'
|
|
14
|
+
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'
|
|
5
15
|
|
|
6
16
|
// Logger
|
|
7
|
-
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service'
|
|
8
|
-
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
17
|
+
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service'
|
|
18
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
9
19
|
|
|
10
20
|
@Component({
|
|
11
21
|
selector: 'app-loader-preview',
|
|
@@ -13,103 +23,138 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
|
13
23
|
styleUrls: ['./loader-preview.page.scss'],
|
|
14
24
|
})
|
|
15
25
|
export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
16
|
-
@ViewChild('thumbnailsPreview', { static: false })
|
|
17
|
-
|
|
26
|
+
@ViewChild('thumbnailsPreview', { static: false })
|
|
27
|
+
thumbnailsPreview: ElementRef
|
|
28
|
+
@ViewChild('messageTextArea', { static: false }) messageTextArea: ElementRef
|
|
18
29
|
@ViewChild('imageCaptionTexarea', { static: false }) imageCaptionTexarea: any
|
|
19
30
|
// @Output() eventSendMessage = new EventEmitter<object>();
|
|
20
|
-
@Input() files: [any]
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
public
|
|
25
|
-
public
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
public
|
|
31
|
-
|
|
31
|
+
@Input() files: [any]
|
|
32
|
+
@Input() enableBackdropDismiss: any
|
|
33
|
+
@Input() msg: string
|
|
34
|
+
|
|
35
|
+
public arrayFiles = []
|
|
36
|
+
public fileSelected: any
|
|
37
|
+
public messageString: string
|
|
38
|
+
public heightPreviewArea = '183'
|
|
39
|
+
private selectedFiles: any
|
|
40
|
+
srcData: SafeResourceUrl
|
|
41
|
+
public file_extension: string
|
|
42
|
+
public file_name: string
|
|
43
|
+
public file_name_ellipsis_the_middle: string
|
|
44
|
+
private logger: LoggerService = LoggerInstance.getInstance()
|
|
32
45
|
|
|
33
46
|
constructor(
|
|
34
47
|
public viewCtrl: ModalController,
|
|
35
|
-
private sanitizer: DomSanitizer
|
|
36
|
-
) {
|
|
48
|
+
private sanitizer: DomSanitizer,
|
|
49
|
+
) {}
|
|
37
50
|
|
|
38
51
|
ngOnInit() {
|
|
39
|
-
this.logger.log('[LOADER-PREVIEW-PAGE] Hello!')
|
|
52
|
+
this.logger.log('[LOADER-PREVIEW-PAGE] Hello!')
|
|
40
53
|
// tslint:disable-next-line: prefer-for-of
|
|
41
|
-
this.selectedFiles = this.files
|
|
54
|
+
this.selectedFiles = this.files
|
|
42
55
|
for (let i = 0; i < this.files.length; i++) {
|
|
43
|
-
this.readAsDataURL(this.files[i])
|
|
56
|
+
this.readAsDataURL(this.files[i])
|
|
44
57
|
//this.fileChange(this.files[i]);
|
|
45
58
|
}
|
|
46
59
|
}
|
|
47
60
|
ngAfterViewInit() {
|
|
61
|
+
this.logger.log('[LOADER-PREVIEW-PAGE] this.files', this.files)
|
|
62
|
+
this.logger.log(
|
|
63
|
+
'[LOADER-PREVIEW-PAGE] enableBackdropDismiss',
|
|
64
|
+
this.enableBackdropDismiss,
|
|
65
|
+
)
|
|
66
|
+
this.logger.log('[LOADER-PREVIEW-PAGE] msg', this.msg)
|
|
67
|
+
if (this.msg) {
|
|
68
|
+
this.messageString = this.msg
|
|
69
|
+
}
|
|
70
|
+
|
|
48
71
|
if (this.imageCaptionTexarea) {
|
|
49
72
|
setTimeout(() => {
|
|
50
73
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] set focus on ", this.messageTextArea);
|
|
51
74
|
// Keyboard.show() // for android
|
|
52
|
-
this.logger.log(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
75
|
+
this.logger.log(
|
|
76
|
+
'[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit this.imageCaptionTexarea ',
|
|
77
|
+
this.imageCaptionTexarea,
|
|
78
|
+
)
|
|
79
|
+
this.imageCaptionTexarea.setFocus()
|
|
80
|
+
}, 1000) //a least 150ms.
|
|
56
81
|
}
|
|
57
82
|
}
|
|
58
83
|
|
|
59
84
|
ionViewDidEnter() {
|
|
60
|
-
this.logger.log(
|
|
61
|
-
|
|
85
|
+
this.logger.log(
|
|
86
|
+
'[LOADER-PREVIEW-PAGE] ionViewDidEnter thumbnailsPreview.nativeElement.offsetHeight',
|
|
87
|
+
this.thumbnailsPreview.nativeElement.offsetHeight,
|
|
88
|
+
)
|
|
89
|
+
this.calculateHeightPreviewArea()
|
|
62
90
|
}
|
|
63
91
|
|
|
64
92
|
readAsDataURL(file: any) {
|
|
65
|
-
this.logger.log('[LOADER-PREVIEW-PAGE] readAsDataURL file', file)
|
|
93
|
+
this.logger.log('[LOADER-PREVIEW-PAGE] readAsDataURL file', file)
|
|
66
94
|
// ---------------------------------------------------------------------
|
|
67
95
|
// USE CASE IMAGE
|
|
68
96
|
// ---------------------------------------------------------------------
|
|
69
|
-
if (file.type.startsWith(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
97
|
+
if (file.type.startsWith('image') && !file.type.includes('svg')) {
|
|
98
|
+
this.logger.log(
|
|
99
|
+
'[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE IMAGE file TYPE',
|
|
100
|
+
file.type,
|
|
101
|
+
)
|
|
102
|
+
const reader = new FileReader()
|
|
73
103
|
reader.onloadend = (evt) => {
|
|
74
|
-
const img = reader.result.toString()
|
|
75
|
-
this.logger.log(
|
|
76
|
-
|
|
104
|
+
const img = reader.result.toString()
|
|
105
|
+
this.logger.log(
|
|
106
|
+
'[LOADER-PREVIEW-PAGE] - readAsDataURL - FileReader success ',
|
|
107
|
+
img,
|
|
108
|
+
)
|
|
109
|
+
this.arrayFiles.push(img)
|
|
77
110
|
if (!this.fileSelected) {
|
|
78
|
-
this.fileSelected = img
|
|
111
|
+
this.fileSelected = img
|
|
79
112
|
}
|
|
80
|
-
}
|
|
113
|
+
}
|
|
81
114
|
|
|
82
|
-
reader.readAsDataURL(file)
|
|
115
|
+
reader.readAsDataURL(file)
|
|
83
116
|
// ---------------------------------------------------------------------
|
|
84
|
-
// USE CASE SVG
|
|
117
|
+
// USE CASE SVG
|
|
85
118
|
// ---------------------------------------------------------------------
|
|
86
|
-
} else if (file.type.startsWith(
|
|
119
|
+
} else if (file.type.startsWith('image') && file.type.includes('svg')) {
|
|
87
120
|
// this.previewFiles(file)
|
|
88
121
|
|
|
89
|
-
this.logger.log(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
reader
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
122
|
+
this.logger.log(
|
|
123
|
+
'[LOADER-PREVIEW-PAGE] - readAsDataURL file TYPE',
|
|
124
|
+
file.type,
|
|
125
|
+
)
|
|
126
|
+
this.logger.log('[LOADER-PREVIEW-PAGE] - readAsDataURL file ', file)
|
|
127
|
+
const preview = document.querySelector('#img-preview') as HTMLImageElement
|
|
128
|
+
|
|
129
|
+
const reader = new FileReader()
|
|
130
|
+
const that = this
|
|
131
|
+
reader.addEventListener(
|
|
132
|
+
'load',
|
|
133
|
+
function () {
|
|
134
|
+
// convert image file to base64 string
|
|
135
|
+
// const img = reader.result as string;
|
|
136
|
+
const img = reader.result.toString()
|
|
137
|
+
that.logger.log(
|
|
138
|
+
'FIREBASE-UPLOAD USE CASE SVG LoaderPreviewPage readAsDataURL img ',
|
|
139
|
+
img,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
// that.fileSelected = that.sanitizer.bypassSecurityTrustResourceUrl(img);
|
|
143
|
+
|
|
144
|
+
that.arrayFiles.push(
|
|
145
|
+
that.sanitizer.bypassSecurityTrustResourceUrl(img),
|
|
146
|
+
)
|
|
147
|
+
if (!that.fileSelected) {
|
|
148
|
+
that.fileSelected = that.sanitizer.bypassSecurityTrustResourceUrl(
|
|
149
|
+
img,
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
false,
|
|
154
|
+
)
|
|
109
155
|
|
|
110
156
|
if (file) {
|
|
111
|
-
|
|
112
|
-
reader.readAsDataURL(file);
|
|
157
|
+
reader.readAsDataURL(file)
|
|
113
158
|
}
|
|
114
159
|
|
|
115
160
|
// ---------------------------------------------------------------------
|
|
@@ -117,13 +162,27 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
117
162
|
// ---------------------------------------------------------------------
|
|
118
163
|
// } else if (file.type.startsWith("application") || file.type.startsWith("video") || file.type.startsWith("audio") ) {
|
|
119
164
|
} else {
|
|
120
|
-
this.logger.log(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
165
|
+
this.logger.log(
|
|
166
|
+
'[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE FILE - FILE ',
|
|
167
|
+
file,
|
|
168
|
+
)
|
|
169
|
+
this.logger.log(
|
|
170
|
+
'[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE FILE - FILE TYPE',
|
|
171
|
+
file.type,
|
|
172
|
+
)
|
|
173
|
+
this.file_extension =
|
|
174
|
+
file.name.substring(file.name.lastIndexOf('.') + 1, file.name.length) ||
|
|
175
|
+
file.name
|
|
176
|
+
this.logger.log(
|
|
177
|
+
'[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE FILE - FILE EXTENSION',
|
|
178
|
+
this.file_extension,
|
|
179
|
+
)
|
|
124
180
|
this.file_name = file.name
|
|
125
181
|
this.file_name_ellipsis_the_middle = this.start_and_end(file.name)
|
|
126
|
-
this.logger.log(
|
|
182
|
+
this.logger.log(
|
|
183
|
+
'[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE FILE - FILE NAME',
|
|
184
|
+
this.file_name,
|
|
185
|
+
)
|
|
127
186
|
// if (file.type) {
|
|
128
187
|
// const file_type_array = file.type.split('/');
|
|
129
188
|
// this.logger.log('FIREBASE-UPLOAD USE CASE FILE LoaderPreviewPage readAsDataURL file_type_array', file_type_array);
|
|
@@ -132,38 +191,40 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
132
191
|
// this.file_type = file.name.substring(file.name.lastIndexOf('.')+1, file.name.length) || file.name;
|
|
133
192
|
|
|
134
193
|
// }
|
|
135
|
-
this.createFile()
|
|
194
|
+
this.createFile()
|
|
136
195
|
}
|
|
137
196
|
}
|
|
138
197
|
|
|
139
198
|
start_and_end(str) {
|
|
140
199
|
if (str.length > 70) {
|
|
141
|
-
return str.substr(0, 20) + '...' + str.substr(str.length - 10, str.length)
|
|
200
|
+
return str.substr(0, 20) + '...' + str.substr(str.length - 10, str.length)
|
|
142
201
|
}
|
|
143
|
-
return str
|
|
202
|
+
return str
|
|
144
203
|
}
|
|
145
204
|
// file-alt-solid.png
|
|
146
205
|
async createFile() {
|
|
147
|
-
let response = await fetch('./assets/images/file-alt-solid.png')
|
|
148
|
-
let data = await response.blob()
|
|
206
|
+
let response = await fetch('./assets/images/file-alt-solid.png')
|
|
207
|
+
let data = await response.blob()
|
|
149
208
|
let metadata = {
|
|
150
|
-
type: 'image/png'
|
|
151
|
-
}
|
|
152
|
-
let file = new File([data],
|
|
153
|
-
this.logger.log('[LOADER-PREVIEW-PAGE] - createFile file - file', file)
|
|
154
|
-
const reader = new FileReader()
|
|
209
|
+
type: 'image/png',
|
|
210
|
+
}
|
|
211
|
+
let file = new File([data], 'test.png', metadata)
|
|
212
|
+
this.logger.log('[LOADER-PREVIEW-PAGE] - createFile file - file', file)
|
|
213
|
+
const reader = new FileReader()
|
|
155
214
|
reader.onloadend = (evt) => {
|
|
156
|
-
const img = reader.result.toString()
|
|
157
|
-
this.logger.log(
|
|
158
|
-
|
|
215
|
+
const img = reader.result.toString()
|
|
216
|
+
this.logger.log(
|
|
217
|
+
'[LOADER-PREVIEW-PAGE] - createFile file - FileReader success img',
|
|
218
|
+
img,
|
|
219
|
+
)
|
|
220
|
+
this.arrayFiles.push(img)
|
|
159
221
|
if (!this.fileSelected) {
|
|
160
|
-
this.fileSelected = img
|
|
222
|
+
this.fileSelected = img
|
|
161
223
|
}
|
|
162
|
-
}
|
|
163
|
-
reader.readAsDataURL(file)
|
|
224
|
+
}
|
|
225
|
+
reader.readAsDataURL(file)
|
|
164
226
|
}
|
|
165
227
|
|
|
166
|
-
|
|
167
228
|
// for svg
|
|
168
229
|
|
|
169
230
|
// previewFiles(file) {
|
|
@@ -174,7 +235,6 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
174
235
|
// this.readAndPreview(file, preview)
|
|
175
236
|
// }
|
|
176
237
|
|
|
177
|
-
|
|
178
238
|
// readAndPreview(file, preview) {
|
|
179
239
|
// this.logger.log('LoaderPreviewPage readAsDataURL preview HERE 1');
|
|
180
240
|
// // Make sure `file.name` matches our extensions criteria
|
|
@@ -201,51 +261,52 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
201
261
|
|
|
202
262
|
// }
|
|
203
263
|
|
|
204
|
-
|
|
205
|
-
// NOT USED
|
|
264
|
+
// NOT USED
|
|
206
265
|
fileChange(file) {
|
|
207
|
-
this.logger.log('fileChange')
|
|
208
|
-
const that = this
|
|
266
|
+
this.logger.log('fileChange')
|
|
267
|
+
const that = this
|
|
209
268
|
if (file) {
|
|
210
|
-
const nameImg = file.name
|
|
211
|
-
const typeFile = file.type
|
|
212
|
-
this.logger.log('nameImg: ', nameImg)
|
|
213
|
-
this.logger.log('typeFile: ', typeFile)
|
|
214
|
-
|
|
215
|
-
const reader = new FileReader()
|
|
216
|
-
reader.addEventListener(
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
that.
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
269
|
+
const nameImg = file.name
|
|
270
|
+
const typeFile = file.type
|
|
271
|
+
this.logger.log('nameImg: ', nameImg)
|
|
272
|
+
this.logger.log('typeFile: ', typeFile)
|
|
273
|
+
|
|
274
|
+
const reader = new FileReader()
|
|
275
|
+
reader.addEventListener(
|
|
276
|
+
'load',
|
|
277
|
+
function () {
|
|
278
|
+
const img = reader.result.toString()
|
|
279
|
+
that.logger.log('FileReader success')
|
|
280
|
+
that.arrayFiles.push(img)
|
|
281
|
+
if (!that.fileSelected) {
|
|
282
|
+
that.fileSelected = img
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (typeFile.indexOf('image') !== -1) {
|
|
286
|
+
const file4Load = new Image()
|
|
287
|
+
file4Load.src = reader.result.toString()
|
|
288
|
+
file4Load.title = nameImg
|
|
289
|
+
file4Load.onload = function () {
|
|
290
|
+
that.logger.log('that.file4Load: ', file4Load)
|
|
291
|
+
//that.arrayFiles.push(file4Load);
|
|
292
|
+
const uid = file4Load.src.substring(file4Load.src.length - 16)
|
|
293
|
+
const metadata = {
|
|
294
|
+
name: file4Load.title,
|
|
295
|
+
src: file4Load.src,
|
|
296
|
+
width: file4Load.width,
|
|
297
|
+
height: file4Load.height,
|
|
298
|
+
type: typeFile,
|
|
299
|
+
uid: uid,
|
|
300
|
+
}
|
|
301
|
+
// const type_msg = 'image';
|
|
302
|
+
// 1 - invio messaggio
|
|
303
|
+
//that.viewCtrl.dismiss({fileSelected: file4Load, messageString: that.messageString});
|
|
304
|
+
//that.addLocalMessage(metadata, type_msg);
|
|
305
|
+
// 2 - carico immagine
|
|
306
|
+
//that.uploadSingle(metadata, type_msg);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
/*
|
|
249
310
|
else if (typeFile.indexOf('application') !== -1) {
|
|
250
311
|
const type_msg = 'file';
|
|
251
312
|
const file = that.selectedFiles.item(0);
|
|
@@ -261,29 +322,34 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
261
322
|
that.uploadSingle(metadata, type_msg);
|
|
262
323
|
}
|
|
263
324
|
*/
|
|
264
|
-
|
|
325
|
+
},
|
|
326
|
+
false,
|
|
327
|
+
)
|
|
265
328
|
if (file) {
|
|
266
|
-
reader.readAsDataURL(file)
|
|
329
|
+
reader.readAsDataURL(file)
|
|
267
330
|
}
|
|
268
331
|
}
|
|
269
332
|
}
|
|
270
333
|
|
|
271
334
|
calculateHeightPreviewArea() {
|
|
272
|
-
const heightThumbnailsPreview = this.thumbnailsPreview.nativeElement
|
|
273
|
-
|
|
274
|
-
|
|
335
|
+
const heightThumbnailsPreview = this.thumbnailsPreview.nativeElement
|
|
336
|
+
.offsetHeight
|
|
337
|
+
const heightMessageTextArea = this.messageTextArea.nativeElement
|
|
338
|
+
.offsetHeight
|
|
339
|
+
this.heightPreviewArea = (
|
|
340
|
+
heightMessageTextArea + heightThumbnailsPreview
|
|
341
|
+
).toString()
|
|
275
342
|
// this.logger.log('heightThumbnailsPreview', heightThumbnailsPreview);
|
|
276
343
|
// this.logger.log('heightMessageTextArea', this.messageTextArea);
|
|
277
344
|
// this.logger.log('heightPreviewArea', this.heightPreviewArea);
|
|
278
345
|
}
|
|
279
346
|
|
|
280
|
-
uploadImages() {
|
|
281
|
-
|
|
347
|
+
uploadImages() {}
|
|
282
348
|
|
|
283
349
|
/** */
|
|
284
350
|
onChangeTextArea(e: any) {
|
|
285
|
-
this.logger.log('onChangeTextArea', e.target.clientHeight)
|
|
286
|
-
this.calculateHeightPreviewArea()
|
|
351
|
+
this.logger.log('onChangeTextArea', e.target.clientHeight)
|
|
352
|
+
this.calculateHeightPreviewArea()
|
|
287
353
|
// try {
|
|
288
354
|
// let height: number = e.target.offsetHeight;
|
|
289
355
|
// if (height < 37 ) {
|
|
@@ -297,20 +363,18 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
297
363
|
|
|
298
364
|
/** */
|
|
299
365
|
onSelectImage(file: any) {
|
|
300
|
-
this.fileSelected = file
|
|
366
|
+
this.fileSelected = file
|
|
301
367
|
}
|
|
302
368
|
|
|
303
369
|
@HostListener('document:keydown', ['$event'])
|
|
304
370
|
handleKeyboardEvent(event: KeyboardEvent) {
|
|
305
371
|
if (event.key === 'Enter') {
|
|
306
|
-
|
|
307
372
|
this.onSendMessage()
|
|
308
373
|
}
|
|
309
|
-
|
|
310
374
|
}
|
|
311
375
|
|
|
312
376
|
pressedOnKeyboard(e: any, text: string) {
|
|
313
|
-
this.logger.log('[LOADER-PREVIEW-PAGE] pressedOnKeyboard - event:: ', e)
|
|
377
|
+
this.logger.log('[LOADER-PREVIEW-PAGE] pressedOnKeyboard - event:: ', e)
|
|
314
378
|
// const message = e.target.textContent.trim();
|
|
315
379
|
// if (e.inputType === 'insertLineBreak' && message === '') {
|
|
316
380
|
// this.messageString = '';
|
|
@@ -322,32 +386,37 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
322
386
|
this.onSendMessage()
|
|
323
387
|
}
|
|
324
388
|
|
|
325
|
-
|
|
326
|
-
|
|
327
389
|
/** */
|
|
328
390
|
onSendMessage() {
|
|
329
|
-
this.logger.log(
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
391
|
+
this.logger.log(
|
|
392
|
+
'[LOADER-PREVIEW-PAGE] onSendMessage messageString:',
|
|
393
|
+
this.messageString,
|
|
394
|
+
)
|
|
395
|
+
let file = this.selectedFiles.item(0)
|
|
396
|
+
const file4Load = new Image()
|
|
397
|
+
const nameImg = file.name
|
|
398
|
+
const typeFile = file.type
|
|
399
|
+
|
|
400
|
+
file4Load.src = this.fileSelected
|
|
401
|
+
file4Load.title = nameImg
|
|
402
|
+
const uid = file4Load.src.substring(file4Load.src.length - 16)
|
|
338
403
|
const metadata = {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
this.viewCtrl.dismiss({
|
|
347
|
-
|
|
404
|
+
name: file4Load.title,
|
|
405
|
+
src: file4Load.src,
|
|
406
|
+
width: file4Load.width,
|
|
407
|
+
height: file4Load.height,
|
|
408
|
+
type: typeFile,
|
|
409
|
+
uid: uid,
|
|
410
|
+
}
|
|
411
|
+
this.viewCtrl.dismiss({
|
|
412
|
+
fileSelected: file,
|
|
413
|
+
messageString: this.messageString,
|
|
414
|
+
metadata: metadata,
|
|
415
|
+
type: TYPE_MSG_IMAGE,
|
|
416
|
+
})
|
|
348
417
|
}
|
|
349
418
|
|
|
350
419
|
async onClose() {
|
|
351
|
-
this.viewCtrl.dismiss()
|
|
420
|
+
this.viewCtrl.dismiss()
|
|
352
421
|
}
|
|
353
422
|
}
|
|
@@ -91,6 +91,25 @@ export class TiledeskService {
|
|
|
91
91
|
}))
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
|
|
95
|
+
public getProjectById( token: string , id: string) {
|
|
96
|
+
const url = this.apiUrl + 'projects/' + id;
|
|
97
|
+
this.logger.log('[TILEDESK-SERVICE] - GET PROJECT BY ID URL', url);
|
|
98
|
+
|
|
99
|
+
const httpOptions = {
|
|
100
|
+
headers: new HttpHeaders({
|
|
101
|
+
'Content-Type': 'application/json',
|
|
102
|
+
Authorization: token
|
|
103
|
+
})
|
|
104
|
+
};
|
|
105
|
+
return this.http
|
|
106
|
+
.get(url, httpOptions)
|
|
107
|
+
.pipe(map((res: any) => {
|
|
108
|
+
this.logger.log('[TILEDESK-SERVICE] GET PROJECT BY ID URL - RES ', res);
|
|
109
|
+
return res
|
|
110
|
+
}))
|
|
111
|
+
}
|
|
112
|
+
|
|
94
113
|
|
|
95
114
|
|
|
96
115
|
|
package/src/assets/i18n/de.json
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"LABEL_VIDEO_CHAT": "Videoanruf",
|
|
45
45
|
"LABEL_LEAVE_GROUP": "Die Gruppe verlassen",
|
|
46
46
|
"LABEL_CLOSE_GROUP": "Nah dran",
|
|
47
|
-
"ALERT_TITLE": "
|
|
47
|
+
"ALERT_TITLE": "Aufmerksamkeit!",
|
|
48
48
|
"CLOSE_ALERT_CONFIRM_LABEL": "OK",
|
|
49
49
|
"CLOSE_ALERT_CANCEL_LABEL": "ABBRECHEN",
|
|
50
50
|
"LEAVE_ALERT_MSG": "Die Gruppe verlassen?",
|
|
@@ -210,18 +210,20 @@
|
|
|
210
210
|
"PaydPlanNamePro": "Pro-Plan",
|
|
211
211
|
"PaydPlanNameEnterprise": "Enterprise-Plan",
|
|
212
212
|
"ProPlanTrial": "Pro-Plan (Testversion)",
|
|
213
|
-
"FreePlan":"Kostenloser Plan",
|
|
213
|
+
"FreePlan": "Kostenloser Plan",
|
|
214
214
|
"SubscriptionPaymentProblem": "Problem mit der Zahlung des Abos",
|
|
215
215
|
"ThePlanHasExpired": "Der Plan ist abgelaufen",
|
|
216
216
|
"owner": "Eigentümer",
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
"admin": "Administrator",
|
|
218
|
+
"agent": "Agent",
|
|
219
219
|
"Conversations": "Gespräche",
|
|
220
|
-
"Apps":"Anwendungen",
|
|
221
|
-
"Analytics":"Analytik",
|
|
220
|
+
"Apps": "Anwendungen",
|
|
221
|
+
"Analytics": "Analytik",
|
|
222
222
|
"Activities": "Aktivitäten",
|
|
223
223
|
"History": "Verlauf",
|
|
224
224
|
"Settings": "Einstellungen",
|
|
225
225
|
"Resolve": "Lösen",
|
|
226
|
-
"Archive": "Archivieren"
|
|
226
|
+
"Archive": "Archivieren",
|
|
227
|
+
"ActionNotAllowed": "Aktion nicht erlaubt",
|
|
228
|
+
"YouAreNoLongerAmongTheTeammatesManagingThisConversation":"Sie gehören nicht mehr zu den Teamkollegen, die diese Unterhaltung führen"
|
|
227
229
|
}
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"LABEL_VIDEO_CHAT": "Video call",
|
|
45
45
|
"LABEL_LEAVE_GROUP": "Leave the group",
|
|
46
46
|
"LABEL_CLOSE_GROUP": "Close",
|
|
47
|
-
"ALERT_TITLE": "
|
|
47
|
+
"ALERT_TITLE": "Attention!",
|
|
48
48
|
"CLOSE_ALERT_CONFIRM_LABEL": "OK",
|
|
49
49
|
"CLOSE_ALERT_CANCEL_LABEL": "CANCEL",
|
|
50
50
|
"LEAVE_ALERT_MSG": "Leave the group?",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"LABEL_INFO_USER": "Info user",
|
|
109
109
|
"LABEL_IS_WRITING": "typing",
|
|
110
110
|
"LABEL_VERSION": "version",
|
|
111
|
-
"LABEL_CONTACTS": "
|
|
111
|
+
"LABEL_CONTACTS": "Contacts",
|
|
112
112
|
"LABEL_PLACEHOLDER": "type your message..",
|
|
113
113
|
"LABEL_START_NW_CONV": "New conversation",
|
|
114
114
|
"LABEL_FIRST_MSG": "Describe shortly your problem, you will be contacted by an agent.",
|
|
@@ -223,5 +223,7 @@
|
|
|
223
223
|
"History": "History",
|
|
224
224
|
"Settings": "Settings",
|
|
225
225
|
"Resolve": "Resolve",
|
|
226
|
-
"Archive": "Archive"
|
|
226
|
+
"Archive": "Archive",
|
|
227
|
+
"ActionNotAllowed":"Action not allowed",
|
|
228
|
+
"YouAreNoLongerAmongTheTeammatesManagingThisConversation":"You are no longer among the teammates managing this conversation"
|
|
227
229
|
}
|
package/src/assets/i18n/es.json
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"LABEL_VIDEO_CHAT": "Videollamada",
|
|
45
45
|
"LABEL_LEAVE_GROUP": "Dejar el grupo",
|
|
46
46
|
"LABEL_CLOSE_GROUP": "Cerrar",
|
|
47
|
-
"ALERT_TITLE": "
|
|
47
|
+
"ALERT_TITLE": "¡Atención!",
|
|
48
48
|
"CLOSE_ALERT_CONFIRM_LABEL": "Ok",
|
|
49
49
|
"CLOSE_ALERT_CANCEL_LABEL": "CANCAR",
|
|
50
50
|
"LEAVE_ALERT_MSG": "¿Abandonar el grupo?",
|
|
@@ -223,5 +223,7 @@
|
|
|
223
223
|
"History": "Historial",
|
|
224
224
|
"Settings": "Ajustes",
|
|
225
225
|
"Resolve": "Resolver",
|
|
226
|
-
"Archive": "Archivas"
|
|
226
|
+
"Archive": "Archivas",
|
|
227
|
+
"ActionNotAllowed":"Acción no permitida",
|
|
228
|
+
"YouAreNoLongerAmongTheTeammatesManagingThisConversation":"Ya no estás entre los compañeros de equipo que gestionan esta conversación"
|
|
227
229
|
}
|