@chat21/chat21-ionic 3.4.32-rc5 → 3.4.32-rc6
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 +3 -0
- package/package.json +1 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +4 -2
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +4 -4
- package/src/app/services/tiledesk/tiledesk.service.ts +0 -16
- package/src/chat21-core/utils/constants.ts +1 -0
- package/src/chat21-core/utils/convertRequestToConversation.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
### **Copyrigth**:
|
|
9
9
|
*Tiledesk SRL*
|
|
10
10
|
|
|
11
|
+
# 3.4.32-rc6
|
|
12
|
+
- **bug-fixed**: convertRequestToConversation timestamp wrong unit
|
|
13
|
+
|
|
11
14
|
# 3.4.32-rc5
|
|
12
15
|
- **added**: conversations-list — on init, fetches all projects via `getProjects` and stores them in AppStorageService under `all_projects`; before saving, checks that the key does not already contain each project (avoids duplicates).
|
|
13
16
|
- **changed**: conversations-list `onConversationLoaded` — project name and id are now resolved from the `all_projects` storage key instead of per-project localStorage entries.
|
package/package.json
CHANGED
|
@@ -57,8 +57,9 @@ import { getOSCode, hasRole } from 'src/app/utils/utils';
|
|
|
57
57
|
import { PERMISSIONS } from 'src/app/utils/permissions.constants';
|
|
58
58
|
import { ProjectUser } from 'src/chat21-core/models/projectUsers';
|
|
59
59
|
import { ProjectUsersService } from 'src/app/services/project_users/project-users.service';
|
|
60
|
+
import { ProjectService } from 'src/app/services/projects/project.service';
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
import { PROJECTS_STORAGE_KEY } from 'src/chat21-core/utils/constants';
|
|
62
63
|
|
|
63
64
|
@Component({
|
|
64
65
|
selector: 'app-conversations-list',
|
|
@@ -140,6 +141,7 @@ export class ConversationListPage implements OnInit {
|
|
|
140
141
|
public tiledeskService: TiledeskService,
|
|
141
142
|
public tiledeskAuthService: TiledeskAuthService,
|
|
142
143
|
public projectUsersService: ProjectUsersService,
|
|
144
|
+
public projectService: ProjectService,
|
|
143
145
|
public appConfigProvider: AppConfigProvider,
|
|
144
146
|
public platform: Platform,
|
|
145
147
|
public wsService: WebsocketService,
|
|
@@ -230,7 +232,7 @@ export class ConversationListPage implements OnInit {
|
|
|
230
232
|
private loadAndStoreProjects() {
|
|
231
233
|
const token = this.tiledeskAuthService.getTiledeskToken();
|
|
232
234
|
if (!token) return;
|
|
233
|
-
this.
|
|
235
|
+
this.projectService.getProjects().subscribe((projects: Project[]) => {
|
|
234
236
|
if (!projects?.length) return;
|
|
235
237
|
let projectsMap: Record<string, Project> = {};
|
|
236
238
|
const stored = this.appStorageService.getItem(PROJECTS_STORAGE_KEY);
|
|
@@ -14,9 +14,8 @@ import { TiledeskService } from 'src/app/services/tiledesk/tiledesk.service';
|
|
|
14
14
|
import { getProjectIdSelectedConversation, isGroup } from 'src/chat21-core/utils/utils';
|
|
15
15
|
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';
|
|
16
16
|
import { Project } from 'src/chat21-core/models/projects';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
import { ProjectService } from 'src/app/services/projects/project.service';
|
|
18
|
+
import { PROJECTS_STORAGE_KEY } from 'src/chat21-core/utils/constants';
|
|
20
19
|
|
|
21
20
|
@Component({
|
|
22
21
|
selector: 'app-unassigned-conversations',
|
|
@@ -59,6 +58,7 @@ export class UnassignedConversationsPage implements OnInit, OnChanges {
|
|
|
59
58
|
private events: EventsService,
|
|
60
59
|
private tiledeskAuthService: TiledeskAuthService,
|
|
61
60
|
private tiledeskService: TiledeskService,
|
|
61
|
+
private projectService: ProjectService,
|
|
62
62
|
public imageRepoService: ImageRepoService,
|
|
63
63
|
public appStorageService: AppStorageService,
|
|
64
64
|
) {
|
|
@@ -125,7 +125,7 @@ export class UnassignedConversationsPage implements OnInit, OnChanges {
|
|
|
125
125
|
}
|
|
126
126
|
const token = this.tiledeskAuthService.getTiledeskToken();
|
|
127
127
|
if (!token) return;
|
|
128
|
-
this.
|
|
128
|
+
this.projectService.getProjects().subscribe(
|
|
129
129
|
(projects: Project[]) => {
|
|
130
130
|
if (!projects?.length) return;
|
|
131
131
|
let projectsMap: Record<string, Project> = {};
|
|
@@ -95,22 +95,6 @@ export class TiledeskService {
|
|
|
95
95
|
}))
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
public getProjects(token: string): Observable<Project[]> {
|
|
99
|
-
const url = this.SERVER_BASE_URL + 'projects/';
|
|
100
|
-
this.logger.log('[TILEDESK-SERVICE] - GET PROJECTS URL', url);
|
|
101
|
-
|
|
102
|
-
const httpOptions = {
|
|
103
|
-
headers: new HttpHeaders({
|
|
104
|
-
'Content-Type': 'application/json',
|
|
105
|
-
Authorization: token
|
|
106
|
-
})
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
return this.http.get(url, httpOptions).pipe(map((projects: Project[]) => {
|
|
110
|
-
this.logger.log('[TILEDESK-SERVICE] GET PROJECTS - RES ', projects);
|
|
111
|
-
return projects
|
|
112
|
-
}))
|
|
113
|
-
}
|
|
114
98
|
|
|
115
99
|
public getProjectUsersByProjectId(project_id: string) {
|
|
116
100
|
const url = this.SERVER_BASE_URL + project_id + '/project_users/';
|
|
@@ -116,6 +116,7 @@ export const PLATFORM_DESKTOP = 'desktop';
|
|
|
116
116
|
|
|
117
117
|
// STORAGE
|
|
118
118
|
export const STORAGE_PREFIX = 'tiledesk_widget_';
|
|
119
|
+
export const PROJECTS_STORAGE_KEY = 'all_projects';
|
|
119
120
|
|
|
120
121
|
// links
|
|
121
122
|
export const FIREBASESTORAGE_BASE_URL_IMAGE = 'https://firebasestorage.googleapis.com/v0/b/' //+ 'chat-v2-dev.appspot.com/o/';
|
|
@@ -30,7 +30,7 @@ export class ConvertRequestToConversation {
|
|
|
30
30
|
'',
|
|
31
31
|
request.lead && request.lead.fullname ? request.lead.fullname: null,
|
|
32
32
|
request.status || '0',
|
|
33
|
-
moment(request.createdAt).
|
|
33
|
+
moment(request.createdAt).valueOf(),
|
|
34
34
|
getColorBck(request.lead.fullname),
|
|
35
35
|
avatarPlaceholder(request.lead.fullname),
|
|
36
36
|
false,
|