diff --git a/CHANGELOG.md b/CHANGELOG.md
index d72bd40e3afe..22a1b4f638d8 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,9 +1,9 @@
# tiledesk-dashboard
-### 2.7.33
-- Adds, on the History page, the ability to filter by conversation duration
+### 2.7.33-rc1
+- Adds, on the History page, the ability to filter by conversation duration
-### 2.7.32
+### 2.7.32-rc1
- Moves the menu item "Apps" from the sidebar to the setting sidebar
### 2.7.31
@@ -48,9 +48,15 @@
- Adds the ability to select the launch block when a conversation is manually assigned to a chatbot
- Improves the method to get the number of conversations in the monitor page
+### 2.7.19-rc1
+- Adds the ability to select the launch block when a conversation is manually assigned to a chatbot
+
### 2.7.18
- Minor improvements and bug fixing
+### 2.7.18-rc1
+- Improves the method to get the number of conversations in the monitor page
+
### 2.7.17
- Removes the ability to customize the quotas email template
- Implements the icons for the SMS channel
@@ -99,6 +105,9 @@
- Deploys in production
- Adds the knowledge base walkthrough on the knowledge base page
+### 2.7.7-rc1
+- Adds the knowledge base walkthrough on the knowledge base page
+
### 2.7.6
- Deploys in production
- Adds a warning banner to the home page that displays when the user has used up one or more of his monthly resources
@@ -110,10 +119,21 @@
### 2.7.4
- Added Time Slots in Operating Hours page
+### 2.7.4-rc1
+- Fix saving operation hours bug
+
### 2.7.3
- Adds the ability, during onboarding, to create a chatbot that automatically answers questions based on the contents of the Knowledge Base
- Improves the knowledge base page
+### 2.7.3-rc2
+- Adds the ability, during onboarding, to create a chatbot that automatically answers questions based on the contents of the Knowledge Base
+- Improves the knowledge base page
+- Improves time slots UI
+
+### 2.7.3-rc1
+- Kb onboarding
+
### 2.7.2
- Deploys in production
- Adds GPT-4o mini language model
@@ -127,24 +147,61 @@
- Adds the ability to edit the "Quota checkpoint notification" email template
- Adds Twilio SMS channel integration
+### 2.6.45-rc2
+- Improves time slots UI
+- Added translations for time slots
+
+### 2.6.45-rc1
+- Added time slots in Operating Hours
+
### 2.6.44
- Deploys in production
- Adds the option "Teammates can only see their own conversations" in the Project Settings > Advanced tab
- Improvements and bug fixing
+### 2.6.44-rc4
+- Improvements and bug fixing
+
+### 2.6.44-rc3
+- Adds the option "Teammates can only see their own conversations" in the Project Settings > Advanced tab
+
+### 2.6.44-rc2
+- Fix vxml voice integration visibility
+
+### 2.6.44-rc1
+- Added vxml voice integration
+- Added twilio sms integration
+
### 2.6.43
- Deploys in production
- Improves the quota usage widget
- Minor improvements
+### 2.6.43-rc2
+- Improves Knowledge Bases page
+
+### 2.6.43-rc1
+- Improves quotes widget
+- Added voice-vxml and sms-twilio channel in analytics
+
### 2.6.42
- Deploys in production
- Displays all the indexed chunks of a content on the "Manage your Knowledge Bases" page
+### 2.6.42-rc1
+- Displays all the indexed chunks of a content on the "Manage your Knowledge Bases" page
+
### 2.6.41
- Deploys in production
- Displays information about the Voice channel
+### 2.6.41-rc2
+- Adds the Voice Channel integration
+
+### 2.6.41-rc1
+- Deploys in production
+- Displays information about the Voice channel
+
### 2.6.40
- Deploys in production
- Displays a dialog box that allows to update the plan when the knowledge bases limit is reached
diff --git a/package-lock.json b/package-lock.json
index 7a65df162768..2ab0b0ddd71e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "@tiledesk/tiledesk-dashboard",
- "version": "2.7.33",
+ "version": "2.7.33-rc1",
"lockfileVersion": 1,
"requires": true,
"packages": {
@@ -16347,7 +16347,6 @@
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
- "deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true,
"dependencies": {
"fs.realpath": "^1.0.0",
@@ -16646,7 +16645,6 @@
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
- "deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true,
"dependencies": {
"fs.realpath": "^1.0.0",
@@ -16854,7 +16852,6 @@
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
- "deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true,
"dependencies": {
"fs.realpath": "^1.0.0",
diff --git a/package.json b/package.json
index 19057981eb23..7164c60a5811 100755
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@tiledesk/tiledesk-dashboard",
- "version": "2.7.33",
+ "version": "2.7.33-rc1",
"scripts": {
"ng": "ng",
"start": "ng serve --aot",
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index c4069b8e5f80..8ba1f69a0d8b 100755
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -397,6 +397,9 @@ import { UserModalComponent } from './users/user-modal/user-modal.component';
import { MessagesStatsModalComponent } from './components/modals/messages-stats-modal/messages-stats-modal.component';
import { WsChatbotService } from './services/websocket/ws-chatbot.service';
import { AnalyticsService } from './services/analytics.service';
+import { N8nIntegrationComponent } from './integrations/list/n8n-integration/n8n-integration.component';
+
+
import { KnowledgeBasesAlertComponent } from './knowledge-bases/knowledge-bases-alert/knowledge-bases-alert.component';
import { LogRequestsInterceptor } from './services/interceptor/log-requests.interceptor';
import { CnpSelectTemplatesOrKbComponent } from './create-new-project/cnp-select-templates-or-kb/cnp-select-templates-or-kb.component';
diff --git a/src/app/auth/autologin/autologin.component.ts b/src/app/auth/autologin/autologin.component.ts
index df34a2fc764b..ae2a9d072403 100755
--- a/src/app/auth/autologin/autologin.component.ts
+++ b/src/app/auth/autologin/autologin.component.ts
@@ -168,11 +168,11 @@ export class AutologinComponent implements OnInit {
this.logger.log('[AUTOLOGIN] SSO - ssoLogin routeSegments ', routeSegments);
const projectIDGetFromRoute = routeSegments[2]
-
+
this.logger.log('[AUTOLOGIN] SSO - ssoLogin projectIDGetFromRoute ', projectIDGetFromRoute);
-
+
this.getProject(projectIDGetFromRoute)
-
+
this.router.navigate([route]);
@@ -205,6 +205,7 @@ export class AutologinComponent implements OnInit {
}
+
}, () => {
this.logger.log('[AUTOLOGIN] SSO - ssoLogin getCurrentAuthenticatedUser * COMPLETE *');
@@ -222,7 +223,7 @@ export class AutologinComponent implements OnInit {
});
}
-
+
getProject(projectIDGetFromRouteIsNumber) {
@@ -240,7 +241,7 @@ export class AutologinComponent implements OnInit {
})
}
-
+
diff --git a/src/app/components/navbar/navbar.component.html b/src/app/components/navbar/navbar.component.html
index b0e44568251a..5e1b042c8358 100755
--- a/src/app/components/navbar/navbar.component.html
+++ b/src/app/components/navbar/navbar.component.html
@@ -80,26 +80,11 @@
-
-
-
-
-
-
-
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 50829cfd5d26..cd0e47e7fc8e 100755
--- a/src/app/components/navbar/navbar.component.ts
+++ b/src/app/components/navbar/navbar.component.ts
@@ -355,7 +355,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);
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/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/hours/old_hours.component.ts b/src/app/hours/old_hours.component.ts
deleted file mode 100755
index 460e9d52ee29..000000000000
--- a/src/app/hours/old_hours.component.ts
+++ /dev/null
@@ -1,876 +0,0 @@
-import { Component, OnInit, ViewEncapsulation, OnDestroy, ViewChild } from '@angular/core';
-import { AuthService } from '../core/auth.service';
-
-import { ProjectService } from '../services/project.service';
-import { UsersService } from '../services/users.service';
-
-// import { AmazingTimePickerService } from 'amazing-time-picker';
-import { TranslateService } from '@ngx-translate/core';
-
-// import * as moment from 'moment';
-import * as moment from 'moment-timezone'
-import { NotifyService } from '../core/notify.service';
-
-import { Router } from '@angular/router';
-import { Project } from '../models/project-model';
-import { AppConfigService } from '../services/app-config.service';
-import { LoggerService } from '../services/logger/logger.service';
-import { FormControl } from "@angular/forms";
-import { MatDialog, MatDialogRef } from '@angular/material/dialog';
-import { NewSlotModalComponent } from './modals/new-slot-modal/new-slot-modal.component';
-import { v4 as uuidv4 } from 'uuid';
-
-@Component({
- selector: 'appdashboard-hours',
- templateUrl: './old_hours.component.html',
- styleUrls: ['./hours.component.scss'],
- encapsulation: ViewEncapsulation.None
-})
-
-
-export class HoursComponent implements OnInit, OnDestroy {
-
- // time picker
- formControlItem: FormControl = new FormControl("");
- required: boolean = !1;
- @ViewChild("timepicker") timepicker: any;
-
-
-
- activeOperatingHours: boolean;
- operatingHours: any;
-
- public days = [
- // tslint:disable-next-line:max-line-length
- {
- _id: '0',
- weekday: 'Sunday',
- isOpen: false,
- isOpenPm: true,
- operatingHours: '',
- operatingHoursAmStart: '',
- operatingHoursAmEnd: '',
- operatingHoursPmStart: '',
- operatingHoursPmEnd: ''
- },
- // tslint:disable-next-line:max-line-length
- {
- _id: '1',
- weekday: 'Monday',
- isOpen: false,
- isOpenPm: true,
- operatingHours: '',
- operatingHoursAmStart: '',
- operatingHoursAmEnd: '',
- operatingHoursPmStart: '',
- operatingHoursPmEnd: ''
- },
- // tslint:disable-next-line:max-line-length
- {
- _id: '2',
- weekday: 'Tuesday',
- isOpen: false,
- isOpenPm: true,
- operatingHours: '',
- operatingHoursAmStart: '',
- operatingHoursAmEnd: '',
- operatingHoursPmStart: '',
- operatingHoursPmEnd: ''
- },
- // tslint:disable-next-line:max-line-length
- {
- _id: '3',
- weekday: 'Wednesday',
- isOpen: false,
- isOpenPm: true,
- operatingHours: '',
- operatingHoursAmStart: '',
- operatingHoursAmEnd: '',
- operatingHoursPmStart: '',
- operatingHoursPmEnd: ''
- },
- // tslint:disable-next-line:max-line-length
- {
- _id: '4',
- weekday: 'Thursday',
- isOpen: false,
- isOpenPm: true,
- operatingHours: '',
- operatingHoursAmStart: '',
- operatingHoursAmEnd: '',
- operatingHoursPmStart: '',
- operatingHoursPmEnd: ''
- },
- // tslint:disable-next-line:max-line-length
- {
- _id: '5',
- weekday: 'Friday',
- isOpen: false,
- isOpenPm: true,
- operatingHours: '',
- operatingHoursAmStart: '',
- operatingHoursAmEnd: '',
- operatingHoursPmStart: '',
- operatingHoursPmEnd: ''
- },
- // tslint:disable-next-line:max-line-length
- {
- _id: '6',
- weekday: 'Saturday',
- isOpen: false,
- isOpenPm: true,
- operatingHours: '',
- operatingHoursAmStart: '',
- operatingHoursAmEnd: '',
- operatingHoursPmStart: '',
- operatingHoursPmEnd: ''
- }
- ];
-
- // daysList: any;
- IS_OPEN = false;
-
- projectid: string;
- projectname: string;
- project_operatingHours: any;
- project_timeSlots: any;
- public selectedTime: any;
- projectOffsetfromUtcZero: any;
- offsetDirectionFromUtcZero: any;
- isActiveOperatingHours: boolean;
- browser_lang: string;
- IS_CLOSED_IN_PM: boolean;
- timezone_name: string;
- current_prjct_timezone_name: string;
- current_prjct_UTC: any;
- timezone_NamesAndUTC_list: any;
- timezoneNameForTooltip: any;
- timezoneUTCOffsetForTooltip: any;
- displayModalUpdatingOperatingHours = 'none'
- SHOW_CIRCULAR_SPINNER = false;
- UPDATE_HOURS_ERROR = false;
- TIMEZONE_NAME_IS_NULL = false;
- timeZoneSelectedIsUnlikeCurrentTimezone: boolean;
-
- showSpinner = true;
- public_Key: string;
- IS_OPEN_SETTINGS_SIDEBAR: boolean;
- // hasSaved: boolean
- isChromeVerGreaterThan100: boolean;
- USER_ROLE: string;
-
- timeSlotsArray: Array
= [];
-
- constructor(
- private auth: AuthService,
- private projectService: ProjectService,
- private usersService: UsersService,
- // private atp: AmazingTimePickerService,
- private translate: TranslateService,
- public notify: NotifyService,
- private router: Router,
- public appConfigService: AppConfigService,
- private logger: LoggerService,
- public dialog: MatDialog,
- ) { }
-
- ngOnInit() {
- this.logger.log('[HOURS] - on init DAYS ', this.days);
-
- // getCurrentProject > getProjectById > BUILD THE OBJECT DAYS
- this.getCurrentProject();
- this.getOSCODE();
- // this.daysList = this.days
- this.auth.checkRoleForCurrentProject();
-
- // this.projectOffsetfromUtcZero = this.getPrjctOffsetHoursfromTzOffset();
- // this.logger.log('[HOURS] - PRJCT OFFSET FROM UTC 0::: ', this.projectOffsetfromUtcZero);
-
- this.browser_lang = this.translate.getBrowserLang();
- this.logger.log('[HOURS] - BROWSER LANGUAGE ', this.browser_lang);
-
-
- this.current_prjct_UTC = moment.tz(this.current_prjct_timezone_name).format('Z');
- this.logger.log('[HOURS] - CURRENT PROJECT TIMEZONE-UTC ', this.current_prjct_UTC);
-
- // current TIMEZONE NAME - USED IN THE BOX 'You are currently at:' and
- // to set to the current timezone the timezone selected in the option input
- this.timezoneNameForTooltip = moment.tz.guess();
- this.logger.log('[HOURS] - TIMEZONE NAME FOR TOOLTIP ', this.timezoneNameForTooltip);
-
- // current TIMEZONE OFFSET - USED IN THE BOX 'You are currently at:'
- this.timezoneUTCOffsetForTooltip = moment.tz(this.timezoneNameForTooltip).format('Z')
- this.logger.log('[HOURS] - TIMEZONE OFFSET FOR TOOLTIP ', this.timezoneUTCOffsetForTooltip);
-
-
- /* ====== DEBUG ====== */
- // const timezone_offset = moment.tz(timezone_name).utcOffset()
- // const timezone_offset = moment.tz(moment.utc(), 'America/New_York').utcOffset()
- // const timezone_offset = moment.tz(moment.utc(), 'EST5EDT').utcOffset()
- // const timezone_offset = moment.tz(moment.utc(), 'Europe/Rome').utcOffset()
- // this.logger.log('»» »» HOURS COMP - TIMEZONE OOOFFSET ', timezone_offset);
-
- const timezone_names = moment.tz.names();
- // this.logger.log('»» »» HOURS COMP - TIMEZONE NAMES ', timezone_names);
-
- this.timezone_NamesAndUTC_list = []
- timezone_names.forEach(timezone_name => {
- const tzNameAndUTC = '(UTC ' + moment.tz(timezone_name).format('Z') + ') ' + timezone_name
- // this.logger.log('(UTC ', moment.tz(timezone_name).format('Z'), ') ', timezone_name);
- this.timezone_NamesAndUTC_list.push({ tz: tzNameAndUTC, value: timezone_name })
-
- });
- this.logger.log('[HOURS] - TIMEZONE NAME & OFFSET ARRAY ', this.timezone_NamesAndUTC_list);
- this.listenSidebarIsOpened();
- this.getBrowserVersion();
- this.getUserRole()
- }
-
- getUserRole() {
- this.usersService.project_user_role_bs
- .subscribe((userRole) => {
- this.logger.log('[HOURS] - $UBSCRIPTION TO USER ROLE »»» ', userRole)
- this.USER_ROLE = userRole;
- })
- }
-
- getBrowserVersion() {
- this.auth.isChromeVerGreaterThan100.subscribe((isChromeVerGreaterThan100: boolean) => {
- this.isChromeVerGreaterThan100 = isChromeVerGreaterThan100;
- // this.logger.log("[WS-REQUESTS-LIST] isChromeVerGreaterThan100 ",this.isChromeVerGreaterThan100);
- })
- }
-
- listenSidebarIsOpened() {
- this.auth.settingSidebarIsOpned.subscribe((isopened) => {
- this.logger.log('[HOURS] SETTINGS-SIDEBAR isopened (FROM SUBSCRIPTION) ', isopened)
- this.IS_OPEN_SETTINGS_SIDEBAR = isopened
- });
- }
-
-
- getOSCODE() {
- this.public_Key = this.appConfigService.getConfig().t2y12PruGU9wUtEGzBJfolMIgK;
- // this.logger.log('[HOURS] AppConfigService getAppConfig public_Key', this.public_Key);
- let keys = this.public_Key.split("-");
- // this.logger.log('[HOURS] PUBLIC-KEY keys', keys)
- keys.forEach(key => {
- // this.logger.log('HOURS COMP public_Key key', key)
- if (key.includes("OPH")) {
- // this.logger.log('[HOURS] PUBLIC-KEY - key', key);
- let oph = key.split(":");
- // this.logger.log('[HOURS] PUBLIC-KEY - oph key&value', oph);
- if (oph[1] === "F") {
- this.router.navigate([`project/${this.projectid}/unauthorized`]);
- }
- }
- });
-
-
- if (!this.public_Key.includes("OPH")) {
- // this.logger.log('PUBLIC-KEY (Home) - key.includes("OPH")', this.public_Key.includes("OPH"));
- this.router.navigate([`project/${this.projectid}/unauthorized`]);
- }
- }
-
- ngOnDestroy() {
- // this.logger.log('[HOURS] - NG-ON-DESTROY ')
-
- }
-
- setProjectToYourTimezone() {
- this.logger.log('[HOURS] - SET TIMEZONE TO YOUR TIMEZONE ', this.timezoneNameForTooltip);
- this.current_prjct_timezone_name = this.timezoneNameForTooltip
-
- if (this.current_prjct_timezone_name !== this.timezoneNameForTooltip) {
- this.timeZoneSelectedIsUnlikeCurrentTimezone = true;
- this.logger.log('[HOURS] - TIMEZONE SELECTED id != OF CURRENT TIMEZONE ? ', this.timeZoneSelectedIsUnlikeCurrentTimezone);
- } else {
- this.timeZoneSelectedIsUnlikeCurrentTimezone = false;
- }
- }
-
- setSelectedTimeZone(): void {
- this.logger.log('[HOURS] - TIMEZONE SELECTED ', this.current_prjct_timezone_name);
-
- if (this.current_prjct_timezone_name !== this.timezoneNameForTooltip) {
- this.timeZoneSelectedIsUnlikeCurrentTimezone = true;
- this.logger.log('[HOURS] - TIMEZONE SELECTED id != OF CURRENT TIMEZONE ? ', this.timeZoneSelectedIsUnlikeCurrentTimezone);
- } else {
- this.timeZoneSelectedIsUnlikeCurrentTimezone = false;
- }
- }
-
- // !! NO MORE USED
- getPrjctOffsetHoursfromTzOffset() {
- // The getTimezoneOffset() method returns the time difference between UTC time and local time, in minutes
- // e.g.: -120
- const offset = new Date().getTimezoneOffset();
- this.logger.log('[HOURS] - GET CURRENT DATE', new Date());
-
-
- this.logger.log('[HOURS] - GET TIMEZONE OFFSET ', offset);
-
- const a = moment.tz('2013-11-18 11:55', 'Asia/Taipei');
- const testdate = a.format();
- this.logger.log('[HOURS] - TEST DATE ', testdate);
- const _testdate = new Date(testdate);
- this.logger.log('[HOURS] - NEW TEST DATE ', _testdate);
- this.logger.log('[HOURS] - OFFSET OF TEST DATE ', _testdate.getTimezoneOffset())
-
- // moment.tz.zone('America/Los_Angeles').utcOffset(1403465838805);
- // NEW FOR DEBUG ==============================================
- // -3 | -2 | -1 | UTC | +1 | +2 | +3 |
- if (offset < 0) {
- // EXAMPLE -2 hours after UTC
- this.logger.log(offset / 60 + ' hours after UTC');
- } else {
- document.write(offset / 60 + ' hours before UTC')
- }
-
- const offsetStr = offset.toString();
- this.logger.log('[HOURS] - GET TIMEZONE OFFSET (AS STRING) ', offsetStr);
-
- const offsetOperator = offsetStr.substring(0, 1);
- this.logger.log('[HOURS] - TIMEZONE OFFSET OPERATOR ', offsetOperator);
- // the purpose is to transform the timezone from -120 into the form +2
- // that is, transform the difference in minutes between the local time of the client and the utc in the form UTC +/- (hours)
- if (offsetOperator === '-') {
- this.offsetDirectionFromUtcZero = '+';
- this.logger.log('[HOURS] - TIMEZONE OFFSET DIRECTION from UTC 0: ', this.offsetDirectionFromUtcZero);
- } else if (offsetOperator === '+') {
- this.offsetDirectionFromUtcZero = '-';
- this.logger.log('[HOURS] - TIMEZONE OFFSET DIRECTION from UTC 0: ', this.offsetDirectionFromUtcZero);
- }
- const offsetMinutesAsString = offsetStr.substr(1);
- const offsetMinutes = parseInt(offsetMinutesAsString, 0);
- this.logger.log('[HOURS] - TIMEZONE OFFSET MINUTES: ', offsetMinutes);
- const offsetHours = offsetMinutes / 60;
- this.logger.log('[HOURS] - TIMEZONE OFFSET HOURS: ', offsetHours);
-
- return this.offsetDirectionFromUtcZero + offsetHours;
- }
-
- getCurrentProject() {
- this.auth.project_bs.subscribe(project => {
- if (project) {
- this.projectid = project._id;
- this.projectname = project.name;
- this.logger.log('[HOURS] - PROJECT (from AUTH SERV subscription) ', project);
- this.logger.log('[HOURS] - PROJECT: PROJECT ID ', this.projectid);
- this.logger.log('[HOURS] - PROJECT: PROJECT NAME ', this.projectname);
-
- if (this.projectid) {
- this.getProjectById();
- }
- }
- });
- }
-
- /* --------------------------------------------------------------------------------------------------
- * GET THE PROJECT BY ID AND WITH THE DATA OF OPERATING HOURS (PRESENT OR LESS)
- * BUILD THE OBJECT DAYS
- * --------------------------------------------------------------------------------------------------*/
- getProjectById() {
- this.projectService.getProjectById(this.projectid).subscribe(
- (project: any) => {
- this.logger.log('[HOURS] - on init PROJECT (DETAILS) BY ID - PROJECT OBJECT: ', project);
-
- if (project) {
- this.logger.log('[HOURS] - on init PROJECT OPERATING HOURS (first to assign): ', project.operatingHours);
-
- /* CHECK IF THE PROPERTY activeOperatingHours IS DEFINED */
- // (e.g. THE VALUE OF activeOperatingHours WILL BE 'undefined' FOR A PROJECT CREATED BEFORE
- // THE IMPLEMENTATION IN CHAT21-NODEJS-API > ROUTES > PROJECT OF THE PROPERTY activeOperatingHours = false)
- if (project.activeOperatingHours !== undefined) {
- // used for the checkbox "Activate operating hours"
- this.isActiveOperatingHours = project.activeOperatingHours;
- this.logger.log('[HOURS] - on init PROJECT OPERATING HOURS IS ACTIVE: ', this.isActiveOperatingHours);
- } else {
- this.logger.log('[HOURS] - on init PROJECT OPERATING HOURS IS ACTIVE: ', this.isActiveOperatingHours);
- // this.isActiveOperatingHours = false
- }
-
- /* CHECK IF THE OBJECT activeOperatingHours IS DEFINED */
- // (e.g. FOR NEW PROJECT THE OBJECT activeOperatingHours WILL BE ALWAYS 'undefined'
- // NOTE: if activeOperatingHours is 'undefined' the value of the timezone name selected is setted equal to
- // the current tiemzone get with moment (see the else block)
- if (project.operatingHours !== undefined) {
- this.project_operatingHours = JSON.parse(project.operatingHours);
- this.logger.log('[HOURS]- on init PROJECT OPERATING HOURS: ', this.project_operatingHours);
- this.logger.log('[HOURS] - on init PROJECT TIMEZONE NAME: ', this.project_operatingHours['tzname']);
-
- this.current_prjct_timezone_name = this.project_operatingHours['tzname'];
-
- // GET THE TIMEZONE NAME FROM THE OBJECT OPERATING HOURS PF THE PROJECT
- // IF IT IS != BY THE CURRENT TIMEZONE SET TO TRUE timeZoneSelectedIsUnlikeCurrentTimezone
- // USED TO DISABLED / ENABLED THE BTN 'SET PROJWCT TIMEZONE TO CURRENT TIMEZONE'
-
- if (this.current_prjct_timezone_name !== this.timezoneNameForTooltip) {
- this.timeZoneSelectedIsUnlikeCurrentTimezone = true
- // tslint:disable-next-line:max-line-length
- this.logger.log('[HOURS] - on init TIMEZONE SELECTED id != OF CURRENT TIMEZONE? ', this.timeZoneSelectedIsUnlikeCurrentTimezone);
-
- } else {
- this.timeZoneSelectedIsUnlikeCurrentTimezone = false
- }
-
-
-
- // SE NEL OGGETTO OPERATING HOURS DEL PROGETTO E PRESENTE LA KEY CHE INDICA IL GIORNO AGGIUNGO OPERATING
- // HOURS ALL OBJECT DAY (CREO COSì L'OGGETTO DAYS CHE USO NEL TEMPLATE)
- let i: number;
- for (i = 0; i < 7; i++) {
- // this.logger.log('CICLO I = ', i)
- if (this.project_operatingHours.hasOwnProperty(i)) {
- this.logger.log('[HOURS]', this.days[i].weekday, ' IS SETTED');
- this.logger.log('[HOURS] operating hours start ', this.project_operatingHours[i]);
-
- this.days[i].operatingHours = this.project_operatingHours[i];
-
- this.days[i].isOpen = true;
-
- this.days[i].operatingHoursAmStart = this.project_operatingHours[i][0].start;
- this.days[i].operatingHoursAmEnd = this.project_operatingHours[i][0].end;
-
- if (this.project_operatingHours[i][1]) {
- this.days[i].operatingHoursPmStart = this.project_operatingHours[i][1].start;
- this.days[i].operatingHoursPmEnd = this.project_operatingHours[i][1].end;
- }
-
- // this.project_operatingHours[i].forEach(hours => {
- // this.logger.log('hours start ', hours.start, 'hours end ', hours.end)
- // this.days[i].operatingHoursAmStart = hours.start
- // this.days[i].operatingHoursAmEnd = hours.end
- // });
-
- // this.days.forEach(day => {
- // const num = i
- // this.logger.log('operating hours ', this.project_operatingHours[i] )
-
- // if (day._id === this.project_operatingHours[i]) {
- // this.logger.log('day id ', day._id, ' i: ', i)
- // day.isOpen = true;
- // day.operatingHours = this.project_operatingHours[i]
- // // this.logger.log('DAY IS OPEN ', day.isOpen)
- this.logger.log('[HOURS] - DAYS ON INIT ', this.days);
- if (this.days[i].operatingHoursPmStart === '') {
- this.days[i].isOpenPm = false;
- }
- // }
- // });
- } else {
- this.logger.log('[HOURS] ', this.days[i].weekday, ' IS ! NOT SETTED ');
- }
- }
- } else {
- this.logger.log('[HOURS] - OPERATING HOURS ARE UNDEFINED', project.operatingHours);
-
- // IF THE OPERATING HOURS OBJECT IS UNDEFINED TAKES THE NAME OF THE TIMEZONE FROM THE MOMENT LIBRARY
- // note: current_prjct_timezone_name is the timezone name displayed as selected in the timezone deropdownlist
- this.current_prjct_timezone_name = moment.tz.guess();
- this.logger.log('[HOURS] - CURRENT PROJECT TIMEZONE-NAME DETECTED ', this.current_prjct_timezone_name);
-
- this.timeZoneSelectedIsUnlikeCurrentTimezone = false
- }
-
- if (project.timeSlots) {
- console.log("project.timeSlots: ", project.timeSlots)
- this.project_timeSlots = project.timeSlots;
- this.timeSlotsArray = Object.keys(project.timeSlots).map(key => ({
- id: key,
- ...project.timeSlots[key]
- }));
- console.log("this.timeSlotsArray: ", this.timeSlotsArray)
- } else {
- this.project_timeSlots = {};
- console.log("this.timeSlotsArray: ", this.timeSlotsArray)
- }
-
- }
- }, error => {
- this.showSpinner = false;
- this.logger.error('[HOURS] - GET PROJECT BY ID - ERROR ', error);
- }, () => {
- this.showSpinner = false;
- this.logger.log('[HOURS] - GET PROJECT BY ID - COMPLETE ');
- }
- );
- }
-
- onChange($event) {
- this.activeOperatingHours = $event.target.checked;
- // used in the template to change the checkbox label text
- this.isActiveOperatingHours = this.activeOperatingHours;
- this.logger.log('[HOURS] - onChange OPERATING HOURS ARE ACTIVE ', this.activeOperatingHours);
- }
-
- // !!! TEST METHOD - UPDATE PROJECT OPERATING HOURS - USED (FOR TEST) TO 'INIECT' THE JSON 'OPERATING HOURS' FROM THE INPUT FIELD
- // (see in the template)
- updateProjectOperatingHours() {
- this.logger.log('[HOURS] - ON UPDATE OPERATING HOURS - OPERATING HOURS ARE ACTIVE ', this.activeOperatingHours);
- this.logger.log('[HOURS] - ON UPDATE OPERATING HOURS - OPERATING HOURS ', this.operatingHours);
-
- this.projectService
- .updateProjectOperatingHours(this.activeOperatingHours, this.operatingHours)
- .subscribe(project => {
- this.logger.log('[HOURS] »»»»»» UPDATED PROJECT ', project);
- });
- }
-
- testAvailableProjectUserConsideringProjectOperatingHours() {
- const offset = new Date().getTimezoneOffset();
- this.logger.log('[HOURS] - OFFEST ', offset);
-
- const time = new Date('2001-01-01T06:00:00+08:00');
- this.logger.log('[HOURS] - TIME ', time);
- this.logger.log('[HOURS] - TIME ', time.toUTCString());
-
- this.usersService
- .getAvailableProjectUsersConsideringOperatingHours()
- .subscribe(available_project => {
- this.logger.log('[HOURS] »»»»»»» NEW - GET AVAILABLE PROJECT USERS (CONSIDERING OPERATING HOURS)', available_project);
- }, (error) => {
- this.logger.error('[HOURS] »»»»»»» NEW - GET AVAILABLE PROJECT USERS (CONSIDERING OPERATING HOURS) - ERROR ', error);
- // this.showSpinner = false;
- }, () => {
- this.logger.log('[HOURS] »»»»»»» NEW - GET AVAILABLE PROJECT USERS (CONSIDERING OPERATING HOURS) * COMPLETE');
- });
-
- }
-
-
- onChangeOpenedClosedStatus($event, weekdayid: string, weekdayname: string) {
- // this.logger.log('XXXX ', $event.target.checked)
- // tslint:disable-next-line:max-line-length
- this.logger.log('[HOURS] - CLICKED CHANGE STATUS OPENED/CLOSED for the WEEKDAY ID ', weekdayid, ' - ', weekdayname, 'IS OPEN ', $event.target.checked);
-
- this.days.forEach(day => {
- if (weekdayid === day._id && $event.target.checked === true) {
- day.isOpen = true;
- this.logger.log('[HOURS] - DAY IS OPEN ', day.isOpen);
- this.logger.log('[HOURS] - DAYS ', this.days);
- day.operatingHoursAmStart = '09:00';
- day.operatingHoursAmEnd = '13:00';
- day.operatingHoursPmStart = '14:00';
- day.operatingHoursPmEnd = '18:00';
- this.logger.log('[HOURS] - AM START ', day.operatingHoursAmStart, 'AM END ', day.operatingHoursAmEnd);
- this.logger.log('[HOURS] - PM START ', day.operatingHoursPmStart, 'PM END ', day.operatingHoursPmEnd);
-
- // SET to TRUE isOpenPm
- day.isOpenPm = true;
- } else if (weekdayid === day._id && $event.target.checked === false) {
- day.isOpen = false;
- this.logger.log('[HOURS] - DAYS ', this.days);
- day.operatingHoursAmStart = '';
- day.operatingHoursAmEnd = '';
- day.operatingHoursPmStart = '';
- day.operatingHoursPmEnd = '';
- }
- });
- // this.days = $event.target.checked;
- }
-
- // open(dayid) {
- // this.logger.log('DAY ID ', dayid)
- // const amazingTimePicker = this.atp.open({
- // // time: this.selectedTime,
- // time: this.days[dayid].operatingHoursAmStart,
- // theme: 'dark',
- // arrowStyle: {
- // background: 'red',
- // color: 'white'
- // }
- // });
- // onChangeOpenedClosedStatus.afterClose().subscribe(time => {
- // this.days[dayid].operatingHoursAmStart = time;
- // this.logger.log('SELECTED TIME ', this.days[dayid].operatingHoursAmStart)
- // this.logger.log('DAYS ', this.days)
- // });
- // }
-
- updateProject() {
- // this.hasSaved = true;
-
- this.displayModalUpdatingOperatingHours = 'block'
- this.SHOW_CIRCULAR_SPINNER = true;
-
- this.logger.log('[HOURS] - WHEN UPDATE PROJECT - DAYS ', this.days);
-
- const operatingHoursUpdated = {};
-
- let j;
- for (j = 0; j < 7; j++) {
- if (this.days[j].isOpen === true) {
- // tslint:disable-next-line:max-line-length
- operatingHoursUpdated[j] = [
- { start: this.days[j].operatingHoursAmStart, end: this.days[j].operatingHoursAmEnd },
- { start: this.days[j].operatingHoursPmStart, end: this.days[j].operatingHoursPmEnd }
- ];
- }
- }
-
- /* !!!! NO MORE USED */
- // e.g.: operatingHoursUpdated = '"tz": "+2"'
- // operatingHoursUpdated['tz'] = this.projectOffsetfromUtcZero;
- // this.logger.log('»»» PROJECT OFFSET FROM UTC : ', this.projectOffsetfromUtcZero);
-
- if (this.current_prjct_timezone_name !== null) {
- // e.g.: Europe/Rome
- operatingHoursUpdated['tzname'] = this.current_prjct_timezone_name;
-
-
- this.logger.log('[HOURS] - OPERATING HOURS UPDATED: ', operatingHoursUpdated);
- this.logger.log('[HOURS] - THIS TIMEZONE NAME: ', this.current_prjct_timezone_name);
-
- const operatingHoursUpdatedStr = JSON.stringify(operatingHoursUpdated);
- this.projectService
- .updateProjectOperatingHours(this.activeOperatingHours, operatingHoursUpdatedStr)
- .subscribe((project: any)=> {
- this.logger.log('[HOURS] - UPDATED PROJECT ', project);
- this.logger.log('[HOURS] - UPDATED PROJECT this.activeOperatingHours', this.activeOperatingHours);
- project['role'] = this.USER_ROLE;
- // const _project: Project = {
- // _id: project['_id'],
- // name: project['name'],
- // profile_name: project['profile'].name,
- // trial_expired: project['trialExpired'],
- // trial_days_left: project['trialDaysLeft'],
- // operatingHours: project['activeOperatingHours']
- // }
-
- this.logger.log('[HOURS] - UPDATED PROJECT _project set in storage', project);
- localStorage.setItem(project['_id'], JSON.stringify(project));
- // const _ project = project
- this.auth.projectSelected(project, 'hours')
-
-
- }, (error) => {
- this.logger.error('[HOURS] - UPDATE PROJECT - ERROR ', error);
- this.SHOW_CIRCULAR_SPINNER = false;
- this.UPDATE_HOURS_ERROR = true;
- this.notify.showWidgetStyleUpdateNotification('An error has occurred updating operating hours', 4, 'report_problem')
- },() => {
- this.logger.log('[HOURS] - UPDATE PROJECT * COMPLETE *');
-
- setTimeout(() => {
- this.SHOW_CIRCULAR_SPINNER = false
- }, 300);
-
- this.UPDATE_HOURS_ERROR = false;
- this.notify.showWidgetStyleUpdateNotification('operating hours has been successfully updated', 2, 'done');
- });
-
- } else {
- // the timezone name is null
- setTimeout(() => {
- this.SHOW_CIRCULAR_SPINNER = false
- this.UPDATE_HOURS_ERROR = true;
- this.TIMEZONE_NAME_IS_NULL = true;
- }, 300);
-
-
- }
- }
-
- closeModalOperatingHours() {
- this.displayModalUpdatingOperatingHours = 'none'
- }
-
- closeModalOperatingHoursHandler() {
- this.displayModalUpdatingOperatingHours = 'none'
- }
-
- onChangeAmStartFromArrow(time, weekdayid) {
- this.logger.log('[HOURS] - ON CHANGE AM START FROM UP/DOWN ARROW - DAY ID', weekdayid, ' - TIME: ', time);
- this.days[weekdayid].operatingHoursAmStart = time;
- }
-
- onChangeAmEndFromArrow(time, weekdayid) {
- this.logger.log('[HOURS] - ON CHANGE AM END FROM UP/DOWN ARROW - DAY ID', weekdayid, ' - TIME: ', time);
- this.days[weekdayid].operatingHoursAmEnd = time;
- }
-
- onChangePmStartFromArrow(time, weekdayid) {
- this.logger.log('[HOURS] - ON CHANGE PM START FROM UP/DOWN ARROW - DAY ID:', weekdayid, ' - TIME: ', time);
- this.days[weekdayid].operatingHoursPmStart = time;
-
- // IF THE PM START TIME IS EMPTY SET TO EMPTY ALSO THE PM END TIME
- if (this.days[weekdayid].operatingHoursPmStart === '') {
- this.days[weekdayid].operatingHoursPmEnd = '';
-
- // used to set the 'disabled class' to the buttons and input when the pm start time and pm end time are empty
- this.days[weekdayid].isOpenPm = false;
- } else {
- this.days[weekdayid].isOpenPm = true;
- }
- }
-
- onChangePmEndFromArrow(time, weekdayid) {
- this.logger.log('[HOURS] - ON CHANGE PM END FROM UP/DOWN ARROW - DAY ID: ', weekdayid, ' - TIME: ', time);
- this.days[weekdayid].operatingHoursPmEnd = time;
- }
-
- close_Pm(dayid) {
- this.logger.log('[HOURS] - CLOSE PM FOR THE DAY ID ', dayid);
- this.days[dayid].operatingHoursPmStart = '';
- this.days[dayid].operatingHoursPmEnd = '';
- this.days[dayid].isOpenPm = false;
- }
-
- open_Pm(dayid) {
- this.logger.log('[HOURS] - OPEN PM FOR THE DAY ID ', dayid);
- this.days[dayid].isOpenPm = true;
- this.days[dayid].operatingHoursPmStart = '14:00';
- this.days[dayid].operatingHoursPmEnd = '18:00';
- }
-
- openAmStart(dayid) {
- // this.logger.log('[HOURS] - openAmStart DAY ID ', dayid);
- // const amazingTimePicker = this.atp.open({
- // // time: this.selectedTime,
- // time: this.days[dayid].operatingHoursAmStart,
- // theme: 'dark',
- // arrowStyle: {
- // background: 'red',
- // color: 'white'
- // }
- // });
- // amazingTimePicker.afterClose().subscribe(time => {
- // this.days[dayid].operatingHoursAmStart = time;
- // this.logger.log('[HOURS] - openAmStart SELECTED TIME ', this.days[dayid].operatingHoursAmStart);
- // this.logger.log('[HOURS] - openAmStart DAYS ', this.days);
- // });
- }
-
- openAmEnd(dayid) {
- // this.logger.log('[HOURS] openAmEnd DAY ID ', dayid);
- // const amazingTimePicker = this.atp.open({
- // // time: this.selectedTime,
- // time: this.days[dayid].operatingHoursAmEnd,
- // theme: 'dark',
- // arrowStyle: {
- // background: 'red',
- // color: 'white'
- // }
- // });
- // amazingTimePicker.afterClose().subscribe(time => {
- // this.days[dayid].operatingHoursAmEnd = time;
- // this.logger.log('[HOURS] - openAmEnd SELECTED TIME ', this.days[dayid].operatingHoursAmEnd);
- // this.logger.log('[HOURS] - openAmEnd DAYS ', this.days);
- // });
- }
-
- openPmStart(dayid) {
- this.logger.log('[HOURS] - openPmStart DAY ID ', dayid);
- // const amazingTimePicker = this.atp.open({
- // // time: this.selectedTime,
- // time: this.days[dayid].operatingHoursPmStart,
- // theme: 'dark',
- // arrowStyle: {
- // background: 'red',
- // color: 'white'
- // }
- // });
- // amazingTimePicker.afterClose().subscribe(time => {
- // this.days[dayid].operatingHoursPmStart = time;
- // this.logger.log('[HOURS] - openPmStart SELECTED TIME ', this.days[dayid].operatingHoursPmStart);
- // this.logger.log('[HOURS] - openPmStart DAYS ', this.days);
-
- // // IF THE PM START TIME IS not EMPTY SET to TRUE isOpenPm
- // if (this.days[dayid].operatingHoursPmStart !== '') {
- // this.days[dayid].isOpenPm = true;
- // }
- // });
- }
-
- openPmEnd(dayid) {
- this.logger.log('[HOURS] - openPmEnd DAY ID ', dayid);
- // const amazingTimePicker = this.atp.open({
- // // time: this.selectedTime,
- // time: this.days[dayid].operatingHoursPmEnd,
- // theme: 'dark',
- // arrowStyle: {
- // background: 'red',
- // color: 'white'
- // }
- // });
- // amazingTimePicker.afterClose().subscribe(time => {
- // this.days[dayid].operatingHoursPmEnd = time;
- // this.logger.log('[HOURS] - openPmEnd SELECTED TIME ', this.days[dayid].operatingHoursPmEnd);
- // this.logger.log('[HOURS] - openPmEnd DAYS ', this.days);
-
- // // IF THE PM END TIME IS not EMPTY SET to TRUE isOpenPm
- // if (this.days[dayid].operatingHoursPmEnd !== '') {
- // this.days[dayid].isOpenPm = true;
- // }
- // });
- }
-
-
- // SLOTS SECTION - START
- onSelectGeneralOperatingHours() {
- console.log("onSelectGeneralOperatingHours clicked")
- this.getProjectById();
- }
-
- onSelectSlot(slot) {
- console.log("onSelectSlot slot: ", slot)
- this.isActiveOperatingHours = slot.active;
- }
-
- presentModalNewSlot() {
- const dialogRef = this.dialog.open(NewSlotModalComponent, {
- backdropClass: 'cdk-overlay-transparent-backdrop',
- hasBackdrop: true,
- width: '600px',
-
- });
- dialogRef.afterClosed().subscribe(body => {
- this.logger.log('[Modal Add content] Dialog body: ', body);
- if (body) {
- console.log("body after close: ", body)
- this.addSlot(body.slotName);
- //this.onAddKb(body)
- }
- });
-
- }
-
- addSlot(slot_name) {
- let new_slot = {
- name: slot_name,
- active: false,
- hours: null
- }
-
- let uuid = uuidv4();
- console.log("uuid: ", uuid)
- let short_uuid = uuid.substring(uuid.lastIndexOf('-') + 1)
- console.log("short_uuid: ", short_uuid)
-
- console.log("new_slot: ", new_slot);
- this.project_timeSlots[short_uuid] = new_slot;
- console.log("project timeSlots: ", this.project_timeSlots);
- this.saveSlot();
- }
-
- saveSlot() {
- let data = {
- timeSlots: this.project_timeSlots
- }
- console.log("data: ", data);
- this.projectService.updateProject(this.projectid, data).subscribe((updatedProject) => {
- console.log("updatedProject: ", updatedProject);
- }, (error) => {
- console.log("error updating project: ", error);
- })
- }
-
- // SLOTS SECTION - END
-
-
-
-
-
-}
diff --git a/src/app/integrations/integrations.component.html b/src/app/integrations/integrations.component.html
index d4e0f94ce11e..31b409bf941e 100644
--- a/src/app/integrations/integrations.component.html
+++ b/src/app/integrations/integrations.component.html
@@ -98,6 +98,12 @@
(onDeleteIntegration)=integrationDeletedEvent($event)>
+
+
+
i.category === INTEGRATIONS_CATEGORIES.CHANNEL);
if (index === -1) {
let idx = this.CATEGORIES.findIndex(c => c.type === INTEGRATIONS_CATEGORIES.CHANNEL);
diff --git a/src/app/integrations/integrations.module.ts b/src/app/integrations/integrations.module.ts
index 499bcc5cb204..d93c66dd336d 100644
--- a/src/app/integrations/integrations.module.ts
+++ b/src/app/integrations/integrations.module.ts
@@ -16,6 +16,7 @@ import { SharedModule } from 'app/shared/shared.module';
import { RouterModule, Routes } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { ExtIntegrationComponent } from './list/ext-integration/ext-integration.component';
+import { N8nIntegrationComponent } from './list/n8n-integration/n8n-integration.component';
const routes: Routes = [
{ path: "", component: IntegrationsComponent},
@@ -32,7 +33,8 @@ const routes: Routes = [
MakeIntegrationComponent,
OpenaiIntegrationComponent,
QaplaIntegrationComponent,
- ExtIntegrationComponent
+ ExtIntegrationComponent,
+ N8nIntegrationComponent
],
imports: [
RouterModule.forChild(routes),
diff --git a/src/app/integrations/list/brevo-integration/brevo-integration.component.html b/src/app/integrations/list/brevo-integration/brevo-integration.component.html
index 6778e0ac7bd5..39cd96c47384 100644
--- a/src/app/integrations/list/brevo-integration/brevo-integration.component.html
+++ b/src/app/integrations/list/brevo-integration/brevo-integration.component.html
@@ -1,7 +1,10 @@
+
@@ -30,7 +34,7 @@
Api Key
\ No newline at end of file
diff --git a/src/app/integrations/list/brevo-integration/brevo-integration.component.scss b/src/app/integrations/list/brevo-integration/brevo-integration.component.scss
index 95cc9884eb3e..4059ef5e5973 100644
--- a/src/app/integrations/list/brevo-integration/brevo-integration.component.scss
+++ b/src/app/integrations/list/brevo-integration/brevo-integration.component.scss
@@ -10,7 +10,15 @@ p {
flex-direction: row;
align-items: center;
justify-content: space-between;
+
+ .signup {
+ display: flex;
+ p {
+ margin: 0 0 0 5px;
+ }
+ }
+
.status {
display: flex;
align-items: center;
diff --git a/src/app/integrations/list/brevo-integration/brevo-integration.component.ts b/src/app/integrations/list/brevo-integration/brevo-integration.component.ts
index ebd2641986f9..4c860ab53ff1 100644
--- a/src/app/integrations/list/brevo-integration/brevo-integration.component.ts
+++ b/src/app/integrations/list/brevo-integration/brevo-integration.component.ts
@@ -1,5 +1,4 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
-import { TranslateService } from '@ngx-translate/core';
import { IntegrationService } from 'app/services/integration.service';
import { LoggerService } from 'app/services/logger/logger.service';
@@ -17,16 +16,18 @@ export class BrevoIntegrationComponent implements OnInit {
keyVisibile: boolean = false;
isVerified: boolean;
+ translateparams: any;
+
constructor(
private integrationService: IntegrationService,
private logger: LoggerService,
- private translate: TranslateService
) { }
ngOnInit(): void {
this.logger.debug("[INT-Brevo] integration ", this.integration)
+ this.translateparams = { intname: "Brevo" }
if (this.integration.value.apikey) {
- this.checkKey(this.integration.value.apikey);
+ this.checkKey();
}
}
@@ -41,13 +42,13 @@ export class BrevoIntegrationComponent implements OnInit {
}
saveIntegration() {
- // this.checkKey(this.integration.value.apikey).then((status) => {
- // let data = {
- // integration: this.integration,
- // isVerified: status
- // }
- // this.onUpdateIntegration.emit(data);
- // })
+ this.checkKey().then((status) => {
+ let data = {
+ integration: this.integration,
+ isVerified: status
+ }
+ this.onUpdateIntegration.emit(data);
+ })
}
deleteIntegration() {
@@ -55,7 +56,19 @@ export class BrevoIntegrationComponent implements OnInit {
this.onDeleteIntegration.emit(this.integration);
}
- checkKey(key: string) {
+ checkKey() {
+ return new Promise((resolve) => {
+ let url = "https://api.brevo.com/v3/contacts?limit=2";
+ let apikey = 'Basic ' + this.integration.value.apikey;
+ this.integrationService.checkIntegrationKeyValidity(url, null, apikey).subscribe((resp: any) => {
+ this.isVerified = true;
+ resolve(true);
+ }, (error) => {
+ this.logger.error("[INT-Customer.io] Key verification failed: ", error);
+ this.isVerified = false;
+ resolve(false);
+ })
+ })
}
resetValues() {
diff --git a/src/app/integrations/list/n8n-integration/n8n-integration.component.html b/src/app/integrations/list/n8n-integration/n8n-integration.component.html
new file mode 100644
index 000000000000..4bf00ea120e7
--- /dev/null
+++ b/src/app/integrations/list/n8n-integration/n8n-integration.component.html
@@ -0,0 +1,42 @@
+
+
+
+
diff --git a/src/app/integrations/list/n8n-integration/n8n-integration.component.scss b/src/app/integrations/list/n8n-integration/n8n-integration.component.scss
new file mode 100644
index 000000000000..ed107d983bb3
--- /dev/null
+++ b/src/app/integrations/list/n8n-integration/n8n-integration.component.scss
@@ -0,0 +1,32 @@
+p {
+ margin-bottom: 0px;
+}
+
+.header {
+ border-bottom: solid 1px #e0e0e0;
+ padding: 12px 12px;
+ font-weight: 400;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: space-between;
+ height: 50px;
+
+ .signup {
+ display: flex;
+
+ p {
+ margin: 0 0 0 5px;
+ }
+ }
+
+ .status {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+}
+
+.content {
+ padding: 20px;
+}
\ No newline at end of file
diff --git a/src/app/integrations/list/n8n-integration/n8n-integration.component.spec.ts b/src/app/integrations/list/n8n-integration/n8n-integration.component.spec.ts
new file mode 100644
index 000000000000..6ec47ef234c7
--- /dev/null
+++ b/src/app/integrations/list/n8n-integration/n8n-integration.component.spec.ts
@@ -0,0 +1,23 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { N8nIntegrationComponent } from './n8n-integration.component';
+
+describe('N8nIntegrationComponent', () => {
+ let component: N8nIntegrationComponent;
+ let fixture: ComponentFixture
;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ N8nIntegrationComponent ]
+ })
+ .compileComponents();
+
+ fixture = TestBed.createComponent(N8nIntegrationComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/integrations/list/n8n-integration/n8n-integration.component.ts b/src/app/integrations/list/n8n-integration/n8n-integration.component.ts
new file mode 100644
index 000000000000..f845c10d93c8
--- /dev/null
+++ b/src/app/integrations/list/n8n-integration/n8n-integration.component.ts
@@ -0,0 +1,31 @@
+import { Component, EventEmitter, Input, OnInit, Output, SimpleChanges } from '@angular/core';
+import { LoggerService } from 'app/services/logger/logger.service';
+
+@Component({
+ selector: 'n8n-integration',
+ templateUrl: './n8n-integration.component.html',
+ styleUrls: ['./n8n-integration.component.scss']
+})
+export class N8nIntegrationComponent implements OnInit {
+
+ @Input() integration: any;
+ @Output() onUpdateIntegration = new EventEmitter;
+ @Output() onDeleteIntegration = new EventEmitter;
+
+ translateparams: any;
+
+ constructor(
+ private logger: LoggerService
+ ) { }
+
+ ngOnInit(): void {
+ this.logger.log("[INT-n8n] integration (oninit)", this.integration);
+ this.translateparams = { intname: 'n8n' };
+ }
+
+ ngOnChanges(changes: SimpleChanges): void {
+ this.logger.log("[INT-Make] integration (onchanges) changes", changes);
+ this.logger.log("[INT-Make] integration (onchanges) integration", this.integration);
+ }
+
+}
diff --git a/src/app/integrations/utils.ts b/src/app/integrations/utils.ts
index e11f1a20e65e..ecc091c4b701 100644
--- a/src/app/integrations/utils.ts
+++ b/src/app/integrations/utils.ts
@@ -11,6 +11,7 @@ export enum INTEGRATIONS_KEYS {
MESSENGER = 'messenger',
MAILCHIMP = 'mailchimp',
MAKE = 'make',
+ N8N = 'n8n',
PIPEDRIVE = 'pipedrive',
SALESFORCE = 'salesforce',
TWILIO_SMS = "sms",
@@ -67,8 +68,8 @@ export const CATEGORIES_LIST = [
export const INTEGRATIONS_LIST: { [key: string]: { name: string, category: INTEGRATIONS_CATEGORIES, key: INTEGRATIONS_KEYS, src_icon: string, src_logo: string, pro?: boolean, plan: 'Sandbox' | 'Basic' | 'Premium' | 'Custom' } } = {
- //BREVO: { name: "Brevo", category: INTEGRATIONS_CATEGORIES.CRM, key: INTEGRATIONS_KEYS.BREVO, src_icon: "assets/img/int/brevo.png", src_logo: "assets/img/int/brevo-logo.png", pro: true, plan: 'Premium' },
- CUSTOMERIO: { name: "Customer.io", category: INTEGRATIONS_CATEGORIES.CRM, key: INTEGRATIONS_KEYS.CUSTOMERIO, src_icon: "assets/img/int/customer-io-logo-color.svg", src_logo: "assets/img/int/customerio-logo_new.svg", pro: true, plan: 'Premium' },
+ BREVO: { name: "Brevo", category: INTEGRATIONS_CATEGORIES.CRM, key: INTEGRATIONS_KEYS.BREVO, src_icon: "assets/img/int/brevo.png", src_logo: "assets/img/int/brevo-logo.png", pro: true, plan: 'Premium' },
+ CUSTOMERIO: { name: "Customer.io", category: INTEGRATIONS_CATEGORIES.CRM, key: INTEGRATIONS_KEYS.CUSTOMERIO, src_icon: "assets/img/int/customer-io-logo-color.svg", src_logo: "assets/img/int/customerio-logo_new.svg", pro: true, plan: 'Premium' },
HUBSPOT: { name: "HubSpot", category: INTEGRATIONS_CATEGORIES.CRM, key: INTEGRATIONS_KEYS.HUBSPOT, src_icon: "assets/img/int/hubspot.png", src_logo: "assets/img/int/hubspot-logo.svg", pro: true, plan: 'Premium' },
OPENAI: { name: "OpenAI", category: INTEGRATIONS_CATEGORIES.AI, key: INTEGRATIONS_KEYS.OPENAI, src_icon: "assets/cds/images/actions/openai-icon.svg", src_logo: "assets/img/int/openai-logo.svg", pro: true, plan: 'Custom' },
QAPLA: { name: "Qapla'", category: INTEGRATIONS_CATEGORIES.ECOMMERCE, key: INTEGRATIONS_KEYS.QAPLA, src_icon: "assets/cds/images/actions/qapla.jpg", src_logo: "assets/img/int/qapla-logo.png", pro: true, plan: 'Premium' },
@@ -77,6 +78,7 @@ export const INTEGRATIONS_LIST: { [key: string]: { name: string, category: INTEG
//KLAVIYO: { name: "Klaviyo", category: INTEGRATIONS_CATEGORIES.AUTOMATION, key: INTEGRATIONS_KEYS.KLAVIYO, src_icon: "assets/img/int/klaviyo-icon.png", src_logo: "assets/img/int/klaviyo-logo.png", pro: true, plan: 'Premium' },
//MAILCHIMP: { name: "Mailchimp", category: INTEGRATIONS_CATEGORIES.EMAIL, key: INTEGRATIONS_KEYS.MAILCHIMP, src_icon: "assets/img/int/mailchimp-icon.png", src_logo: "assets/img/int/mailchimp-logo.png", pro: true, plan: 'Premium' },
MAKE: { name: "Make", category: INTEGRATIONS_CATEGORIES.INT_PLAT, key: INTEGRATIONS_KEYS.MAKE, src_icon: "assets/img/int/make-icon.png", src_logo: "assets/img/int/make-logo.svg", pro: true, plan: 'Basic'},
+ N8N: { name: "N8N", category: INTEGRATIONS_CATEGORIES.INT_PLAT, key: INTEGRATIONS_KEYS.N8N, src_icon: "assets/img/int/n8n-icon.svg", src_logo: "assets/img/int/n8n-logo.png", pro: true, plan: 'Basic'},
//PIPEDRIVE: { name: "Pipedrive", category: INTEGRATIONS_CATEGORIES.CRM, key: INTEGRATIONS_KEYS.PIPEDRIVE, src_icon: "assets/img/int/pipedrive-icon.png", src_logo: "assets/img/int/pipedrive-logo.png", pro: true, plan: 'Premium' },
//SALESFORCE: { name: "Salesforce", category: INTEGRATIONS_CATEGORIES.CRM, key: INTEGRATIONS_KEYS.SALESFORCE, src_icon: "assets/img/int/salesforce-icon.png", src_logo: "assets/img/int/salesforce-logo.png", pro: true, plan: 'Premium' },
//ZAPIER: { name: "Zapier", category: INTEGRATIONS_CATEGORIES.INT_PLAT, key: INTEGRATIONS_KEYS.ZAPIER, src_icon: "assets/img/int/zapier-icon.png", src_logo: "assets/img/int/zapier-logo.svg", pro: true, plan: 'Basic' },
@@ -187,3 +189,11 @@ export class MakeIntegration extends Integration {
this.value = {}
}
}
+
+export class N8nIntegration extends Integration {
+ constructor() {
+ super();
+ this.name = INTEGRATIONS_KEYS.N8N;
+ this.value = {};
+ }
+}
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/modals/knowledge-base-table/knowledge-base-table.component.html b/src/app/knowledge-bases/modals/knowledge-base-table/knowledge-base-table.component.html
index a09b614beaf3..25e7f79983ce 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 }}
@@ -1537,6 +1537,7 @@
+
@@ -1550,6 +1551,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 34d3af97688b..fce91a1aaa5b 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
@@ -2408,6 +2408,8 @@ export class HistoryAndNortConvsComponent extends WsSharedComponent implements O
// this.conversationTypeValue = '';
// }
+ this.conversationTypeValue = 'all'
+ this.conversation_type = 'all'
if (this.requester_email) {
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 95ccb970e735..e8574f9b2bb9 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
@@ -313,7 +313,7 @@
{{countRequestsServedByHumanRr }}
-
+
{{'AssignedToHumans' | translate}}
@@ -330,7 +330,7 @@
{{countRequestsServedByBotRr }}
-
+
{{'AssignedToBots' | translate}}
@@ -344,7 +344,7 @@
{{ countRequestsUnservedRr }}
-
{{'Unserved' | translate}}
+
{{'Unserved' | translate}}
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 5fb8ea1523cb..980472a2bd9e 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
@@ -531,6 +531,21 @@
+
+
+
+
+
+
+
+ {{'MessageChannel' | translate}}:
+
+ SMS
+
+
+
+
diff --git a/src/app/ws_requests/ws-requests-msgs/ws-requests-msgs.component.html b/src/app/ws_requests/ws-requests-msgs/ws-requests-msgs.component.html
index 70df21c4cf66..3deff3c71137 100755
--- a/src/app/ws_requests/ws-requests-msgs/ws-requests-msgs.component.html
+++ b/src/app/ws_requests/ws-requests-msgs/ws-requests-msgs.component.html
@@ -3327,7 +3327,7 @@
-
+
-
+
{{dept?.name}}
- {{'Departments' | translate}} ( {{departments?.length }})
+ {{'Departments' | translate}} ( {{departments?.length }} )
2 Currently I am {{panelOpenState ? 'open' : 'closed'}}
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/assets/img/int/n8n-icon.svg b/src/assets/img/int/n8n-icon.svg
new file mode 100644
index 000000000000..c0d3e6f5de1a
--- /dev/null
+++ b/src/assets/img/int/n8n-icon.svg
@@ -0,0 +1,3 @@
+
+
+
diff --git a/src/assets/img/int/n8n-logo.png b/src/assets/img/int/n8n-logo.png
new file mode 100644
index 000000000000..2bb6b2d750a1
Binary files /dev/null and b/src/assets/img/int/n8n-logo.png differ