From 17a23ca9209450d279d5d1af88b7a21370ce963c Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Thu, 5 Oct 2023 18:15:39 +0200 Subject: [PATCH 1/9] Knowledge Bases Improvements --- .../knowledge-bases.component.ts | 266 ++++++++++++++---- 1 file changed, 207 insertions(+), 59 deletions(-) diff --git a/src/app/knowledge-bases/knowledge-bases.component.ts b/src/app/knowledge-bases/knowledge-bases.component.ts index 7d2d0054e065..8fdd4d036dae 100644 --- a/src/app/knowledge-bases/knowledge-bases.component.ts +++ b/src/app/knowledge-bases/knowledge-bases.component.ts @@ -1,21 +1,25 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, isDevMode } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute } from '@angular/router'; import { AuthService } from 'app/core/auth.service'; +import { NotifyService } from 'app/core/notify.service'; import { KB, KbSettings } from 'app/models/kbsettings-model'; +import { Project } from 'app/models/project-model'; import { KnowledgeBaseService } from 'app/services/knowledge-base.service'; import { LoggerService } from 'app/services/logger/logger.service'; import { OpenaiService } from 'app/services/openai.service'; - +import { ProjectService } from 'app/services/project.service'; + @Component({ selector: 'appdashboard-knowledge-bases', templateUrl: './knowledge-bases.component.html', styleUrls: ['./knowledge-bases.component.scss'] }) export class KnowledgeBasesComponent implements OnInit { - + public IS_OPEN_SETTINGS_SIDEBAR: boolean; public isChromeVerGreaterThan100: boolean; - + addKnowledgeBaseModal = 'none'; previewKnowledgeBaseModal = 'none'; deleteKnowledgeBaseModal = 'none'; @@ -24,10 +28,16 @@ export class KnowledgeBasesComponent implements OnInit { buttonDisabled: boolean = true; addButtonDisabled: boolean = false; gptkeyVisible: boolean = false; - + CURRENT_USER: any; + project: Project; + project_name: string; + id_project: string; + profile_name: string; + callingPage: string; + kbForm: FormGroup; kbsList = []; - + kbSettings: KbSettings = { _id: null, id_project: null, @@ -41,7 +51,7 @@ export class KnowledgeBasesComponent implements OnInit { name: '', url: '' } - + // PREVIEW question: string = ""; answer: string = ""; @@ -50,29 +60,101 @@ export class KnowledgeBasesComponent implements OnInit { error_answer: boolean = false; show_answer: boolean = false; kbid_selected: any; - + constructor( private auth: AuthService, private formBuilder: FormBuilder, private logger: LoggerService, private openaiService: OpenaiService, - private kbService: KnowledgeBaseService - ) { } - + private kbService: KnowledgeBaseService, + private projectService: ProjectService, + public route: ActivatedRoute, + private notify: NotifyService + ) { } ngOnInit(): void { this.getBrowserVersion(); this.listenSidebarIsOpened(); //this.getKnowledgeBases(); this.getKnowledgeBaseSettings(); this.kbForm = this.createConditionGroup(); + this.trackPage(); + this.getLoggedUser(); + this.getCurrentProject() + this.getRouteParams() } - + + getRouteParams() { + this.route.params.subscribe((params) => { + // this.projectId = params.projectid + this.logger.log('[KNOWLEDGE BASES COMP] - GET ROUTE PARAMS ', params); + if (params.calledby && params.calledby === 'h') { + this.callingPage = 'Home' + this.logger.log('[KNOWLEDGE BASES COMP] - GET ROUTE PARAMS callingPage ', this.callingPage); + } else if (!params.calledby) { + this.callingPage = 'Knowledge Bases' + this.logger.log('[KNOWLEDGE BASES COMP] - GET ROUTE PARAMS callingPage ', this.callingPage); + } + }) + } + + trackPage() { + if (!isDevMode()) { + if (window['analytics']) { + try { + window['analytics'].page("Knowledge Bases Page", { + + }); + } catch (err) { + this.logger.error('Signin page error', err); + } + } + } + } + + getLoggedUser() { + this.auth.user_bs.subscribe((user) => { + this.logger.log('[KNOWLEDGE BASES COMP] - LOGGED USER ', user) + if (user) { + this.CURRENT_USER = user + + } + }); + } + + getCurrentProject() { + this.auth.project_bs.subscribe((project) => { + this.project = project + this.logger.log('[KNOWLEDGE BASES COMP] - GET CURRENT PROJECT ', this.project) + if (this.project) { + this.project_name = project.name; + this.id_project = project._id; + this.getProjectById(this.id_project) + this.logger.log('[KNOWLEDGE BASES COMP] - GET CURRENT PROJECT - PROJECT-NAME ', this.project_name, ' PROJECT-ID ', this.id_project) + } + }); + } + + getProjectById(projectId) { + this.projectService.getProjectById(projectId).subscribe((project: any) => { + this.logger.log('[KNOWLEDGE BASES COMP] - GET PROJECT BY ID - PROJECT: ', project); + + this.profile_name = project.profile.name + this.logger.log('[KNOWLEDGE BASES COMP] - GET PROJECT BY ID - profile_name: ', this.profile_name); + + }, error => { + this.logger.error('[KNOWLEDGE BASES COMP] - GET PROJECT BY ID - ERROR ', error); + }, () => { + this.logger.log('[KNOWLEDGE BASES COMP] - GET PROJECT BY ID * COMPLETE * '); + + }); + } + startPooling() { let id = setInterval(() => { this.checkAllStatuses(); }, 30000); } - + // ---------------------- // UTILS FUNCTION - Start getBrowserVersion() { @@ -80,7 +162,7 @@ export class KnowledgeBasesComponent implements OnInit { this.isChromeVerGreaterThan100 = isChromeVerGreaterThan100; }) } - + listenSidebarIsOpened() { this.auth.settingSidebarIsOpned.subscribe((isopened) => { this.logger.log('[KNOWLEDGE BASES COMP] SETTINGS-SIDEBAR isopened (FROM SUBSCRIPTION) ', isopened) @@ -89,33 +171,34 @@ export class KnowledgeBasesComponent implements OnInit { } // UTILS FUNCTION - End // -------------------- - - + + getKnowledgeBaseSettings() { this.kbService.getKbSettings().subscribe((kbSettings: KbSettings) => { - this.logger.debug("[KNOWLEDGE BASES COMP] get kbSettings: ", kbSettings); + this.logger.log("[KNOWLEDGE BASES COMP] get kbSettings: ", kbSettings); this.kbSettings = kbSettings; if (this.kbSettings.kbs.length < kbSettings.maxKbsNumber) { this.addButtonDisabled = false; } else { this.addButtonDisabled = true; } + this.checkAllStatuses(); this.startPooling(); - // this.checkAllStatuses(); }, (error) => { this.logger.error("[KNOWLEDGE BASES COMP] ERROR get kbSettings: ", error); }, () => { - this.logger.info("[KNOWLEDGE BASES COMP] get kbSettings *COMPLETE*"); + this.logger.log("[KNOWLEDGE BASES COMP] get kbSettings *COMPLETE*"); this.showSpinner = false; + }) } - + createConditionGroup(): FormGroup { return this.formBuilder.group({ url: ['', [Validators.required, Validators.pattern('(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?')]] }) } - + onChangeInput(event): void { if (this.kbForm.valid) { this.buttonDisabled = false; @@ -123,7 +206,7 @@ export class KnowledgeBasesComponent implements OnInit { this.buttonDisabled = true; } } - + onInputPreviewChange() { let element = document.getElementById('enter-button') if (this.question !== "") { @@ -132,20 +215,26 @@ export class KnowledgeBasesComponent implements OnInit { element.style.display = 'none'; } } - + saveKnowledgeBase() { - - let first_index = this.newKb.url.indexOf('://') + 3; - let second_index = this.newKb.url.indexOf('www.') + 4; + + let first_index = this.newKb.url.indexOf('://'); + let second_index = this.newKb.url.indexOf('www.'); + let split_index; - if (second_index > first_index) { - split_index = second_index; + if (first_index !== -1 || first_index !== -1) { + if (second_index > first_index) { + split_index = second_index + 4; + } else { + split_index = first_index + 3; + } + this.newKb.name = this.newKb.url.substring(split_index); } else { - split_index = first_index; + this.newKb.name = this.newKb.url; } - this.newKb.name = this.newKb.url.substring(split_index); - + this.kbService.addNewKb(this.kbSettings._id, this.newKb).subscribe((savedSettings: KbSettings) => { + this.runIndexing(this.newKb); this.getKnowledgeBaseSettings(); let kb = savedSettings.kbs.find(kb => kb.url === this.newKb.url); this.checkStatus(kb).then((status_code) => { @@ -157,10 +246,65 @@ export class KnowledgeBasesComponent implements OnInit { }, (error) => { this.logger.error("[KNOWLEDGE BASES COMP] ERROR add new kb: ", error); }, () => { - this.logger.info("[KNOWLEDGE BASES COMP] add new kb *COMPLETED*"); + this.logger.log("[KNOWLEDGE BASES COMP] add new kb *COMPLETED*"); + + this.trackUserActioOnKB('Added Knowledge Base') }) } - + + trackUserActioOnKB(event) { + if (!isDevMode()) { + if (window['analytics']) { + let userFullname = '' + if (this.CURRENT_USER.firstname && this.CURRENT_USER.lastname) { + userFullname = this.CURRENT_USER.firstname + ' ' + this.CURRENT_USER.lastname + } else if (this.CURRENT_USER.firstname && !this.CURRENT_USER.lastname) { + userFullname = this.CURRENT_USER.firstname + } + + try { + window['analytics'].identify(this.CURRENT_USER._id, { + name: userFullname, + email: this.CURRENT_USER.email, + plan: this.profile_name + + }); + } catch (err) { + this.logger.error('identify Invite Sent Profile error', err); + } + + try { + window['analytics'].track(event, { + "type": "organic", + "username": userFullname, + "email": this.CURRENT_USER.email, + 'userId': this.CURRENT_USER._id, + 'page': this.callingPage + + }, { + "context": { + "groupId": this.id_project + } + }); + } catch (err) { + this.logger.error('track Invite Sent event error', err); + } + + try { + window['analytics'].group(this.id_project, { + name: this.project_name, + plan: this.profile_name + ' plan', + }); + } catch (err) { + this.logger.error('group Invite Sent error', err); + } + } + } + + } + + + saveKnowledgeBaseSettings() { this.kbService.saveKbSettings(this.kbSettings).subscribe(((savedSettings) => { this.getKnowledgeBaseSettings(); @@ -171,7 +315,7 @@ export class KnowledgeBasesComponent implements OnInit { this.logger.info("[KNOWLEDGE BASES COMP] save kb settings *COMPLETE*"); }) } - + deleteKnowledgeBase(id) { this.logger.debug("[KNOWLEDGE BASES COMP] kb to delete id: ", id); this.kbService.deleteKb(this.kbSettings._id, id).subscribe((response) => { @@ -180,17 +324,21 @@ export class KnowledgeBasesComponent implements OnInit { }, (error) => { this.logger.error("[KNOWLEDGE BASES COMP] ERROR delete kb: ", error); }, () => { - this.logger.info("[KNOWLEDGE BASES COMP] delete kb *COMPLETE*"); + this.logger.log("[KNOWLEDGE BASES COMP] delete kb *COMPLETE*"); + this.trackUserActioOnKB('Deleted Knowledge Base') }) } - + runIndexing(kb) { let data = { full_url: kb.url, gptkey: this.kbSettings.gptkey } - this.openaiService.startScraping(data).subscribe((response) => { - this.logger.log("start scraping response: ", response); + this.openaiService.startScraping(data).subscribe((response: any) => { + console.log("start scraping response: ", response); + if (response.message && response.message === "Invalid Openai API key") { + this.notify.showWidgetStyleUpdateNotification("Invalid Openai API key", 4, 'report_problem'); + } setTimeout(() => { this.checkStatus(kb).then((status_code: number) => { kb.status = status_code; @@ -202,9 +350,9 @@ export class KnowledgeBasesComponent implements OnInit { this.logger.log("start scraping *COMPLETE*"); }) } - + checkAllStatuses() { - + // SCANDALOSO - DA ELIMINARE IL PRIMA POSSIBILE // INDAGARE CON PUGLIA AI // Anche perchè ogni tanto risponde con tutti status 0 anche con 500ms di delay @@ -212,7 +360,7 @@ export class KnowledgeBasesComponent implements OnInit { for (let i = 0; i < this.kbSettings.kbs.length; i++) { const delay = 500 * i; let kb = this.kbSettings.kbs[i]; - + setTimeout(() => { promises.push(this.checkStatus(kb).then((status_code: number) => { kb.status = status_code; @@ -222,13 +370,13 @@ export class KnowledgeBasesComponent implements OnInit { })) }, delay); } - + Promise.all(promises).then((response) => { this.logger.log("Promise All *COMPLETED* ", response); }) - + } - + checkStatus(kb) { let data = { "full_url": kb.url @@ -242,20 +390,20 @@ export class KnowledgeBasesComponent implements OnInit { }) }) } - + submitQuestion() { let data = { question: this.question, kbid: this.kbid_selected.url, gptkey: this.kbSettings.gptkey } - + this.searching = true; this.show_answer = false; this.error_answer = false; this.answer = null; this.source_url = null; - + this.openaiService.askGpt(data).subscribe((response: any) => { if (response.success == false) { this.error_answer = true; @@ -263,7 +411,7 @@ export class KnowledgeBasesComponent implements OnInit { this.answer = response.answer; this.source_url = response.source_url; } - + this.show_answer = true; this.searching = false; setTimeout(() => { @@ -278,7 +426,7 @@ export class KnowledgeBasesComponent implements OnInit { this.searching = false; }) } - + showHideSecret(target) { this.gptkeyVisible = !this.gptkeyVisible; // let el = document.getElementById(target); @@ -290,22 +438,22 @@ export class KnowledgeBasesComponent implements OnInit { // el.type = "password" // } } - + openAddKnowledgeBaseModal() { this.addKnowledgeBaseModal = 'block'; } - + openPreviewKnowledgeBaseModal(kb) { this.kbid_selected = kb; this.previewKnowledgeBaseModal = 'block'; - + } - + openDeleteKnowledgeBaseModal(kb) { this.kbid_selected = kb; this.deleteKnowledgeBaseModal = 'block'; } - + openSecretsModal() { this.secretsModal = 'block'; if (this.kbSettings.gptkey) { @@ -316,12 +464,12 @@ export class KnowledgeBasesComponent implements OnInit { this.gptkeyVisible = true; } } - + closeAddKnowledgeBaseModal() { this.addKnowledgeBaseModal = 'none'; this.newKb = { name: '', url: ''} } - + closePreviewKnowledgeBaseModal() { this.previewKnowledgeBaseModal = 'none'; this.question = ""; @@ -333,13 +481,13 @@ export class KnowledgeBasesComponent implements OnInit { let element = document.getElementById('enter-button') element.style.display = 'none'; } - + closeDeleteKnowledgeBaseModal() { this.deleteKnowledgeBaseModal = 'none'; } - + closeSecretsModal() { this.secretsModal = 'none'; } - + } \ No newline at end of file From cbe8bbbdb239962581c7188bd3eb96db3fc1b2e5 Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Thu, 5 Oct 2023 18:16:02 +0200 Subject: [PATCH 2/9] Updates changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65acbf03339c..1678acdc9c69 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # tiledesk-dashboard +### 2.4.66 +- Deploys in production +- Knowledge Bases Improvements + ### 2.4.65 - Deploys in production - Improvements and bug fixing From 271ccae85bcc46303021feb7412a807e06fdb24d Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Thu, 5 Oct 2023 18:16:19 +0200 Subject: [PATCH 3/9] Updates version --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 053158d3f314..6073690d5200 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-dashboard", - "version": "2.4.65", + "version": "2.4.66", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 84a62c884bb7..289aa1332416 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-dashboard", - "version": "2.4.65", + "version": "2.4.66", "scripts": { "ng": "ng", "start": "ng serve --aot", From 727923819a604af37962b764f38f99797a8a9c7d Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Fri, 6 Oct 2023 13:59:38 +0200 Subject: [PATCH 4/9] Updates version --- CHANGELOG.md | 4 ++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1678acdc9c69..382ff9a0dc8b 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # tiledesk-dashboard +### 2.4.67 +- Deploys in production +- Improvements and bug fixing + ### 2.4.66 - Deploys in production - Knowledge Bases Improvements diff --git a/package-lock.json b/package-lock.json index 6073690d5200..b93e5d3811d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-dashboard", - "version": "2.4.66", + "version": "2.4.67", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 289aa1332416..e16ccc280761 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-dashboard", - "version": "2.4.66", + "version": "2.4.67", "scripts": { "ng": "ng", "start": "ng serve --aot", From 1057b00f8b1d14e9cc93980373dfc7dc919b6626 Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Fri, 6 Oct 2023 13:59:59 +0200 Subject: [PATCH 5/9] bug fixing --- src/app/components/sidebar/sidebar.component.html | 5 ++++- .../history-and-nort-convs.component.html | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/components/sidebar/sidebar.component.html b/src/app/components/sidebar/sidebar.component.html index 8a3631d211b0..7c49edfbbdef 100755 --- a/src/app/components/sidebar/sidebar.component.html +++ b/src/app/components/sidebar/sidebar.component.html @@ -107,7 +107,10 @@
  • - + + + + From 7b8d8bc57496b485365c6009f3b7be264ecd0ea7 Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Fri, 6 Oct 2023 16:05:05 +0200 Subject: [PATCH 6/9] Bug fixing --- .../components/sidebar/sidebar.component.html | 4 +- .../history-and-nort-convs.component.html | 4 +- .../ws-requests-list.component.html | 114 +++++------------- .../ws-requests-list.component.ts | 35 +++--- 4 files changed, 55 insertions(+), 102 deletions(-) diff --git a/src/app/components/sidebar/sidebar.component.html b/src/app/components/sidebar/sidebar.component.html index 7c49edfbbdef..d48f4878c8c6 100755 --- a/src/app/components/sidebar/sidebar.component.html +++ b/src/app/components/sidebar/sidebar.component.html @@ -107,9 +107,9 @@
  • - + - + diff --git a/src/app/ws_requests/ws-requests-list/ws-requests-list.component.html b/src/app/ws_requests/ws-requests-list/ws-requests-list.component.html index 3ddff7b9d73d..f3f331878a60 100755 --- a/src/app/ws_requests/ws-requests-list/ws-requests-list.component.html +++ b/src/app/ws_requests/ws-requests-list/ws-requests-list.component.html @@ -264,8 +264,6 @@
    - - @@ -334,34 +332,6 @@
    - - - - - - - - - - - - -
    @@ -431,12 +401,12 @@ -
    + + keyboard_arrow_left
    @@ -448,19 +418,19 @@
    - +
    - - - + + + - - - + + + @@ -473,10 +443,9 @@
    - - - - + + +
    @@ -485,9 +454,7 @@ {{ agent?.id_user?.fullname_initial }} - +
    @@ -509,34 +476,34 @@ - +
    - - - + + +
    - +
    - - - + + + - - - + + + @@ -546,10 +513,9 @@
    - - - - + + +
    @@ -557,10 +523,6 @@ {{ agent?.id_user?.fullname_initial }} - -
    @@ -580,29 +542,22 @@ {{ agent?.id_user?.lastname | slice:0:1 }}. - - -
    -
    - - - + + +
    - -
    -
    @@ -611,18 +566,15 @@
    - - -
    - keyboard_arrow_right
    -
    - +
    --> + +
    diff --git a/src/app/ws_requests/ws-requests-list/ws-requests-list.component.ts b/src/app/ws_requests/ws-requests-list/ws-requests-list.component.ts index 498559a8305a..b0c2cc088793 100755 --- a/src/app/ws_requests/ws-requests-list/ws-requests-list.component.ts +++ b/src/app/ws_requests/ws-requests-list/ws-requests-list.component.ts @@ -565,7 +565,7 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit // createBotsAndUsersArray() { this.usersService.getProjectUsersByProjectId().subscribe((_projectUsers: any) => { // this.logger.log('% »»» WebSocketJs WF WS-RL - +++ GET PROJECT-USERS ', projectUsers); - this.logger.log('[WS-REQUESTS-LIST]- GET PROJECT-USERS RES ', _projectUsers); + console.log('[WS-REQUESTS-LIST]- GET PROJECT-USERS RES ', _projectUsers); if (_projectUsers) { this.project_users = _projectUsers this.project_user_length = _projectUsers.length; @@ -593,7 +593,8 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit this.wsRequestsService.subscriptionToWsAllProjectUsersOfTheProject(projectuser.id_user._id); - this.listenToAllProjectUsersOfProject$(projectuser) + // Commented nk + // this.listenToAllProjectUsersOfProject$(projectuser) this.createAgentAvatarInitialsAnfBckgrnd(projectuser.id_user) @@ -633,7 +634,7 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit takeUntil(this.unsubscribe$) ) .subscribe((projectUser_from_ws_subscription) => { - // console.log('[WS-REQUESTS-LIST] $UBSC TO WS PROJECT-USERS (listenTo) projectUser_from_ws_subscription', projectUser_from_ws_subscription); + console.log('[WS-REQUESTS-LIST] $UBSC TO WS PROJECT-USERS (listenTo) projectUser_from_ws_subscription', projectUser_from_ws_subscription); // this.logger.log('WS-REQUESTS-LIST PROJECT-USERS ', projectuser); if (projectuser['_id'] === projectUser_from_ws_subscription['_id']) { @@ -658,8 +659,8 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit this.projectUserArray = this.tempProjectUserArray; // console.log('[WS-REQUESTS-LIST] this.projectUserArray ', this.projectUserArray) - - this.getDeptsByProjectId(this.projectUserArray) + // COMMENTED NK + // this.getDeptsByProjectId(this.projectUserArray) }, (error) => { this.logger.error('[WS-REQUESTS-LIST] $UBSC TO WS PROJECT-USERS - ERROR ', error); @@ -685,11 +686,11 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit if (departmentsCount > 1) { // console.log('»»» »»» DEPTS PAGE - DEPT)', dept); if (dept && dept.default !== true) { - // console.log('[DEPTS] - GET DEPTS - DEPT NAME: ', dept.name, 'dept object', dept); + console.log('[DEPTS] - GET DEPTS - DEPT NAME: ', dept.name, 'dept object', dept); if (!dept.id_group || dept.id_group === undefined) { count = count + 1; - // console.log('[WS-REQUESTS-LIST] display all teammates') + console.log('[WS-REQUESTS-LIST] display all teammates') } } } else if (departmentsCount === 1) { @@ -697,12 +698,12 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit if (!dept.id_group || dept.id_group === undefined) { - // console.log('[WS-REQUESTS-LIST] (only default dept) ') + console.log('[WS-REQUESTS-LIST] (only default dept) ') count = count + 1; } } }); - // console.log('[DEPTS] - COUNT OF DEPT WITHOUT GROUP', count); + console.log('[DEPTS] - COUNT OF DEPT WITHOUT GROUP', count); if (count > 0) { // this.DISPLAY_ALL_TEAMMATES_TO_AGENT = true; this.filteredProjectUsersArray = projectUserArray @@ -722,16 +723,16 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit } getGroupsByProjectId(projectUserArray) { - // console.log('[WS-REQUESTS-LIST] - GROUPS - ALL PROJECT USERS ', projectUserArray) + console.log('[WS-REQUESTS-LIST] - GROUPS - ALL PROJECT USERS ', projectUserArray) this.groupService.getGroupsByProjectId().subscribe((groups: any) => { - // console.log('[WS-REQUESTS-LIST] - GROUPS GET BY PROJECT ID', groups); + console.log('[WS-REQUESTS-LIST] - GROUPS GET BY PROJECT ID', groups); const memberOfAllGroups = [] if (groups) { this.groupsList = groups; // this.logger.log('[DEPT-EDIT-ADD] - GROUP ID SELECTED', this.selectedGroupId); this.groupsList.forEach(group => { - // console.log('[WS-REQUESTS-LIST] - GROUP ', group); + console.log('[WS-REQUESTS-LIST] - GROUP ', group); if (group.members.includes(this.currentUserID)) { // console.log('[WS-REQUESTS-LIST] - GROUPS MEMBERS INCLUDES CURRENT USER'); @@ -739,18 +740,18 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit memberOfAllGroups.indexOf(member) === -1 ? memberOfAllGroups.push(member) : this.logger.log("PUSH MEMBER ID IN memberOfAllGroups : This item already exists"); }); - // console.log('[WS-REQUESTS-LIST] - ARRAY OF ALL MEMBERS OF GROUPS ', memberOfAllGroups); + console.log('[WS-REQUESTS-LIST] - ARRAY OF ALL MEMBERS OF GROUPS ', memberOfAllGroups); this.filteredProjectUsersArray = projectUserArray.filter(projectUser => memberOfAllGroups.includes(projectUser.id_user._id)) - // console.log('[WS-REQUESTS-LIST] - PROJECT USER FILTERED FOR MEMBERS OF THE GROUPS IN WICH IS PRESENT THE CURRENT USER ', this.filteredProjectUsersArray); + console.log('[WS-REQUESTS-LIST] - PROJECT USER FILTERED FOR MEMBERS OF THE GROUPS IN WICH IS PRESENT THE CURRENT USER ', this.filteredProjectUsersArray); } else { - // console.log('[WS-REQUESTS-LIST] - GROUPS MEMBERS NOT INCLUDES CURRENT USER - SHOW ALL TEAMMATES'); + console.log('[WS-REQUESTS-LIST] - GROUPS MEMBERS NOT INCLUDES CURRENT USER - SHOW ALL TEAMMATES'); this.filteredProjectUsersArray = projectUserArray } }); } else { - // console.log('[WS-REQUESTS-LIST] - THE PROJECT NOT HAS GROUPS - SHOW ALL TEAMMATES'); + console.log('[WS-REQUESTS-LIST] - THE PROJECT NOT HAS GROUPS - SHOW ALL TEAMMATES'); this.filteredProjectUsersArray = projectUserArray } }, (error) => { @@ -1103,7 +1104,7 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit // DEPTS_LAZY: add this addDeptObject(wsrequests) { this.departmentService.getDeptsByProjectIdToPromise().then((_departments: any) => { - this.logger.log('[WS-REQUESTS-LIST] - (DEPTS_LAZY) GET DEPTS BY PROJECT-ID toPromise', _departments); + console.log('[WS-REQUESTS-LIST] - (DEPTS_LAZY) GET DEPTS BY PROJECT-ID toPromise', _departments); wsrequests.forEach(request => { if (request.department) { From eb1db051b3015253b53460930caa4e60a5dd5716 Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Fri, 6 Oct 2023 16:08:01 +0200 Subject: [PATCH 7/9] Updates version --- CHANGELOG.md | 4 ++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 382ff9a0dc8b..e8a4b6bd5871 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # tiledesk-dashboard +### 2.4.68 +- Deploys in production +- Improvements and bug fixing + ### 2.4.67 - Deploys in production - Improvements and bug fixing diff --git a/package-lock.json b/package-lock.json index b93e5d3811d9..ba9e0d690963 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-dashboard", - "version": "2.4.67", + "version": "2.4.68", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e16ccc280761..e93107343d23 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-dashboard", - "version": "2.4.67", + "version": "2.4.68", "scripts": { "ng": "ng", "start": "ng serve --aot", From 87770df56951484b47d0138d79f39601c39ffe98 Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Fri, 6 Oct 2023 17:01:30 +0200 Subject: [PATCH 8/9] Updates version --- CHANGELOG.md | 4 ++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8a4b6bd5871..8305a4522493 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # tiledesk-dashboard +### 2.4.69 +- Deploys in production +- Improvements and bug fixing + ### 2.4.68 - Deploys in production - Improvements and bug fixing diff --git a/package-lock.json b/package-lock.json index ba9e0d690963..adb14f96e470 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-dashboard", - "version": "2.4.68", + "version": "2.4.69", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e93107343d23..ce2602299818 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-dashboard", - "version": "2.4.68", + "version": "2.4.69", "scripts": { "ng": "ng", "start": "ng serve --aot", From d347a494e93e19d18d3e3d7df644c78600f12d8b Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Fri, 6 Oct 2023 17:01:47 +0200 Subject: [PATCH 9/9] Bug fixing --- .../ws-requests-list.component.html | 41 ++++++++++--------- .../ws-requests-list.component.scss | 6 +-- .../ws-requests-list.component.ts | 35 ++++++++-------- src/assets/css/demo.scss | 2 +- 4 files changed, 43 insertions(+), 41 deletions(-) diff --git a/src/app/ws_requests/ws-requests-list/ws-requests-list.component.html b/src/app/ws_requests/ws-requests-list/ws-requests-list.component.html index f3f331878a60..c26ebf374171 100755 --- a/src/app/ws_requests/ws-requests-list/ws-requests-list.component.html +++ b/src/app/ws_requests/ws-requests-list/ws-requests-list.component.html @@ -401,7 +401,7 @@ - +
    @@ -421,16 +422,16 @@
    - - - + + + - - - + + + @@ -443,9 +444,9 @@
    - - - + + +
    @@ -482,10 +483,10 @@
    - - - - + + + +
    - - - + + +
    @@ -572,7 +573,7 @@
    -
    --> + diff --git a/src/app/ws_requests/ws-requests-list/ws-requests-list.component.scss b/src/app/ws_requests/ws-requests-list/ws-requests-list.component.scss index dac07bb45744..0e2399db9dc6 100755 --- a/src/app/ws_requests/ws-requests-list/ws-requests-list.component.scss +++ b/src/app/ws_requests/ws-requests-list/ws-requests-list.component.scss @@ -720,12 +720,12 @@ $f21blue: #039be5; .middle-nw { float: left; // width: 90%; - width: 89%; + width: 91%; // overflow: auto; overflow: hidden; /*will change this to hidden later to deny scolling to user*/ white-space: nowrap; - height: 60px; + // height: 60px; } // .teammates-with-picture-assigned-requests-count { @@ -816,7 +816,7 @@ $f21blue: #039be5; align-items: center; justify-content: center; display: flex; - margin-top: 4px; + margin-top: 9px; background: #e4e6eb; border-radius: 50%; padding: 2px; diff --git a/src/app/ws_requests/ws-requests-list/ws-requests-list.component.ts b/src/app/ws_requests/ws-requests-list/ws-requests-list.component.ts index b0c2cc088793..151319bbbf3b 100755 --- a/src/app/ws_requests/ws-requests-list/ws-requests-list.component.ts +++ b/src/app/ws_requests/ws-requests-list/ws-requests-list.component.ts @@ -565,12 +565,13 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit // createBotsAndUsersArray() { this.usersService.getProjectUsersByProjectId().subscribe((_projectUsers: any) => { // this.logger.log('% »»» WebSocketJs WF WS-RL - +++ GET PROJECT-USERS ', projectUsers); - console.log('[WS-REQUESTS-LIST]- GET PROJECT-USERS RES ', _projectUsers); + // console.log('[WS-REQUESTS-LIST]- GET PROJECT-USERS RES ', _projectUsers); if (_projectUsers) { this.project_users = _projectUsers this.project_user_length = _projectUsers.length; - this.logger.log('[WS-REQUESTS-LIST] - GET PROJECT-USERS LENGTH ', this.project_user_length); - // this.projectUserArray = _projectUsers; + // console.log('[WS-REQUESTS-LIST] - GET PROJECT-USERS LENGTH ', this.project_user_length); + // console.log('[WS-REQUESTS-LIST] - GET PROJECT-USERS project_users ', this.project_users); + this.projectUserArray = _projectUsers; _projectUsers.forEach(projectuser => { @@ -594,7 +595,7 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit this.wsRequestsService.subscriptionToWsAllProjectUsersOfTheProject(projectuser.id_user._id); // Commented nk - // this.listenToAllProjectUsersOfProject$(projectuser) + this.listenToAllProjectUsersOfProject$(projectuser) this.createAgentAvatarInitialsAnfBckgrnd(projectuser.id_user) @@ -634,7 +635,7 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit takeUntil(this.unsubscribe$) ) .subscribe((projectUser_from_ws_subscription) => { - console.log('[WS-REQUESTS-LIST] $UBSC TO WS PROJECT-USERS (listenTo) projectUser_from_ws_subscription', projectUser_from_ws_subscription); + // console.log('[WS-REQUESTS-LIST] $UBSC TO WS PROJECT-USERS (listenTo) projectUser_from_ws_subscription', projectUser_from_ws_subscription); // this.logger.log('WS-REQUESTS-LIST PROJECT-USERS ', projectuser); if (projectuser['_id'] === projectUser_from_ws_subscription['_id']) { @@ -686,11 +687,11 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit if (departmentsCount > 1) { // console.log('»»» »»» DEPTS PAGE - DEPT)', dept); if (dept && dept.default !== true) { - console.log('[DEPTS] - GET DEPTS - DEPT NAME: ', dept.name, 'dept object', dept); + // console.log('[DEPTS] - GET DEPTS - DEPT NAME: ', dept.name, 'dept object', dept); if (!dept.id_group || dept.id_group === undefined) { count = count + 1; - console.log('[WS-REQUESTS-LIST] display all teammates') + // console.log('[WS-REQUESTS-LIST] display all teammates') } } } else if (departmentsCount === 1) { @@ -698,12 +699,12 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit if (!dept.id_group || dept.id_group === undefined) { - console.log('[WS-REQUESTS-LIST] (only default dept) ') + // console.log('[WS-REQUESTS-LIST] (only default dept) ') count = count + 1; } } }); - console.log('[DEPTS] - COUNT OF DEPT WITHOUT GROUP', count); + // console.log('[DEPTS] - COUNT OF DEPT WITHOUT GROUP', count); if (count > 0) { // this.DISPLAY_ALL_TEAMMATES_TO_AGENT = true; this.filteredProjectUsersArray = projectUserArray @@ -723,16 +724,16 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit } getGroupsByProjectId(projectUserArray) { - console.log('[WS-REQUESTS-LIST] - GROUPS - ALL PROJECT USERS ', projectUserArray) + // console.log('[WS-REQUESTS-LIST] - GROUPS - ALL PROJECT USERS ', projectUserArray) this.groupService.getGroupsByProjectId().subscribe((groups: any) => { - console.log('[WS-REQUESTS-LIST] - GROUPS GET BY PROJECT ID', groups); + // console.log('[WS-REQUESTS-LIST] - GROUPS GET BY PROJECT ID', groups); const memberOfAllGroups = [] if (groups) { this.groupsList = groups; // this.logger.log('[DEPT-EDIT-ADD] - GROUP ID SELECTED', this.selectedGroupId); this.groupsList.forEach(group => { - console.log('[WS-REQUESTS-LIST] - GROUP ', group); + // console.log('[WS-REQUESTS-LIST] - GROUP ', group); if (group.members.includes(this.currentUserID)) { // console.log('[WS-REQUESTS-LIST] - GROUPS MEMBERS INCLUDES CURRENT USER'); @@ -740,18 +741,18 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit memberOfAllGroups.indexOf(member) === -1 ? memberOfAllGroups.push(member) : this.logger.log("PUSH MEMBER ID IN memberOfAllGroups : This item already exists"); }); - console.log('[WS-REQUESTS-LIST] - ARRAY OF ALL MEMBERS OF GROUPS ', memberOfAllGroups); + // console.log('[WS-REQUESTS-LIST] - ARRAY OF ALL MEMBERS OF GROUPS ', memberOfAllGroups); this.filteredProjectUsersArray = projectUserArray.filter(projectUser => memberOfAllGroups.includes(projectUser.id_user._id)) - console.log('[WS-REQUESTS-LIST] - PROJECT USER FILTERED FOR MEMBERS OF THE GROUPS IN WICH IS PRESENT THE CURRENT USER ', this.filteredProjectUsersArray); + // console.log('[WS-REQUESTS-LIST] - PROJECT USER FILTERED FOR MEMBERS OF THE GROUPS IN WICH IS PRESENT THE CURRENT USER ', this.filteredProjectUsersArray); } else { - console.log('[WS-REQUESTS-LIST] - GROUPS MEMBERS NOT INCLUDES CURRENT USER - SHOW ALL TEAMMATES'); + // console.log('[WS-REQUESTS-LIST] - GROUPS MEMBERS NOT INCLUDES CURRENT USER - SHOW ALL TEAMMATES'); this.filteredProjectUsersArray = projectUserArray } }); } else { - console.log('[WS-REQUESTS-LIST] - THE PROJECT NOT HAS GROUPS - SHOW ALL TEAMMATES'); + // console.log('[WS-REQUESTS-LIST] - THE PROJECT NOT HAS GROUPS - SHOW ALL TEAMMATES'); this.filteredProjectUsersArray = projectUserArray } }, (error) => { @@ -1104,7 +1105,7 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit // DEPTS_LAZY: add this addDeptObject(wsrequests) { this.departmentService.getDeptsByProjectIdToPromise().then((_departments: any) => { - console.log('[WS-REQUESTS-LIST] - (DEPTS_LAZY) GET DEPTS BY PROJECT-ID toPromise', _departments); + // console.log('[WS-REQUESTS-LIST] - (DEPTS_LAZY) GET DEPTS BY PROJECT-ID toPromise', _departments); wsrequests.forEach(request => { if (request.department) { diff --git a/src/assets/css/demo.scss b/src/assets/css/demo.scss index 77fc84723581..874f6d7a1b88 100755 --- a/src/assets/css/demo.scss +++ b/src/assets/css/demo.scss @@ -715,7 +715,7 @@ my-app .main-panel .main-content .card { padding: 0px; display: inline-block; flex: 1 1 32px; - margin-left: 15px; + // margin-left: 15px; cursor: pointer; }