-
-
-
-
-
-
-
Opened
-
{{openedConversations}}
-
-
-
-
Closed
-
{{closedConversations}}
-
-
-
+
+
{{'Requests' | translate}}
+
{{requests_count}} / {{requests_limit}}
+
Conversations
+
{{requests_count | number:'1.0-0'}} / {{requests_limit | number:'1.0-0'}}
diff --git a/src/app/components/navbar/navbar.component.ts b/src/app/components/navbar/navbar.component.ts
index 3640b0312aed..33d920d7b836 100755
--- a/src/app/components/navbar/navbar.component.ts
+++ b/src/app/components/navbar/navbar.component.ts
@@ -41,6 +41,7 @@ import { ProgressSpinnerMode } from '@angular/material/progress-spinner';
import { QuotesService } from 'app/services/quotes.service';
import { PricingBaseComponent } from 'app/pricing/pricing-base/pricing-base.component';
import { APP_SUMO_PLAN_NAME, PLAN_NAME, URL_understanding_default_roles } from 'app/utils/util';
+import { ProjectUser } from 'app/models/project-user';
const swal = require('sweetalert');
const Swal = require('sweetalert2')
@@ -240,7 +241,6 @@ export class NavbarComponent extends PricingBaseComponent implements OnInit, Aft
ngOnInit() {
this.getCurrentProject();
- this.getProjectUserRole();
this.getProfileImageStorage();
// -------------------------------------------
@@ -261,7 +261,7 @@ export class NavbarComponent extends PricingBaseComponent implements OnInit, Aft
// this.getUnservedRequestLenght_bs();
- this.getProjectUserId();
+ this.getProjectUser();
this.getActiveRoute();
this.hidePendingEmailNotification();
@@ -275,7 +275,6 @@ export class NavbarComponent extends PricingBaseComponent implements OnInit, Aft
this.getFromLocalStorageHasOpenedTheChat();
this.getFromNotifyServiceHasOpenedChat();
- this.getUserAvailability();
this.hasChangedAvailabilityStatusInSidebar();
this.hasChangedAvailabilityStatusInUsersComp();
// this.subscribeToLogoutPressedinSidebarNavMobile();
@@ -355,7 +354,6 @@ export class NavbarComponent extends PricingBaseComponent implements OnInit, Aft
getProjectQuotes() {
this.quotesService.getProjectQuotes(this.projectId).then((response) => {
this.logger.log("[NAVBAR] getProjectQuotes response: ", response);
- this.logger.log("getProjectQuotes: ", response);
this.project_limits = response;
}).catch((err) => {
this.logger.error("[NAVBAR] getProjectQuotes error: ", err);
@@ -646,29 +644,6 @@ export class NavbarComponent extends PricingBaseComponent implements OnInit, Aft
// this.logger.log('[NAVBAR] AppConfigService getAppConfig (NAVBAR) CHAT_BASE_URL', this.CHAT_BASE_URL);
}
- getProjectUserRole() {
- // const user___role = this.usersService.project_user_role_bs.value;
- // this.logger.log('[NAVBAR] % »»» WebSocketJs WF +++++ ws-requests--- navbar - USER ROLE 1 ', user___role);
-
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((user_role) => {
- this.logger.log('[NAVBAR] - USER ROLE from $ubscription', user_role);
- if (user_role) {
- this.USER_ROLE = user_role
- if (user_role === 'agent') {
- this.ROLE_IS_AGENT = true;
-
- } else {
- this.ROLE_IS_AGENT = false;
- }
- }
- });
- }
-
-
getProfileImageStorage() {
if (this.appConfigService.getConfig().uploadEngine === 'firebase') {
const firebase_conf = this.appConfigService.getConfig().firebase;
@@ -774,13 +749,6 @@ export class NavbarComponent extends PricingBaseComponent implements OnInit, Aft
this.logger.log('[NAVBAR] ===== BRS LANG ', this.browserLang)
}
- getUserAvailability() {
- this.usersService.user_is_available_bs.subscribe((user_available) => {
- this.IS_AVAILABLE = user_available;
- this.logger.log('[NAVBAR]- USER IS AVAILABLE ', this.IS_AVAILABLE);
- });
- }
-
hasChangedAvailabilityStatusInSidebar() {
this.usersService.has_changed_availability_in_sidebar.subscribe((has_changed_availability) => {
this.logger.log('[NAVBAR] SUBSCRIBES TO HAS CHANGED AVAILABILITY FROM THE SIDEBAR', has_changed_availability)
@@ -1887,10 +1855,21 @@ export class NavbarComponent extends PricingBaseComponent implements OnInit, Aft
return 'Dashboard';
}
- getProjectUserId() {
- this.usersService.project_user_id_bs.subscribe((projectUser_id) => {
- this.logger.log('[NAVBAR] - PROJECT-USER-ID ', projectUser_id);
- this.projectUser_id = projectUser_id;
+ getProjectUser() {
+ this.usersService.projectUser_bs.subscribe((projectUser: ProjectUser) => {
+ this.logger.log('[NAVBAR] - PROJECT-USER-ID ', projectUser);
+ if(projectUser){
+ this.projectUser_id = projectUser._id;
+ this.IS_AVAILABLE = projectUser.user_available;
+
+ this.USER_ROLE = projectUser.role
+ if (this.USER_ROLE === 'agent') {
+ this.ROLE_IS_AGENT = true;
+
+ } else {
+ this.ROLE_IS_AGENT = false;
+ }
+ }
});
}
diff --git a/src/app/components/settings-sidebar/settings-sidebar.component.ts b/src/app/components/settings-sidebar/settings-sidebar.component.ts
index 00612f9cc6e7..137a6436d2d6 100755
--- a/src/app/components/settings-sidebar/settings-sidebar.component.ts
+++ b/src/app/components/settings-sidebar/settings-sidebar.component.ts
@@ -9,6 +9,7 @@ import { UsersService } from 'app/services/users.service'
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { KnowledgeBaseService } from 'app/services/knowledge-base.service'
+import { ProjectUser } from 'app/models/project-user'
@Component({
selector: 'appdashboard-settings-sidebar',
templateUrl: './settings-sidebar.component.html',
@@ -119,14 +120,12 @@ export class SettingsSidebarComponent implements OnInit {
}
getUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((userRole) => {
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
// this.logger.log('[SETTINGS-SIDEBAR]] - SUBSCRIPTION TO USER ROLE »»» ', userRole)
- this.USER_ROLE = userRole;
- })
+ this.USER_ROLE = projectUser.role;
+ }
+ })
}
listenSidebarIsOpened() {
diff --git a/src/app/components/shared/contact-info/contact-info.component.ts b/src/app/components/shared/contact-info/contact-info.component.ts
index e663c788a9e0..e49758420703 100644
--- a/src/app/components/shared/contact-info/contact-info.component.ts
+++ b/src/app/components/shared/contact-info/contact-info.component.ts
@@ -14,6 +14,7 @@ import { browserRefresh } from 'app/app.component';
import { LoggerService } from '../../../services/logger/logger.service';
import { TagsService } from 'app/services/tags.service';
import { UsersService } from 'app/services/users.service';
+import { ProjectUser } from 'app/models/project-user';
@Component({
selector: 'appdashboard-contact-info',
templateUrl: './contact-info.component.html',
@@ -102,15 +103,13 @@ export class ContactInfoComponent implements OnInit, OnChanges, OnDestroy, After
// @ Subscribe to project user role
// -------------------------------------------------------------
getProjectUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((userRole) => {
- this.logger.log('[WS-REQUESTS-MSGS] - GET CURRENT PTOJECT-USER ROLE - userRole ', userRole)
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.logger.log('[WS-REQUESTS-MSGS] - GET CURRENT PTOJECT-USER ROLE - userRole ', projectUser)
// used to display / hide 'WIDGET' and 'ANALITCS' in home.component.html
- this.CURRENT_USER_ROLE = userRole;
- })
+ this.CURRENT_USER_ROLE = projectUser.role;
+ }
+ })
}
detectBrowserRefresh() {
diff --git a/src/app/components/sidebar-user-details/sidebar-user-details.component.ts b/src/app/components/sidebar-user-details/sidebar-user-details.component.ts
index d1be692f78aa..86ec67498f67 100755
--- a/src/app/components/sidebar-user-details/sidebar-user-details.component.ts
+++ b/src/app/components/sidebar-user-details/sidebar-user-details.component.ts
@@ -21,6 +21,7 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { UserModalComponent } from 'app/users/user-modal/user-modal.component';
import { BrandService } from 'app/services/brand.service';
import { Project } from 'app/models/project-model';
+import { ProjectUser } from 'app/models/project-user';
// import { slideInOutAnimation } from '../../../_animations/index';
@Component({
selector: 'appdashboard-sidebar-user-details',
@@ -319,16 +320,13 @@ export class SidebarUserDetailsComponent implements OnInit {
getUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((userRole) => {
-
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
// this.logger..log('[SIDEBAR-USER-DETAILS] - SUBSCRIPTION TO USER ROLE »»» ', userRole)
// used to display / hide 'WIDGET' and 'ANALITCS' in home.component.html
- this.USER_ROLE = userRole;
- })
+ this.USER_ROLE = projectUser.role;
+ }
+ })
}
@@ -390,6 +388,8 @@ export class SidebarUserDetailsComponent implements OnInit {
this.teammateStatus = this.teammateStatus.slice(0)
this.logger.log('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[0].name);
}
+
+
}
// this.teammateStatus = this.teammateStatus.slice(0)
});
@@ -397,11 +397,13 @@ export class SidebarUserDetailsComponent implements OnInit {
}
getUserUserIsBusy() {
- this.usersService.user_is_busy$.subscribe((user_isbusy) => {
- this.IS_BUSY = user_isbusy;
+ this.usersService.projectUser_bs.subscribe((projectUser: ProjectUser) => {
// THE VALUE OS IS_BUSY IS THEN UPDATED WITH THE VALUE RETURNED FROM THE WEBSOCKET getWsCurrentUserIsBusy$()
// WHEN, FOR EXAMPLE IN PROJECT-SETTINGS > ADVANCED THE NUM OF MAX CHAT IS 3 AND THE
// this.logger.log('[SIDEBAR-USER-DETAILS] - USER IS BUSY (from db)', this.IS_BUSY);
+ if(projectUser){
+ this.IS_BUSY = projectUser.isBusy;
+ }
});
}
@@ -409,36 +411,31 @@ export class SidebarUserDetailsComponent implements OnInit {
getProjectUser() {
this.logger.log('[SIDEBAR-USER-DETAILS] !!! SIDEBAR CALL GET-PROJECT-USER')
- this.usersService.getProjectUserByUserId(this.user._id).subscribe((projectUser: any) => {
+ this.usersService.getProjectUserByUserId(this.user._id).subscribe((projectUser: ProjectUser) => {
this.logger.log('[SIDEBAR-USER-DETAILS] PROJECT-USER GET BY USER-ID - PROJECT-ID ', this.projectId);
this.logger.log('[SIDEBAR-USER-DETAILS] PROJECT-USER GET BY USER-ID - CURRENT-USER-ID ', this.user._id);
- // this.logger..log('[SIDEBAR-USER-DETAILS] PROJECT-USER GET BY USER-ID - PROJECT USER ', projectUser);
- this.logger.log('[SIDEBAR-USER-DETAILS] PROJECT-USER GET BY USER-ID - PROJECT USER LENGTH', projectUser.length);
- if ((projectUser) && (projectUser.length !== 0)) {
- // this.logger.log('[SIDEBAR] PROJECT-USER ID ', projectUser[0]._id)
- // this.logger.log('[SIDEBAR] USER IS AVAILABLE ', projectUser[0].user_available)
- // this.logger.log('[SIDEBAR] USER IS BUSY (from db)', projectUser[0].isBusy)
+ console.log('[SIDEBAR-USER-DETAILS] PROJECT-USER GET BY USER-ID - PROJECT USER ', projectUser);
+ if (projectUser) {
+ // this.logger.log('[SIDEBAR] PROJECT-USER ID ', projectUser._id)
+ // this.logger.log('[SIDEBAR] USER IS AVAILABLE ', projectUser.user_available)
+ // this.logger.log('[SIDEBAR] USER IS BUSY (from db)', projectUser.isBusy)
// this.user_is_available_bs = projectUser.user_available;
- // NOTE_nk: comment this this.subsTo_WsCurrentUser(projectUser[0]._id)
- this.subsTo_WsCurrentUser(projectUser[0]._id)
-
- if (projectUser[0].user_available !== undefined) {
+ // NOTE_nk: comment this this.subsTo_WsCurrentUser(projectUser._id)
+ this.subsTo_WsCurrentUser(projectUser._id)
- this.usersService.user_availability(projectUser[0]._id, projectUser[0].user_available, projectUser[0].isBusy, projectUser[0])
+ if (projectUser.user_available !== undefined) {
+ this.usersService.setProjectUser(projectUser)
}
// ADDED 21 AGO
- if (projectUser[0].role !== undefined) {
- this.logger.log('[SIDEBAR-USER-DETAILS] GET PROJECT USER ROLE FOR THE PROJECT ', this.projectId, ' »» ', projectUser[0].role);
+ if (projectUser.role !== undefined) {
+ this.logger.log('[SIDEBAR-USER-DETAILS] GET PROJECT USER ROLE FOR THE PROJECT ', this.projectId, ' »» ', projectUser.role);
// ASSIGN THE projectUser[0].role VALUE TO USER_ROLE
- this.USER_ROLE = projectUser[0].role;
-
- // SEND THE ROLE TO USER SERVICE THAT PUBLISH
- this.usersService.user_role(projectUser[0].role);
+ this.USER_ROLE = projectUser.role;
}
} else {
diff --git a/src/app/components/sidebar/sidebar.component.ts b/src/app/components/sidebar/sidebar.component.ts
index 1e65f4837e31..2c7e290f0a05 100755
--- a/src/app/components/sidebar/sidebar.component.ts
+++ b/src/app/components/sidebar/sidebar.component.ts
@@ -44,6 +44,7 @@ import { getSteps as defaultSteps, defaultStepOptions } from './sidebar.tour.con
import Step from 'shepherd.js/src/types/step';
import { environment } from 'environments/environment';
+import { ProjectUser } from 'app/models/project-user';
declare const $: any;
@@ -313,8 +314,6 @@ export class SidebarComponent implements OnInit, AfterViewInit {
this.translateChangeAvailabilitySuccessMsg();
this.translateChangeAvailabilityErrorMsg();
this.getProfileImageStorage();
- this.getUserAvailability();
- this.getUserUserIsBusy();
this.getProjectUserId();
this.hasChangedAvailabilityStatusInUsersComp();
this.checkUserImageUploadIsComplete();
@@ -1358,17 +1357,19 @@ export class SidebarComponent implements OnInit, AfterViewInit {
getProjectUserId() {
- this.usersService.project_user_id_bs.subscribe((projectUser_id) => {
- this.logger.log('[SIDEBAR] - PROJECT-USER-ID ', projectUser_id);
-
- // if (this.projectUser_id) {
- // this.logger.log('[SIDEBAR] - PROJECT-USER-ID (THIS) ', this.projectUser_id);
- // this.logger.log('[SIDEBAR] - PROJECT-USER-ID ', projectUser_id);
-
- // this.usersService.unsubscriptionToWsCurrentUser(projectUser_id)
- // }
- if (projectUser_id) {
- this.projectUser_id = projectUser_id;
+ this.usersService.projectUser_bs.subscribe((projectUser: ProjectUser) => {
+ this.logger.log('[SIDEBAR] - PROJECT-USER-ID ', projectUser);
+ if (projectUser) {
+ this.projectUser_id = projectUser._id;
+ this.IS_AVAILABLE = projectUser.user_available;
+ this.IS_BUSY = projectUser.isBusy;
+
+ this.USER_ROLE = projectUser.role;
+ if (this.USER_ROLE) {
+ if (this.USER_ROLE === 'agent') {
+ this.SHOW_SETTINGS_SUBMENU = false;
+ }
+ }
}
});
}
@@ -1380,22 +1381,6 @@ export class SidebarComponent implements OnInit, AfterViewInit {
- the USER-SERVICE PUBLISH THE PROJECT-USER AVAILABILITY AND THE PROJECT-USER ID
- the SIDEBAR (this component) SUBSCRIBES THESE VALUES
*/
- getUserAvailability() {
- this.usersService.user_is_available_bs.subscribe((user_available) => {
- this.IS_AVAILABLE = user_available;
- // this.logger.log('[SIDEBAR] - USER IS AVAILABLE ', this.IS_AVAILABLE);
- });
- }
-
- getUserUserIsBusy() {
- this.usersService.user_is_busy$.subscribe((user_isbusy) => {
- this.IS_BUSY = user_isbusy;
- // THE VALUE OS IS_BUSY IS THEN UPDATED WITH THE VALUE RETURNED FROM THE WEBSOCKET getWsCurrentUserIsBusy$()
- // WHEN, FOR EXAMPLE IN PROJECT-SETTINGS > ADVANCED THE NUM OF MAX CHAT IS 3 AND THE
- // this.logger.log('[SIDEBAR] - USER IS BUSY (from db)', this.IS_BUSY);
- });
- }
-
// changeAvailabilityState(IS_AVAILABLE, profilestatus) {
// this.logger.log('[SIDEBAR] - CHANGE STATUS - USER IS AVAILABLE ? ', IS_AVAILABLE);
@@ -1450,34 +1435,28 @@ export class SidebarComponent implements OnInit, AfterViewInit {
// *** NOTE: THE SAME CALLBACK IS RUNNED IN THE HOME.COMP ***
getProjectUser() {
// this.logger.log('[SIDEBAR] !!! SIDEBAR CALL GET-PROJECT-USER')
- this.usersService.getProjectUserByUserId(this.currentUserId).subscribe((projectUser: any) => {
+ this.usersService.getProjectUserByUserId(this.currentUserId).subscribe((projectUser: ProjectUser) => {
this.logger.log('[SIDEBAR] PROJECT-USER GET BY USER-ID ', projectUser);
this.logger.log('[SIDEBAR] PROJECT-USER GET BY USER-ID - PROJECT-ID ', this.projectId);
this.logger.log('[SIDEBAR] PROJECT-USER GET BY USER-ID - CURRENT-USER-ID ', this.user._id);
// this.logger.log('[SIDEBAR] PROJECT-USER GET BY USER-ID - PROJECT USER ', projectUser);
- this.logger.log('[SIDEBAR] PROJECT-USER GET BY USER-ID - PROJECT USER LENGTH', projectUser.length);
- if ((projectUser) && (projectUser.length !== 0)) {
- // this.logger.log('[SIDEBAR] PROJECT-USER ID ', projectUser[0]._id)
- // this.logger.log('[SIDEBAR] USER IS AVAILABLE ', projectUser[0].user_available)
- // this.logger.log('[SIDEBAR] USER IS BUSY (from db)', projectUser[0].isBusy)
+ if (projectUser) {
+ // this.logger.log('[SIDEBAR] PROJECT-USER ID ', projectUser._id)
+ // this.logger.log('[SIDEBAR] USER IS AVAILABLE ', projectUser.user_available)
+ // this.logger.log('[SIDEBAR] USER IS BUSY (from db)', projectUser.isBusy)
// this.user_is_available_bs = projectUser.user_available;
- // NOTE_nk: comment this this.subsTo_WsCurrentUser(projectUser[0]._id)
- this.subsTo_WsCurrentUser(projectUser[0]._id)
+ // NOTE_nk: comment this this.subsTo_WsCurrentUser(projectUser._id)
+ this.subsTo_WsCurrentUser(projectUser._id)
- if (projectUser[0].user_available !== undefined) {
- this.usersService.user_availability(projectUser[0]._id, projectUser[0].user_available, projectUser[0].isBusy, projectUser[0])
- }
+ this.usersService.setProjectUser(projectUser)
// ADDED 21 AGO
- if (projectUser[0].role !== undefined) {
- this.logger.log('[SIDEBAR] GET PROJECT USER ROLE FOR THE PROJECT ', this.projectId, ' »» ', projectUser[0].role);
-
- // ASSIGN THE projectUser[0].role VALUE TO USER_ROLE
- this.USER_ROLE = projectUser[0].role;
+ if (projectUser.role !== undefined) {
+ this.logger.log('[SIDEBAR] GET PROJECT USER ROLE FOR THE PROJECT ', this.projectId, ' »» ', projectUser.role);
- // SEND THE ROLE TO USER SERVICE THAT PUBLISH
- this.usersService.user_role(projectUser[0].role);
+ // ASSIGN THE projectUser.role VALUE TO USER_ROLE
+ this.USER_ROLE = projectUser.role;
}
} else {
@@ -1602,7 +1581,7 @@ export class SidebarComponent implements OnInit, AfterViewInit {
});
- this.getProjectUserRole();
+ this.getProjectUserId();
this.getProjectUser();
// this.getFaqKbByProjectId()
@@ -1648,21 +1627,6 @@ export class SidebarComponent implements OnInit, AfterViewInit {
});
}
- getProjectUserRole() {
- this.usersService.project_user_role_bs.subscribe((user_role) => {
- this.USER_ROLE = user_role;
- this.logger.log('[SIDEBAR] - 1. SUBSCRIBE PROJECT_USER_ROLE_BS ', this.USER_ROLE);
- if (this.USER_ROLE) {
- // this.logger.log('[SIDEBAR] - PROJECT USER ROLE get from $ subsription', this.USER_ROLE);
- if (this.USER_ROLE === 'agent') {
- this.SHOW_SETTINGS_SUBMENU = false;
- }
- }
-
- });
- // }
- }
-
round5(x) {
// const percentageRounded = Math.ceil(x / 5) * 5;
// this.logger.log('SIDEBAR project trial days left % rounded', percentageRounded);
diff --git a/src/app/components/widget-installations/magento-installation/magento-installation.component.html b/src/app/components/widget-installations/magento-installation/magento-installation.component.html
index 4c2be73b713d..85e4481ed3c1 100644
--- a/src/app/components/widget-installations/magento-installation/magento-installation.component.html
+++ b/src/app/components/widget-installations/magento-installation/magento-installation.component.html
@@ -1,76 +1,75 @@
\ No newline at end of file
diff --git a/src/app/components/widget-installations/prestashop-installation/prestashop-installation.component.html b/src/app/components/widget-installations/prestashop-installation/prestashop-installation.component.html
index 3825b6df3ad6..a6c850a51b14 100644
--- a/src/app/components/widget-installations/prestashop-installation/prestashop-installation.component.html
+++ b/src/app/components/widget-installations/prestashop-installation/prestashop-installation.component.html
@@ -1,107 +1,116 @@
-
+
\ No newline at end of file
diff --git a/src/app/contacts/contacts.component.ts b/src/app/contacts/contacts.component.ts
index 7a0d43a6a928..a08df928cdab 100755
--- a/src/app/contacts/contacts.component.ts
+++ b/src/app/contacts/contacts.component.ts
@@ -13,6 +13,7 @@ import { TranslateService } from '@ngx-translate/core';
import { ProjectPlanService } from '../services/project-plan.service';
import { Subscription } from 'rxjs';
import { LoggerService } from '../services/logger/logger.service';
+import { ProjectUser } from 'app/models/project-user';
declare const $: any;
const swal = require('sweetalert');
const Swal = require('sweetalert2')
@@ -405,27 +406,29 @@ export class ContactsComponent implements OnInit, OnDestroy, AfterViewInit {
}
getProjectUserRole() {
- this.usersService.project_user_role_bs.subscribe((user_role) => {
- const current_user_role = user_role;
- this.USER_ROLE = user_role;
- this.logger.log('[CONTACTS-COMP] - SUBSCRIBE PROJECT_USER_ROLE_BS ', current_user_role);
- if (current_user_role) {
- this.logger.log('[CONTACTS-COMP] - PROJECT USER ROLE ', current_user_role);
- if (current_user_role === 'agent') {
- this.IS_CURRENT_USER_AGENT = true;
- this.logger.log('[CONTACTS-COMP] - PROJECT USER ROLE - IS CURRENT USER AGENT? ', this.IS_CURRENT_USER_AGENT);
- } else {
- this.IS_CURRENT_USER_AGENT = false;
- this.logger.log('[CONTACTS-COMP] - PROJECT USER ROLE - IS CURRENT USER AGENT? ', this.IS_CURRENT_USER_AGENT);
- }
+ this.usersService.projectUser_bs.subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ const current_user_role = projectUser.role;
+ this.USER_ROLE = current_user_role;
+ this.logger.log('[CONTACTS-COMP] - SUBSCRIBE PROJECT_USER_ROLE_BS ', current_user_role);
+ if (current_user_role) {
+ this.logger.log('[CONTACTS-COMP] - PROJECT USER ROLE ', current_user_role);
+ if (current_user_role === 'agent') {
+ this.IS_CURRENT_USER_AGENT = true;
+ this.logger.log('[CONTACTS-COMP] - PROJECT USER ROLE - IS CURRENT USER AGENT? ', this.IS_CURRENT_USER_AGENT);
+ } else {
+ this.IS_CURRENT_USER_AGENT = false;
+ this.logger.log('[CONTACTS-COMP] - PROJECT USER ROLE - IS CURRENT USER AGENT? ', this.IS_CURRENT_USER_AGENT);
+ }
- if (current_user_role === 'owner') {
- this.IS_CURRENT_USER_OWNER = true;
- this.logger.log('[CONTACTS-COMP] - PROJECT USER ROLE - IS CURRENT USER OWNER? ', this.IS_CURRENT_USER_OWNER);
- } else {
- this.IS_CURRENT_USER_OWNER = false;
- this.logger.log('[CONTACTS-COMP] - PROJECT USER ROLE - IS CURRENT USER OWNER? ', this.IS_CURRENT_USER_OWNER);
+ if (current_user_role === 'owner') {
+ this.IS_CURRENT_USER_OWNER = true;
+ this.logger.log('[CONTACTS-COMP] - PROJECT USER ROLE - IS CURRENT USER OWNER? ', this.IS_CURRENT_USER_OWNER);
+ } else {
+ this.IS_CURRENT_USER_OWNER = false;
+ this.logger.log('[CONTACTS-COMP] - PROJECT USER ROLE - IS CURRENT USER OWNER? ', this.IS_CURRENT_USER_OWNER);
+ }
}
}
});
diff --git a/src/app/core/admin.guard.ts b/src/app/core/admin.guard.ts
deleted file mode 100755
index 7c7d781fff24..000000000000
--- a/src/app/core/admin.guard.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import { Injectable } from '@angular/core';
-import { Router } from '@angular/router';
-import { UsersService } from '../services/users.service';
-import { AuthService } from '../core/auth.service';
-import { LoggerService } from '../services/logger/logger.service';
-// implements CanActivate
-@Injectable()
-export class AdminGuard {
-
- userRole: string;
- projectId: string;
- currentUserId: string
-
- constructor(
- private router: Router,
- private usersService: UsersService,
- private auth: AuthService,
- private logger: LoggerService
- ) {
- // this.checkRole();
- // this.getLoggedUser();
- // this.getCurrentProject();
-
- }
-
- getLoggedUser() {
- this.auth.user_bs.subscribe((user) => {
-
- if (user) {
- this.currentUserId = user._id;
- this.logger.log('[ADMIN-GUARD] - Current USER ID ', this.currentUserId)
-
- }
- });
- }
-
- getCurrentProject() {
- this.auth.project_bs.subscribe((project) => {
-
- if (project) {
- this.projectId = project._id
- this.logger.log('[ADMIN-GUARD] - PRJCT ID from AUTH SERV SUBSC ', this.projectId);
- }
-
- });
- }
-
- checkRole() {
- this.usersService.project_user_role_bs.subscribe((user_role) => {
- if (user_role) {
-
- this.userRole = user_role;
- // this.userRole = 'agent';
- this.logger.log('[ADMIN-GUARD] - CHECK ROLE (FROM SUBSCRIPTION) »»» ', this.userRole);
- // if (user_role === 'agent' || user_role === undefined) {
- // this.logger.log([ADMIN-GUARD] - CHECK ROLE (FROM SUBSCRIPTION) »»» ', user_role);
-
- // this.router.navigate(['unauthorized']);
-
- // } else {
- // this.logger.log([ADMIN-GUARD] - CHECK ROLE (FROM SUBSCRIPTION) »»» ', user_role);
- // }
- }
- });
- }
-
-}
diff --git a/src/app/core/auth.guard.ts b/src/app/core/auth.guard.ts
index e1074943fc26..f6528922268a 100755
--- a/src/app/core/auth.guard.ts
+++ b/src/app/core/auth.guard.ts
@@ -16,6 +16,7 @@ import { LocalDbService } from 'app/services/users-local-db.service';
import { MatSnackBar } from '@angular/material/snack-bar';
import { AppConfigService } from 'app/services/app-config.service';
import { HttpClient, HttpHeaders } from '@angular/common/http';
+import { FaqKbService } from 'app/services/faq-kb.service';
// import { RequestsMsgsComponent } from '../requests-msgs/requests-msgs.component';
// import { HomeComponent } from '../home/home.component';
@@ -58,6 +59,7 @@ export class AuthGuard implements CanActivate {
private usersService: UsersService,
private logger: LoggerService,
public localDbService: LocalDbService,
+ private faqKbService: FaqKbService,
private _snackBar: MatSnackBar,
public appConfigService: AppConfigService,
private _httpClient: HttpClient,
@@ -205,7 +207,7 @@ export class AuthGuard implements CanActivate {
this.usersService.getAllUsersOfCurrentProjectAndSaveInStorage();
// GET AND SAVE ALL BOTS OF CURRENT PROJECT IN LOCAL STORAGE
- this.usersService.getBotsByProjectIdAndSaveInStorage();
+ this.faqKbService.getBotsByProjectIdAndSaveInStorage();
} else {
this.logger.log('[AUTH-GUARD] - PROJECT OBJCT FILTERED FOR PROJECT ID !! NOT FOUND - GO TO UNAUTHORIZED PAGE ');
diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts
index fbbf4c9e6799..c2d876d6729a 100755
--- a/src/app/core/core.module.ts
+++ b/src/app/core/core.module.ts
@@ -1,7 +1,6 @@
import { NgModule } from '@angular/core';
import { AuthService } from './auth.service';
-import { AdminGuard } from './admin.guard';
import { NotifyService } from './notify.service';
import { SsoService } from './sso.service';
@@ -11,7 +10,6 @@ import { SsoService } from './sso.service';
providers: [
AuthService,
NotifyService,
- AdminGuard,
SsoService
],
})
diff --git a/src/app/create-project-wizard/activate-appsumo-product/activate-appsumo-product.component.ts b/src/app/create-project-wizard/activate-appsumo-product/activate-appsumo-product.component.ts
index e078bb547c1b..d96903cf4738 100644
--- a/src/app/create-project-wizard/activate-appsumo-product/activate-appsumo-product.component.ts
+++ b/src/app/create-project-wizard/activate-appsumo-product/activate-appsumo-product.component.ts
@@ -11,6 +11,7 @@ import { WidgetSetUpBaseComponent } from 'app/widget_components/widget-set-up/wi
import { WidgetService } from 'app/services/widget.service';
import { NotifyService } from 'app/core/notify.service';
import { UsersService } from 'app/services/users.service';
+import { ProjectUser } from 'app/models/project-user';
const swal = require('sweetalert');
@Component({
@@ -92,11 +93,10 @@ export class ActivateAppsumoProductComponent extends WidgetSetUpBaseComponent im
}
getProjectUserRole() {
- this.usersService.project_user_role_bs
- .subscribe((user_role) => {
+ this.usersService.projectUser_bs.subscribe((projectUser: ProjectUser) => {
// this.logger.log('[ACTIVATE-APPSUMO-PRODUCT] - USER ROLE ', user_role);
- if (user_role) {
- this.USER_ROLE = user_role
+ if (projectUser) {
+ this.USER_ROLE = projectUser.role
}
});
}
diff --git a/src/app/create-project-wizard/get-start-chatbot-fork/get-start-chatbot-fork.component.ts b/src/app/create-project-wizard/get-start-chatbot-fork/get-start-chatbot-fork.component.ts
index 7c90b50c1566..65e08c3359b6 100644
--- a/src/app/create-project-wizard/get-start-chatbot-fork/get-start-chatbot-fork.component.ts
+++ b/src/app/create-project-wizard/get-start-chatbot-fork/get-start-chatbot-fork.component.ts
@@ -18,6 +18,7 @@ import { ChatbotModalComponent } from 'app/bots/bots-list/chatbot-modal/chatbot-
import { MatDialog } from '@angular/material/dialog';
import { TranslateService } from '@ngx-translate/core';
import { CacheService } from 'app/services/cache.service';
+import { ProjectUser } from 'app/models/project-user';
const swal = require('sweetalert');
@Component({
@@ -112,12 +113,12 @@ export class GetStartChatbotForkComponent implements OnInit {
}
getUserRole() {
- this.usersService.project_user_role_bs
- .subscribe((userRole) => {
-
- this.logger.log('[GET START CHATBOT FORK] - SUBSCRIPTION TO USER ROLE »»» ', userRole)
- this.USER_ROLE = userRole;
- })
+ this.usersService.projectUser_bs.subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.logger.log('[GET START CHATBOT FORK] - SUBSCRIPTION TO USER ROLE »»» ', projectUser)
+ this.USER_ROLE = projectUser.role;
+ }
+ })
}
// getCurrentProject() {
diff --git a/src/app/create-project-wizard/install-template/install-template.component.ts b/src/app/create-project-wizard/install-template/install-template.component.ts
index 2e4ed7045e0d..d46908facbfe 100644
--- a/src/app/create-project-wizard/install-template/install-template.component.ts
+++ b/src/app/create-project-wizard/install-template/install-template.component.ts
@@ -22,6 +22,7 @@ import { ProjectPlanService } from 'app/services/project-plan.service';
import { UsersService } from 'app/services/users.service';
import { NotifyService } from 'app/core/notify.service';
import { ChatbotModalComponent } from 'app/bots/bots-list/chatbot-modal/chatbot-modal.component';
+import { ProjectUser } from 'app/models/project-user';
@Component({
selector: 'appdashboard-install-template',
templateUrl: './install-template.component.html',
@@ -136,12 +137,12 @@ export class InstallTemplateComponent extends PricingBaseComponent implements On
}
getUserRole() {
- this.usersService.project_user_role_bs
- .subscribe((userRole) => {
-
- this.logger.log('[INSTALL-TEMPLATE] - SUBSCRIPTION TO USER ROLE »»» ', userRole)
- this.USER_ROLE = userRole;
- })
+ this.usersService.projectUser_bs.subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.logger.log('[INSTALL-TEMPLATE] - SUBSCRIPTION TO USER ROLE »»» ', projectUser)
+ this.USER_ROLE = projectUser.role;
+ }
+ })
}
getParamsTemplatesAndProjects() {
diff --git a/src/app/department-edit-add/department-edit-add.component.ts b/src/app/department-edit-add/department-edit-add.component.ts
index 14d1f490824a..584889663398 100755
--- a/src/app/department-edit-add/department-edit-add.component.ts
+++ b/src/app/department-edit-add/department-edit-add.component.ts
@@ -22,6 +22,7 @@ import { takeUntil } from 'rxjs/operators'
import { FaqKb } from 'app/models/faq_kb-model';
import { ProjectPlanService } from 'app/services/project-plan.service';
import { PricingBaseComponent } from 'app/pricing/pricing-base/pricing-base.component';
+import { ProjectUser } from 'app/models/project-user';
import { RoleService } from 'app/services/role.service';
declare const $: any;
const swal = require('sweetalert');
@@ -426,16 +427,13 @@ export class DepartmentEditAddComponent extends PricingBaseComponent implements
getUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((userRole) => {
-
- this.logger.log('[DEPT-EDIT-ADD] - SUBSCRIPTION TO USER ROLE »»» ', userRole)
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.logger.log('[DEPT-EDIT-ADD] - SUBSCRIPTION TO USER ROLE »»» ', projectUser)
// used to display / hide 'WIDGET' and 'ANALITCS' in home.component.html
- this.USER_ROLE = userRole;
- })
+ this.USER_ROLE = projectUser.role;
+ }
+ })
}
getBrowserVersion() {
@@ -1364,12 +1362,12 @@ export class DepartmentEditAddComponent extends PricingBaseComponent implements
getProjectuserbyUseridAndGoToEditProjectuser(member_id: string) {
- this.usersService.getProjectUserByUserId(member_id).subscribe((projectUser: any) => {
+ this.usersService.getProjectUserByUserId(member_id).subscribe((projectUser: ProjectUser) => {
this.logger.log('[DEPT-EDIT-ADD] GET projectUser by USER-ID ', projectUser)
if (projectUser) {
- this.logger.log('[DEPT-EDIT-ADD] - GET projectUser by USER-ID > projectUser id', projectUser[0]._id);
+ this.logger.log('[DEPT-EDIT-ADD] - GET projectUser by USER-ID > projectUser id', projectUser._id);
- this.router.navigate(['project/' + this.project._id + '/user/edit/' + projectUser[0]._id]);
+ this.router.navigate(['project/' + this.project._id + '/user/edit/' + projectUser._id]);
}
}, (error) => {
this.logger.error('[DEPT-EDIT-ADD] GET projectUser by USER-ID - ERROR ', error);
diff --git a/src/app/home-components/home-analytics-indicator/home-analytics-indicator.component.ts b/src/app/home-components/home-analytics-indicator/home-analytics-indicator.component.ts
index b1f59774cd6c..6f8b89684633 100644
--- a/src/app/home-components/home-analytics-indicator/home-analytics-indicator.component.ts
+++ b/src/app/home-components/home-analytics-indicator/home-analytics-indicator.component.ts
@@ -9,6 +9,7 @@ import { ContactsService } from 'app/services/contacts.service';
import { LoggerService } from 'app/services/logger/logger.service';
import { AppConfigService } from 'app/services/app-config.service';
import { AnalyticsService } from 'app/services/analytics.service';
+import { ProjectUser } from 'app/models/project-user';
@Component({
selector: 'appdashboard-home-analytics-indicator',
templateUrl: './home-analytics-indicator.component.html',
@@ -97,13 +98,11 @@ export class HomeAnalyticsIndicatorComponent implements OnInit {
getUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((userRole) => {
- this.USER_ROLE = userRole;
- })
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.USER_ROLE = projectUser.role;
+ }
+ })
}
getActiveContactsCount() {
diff --git a/src/app/home-components/home-cds/home-cds.component.ts b/src/app/home-components/home-cds/home-cds.component.ts
index 2cadab7ed522..da325177acf2 100644
--- a/src/app/home-components/home-cds/home-cds.component.ts
+++ b/src/app/home-components/home-cds/home-cds.component.ts
@@ -8,6 +8,7 @@ import { NotifyService } from 'app/core/notify.service';
import { ModalChatbotNameComponent } from 'app/knowledge-bases/modals/modal-chatbot-name/modal-chatbot-name.component';
import { ModalHookBotComponent } from 'app/knowledge-bases/modals/modal-hook-bot/modal-hook-bot.component';
import { Chatbot } from 'app/models/faq_kb-model';
+import { ProjectUser } from 'app/models/project-user';
import { PricingBaseComponent } from 'app/pricing/pricing-base/pricing-base.component';
import { AppConfigService } from 'app/services/app-config.service';
import { DepartmentService } from 'app/services/department.service';
@@ -225,14 +226,12 @@ export class HomeCdsComponent extends PricingBaseComponent implements OnInit, On
getUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((userRole) => {
- this.logger.log('[HOME-CDS] - SUBSCRIPTION TO USER ROLE »»» ', userRole)
- this.USER_ROLE = userRole;
- })
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.logger.log('[HOME-CDS] - SUBSCRIPTION TO USER ROLE »»» ', projectUser)
+ this.USER_ROLE = projectUser.role;
+ }
+ })
}
diff --git a/src/app/home-components/home-convs-graph/home-convs-graph.component.ts b/src/app/home-components/home-convs-graph/home-convs-graph.component.ts
index 8aea66dff296..456b7fe936c0 100644
--- a/src/app/home-components/home-convs-graph/home-convs-graph.component.ts
+++ b/src/app/home-components/home-convs-graph/home-convs-graph.component.ts
@@ -12,6 +12,7 @@ import { ContactsService } from 'app/services/contacts.service';
import { LoggerService } from 'app/services/logger/logger.service';
import { AppConfigService } from 'app/services/app-config.service';
import { AnalyticsService } from 'app/services/analytics.service';
+import { ProjectUser } from 'app/models/project-user';
@Component({
selector: 'appdashboard-home-convs-graph',
@@ -226,13 +227,11 @@ export class HomeConvsGraphComponent implements OnInit, OnChanges {
getUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((userRole) => {
- this.USER_ROLE = userRole;
- })
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.USER_ROLE = projectUser.role;
+ }
+ })
}
getMonthsName() {
diff --git a/src/app/home-components/home-create-chatbot/home-create-chatbot.component.ts b/src/app/home-components/home-create-chatbot/home-create-chatbot.component.ts
index 8ea5b8f2eed8..45ec7484b382 100644
--- a/src/app/home-components/home-create-chatbot/home-create-chatbot.component.ts
+++ b/src/app/home-components/home-create-chatbot/home-create-chatbot.component.ts
@@ -21,6 +21,7 @@ import { NotifyService } from 'app/core/notify.service';
import { PricingBaseComponent } from 'app/pricing/pricing-base/pricing-base.component';
import { TranslateService } from '@ngx-translate/core';
import { BrandService } from 'app/services/brand.service';
+import { ProjectUser } from 'app/models/project-user';
@Component({
selector: 'appdashboard-home-create-chatbot',
@@ -258,15 +259,12 @@ export class HomeCreateChatbotComponent extends PricingBaseComponent implements
getUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((userRole) => {
-
- this.logger.log('[HOME-CREATE-CHATBOT] - SUBSCRIPTION TO USER ROLE »»» ', userRole)
- this.USER_ROLE = userRole;
- })
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.logger.log('[HOME-CREATE-CHATBOT] - SUBSCRIPTION TO USER ROLE »»» ', projectUser)
+ this.USER_ROLE = projectUser.role;
+ }
+ })
}
getCurrentProjectAndPrjctBots() {
diff --git a/src/app/home-components/home-create-teammate/home-create-teammate.component.ts b/src/app/home-components/home-create-teammate/home-create-teammate.component.ts
index 7a7602480153..9149d7e1e6a1 100644
--- a/src/app/home-components/home-create-teammate/home-create-teammate.component.ts
+++ b/src/app/home-components/home-create-teammate/home-create-teammate.component.ts
@@ -16,6 +16,7 @@ import { HomeInviteTeammateErrorModalComponent } from './home-invite-teammate-er
import { TranslateService } from '@ngx-translate/core';
import { PricingBaseComponent } from 'app/pricing/pricing-base/pricing-base.component';
import { BrandService } from 'app/services/brand.service';
+import { ProjectUser } from 'app/models/project-user';
@Component({
selector: 'appdashboard-home-create-teammate',
@@ -172,15 +173,12 @@ export class HomeCreateTeammateComponent extends PricingBaseComponent implements
getUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((userRole) => {
-
- this.logger.log('[HOME-CREATE-TEAMMATE] - SUBSCRIPTION TO USER ROLE »»» ', userRole)
- this.USER_ROLE = userRole;
- })
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.logger.log('[HOME-CREATE-TEAMMATE] - SUBSCRIPTION TO USER ROLE »»» ', projectUser)
+ this.USER_ROLE = projectUser.role;
+ }
+ })
}
getLoggedUser() {
@@ -586,12 +584,12 @@ export class HomeCreateTeammateComponent extends PricingBaseComponent implements
getProjectuserbyUseridAndGoToEditProjectuser(member_id: string) {
this.usersService.getProjectUserByUserId(member_id)
- .subscribe((projectUser: any) => {
+ .subscribe((projectUser: ProjectUser) => {
this.logger.log('[HOME-CREATE-TEAMMATE] - GET projectUser by USER-ID ', projectUser)
if (projectUser) {
- this.logger.log('[HOME-CREATE-TEAMMATE] - GET projectUser > projectUser id', projectUser[0]._id);
+ this.logger.log('[HOME-CREATE-TEAMMATE] - GET projectUser > projectUser id', projectUser._id);
- this.router.navigate(['project/' + this.projectId + '/user/edit/' + projectUser[0]._id]);
+ this.router.navigate(['project/' + this.projectId + '/user/edit/' + projectUser._id]);
}
}, (error) => {
this.logger.error('[HOME-CREATE-TEAMMATE] - GET projectUser by USER-ID - ERROR ', error);
diff --git a/src/app/home-components/home-kb/home-kb.component.ts b/src/app/home-components/home-kb/home-kb.component.ts
index e0172c69dee7..439679465ff8 100644
--- a/src/app/home-components/home-kb/home-kb.component.ts
+++ b/src/app/home-components/home-kb/home-kb.component.ts
@@ -22,6 +22,7 @@ import { FaqService } from 'app/services/faq.service';
import { ModalHookBotComponent } from 'app/knowledge-bases/modals/modal-hook-bot/modal-hook-bot.component';
import { DepartmentService } from 'app/services/department.service';
import { ModalChatbotNameComponent } from 'app/knowledge-bases/modals/modal-chatbot-name/modal-chatbot-name.component';
+import { ProjectUser } from 'app/models/project-user';
const Swal = require('sweetalert2')
@Component({
selector: 'appdashboard-home-kb',
@@ -100,14 +101,12 @@ export class HomeKbComponent extends PricingBaseComponent implements OnInit {
getUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((userRole) => {
- this.logger.log('[HOME-KB] - SUBSCRIPTION TO USER ROLE »»» ', userRole)
- this.USER_ROLE = userRole;
- })
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.logger.log('[HOME-KB] - SUBSCRIPTION TO USER ROLE »»» ', projectUser)
+ this.USER_ROLE = projectUser.role;
+ }
+ })
}
getCurrentProject() {
diff --git a/src/app/home-components/home-whatsapp-account/home-whatsapp-account.component.ts b/src/app/home-components/home-whatsapp-account/home-whatsapp-account.component.ts
index 94c91512ec81..61cabf0c26e1 100644
--- a/src/app/home-components/home-whatsapp-account/home-whatsapp-account.component.ts
+++ b/src/app/home-components/home-whatsapp-account/home-whatsapp-account.component.ts
@@ -13,6 +13,7 @@ import { Subscription } from 'rxjs';
import { takeUntil } from 'rxjs/operators'
import { Subject } from 'rxjs';
import { ProjectService } from 'app/services/project.service';
+import { ProjectUser } from 'app/models/project-user';
const swal = require('sweetalert');
@Component({
@@ -133,16 +134,14 @@ export class HomeWhatsappAccountComponent implements OnInit, OnChanges {
}
getProjectUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((user_role) => {
- this.logger.log('[HOME-WA] - GET PROJECT-USER ROLE ', user_role);
- if (user_role) {
- this.USER_ROLE = user_role;
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.logger.log('[HOME-WA] - GET PROJECT-USER ROLE ', projectUser);
+ if (projectUser.role) {
+ this.USER_ROLE = projectUser.role;
}
- });
+ }
+ });
}
translateLabels() {
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts
index 3a9ded135823..af2dbeb3b185 100755
--- a/src/app/home/home.component.ts
+++ b/src/app/home/home.component.ts
@@ -41,6 +41,7 @@ import { AnalyticsService } from 'app/services/analytics.service';
import { ThemePalette } from '@angular/material/core';
import { ProgressSpinnerMode } from '@angular/material/progress-spinner';
import { QuotesService } from 'app/services/quotes.service';
+import { ProjectUser } from 'app/models/project-user';
const swal = require('sweetalert');
const Swal = require('sweetalert2')
@@ -311,12 +312,12 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit {
this.getProjectUser();
// GET AND SAVE ALL BOTS OF CURRENT PROJECT IN LOCAL STORAGE
- this.usersService.getBotsByProjectIdAndSaveInStorage();
+ this.faqKbService.getBotsByProjectIdAndSaveInStorage();
// TEST FUNCTION : GET ALL AVAILABLE PROJECT USER
// this.getAvailableProjectUsersByProjectId();
- this.getUserRole();
+ // this.getUserRole();
// this.getProjectPlan();
// this.getVisitorCounter();
this.getOSCODE();
@@ -3305,30 +3306,27 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit {
// *** NOTE: THE SAME CALLBACK IS RUNNED IN THE SIDEBAR.COMP ***
getProjectUser() {
this.logger.log('[HOME] CALL GET-PROJECT-USER')
- this.usersService.getProjectUserByUserId(this.user._id).subscribe((projectUser: any) => {
+ this.usersService.getProjectUserByUserId(this.user._id).subscribe((projectUser: ProjectUser) => {
this.logger.log('[HOME] PROJECT-USER GET BY PROJECT-ID & CURRENT-USER-ID ', projectUser)
if (projectUser) {
- this.logger.log('[HOME] PROJECT-USER ID ', projectUser[0]._id)
- this.logger.log('[HOME] USER IS AVAILABLE ', projectUser[0].user_available)
- this.logger.log('[HOME] USER IS BUSY ', projectUser[0].isBusy)
+ this.logger.log('[HOME] PROJECT-USER ID ', projectUser._id)
+ this.logger.log('[HOME] USER IS AVAILABLE ', projectUser.user_available)
+ this.logger.log('[HOME] USER IS BUSY ', projectUser.isBusy)
// this.user_is_available_bs = projectUser.user_available;
- if (projectUser[0].user_available !== undefined) {
- this.usersService.user_availability(projectUser[0]._id, projectUser[0].user_available, projectUser[0].isBusy, projectUser[0]);
+ if (projectUser.user_available !== undefined) {
+ this.usersService.setProjectUser(projectUser);
}
- if (projectUser[0].role !== undefined) {
- this.logger.log('!!! »»» HOME GET THE USER ROLE FOR THE PROJECT »»', this.projectId, '»»» ', projectUser[0].role);
+ if (projectUser.role !== undefined) {
+ this.logger.log('!!! »»» HOME GET THE USER ROLE FOR THE PROJECT »»', this.projectId, '»»» ', projectUser.role);
// SEND THE ROLE TO USER SERVICE THAT PUBLISH
- this.usersService.user_role(projectUser[0].role);
+ this.USER_ROLE = projectUser.role;
// save the user role in storage - then the value is get by auth.service:
// the user with agent role can not access to the pages under the settings sub-menu
- // this.auth.user_role(projectUser[0].role);
- // this.usersLocalDbService.saveUserRoleInStorage(projectUser[0].role);
-
- // used to display / hide 'WIDGET' and 'ANALITCS' in home.component.html
- this.USER_ROLE = projectUser[0].role;
+ // this.auth.user_role(projectUser.role);
+ // this.usersLocalDbService.saveUserRoleInStorage(projectUser.role);
}
}
@@ -3410,18 +3408,18 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit {
// CON getUserRole() AGGIORNO this.USER_ROLE QUANDO LA SIDEBAR, NEL MOMENTO
// IN CUI ESGUE getProjectUser() PASSA LO USER ROLE ALLO USER SERVICE CHE LO PUBBLICA
// NOTA: LA SIDEBAR AGGIORNA LO USER ROLE PRIMA DELLA HOME
- getUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((userRole) => {
+ // getUserRole() {
+ // this.usersService.project_user_role_bs
+ // .pipe(
+ // takeUntil(this.unsubscribe$)
+ // )
+ // .subscribe((userRole) => {
- this.logger.log('[HOME] - SUBSCRIPTION TO USER ROLE »»» ', userRole)
- // used to display / hide 'WIDGET' and 'ANALITCS' in home.component.html
- this.USER_ROLE = userRole;
- })
- }
+ // this.logger.log('[HOME] - SUBSCRIPTION TO USER ROLE »»» ', userRole)
+ // // used to display / hide 'WIDGET' and 'ANALITCS' in home.component.html
+ // this.USER_ROLE = userRole;
+ // })
+ // }
// TEST FUNCTION : GET ALL AVAILABLE PROJECT USER
getAvailableProjectUsersByProjectId() {
@@ -3566,12 +3564,12 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit {
// SERVED_BY: add this if not exist -->
getProjectuserbyUseridAndGoToEditProjectuser(member_id: string) {
this.usersService.getProjectUserByUserId(member_id)
- .subscribe((projectUser: any) => {
+ .subscribe((projectUser: ProjectUser) => {
this.logger.log('[HOME] - GET projectUser by USER-ID ', projectUser)
if (projectUser) {
- this.logger.log('[HOME] - GET projectUser > projectUser id', projectUser[0]._id);
+ this.logger.log('[HOME] - GET projectUser > projectUser id', projectUser._id);
- this.router.navigate(['project/' + this.projectId + '/user/edit/' + projectUser[0]._id]);
+ this.router.navigate(['project/' + this.projectId + '/user/edit/' + projectUser._id]);
}
}, (error) => {
this.logger.error('[HOME] - GET projectUser by USER-ID - ERROR ', error);
diff --git a/src/app/hours/hours.component.ts b/src/app/hours/hours.component.ts
index 8aaf8cccf4fb..c851b84f085e 100755
--- a/src/app/hours/hours.component.ts
+++ b/src/app/hours/hours.component.ts
@@ -16,6 +16,7 @@ import { v4 as uuidv4 } from 'uuid';
import { DAYS } from './utils';
import { takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs';
+import { ProjectUser } from 'app/models/project-user';
import { RoleService } from 'app/services/role.service';
const Swal = require('sweetalert2')
@@ -103,11 +104,12 @@ export class HoursComponent implements OnInit, OnDestroy {
}
getUserRole() {
- this.usersService.project_user_role_bs
- .subscribe((userRole) => {
- this.logger.log('[HOURS] - $UBSCRIPTION TO USER ROLE »»» ', userRole)
- this.USER_ROLE = userRole;
- })
+ this.usersService.projectUser_bs.subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.logger.log('[HOURS] - $UBSCRIPTION TO USER ROLE »»» ', projectUser)
+ this.USER_ROLE = projectUser.role;
+ }
+ })
}
getOSCODE() {
diff --git a/src/app/hours/old_hours.component.html b/src/app/hours/old_hours.component.html
deleted file mode 100755
index 7b484b77d2c9..000000000000
--- a/src/app/hours/old_hours.component.html
+++ /dev/null
@@ -1,591 +0,0 @@
-
-
-
-
-
- settings
-
- {{ 'Settings' | translate }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
General
-
-
-
- unfold_more
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{slot.name}}
-
-
-
-
-
-
-
- {{ "Save" | translate }}
-
-
-
-
-
-
-
-
-
-
-
- {{ "HoursPage.ActivateTimetables" | translate }}
-
-
-
-
-
-
-
-
-
- {{ "HoursPage.OpeningHoursActivated" | translate }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ "HoursPage.TheProject" | translate }} time zone {{ "HoursPage.IsSettedTo" | translate }}
-
-
-
-
-
-
-
- {{ tz.tz }}
-
-
-
-
-
-
-
- {{ "HoursPage.YouAreCurrentlyAt" | translate }} (UTC
- {{ timezoneUTCOffsetForTooltip}}) {{timezoneNameForTooltip}}
-
-
- {{ "HoursPage.SetProjectToYourTimeZone" | translate }}
-
- {{ "HoursPage.TheProjectIsAlreadySettedOnYourTZ" | translate }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ "Save" | translate }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ "HoursPage.Processing" | translate }}
-
-
-
-
-
-
-
done
-
- {{ "HoursPage.Completed" | translate }}
-
-
-
- {{ "HoursPage.OperatingHoursSuccessfullyUpdated" | translate }}
-
-
-
-
-
-
-
report_problem
-
-
- {{ "Error" | translate }}
-
-
-
- {{ "HoursPage.AnErrorHasOccurred" | translate }} {{ "HoursPage.ErrorSelectTheProjectTimezone" | translate }}
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/app/integrations/integrations.component.ts b/src/app/integrations/integrations.component.ts
index ad9469ef08c5..e019aaf7f007 100644
--- a/src/app/integrations/integrations.component.ts
+++ b/src/app/integrations/integrations.component.ts
@@ -14,6 +14,7 @@ import { ProjectPlanService } from 'app/services/project-plan.service';
import { PLAN_NAME } from 'app/utils/util';
import { AppStoreService } from 'app/services/app-store.service';
import { environment } from 'environments/environment';
+import { ProjectUser } from 'app/models/project-user';
const swal = require('sweetalert');
@@ -168,21 +169,17 @@ export class IntegrationsComponent implements OnInit, OnDestroy {
}
getProjectUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((user_role) => {
- if (user_role) {
- this.USER_ROLE = user_role
- if (user_role === 'agent') {
- this.ROLE_IS_AGENT = true;
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if (projectUser) {
+ this.USER_ROLE = projectUser.role
+ if (this.USER_ROLE === 'agent') {
+ this.ROLE_IS_AGENT = true;
- } else {
- this.ROLE_IS_AGENT = false;
- }
+ } else {
+ this.ROLE_IS_AGENT = false;
}
- });
+ }
+ });
}
/**
@@ -818,7 +815,6 @@ export class IntegrationsComponent implements OnInit, OnDestroy {
if (index != -1) { this.INTEGRATIONS.splice(index, 1) };
}
-
let index = this.INTEGRATIONS.findIndex(i => i.category === INTEGRATIONS_CATEGORIES.CHANNEL);
if (index === -1) {
let idx = this.CATEGORIES.findIndex(c => c.type === INTEGRATIONS_CATEGORIES.CHANNEL);
diff --git a/src/app/knowledge-bases/knowledge-bases-alert/knowledge-bases-alert.component.ts b/src/app/knowledge-bases/knowledge-bases-alert/knowledge-bases-alert.component.ts
index fcec682ae73f..8f37d5047326 100644
--- a/src/app/knowledge-bases/knowledge-bases-alert/knowledge-bases-alert.component.ts
+++ b/src/app/knowledge-bases/knowledge-bases-alert/knowledge-bases-alert.component.ts
@@ -11,6 +11,7 @@ import { Project } from 'app/models/project-model';
import { UsersService } from 'app/services/users.service';
import { KnowledgeBaseService } from 'app/services/knowledge-base.service';
import { TranslateService } from '@ngx-translate/core';
+import { ProjectUser } from 'app/models/project-user';
@Component({
selector: 'appdashboard-knowledge-bases-alert',
@@ -69,9 +70,11 @@ export class KnowledgeBasesAlertComponent extends PricingBaseComponent implemen
}
getProjectUserRole() {
- this.usersService.project_user_role_bs.subscribe((user_role) => {
- this.USER_ROLE = user_role
- this.logger.log('[KB-ALERT] - GET PROJECT USER ROLE - USER_ROLE : ', this.USER_ROLE)
+ this.usersService.projectUser_bs.subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.USER_ROLE = projectUser.role
+ this.logger.log('[KB-ALERT] - GET PROJECT USER ROLE - USER_ROLE : ', this.USER_ROLE)
+ }
})
}
diff --git a/src/app/knowledge-bases/knowledge-bases.component.scss b/src/app/knowledge-bases/knowledge-bases.component.scss
index 39bb6962b524..9e9d8b5ea663 100644
--- a/src/app/knowledge-bases/knowledge-bases.component.scss
+++ b/src/app/knowledge-bases/knowledge-bases.component.scss
@@ -34,7 +34,7 @@
}
}
-.header-first-column{
+.header-first-column {
display: flex;
flex-direction: column;
}
@@ -547,7 +547,7 @@ table {
padding-top: 8px !important;
padding-bottom: 8px !important;
color: #fff !important;
- }
+}
.show-hide-button {
cursor: pointer;
@@ -801,33 +801,33 @@ table {
.cbPopover-cbname {
font-weight: 600;
}
- }
+}
- .overlay-backdrop {
- background: #191d2285;
- }
+.overlay-backdrop {
+ background: #191d2285;
+}
.kb-container-wpr {
width: 100%;
}
- .widget-set-up-col {
+.widget-set-up-col {
// background-color: rgb(241, 241, 241);
margin-top: -15px;
padding: 20px 20px 10px 36px;
// margin-bottom: 24px;
// margin-left: 32px;
- }
-
- .widget-set-up-text {
+}
+
+.widget-set-up-text {
font-size: 22px;
font-weight: 600;
margin-bottom: 6px;
line-height: 32px;
- }
-
- .widget-set-up-link-to-docs-wpr {
+}
+
+.widget-set-up-link-to-docs-wpr {
font-size: 14px;
font-weight: 400;
margin-bottom: 6px;
@@ -835,17 +835,17 @@ table {
background-color: rgb(241, 241, 241);
padding: 15px;
width: 100%;
- }
-
- .widget-set-up-link-to-docs {
+}
+
+.widget-set-up-link-to-docs {
margin-left: 8px;
vertical-align: middle;
color: #0f62ff;
font-size: 14px;
font-weight: 400;
cursor: pointer;
- }
-
- .widget-set-up-link-to-docs:hover {
+}
+
+.widget-set-up-link-to-docs:hover {
text-decoration: underline;
- }
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/src/app/knowledge-bases/knowledge-bases.component.ts b/src/app/knowledge-bases/knowledge-bases.component.ts
index f23f7595c0bc..0b3850405cdd 100644
--- a/src/app/knowledge-bases/knowledge-bases.component.ts
+++ b/src/app/knowledge-bases/knowledge-bases.component.ts
@@ -43,6 +43,7 @@ import { getSteps as defaultSteps, defaultStepOptions } from './knowledge-bases.
import Step from 'shepherd.js/src/types/step';
import { ModalFaqsComponent } from './modals/modal-faqs/modal-faqs.component';
+import { ProjectUser } from 'app/models/project-user';
// import {
// // provideHighlightOptions,
// Highlight,
@@ -1437,7 +1438,7 @@ export class KnowledgeBasesComponent extends PricingBaseComponent implements OnI
width: '600px',
});
dialogRef.afterClosed().subscribe(body => {
- this.logger.log('[Modal Add URLS AFTER CLOSED] Dialog body: ', body);
+ console.log('[Modal Add URLS AFTER CLOSED] Dialog body: ', body);
if (body) {
this.onAddMultiKb(body)
}
@@ -1454,7 +1455,7 @@ export class KnowledgeBasesComponent extends PricingBaseComponent implements OnI
});
dialogRef.afterClosed().subscribe(body => {
- this.logger.log('[Modal IMPORT SITEMAP AFTER CLOSED] body: ', body);
+ console.log('[Modal IMPORT SITEMAP AFTER CLOSED] body: ', body);
if (body) {
this.onAddMultiKb(body)
}
@@ -1481,17 +1482,12 @@ export class KnowledgeBasesComponent extends PricingBaseComponent implements OnI
}
getProjectUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((user_role) => {
- this.logger.log('[PRJCT-EDIT-ADD] - USER ROLE ', user_role);
- if (user_role) {
- this.USER_ROLE = user_role
-
- }
- });
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ this.logger.log('[PRJCT-EDIT-ADD] - USER ROLE ', projectUser);
+ if (projectUser) {
+ this.USER_ROLE = projectUser.role
+ }
+ });
}
diff --git a/src/app/knowledge-bases/modals/knowledge-base-table/knowledge-base-table.component.html b/src/app/knowledge-bases/modals/knowledge-base-table/knowledge-base-table.component.html
index 396f2f45f131..1c1c1996fea4 100644
--- a/src/app/knowledge-bases/modals/knowledge-base-table/knowledge-base-table.component.html
+++ b/src/app/knowledge-bases/modals/knowledge-base-table/knowledge-base-table.component.html
@@ -276,7 +276,7 @@
- {{ kb.createdAt | amTimeAgo }}
+ {{ kb.updatedAt | amTimeAgo }}
diff --git a/src/app/ws_requests/for-panel/ws-requests-unserved-for-panel/ws-requests-unserved-for-panel.component.ts b/src/app/ws_requests/for-panel/ws-requests-unserved-for-panel/ws-requests-unserved-for-panel.component.ts
index 635d1791fb73..ef4d632a2d68 100755
--- a/src/app/ws_requests/for-panel/ws-requests-unserved-for-panel/ws-requests-unserved-for-panel.component.ts
+++ b/src/app/ws_requests/for-panel/ws-requests-unserved-for-panel/ws-requests-unserved-for-panel.component.ts
@@ -28,6 +28,7 @@ const swal = require('sweetalert');
import { ContactsService } from '../../../services/contacts.service';
import { LoggerService } from '../../../services/logger/logger.service';
import { WebSocketJs } from 'app/services/websocket/websocket-js';
+import { ProjectUser } from 'app/models/project-user';
@Component({
selector: 'appdashboard-ws-requests-unserved-for-panel',
@@ -202,14 +203,12 @@ export class WsRequestsUnservedForPanelComponent extends WsSharedComponent imple
getUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((userRole) => {
- this.logger.log('[WS-REQUESTS-UNSERVED-X-PANEL] - SUBSCRIPTION TO USER ROLE »»» ', userRole)
- this.USER_ROLE = userRole;
- })
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.logger.log('[WS-REQUESTS-UNSERVED-X-PANEL] - SUBSCRIPTION TO USER ROLE »»» ', projectUser)
+ this.USER_ROLE = projectUser.role;
+ }
+ })
}
// ------------------------------------------
@@ -438,29 +437,24 @@ export class WsRequestsUnservedForPanelComponent extends WsSharedComponent imple
}
getProjectUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((user_role) => {
- this.logger.log('[WS-REQUESTS-UNSERVED-X-PANEL] - GET PROJECT-USER ROLE user_role ', user_role);
-
- this.ONLY_MY_REQUESTS = true
- this.getWsRequests$();
- // if (user_role) {
- // if (user_role === 'agent') {
- // this.ROLE_IS_AGENT = true
- // // this.displayBtnLabelSeeYourRequets = true
- // // ------
- // this.ONLY_MY_REQUESTS = true
- // this.getWsRequests$();
- // } else {
- // this.ROLE_IS_AGENT = false
- // // this.displayBtnLabelSeeYourRequets = false;
- // this.getWsRequests$();
- // }
- // }
- });
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ this.logger.log('[WS-REQUESTS-UNSERVED-X-PANEL] - GET PROJECT-USER ROLE user_role ', projectUser);
+ this.ONLY_MY_REQUESTS = true
+ this.getWsRequests$();
+ // if (user_role) {
+ // if (user_role === 'agent') {
+ // this.ROLE_IS_AGENT = true
+ // // this.displayBtnLabelSeeYourRequets = true
+ // // ------
+ // this.ONLY_MY_REQUESTS = true
+ // this.getWsRequests$();
+ // } else {
+ // this.ROLE_IS_AGENT = false
+ // // this.displayBtnLabelSeeYourRequets = false;
+ // this.getWsRequests$();
+ // }
+ // }
+ });
}
diff --git a/src/app/ws_requests/history-and-nort-convs/history-and-nort-convs.component.html b/src/app/ws_requests/history-and-nort-convs/history-and-nort-convs.component.html
index 253522ca920a..c4e6e4f31a20 100755
--- a/src/app/ws_requests/history-and-nort-convs/history-and-nort-convs.component.html
+++ b/src/app/ws_requests/history-and-nort-convs/history-and-nort-convs.component.html
@@ -659,12 +659,12 @@
@@ -1575,6 +1575,7 @@
+
@@ -1588,6 +1589,7 @@
+
diff --git a/src/app/ws_requests/history-and-nort-convs/history-and-nort-convs.component.ts b/src/app/ws_requests/history-and-nort-convs/history-and-nort-convs.component.ts
index 4cd46d8d2342..4738eb323fc5 100755
--- a/src/app/ws_requests/history-and-nort-convs/history-and-nort-convs.component.ts
+++ b/src/app/ws_requests/history-and-nort-convs/history-and-nort-convs.component.ts
@@ -32,6 +32,7 @@ import { WsMsgsService } from 'app/services/websocket/ws-msgs.service';
import { FormGroup, FormControl } from '@angular/forms';
import { MAT_DATE_FORMATS } from '@angular/material/core';
import { BrandService } from 'app/services/brand.service';
+import { ProjectUser } from 'app/models/project-user';
export const MY_DATE_FORMATS = {
parse: {
@@ -401,28 +402,6 @@ export class HistoryAndNortConvsComponent extends WsSharedComponent implements O
}
- getProjectUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((user_role) => {
- this.logger.log('[HISTORY & NORT-CONVS] - USER ROLE ', user_role);
- if (user_role) {
- this.USER_ROLE = user_role
- this.manageStatusInHistoryForAgentAndExpiredPlan(this.USER_ROLE)
- }
- if (user_role) {
- if (user_role === 'agent') {
- this.ROLE_IS_AGENT = true
-
- } else {
- this.ROLE_IS_AGENT = false
- }
- }
- });
- }
-
manageStatusInHistoryForAgentAndExpiredPlan(USER_ROLE) {
this.logger.log('[HISTORY & NORT-CONVS] manageStatusInHistoryForAgentAndExpiredPlan statusInHistory', this.statusInHistory)
if (USER_ROLE === 'agent') {
@@ -1605,7 +1584,20 @@ export class HistoryAndNortConvsComponent extends WsSharedComponent implements O
this.logger.log('[HISTORY & NORT-CONVS] - detectMobile IS MOBILE ', this.isMobile);
}
-
+ getProjectUserRole() {
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ this.logger.log('[HISTORY & NORT-CONVS] - USER ROLE ', projectUser);
+ if (projectUser) {
+ this.USER_ROLE = projectUser.role
+ this.manageStatusInHistoryForAgentAndExpiredPlan(this.USER_ROLE)
+ if (this.USER_ROLE === 'agent') {
+ this.ROLE_IS_AGENT = true
+ } else {
+ this.ROLE_IS_AGENT = false
+ }
+ }
+ });
+ }
// requestWillBePermanentlyDeleted
@@ -2527,7 +2519,8 @@ export class HistoryAndNortConvsComponent extends WsSharedComponent implements O
// this.conversationTypeValue = '';
// }
-
+
+
if (this.requester_email) {
this.emailValue = this.requester_email;
@@ -2952,12 +2945,12 @@ export class HistoryAndNortConvsComponent extends WsSharedComponent implements O
// SERVED_BY: add this if not exist -->
getProjectuserbyUseridAndGoToEditProjectuser(member_id: string) {
this.usersService.getProjectUserByUserId(member_id)
- .subscribe((projectUser: any) => {
+ .subscribe((projectUser: ProjectUser) => {
this.logger.log('[HISTORY & NORT-CONVS] GET projectUser by USER-ID ', projectUser)
if (projectUser) {
- this.logger.log('[HISTORY & NORT-CONVS] GET projectUser by USER-ID > projectUser id', projectUser[0]._id);
+ this.logger.log('[HISTORY & NORT-CONVS] GET projectUser by USER-ID > projectUser id', projectUser._id);
- this.router.navigate(['project/' + this.projectId + '/user/edit/' + projectUser[0]._id]);
+ this.router.navigate(['project/' + this.projectId + '/user/edit/' + projectUser._id]);
}
}, (error) => {
this.logger.error('[HISTORY & NORT-CONVS] GET projectUser by USER-ID - ERROR ', error);
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 e12724e03e64..4f20ec88bab4 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
@@ -541,15 +541,11 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit
getProjectUserRole() {
// this.logger.log('[WS-REQUESTS-LIST] - GET PROJECT-USER ROLE calling getProjectUserRole ');
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((user_role) => {
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
// this.logger.log('[WS-REQUESTS-LIST] - GET PROJECT-USER ROLE user_role ', user_role);
- if (user_role) {
- this.CURRENT_USER_ROLE = user_role;
- if (user_role === 'agent') {
+ if (projectUser) {
+ this.CURRENT_USER_ROLE = projectUser.role;
+ if (this.CURRENT_USER_ROLE === 'agent') {
this.ROLE_IS_AGENT = true
this.displayBtnLabelSeeYourRequets = true
diff --git a/src/app/ws_requests/ws-requests-list/ws-requests-served/ws-requests-served.component.html b/src/app/ws_requests/ws-requests-list/ws-requests-served/ws-requests-served.component.html
index e60298989280..a299dcbd08fe 100755
--- a/src/app/ws_requests/ws-requests-list/ws-requests-served/ws-requests-served.component.html
+++ b/src/app/ws_requests/ws-requests-list/ws-requests-served/ws-requests-served.component.html
@@ -541,6 +541,21 @@
+
+
+
+
+
+
+
+ {{'MessageChannel' | translate}}:
+
+ SMS
+
+
+
+
diff --git a/src/app/ws_requests/ws-requests-list/ws-requests-served/ws-requests-served.component.ts b/src/app/ws_requests/ws-requests-list/ws-requests-served/ws-requests-served.component.ts
index d87e33225107..1d1726ea819f 100755
--- a/src/app/ws_requests/ws-requests-list/ws-requests-served/ws-requests-served.component.ts
+++ b/src/app/ws_requests/ws-requests-list/ws-requests-served/ws-requests-served.component.ts
@@ -25,6 +25,7 @@ import { MatMenuTrigger } from '@angular/material/menu';
const swal = require('sweetalert');
import scrollToWithAnimation from 'scrollto-with-animation'
+import { ProjectUser } from 'app/models/project-user';
@Component({
selector: 'appdashboard-ws-requests-served',
@@ -405,15 +406,11 @@ export class WsRequestsServedComponent extends WsSharedComponent implements OnIn
// @ Subscribe to project user role
// -------------------------------------------------------------
getProjectUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((user_role) => {
- this.logger.log('[WS-REQUESTS-LIST][SERVED] GET PROJECT-USER ROLE ', user_role);
- if (user_role) {
- this.USER_ROLE = user_role;
- if (user_role === 'agent') {
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ this.logger.log('[WS-REQUESTS-LIST][SERVED] GET PROJECT-USER ROLE ', projectUser);
+ if (projectUser) {
+ this.USER_ROLE = projectUser.role;
+ if (this.USER_ROLE === 'agent') {
this.ROLE_IS_AGENT = true
} else {
this.ROLE_IS_AGENT = false
@@ -616,12 +613,12 @@ export class WsRequestsServedComponent extends WsSharedComponent implements OnIn
// SERVED_BY: add this if not exist -->
getProjectuserbyUseridAndGoToEditProjectuser(member_id: string) {
this.usersService.getProjectUserByUserId(member_id)
- .subscribe((projectUser: any) => {
+ .subscribe((projectUser: ProjectUser) => {
this.logger.log('[WS-REQUESTS-LIST][SERVED] GET PROJECT-USER-BY-USER-ID & GO TO EDIT PROJECT-USER - projectUser ', projectUser)
if (projectUser) {
- this.logger.log('[WS-REQUESTS-LIST][SERVED] GET PROJECT-USER-BY-USER-ID & GO TO EDIT PROJECT-USER - projectUser id', projectUser[0]._id);
+ this.logger.log('[WS-REQUESTS-LIST][SERVED] GET PROJECT-USER-BY-USER-ID & GO TO EDIT PROJECT-USER - projectUser id', projectUser._id);
- this.router.navigate(['project/' + this.projectId + '/user/edit/' + projectUser[0]._id]);
+ this.router.navigate(['project/' + this.projectId + '/user/edit/' + projectUser._id]);
}
}, (error) => {
this.logger.error('[WS-REQUESTS-LIST][SERVED] GET PROJECT-USER-BY-USER-ID & GO TO EDIT PROJECT-USER - ERROR ', error);
@@ -879,7 +876,7 @@ export class WsRequestsServedComponent extends WsSharedComponent implements OnIn
_getProjectUserByUserId(member_id) {
this.usersService.getProjectUserByUserId(member_id)
- .subscribe((projectUser: any) => {
+ .subscribe((projectUser: ProjectUser) => {
this.logger.log('[WS-REQUESTS-LIST][SERVED] GET projectUser by USER-ID ', projectUser)
if (projectUser) {
this.logger.log('WS-REQUESTS-LIST][SERVED] GET projectUser by USER-ID projectUser id', projectUser);
diff --git a/src/app/ws_requests/ws-requests-list/ws-requests-unserved/ws-requests-unserved.component.html b/src/app/ws_requests/ws-requests-list/ws-requests-unserved/ws-requests-unserved.component.html
index a8a632f84f88..440606c08949 100755
--- a/src/app/ws_requests/ws-requests-list/ws-requests-unserved/ws-requests-unserved.component.html
+++ b/src/app/ws_requests/ws-requests-list/ws-requests-unserved/ws-requests-unserved.component.html
@@ -787,8 +787,8 @@
{{ request?.requester_fullname_initial }}
-
-
+
+
diff --git a/src/app/ws_requests/ws-requests-list/ws-requests-unserved/ws-requests-unserved.component.ts b/src/app/ws_requests/ws-requests-list/ws-requests-unserved/ws-requests-unserved.component.ts
index 14fe8e13f46d..369e90a56849 100755
--- a/src/app/ws_requests/ws-requests-list/ws-requests-unserved/ws-requests-unserved.component.ts
+++ b/src/app/ws_requests/ws-requests-list/ws-requests-unserved/ws-requests-unserved.component.ts
@@ -20,6 +20,7 @@ import { LoggerService } from '../../../services/logger/logger.service';
import { WsMsgsService } from 'app/services/websocket/ws-msgs.service';
import scrollToWithAnimation from 'scrollto-with-animation'
import { CHANNELS_NAME } from 'app/utils/util';
+import { ProjectUser } from 'app/models/project-user';
const swal = require('sweetalert');
const Swal = require('sweetalert2')
@@ -272,15 +273,11 @@ export class WsRequestsUnservedComponent extends WsSharedComponent implements On
// @ Subscribe to project user role
// -------------------------------------------------------------
getProjectUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((user_role) => {
- this.logger.log('[WS-REQUESTS-LIST][UNSERVED] GET PROJECT-USER ROLE ', user_role);
- if (user_role) {
- this.USER_ROLE = user_role;
- if (user_role === 'agent') {
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ this.logger.log('[WS-REQUESTS-LIST][UNSERVED] GET PROJECT-USER ROLE ', projectUser);
+ if (projectUser) {
+ this.USER_ROLE = projectUser.role;
+ if (this.USER_ROLE === 'agent') {
this.ROLE_IS_AGENT = true
} else {
this.ROLE_IS_AGENT = false
diff --git a/src/app/ws_requests/ws-requests-msgs/ws-requests-msgs.component.scss b/src/app/ws_requests/ws-requests-msgs/ws-requests-msgs.component.scss
index 72725375c3fc..364c094d5190 100755
--- a/src/app/ws_requests/ws-requests-msgs/ws-requests-msgs.component.scss
+++ b/src/app/ws_requests/ws-requests-msgs/ws-requests-msgs.component.scss
@@ -4846,6 +4846,7 @@ label {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: var(--no-tags-line-clamp);
+ line-clamp: var(--no-tags-line-clamp);
display: -webkit-box;
-webkit-box-orient: vertical;
font-family: var(--content-font-family);
@@ -5677,6 +5678,10 @@ label {
letter-spacing: -0.01em;
}
+.mat-tab-group-on-panel {
+ margin-top: 5px;
+}
+
::ng-deep .mat-tab-group.mat-primary .mat-ink-bar,.mat-tab-nav-bar.mat-primary .mat-ink-bar {
background-color: #0566ff;
}
diff --git a/src/app/ws_requests/ws-requests-msgs/ws-requests-msgs.component.ts b/src/app/ws_requests/ws-requests-msgs/ws-requests-msgs.component.ts
index fae9dd2832e3..610071c7a1f9 100755
--- a/src/app/ws_requests/ws-requests-msgs/ws-requests-msgs.component.ts
+++ b/src/app/ws_requests/ws-requests-msgs/ws-requests-msgs.component.ts
@@ -45,6 +45,7 @@ import { ModalChatbotNameComponent } from 'app/knowledge-bases/modals/modal-chat
import { ModalChatbotReassignmentComponent } from './modal-chatbot-reassignment/modal-chatbot-reassignment.component';
import { FaqService } from 'app/services/faq.service';
import { Chatbot } from 'app/models/faq_kb-model';
+import { ProjectUser } from 'app/models/project-user';
const swal = require('sweetalert');
const Swal = require('sweetalert2')
@@ -62,7 +63,6 @@ export class WsRequestsMsgsComponent extends WsSharedComponent implements OnInit
featureAvailableFromBPlan: string;
featureAvailableFromEPlan: string;
upgradePlan: string;
- currentUserIsInParticipants: any
objectKeys = Object.keys;
isVisiblePaymentTab: boolean;
@@ -212,7 +212,7 @@ export class WsRequestsMsgsComponent extends WsSharedComponent implements OnInit
showSpinnerInAddNoteBtn: boolean = false;
subscription: Subscription;
- CURRENT_USER_ROLE: any;
+ CURRENT_USER_ROLE: string;
CHAT_PANEL_MODE: boolean // = true; // Nikola for test change color
dshbrdBaseUrl: string;
@@ -1308,7 +1308,7 @@ export class WsRequestsMsgsComponent extends WsSharedComponent implements OnInit
this.overridePay = false;
}
-
+
}
// -------------------------------------------------------------
@@ -1329,14 +1329,12 @@ export class WsRequestsMsgsComponent extends WsSharedComponent implements OnInit
// @ Subscribe to project user role
// -------------------------------------------------------------
getProjectUserRole() {
- this.usersService.project_user_role_bs
- .pipe(
- takeUntil(this.unsubscribe$)
- )
- .subscribe((userRole) => {
- this.logger.log('[WS-REQUESTS-MSGS] - GET CURRENT PTOJECT-USER ROLE - userRole ', userRole)
- // used to display / hide 'WIDGET' and 'ANALITCS' in home.component.html
- this.CURRENT_USER_ROLE = userRole;
+ this.usersService.projectUser_bs.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser: ProjectUser) => {
+ if(projectUser){
+ this.logger.log('[WS-REQUESTS-MSGS] - GET CURRENT PTOJECT-USER ROLE - userRole ', projectUser)
+ // used to display / hide 'WIDGET' and 'ANALITCS' in home.component.html
+ this.CURRENT_USER_ROLE = projectUser.role;
+ }
})
}
@@ -1693,26 +1691,23 @@ export class WsRequestsMsgsComponent extends WsSharedComponent implements OnInit
else if (+hours < 24) return hours + " " + this.translate.instant('Analytics.Hours');
else return days + " " + this.translate.instant('Analytics.Days');
- }
-
+ }
- async getWsRequestById$() {
+ getWsRequestById$() {
this.wsRequestsService.wsRequest$
.pipe(
takeUntil(this.unsubscribe$)
)
- .subscribe(async (wsrequest) => {
+ .subscribe(async(wsrequest) => {
this.logger.log('[WS-REQUESTS-MSGS] - getWsRequestById$ *** wsrequest *** NIKO 2 ', wsrequest)
this.request = wsrequest;
-
+
if (this.request) {
this.getfromStorageIsOpenAppSidebar()
- // this.currentUserIdIsInParticipants this.hasmeInParticipants( this.request.participants)
-
// -----------------------------
// Request dnis (called number)
// -----------------------------
@@ -1786,12 +1781,12 @@ export class WsRequestsMsgsComponent extends WsSharedComponent implements OnInit
this.logger.log('[WS-REQUESTS-MSGS] request > closed_by label ', this.request['closed_by_label'])
} else {
this.usersService.getProjectUserByUserId(this.request['closed_by'])
- .subscribe((projectUser: any) => {
+ .subscribe((projectUser: ProjectUser) => {
// this.logger.log('projectUser ', projectUser)
- if (projectUser && projectUser[0] && projectUser[0].id_user) {
- this.usersLocalDbService.saveMembersInStorage(projectUser[0].id_user._id, projectUser[0].id_user, 'ws-requests-msgs');
+ if (projectUser && projectUser.id_user) {
+ this.usersLocalDbService.saveMembersInStorage(projectUser.id_user._id, projectUser.id_user, 'ws-requests-msgs');
this.logger.log('WS-REQUESTS-MSGS] GET projectUser by USER-ID projectUser id', projectUser);
- this.request['closed_by_label'] = this.translate.instant('By') + ' ' + projectUser[0].id_user.firstname + ' ' + projectUser[0].id_user.lastname
+ this.request['closed_by_label'] = this.translate.instant('By') + ' ' + projectUser.id_user.firstname + ' ' + projectUser.id_user.lastname
} else {
// this.logger.log('[WS-REQUESTS-MSGS] THE REQUEST HAS NOT BEEN CLOSED BY A PROJECT USER');
this.request['closed_by_label'] = this.translate.instant('By') + ' ' + this.request.requester_fullname
@@ -1893,7 +1888,6 @@ export class WsRequestsMsgsComponent extends WsSharedComponent implements OnInit
// User Agent
// -------------------------------------------------------------------
const user_agent_result = this.parseUserAgent(this.request.userAgent);
- // console.log('user_agent_result ', user_agent_result)
if (user_agent_result.browser.name) {
if (user_agent_result.browser.version) {
@@ -1926,41 +1920,29 @@ export class WsRequestsMsgsComponent extends WsSharedComponent implements OnInit
// Members array
// -------------------------------------------------------------------
this.members_array = this.request.participants;
- this.logger.log('[WS-REQUESTS-MSGS] - *** PARTICIPANTS_ARRAY ', this.members_array)
- this.logger.log('[WS-REQUESTS-MSGS] - *** currentUserID ', this.currentUserID)
- this.logger.log('[WS-REQUESTS-MSGS] - *** CURRENT_USER_ROLE ', this.CURRENT_USER_ROLE);
- this.logger.log('[WS-REQUESTS-MSGS] - *** id_project ', this.request.id_project);
+ this.logger.log('[WS-REQUESTS-MSGS] - getWsRequestById PARTICIPANTS_ARRAY ', this.members_array)
-
-
- // if (!this.CURRENT_USER_ROLE) {
- // this.CURRENT_USER_ROLE = await this.getProjectUserInProject(this.currentUserID, this.request.id_project)
- // this.logger.log('[WS-REQUESTS-MSGS] - *** CURRENT_USER_ROLE 2 ', this.CURRENT_USER_ROLE);
- // }
if(!this.CURRENT_USER_ROLE) {
this.CURRENT_USER_ROLE = await this.getProjectUserInProject(this.currentUserID, this.request.id_project)
this.logger.log('[WS-REQUESTS-MSGS] - *** CURRENT_USER_ROLE 2 ', this.CURRENT_USER_ROLE);
}
this.members_array.forEach(member => {
- this.logger.log('[WS-REQUESTS-MSGS] - *** member', member)
// ----------------------------------------------------------------------------------------------
// disable notes and tags if the current user has agent role and is not among the participants
// ----------------------------------------------------------------------------------------------
+ this.logger.log('[WS-REQUESTS-MSGS] - getWsRequestById CURRENT_USER_ROLE ', this.CURRENT_USER_ROLE);
+ this.logger.log('[WS-REQUESTS-MSGS] - getWsRequestById CURRENT_USER_ID ', this.currentUserID);
- this.logger.log('[WS-REQUESTS-MSGS] - *** CURRENT_USER_ID ', this.currentUserID);
- this.logger.log('[WS-REQUESTS-MSGS] - *** CURRENT_USER_ROLE 3 ', this.CURRENT_USER_ROLE);
if (this.currentUserID !== member && this.CURRENT_USER_ROLE === 'agent') {
- this.logger.log('[WS-REQUESTS-MSGS] - *** CURRENT USER NOT IN PARTICIPANT AND IS AGENT currentUserID', this.currentUserID);
+ this.logger.log('[WS-REQUESTS-MSGS] - getWsRequestById CURRENT USER NOT IN PARTICIPANT AND IS AGENT');
this.DISABLE_ADD_NOTE_AND_TAGS = true;
- this.logger.log('[WS-REQUESTS-MSGS] - *** DISABLE_ADD_NOTE_AND_TAGS ', this.DISABLE_ADD_NOTE_AND_TAGS);
this.DISABLE_BTN_AGENT_NO_IN_PARTICIPANTS = true;
} else if (this.currentUserID === member && this.CURRENT_USER_ROLE === 'agent') {
- this.logger.log('[WS-REQUESTS-MSGS] - *** CURRENT USER IS IN PARTICIPANT AND IS AGENT');
+ this.logger.log('[WS-REQUESTS-MSGS] - getWsRequestById CURRENT USER IS IN PARTICIPANT AND IS AGENT');
this.DISABLE_ADD_NOTE_AND_TAGS = false;
- this.logger.log('[WS-REQUESTS-MSGS] - *** DISABLE_ADD_NOTE_AND_TAGS ', this.DISABLE_ADD_NOTE_AND_TAGS);
this.DISABLE_BTN_AGENT_NO_IN_PARTICIPANTS = false;
}
@@ -3034,24 +3016,24 @@ export class WsRequestsMsgsComponent extends WsSharedComponent implements OnInit
addNote() {
// this.disableMainPanelScroll();
if (this.DISABLE_ADD_NOTE_AND_TAGS === false) {
- this.showSpinnerInAddNoteBtn = true;
- this.wsRequestsService.createNote(this.new_note, this.id_request)
- .subscribe((responses: any) => {
- this.logger.log('[WS-REQUESTS-MSGS] - CREATE NOTE - RES ', responses);
- }, (error) => {
- this.logger.error('[WS-REQUESTS-MSGS] - CREATE NOTE - ERROR ', error);
- this.notify.showWidgetStyleUpdateNotification(this.translationMap.get('Notes.NotificationMsgs')['CreateNoteError'], 4, 'report_problem');
- this.showSpinnerInAddNoteBtn = false;
- }, () => {
- this.logger.error('[WS-REQUESTS-MSGS] - CREATE NOTE * COMPLETE *');
- this.new_note = ''
- // var panel = document.querySelector('.note-panel')
- // panel.scrollTop = panel.scrollHeight;
- // this.logger.log('% Ws-REQUESTS-Msgs - note-wf - CREATE NOTE * COMPLETE *');
+ this.showSpinnerInAddNoteBtn = true;
+ this.wsRequestsService.createNote(this.new_note, this.id_request)
+ .subscribe((responses: any) => {
+ this.logger.log('[WS-REQUESTS-MSGS] - CREATE NOTE - RES ', responses);
+ }, (error) => {
+ this.logger.error('[WS-REQUESTS-MSGS] - CREATE NOTE - ERROR ', error);
+ this.notify.showWidgetStyleUpdateNotification(this.translationMap.get('Notes.NotificationMsgs')['CreateNoteError'], 4, 'report_problem');
+ this.showSpinnerInAddNoteBtn = false;
+ }, () => {
+ this.logger.error('[WS-REQUESTS-MSGS] - CREATE NOTE * COMPLETE *');
+ this.new_note = ''
+ // var panel = document.querySelector('.note-panel')
+ // panel.scrollTop = panel.scrollHeight;
+ // this.logger.log('% Ws-REQUESTS-Msgs - note-wf - CREATE NOTE * COMPLETE *');
- this.notify.showWidgetStyleUpdateNotification(this.translationMap.get('Notes.NotificationMsgs')['CreateNoteSuccess'], 2, 'done');
- this.showSpinnerInAddNoteBtn = false;
- // this.enableMainPanelScroll()
+ this.notify.showWidgetStyleUpdateNotification(this.translationMap.get('Notes.NotificationMsgs')['CreateNoteSuccess'], 2, 'done');
+ this.showSpinnerInAddNoteBtn = false;
+ // this.enableMainPanelScroll()
});
}
@@ -5043,12 +5025,12 @@ export class WsRequestsMsgsComponent extends WsSharedComponent implements OnInit
getProjectuserbyUseridAndGoToEditProjectuser(member_id: string) {
- this.usersService.getProjectUserByUserId(member_id).subscribe((projectUser: any) => {
+ this.usersService.getProjectUserByUserId(member_id).subscribe((projectUser: ProjectUser) => {
this.logger.log('[WS-REQUESTS-MSGS] GET projectUser by USER-ID & GO TO EDIT PROJECT USER - projectUser', projectUser)
if (projectUser) {
- this.logger.log('[WS-REQUESTS-MSGS] GET projectUser by USER-ID & GO TO EDIT PROJECT USER - projectUser id', projectUser[0]._id);
+ this.logger.log('[WS-REQUESTS-MSGS] GET projectUser by USER-ID & GO TO EDIT PROJECT USER - projectUser id', projectUser._id);
- this.router.navigate(['project/' + this.id_project + '/user/edit/' + projectUser[0]._id]);
+ this.router.navigate(['project/' + this.id_project + '/user/edit/' + projectUser._id]);
}
}, (error) => {
this.logger.error('[WS-REQUESTS-MSGS] GET projectUser by USER-ID & GO TO EDIT PROJECT USER - ERROR ', error);
diff --git a/src/app/ws_requests/ws-shared/ws-shared.component.ts b/src/app/ws_requests/ws-shared/ws-shared.component.ts
index 1245e430d9f2..be611d2dedac 100755
--- a/src/app/ws_requests/ws-shared/ws-shared.component.ts
+++ b/src/app/ws_requests/ws-shared/ws-shared.component.ts
@@ -9,6 +9,7 @@ import { UsersService } from '../../services/users.service';
import { NotifyService } from '../../core/notify.service';
import { LoggerService } from '../../services/logger/logger.service';
import { TranslateService } from '@ngx-translate/core';
+import { ProjectUser } from 'app/models/project-user';
@Component({
selector: 'appdashboard-ws-shared',
@@ -608,7 +609,7 @@ export class WsSharedComponent implements OnInit {
_getProjectUserByUserId(member_id) {
this.usersService.getProjectUserByUserId(member_id)
- .subscribe((projectUser: any) => {
+ .subscribe((projectUser: ProjectUser) => {
this.logger.log('[WS-SHARED][WS-REQUESTS-LIST][SERVED] - GET projectUser by USER-ID ', projectUser)
if (projectUser) {
this.logger.log('[WS-SHARED][WS-REQUESTS-LIST][SERVED] - GET projectUser id', projectUser);