diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 1a4f2ba5b052..1648bd328d28 100755
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -364,6 +364,7 @@ import { HomeNewsFeedModalComponent } from './home-components/home-news-feed/hom
import { AutomationsComponent } from './automations/automations.component';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { HomeCdsComponent } from './home-components/home-cds/home-cds.component';
+import { AutomationStaticComponent } from './static-pages/automation-static/automation-static.component';
@@ -643,7 +644,8 @@ const appInitializerFn = (appConfig: AppConfigService, brandService: BrandServic
OnboardingWelcomeComponent,
HomeNewsFeedModalComponent,
AutomationsComponent,
- HomeCdsComponent
+ HomeCdsComponent,
+ AutomationStaticComponent
],
imports: [
TooltipModule.forRoot(CutomTooltipOptions as TooltipOptions),
diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts
index 42c22cf7c513..784c460c5863 100755
--- a/src/app/app.routing.ts
+++ b/src/app/app.routing.ts
@@ -81,6 +81,7 @@ import { ActivitiesStaticComponent } from './static-pages/activities-static/acti
import { HoursStaticComponent } from './static-pages/hours-static/hours-static.component';
import { DepartmentsStaticComponent } from './static-pages/departments-static/departments-static.component';
import { ContactsStaticComponent } from './static-pages/contacts-static/contacts-static.component';
+import { AutomationStaticComponent } from './static-pages/automation-static/automation-static.component';
import { AnalyticsComponent } from './analytics/analytics.component';
import { PanoramicaComponent } from './analytics/panoramica/panoramica.component';
@@ -150,6 +151,7 @@ import { AutomationsComponent } from './automations/automations.component';
+
const routes: Routes = [
// Lazy loading
@@ -458,7 +460,9 @@ const routes: Routes = [
{ path: 'project/:projectid/hours-demo', component: HoursStaticComponent, canActivate: [AuthGuard] },
// AUTOMATIONS
- { path: 'project/:projectid/automations', component: AutomationsComponent, canActivate: [AuthGuard]},
+ { path: 'project/:projectid/automations', component: AutomationsComponent, canActivate: [AuthGuard, ProjectProfileGuard]},
+ { path: 'project/:projectid/automations-demo', component: AutomationStaticComponent, canActivate: [AuthGuard]},
+
// KNOWLEDGE BASES
{ path: 'project/:projectid/knowledge-bases', component: KnowledgeBasesComponent, canActivate: [AuthGuard]},
diff --git a/src/app/automations/automations.component.scss b/src/app/automations/automations.component.scss
index e81b75a23cba..07c1a8bf0f3b 100644
--- a/src/app/automations/automations.component.scss
+++ b/src/app/automations/automations.component.scss
@@ -38,7 +38,7 @@ p {
display: flex;
flex-direction: column;
align-items: center;
- padding: 80px;
+ padding: 80px 100px 80px 80px;
.material-icons-outlined {
font-size: 60px;
diff --git a/src/app/core/project-profile.guard.ts b/src/app/core/project-profile.guard.ts
index c2d153f63328..0650e71c6001 100755
--- a/src/app/core/project-profile.guard.ts
+++ b/src/app/core/project-profile.guard.ts
@@ -70,6 +70,14 @@ export class ProjectProfileGuard implements CanActivate {
// console.log('[PROJECT-PROFILE-GUARD] (NEW WF) -> Plan type', type, 'Plan name: ', planName, ' - userIsAuthorized: ', this.userIsAuthorized);
// console.log('[PROJECT-PROFILE-GUARD] (NEW WF) -> PAGE IS ACTIVITIES', url.indexOf('/activities') !== -1);
}
+
+ if ((planName !== PLAN_NAME.C && url.indexOf('/automations') !== -1)) {
+ this.userIsAuthorized = false;
+ // console.log('[PROJECT-PROFILE-GUARD] (NEW WF) -> Plan type', type, 'Plan name: ', planName, ' - userIsAuthorized: ', this.userIsAuthorized);
+ // console.log('[PROJECT-PROFILE-GUARD] (NEW WF) -> PAGE IS ACTIVITIES', url.indexOf('/activities') !== -1);
+ }
+
+
// console.log('[PROJECT-PROFILE-GUARD] (NEW WF) Plan type', type, ' - userIsAuthorized ', this.userIsAuthorized);
}
}
@@ -210,6 +218,15 @@ export class ProjectProfileGuard implements CanActivate {
} else {
// console.log('[PROJECT-PROFILE-GUARD] (NEW WF) -> PAGE IS ACTIVITIES', url.indexOf('/activities') !== -1);
}
+
+ if ((planName !== PLAN_NAME.C && url.indexOf('/automations') !== -1)) {
+ this.userIsAuthorized = false;
+ console.log('[PROJECT-PROFILE-GUARD] (NEW WF) -> Plan type', type, 'Plan name: ', planName, ' - userIsAuthorized: ', this.userIsAuthorized);
+ console.log('[PROJECT-PROFILE-GUARD] (NEW WF) -> PAGE IS ACTIVITIES', url.indexOf('/automations') !== -1);
+
+ } else {
+ // console.log('[PROJECT-PROFILE-GUARD] (NEW WF) -> PAGE IS ACTIVITIES', url.indexOf('/activities') !== -1);
+ }
} else if (isActiveSubscription === false) {
// console.log('[PROJECT-PROFILE-GUARD] -> (NEW WF) isActiveSubscription 2', isActiveSubscription);
this.userIsAuthorized = false;
diff --git a/src/app/static-pages/automation-static/automation-static.component.html b/src/app/static-pages/automation-static/automation-static.component.html
new file mode 100644
index 000000000000..d70d1643d123
--- /dev/null
+++ b/src/app/static-pages/automation-static/automation-static.component.html
@@ -0,0 +1,78 @@
+
+
+
+ Last Automations
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ "AvailableFromThePlan" | translate: tparams }}
+
+
+
+
+
+
+
+
+
+ {{ "HavingCannedResponsesCanPutYouGreatAdvantage" | translate }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/static-pages/automation-static/automation-static.component.scss b/src/app/static-pages/automation-static/automation-static.component.scss
new file mode 100644
index 000000000000..2092baceb532
--- /dev/null
+++ b/src/app/static-pages/automation-static/automation-static.component.scss
@@ -0,0 +1,92 @@
+
+// @import './src/assets/css/slick/slick';
+// @import './src/assets/css/slick/slick-theme';
+
+
+.outline-btn-analytics {
+ background-color: transparent;
+ color: #1e88e5;
+ border-radius: 40px;
+ padding: 18px 36px;
+ line-height: 1.33em;
+ border: 2px solid #1e88e5;
+ font-weight: 500;
+ font-size: 14px;
+}
+
+.outline-btn-analytics:hover {
+ color: #fff;
+ background-color: #1e88e5;
+}
+
+
+
+.demopage-title {
+ margin-top:10px;
+ margin-bottom:5px;
+ font-family:'Poppins','Roboto', 'Arial', sans-serif;
+ text-align:center;
+ color: #1e88e5;
+ line-height: 41px;
+ font-weight: 400;
+}
+
+.demopage-subtitle {
+ margin-top: 5px !important;
+ font-family: 'Poppins','Roboto', 'Arial', sans-serif;
+ text-align:center;
+}
+
+ // to 992
+@media (max-width: 992px) {
+ .left-div-padding {
+ padding-top:10px;
+ }
+
+}
+
+@media (min-width:992px) {
+ .col-container {
+ display: flex;
+ // display: table;
+ }
+
+ .left-side-in-col-container {
+ float: none;
+ // display: table-cell;
+ display: -ms-flexbox;
+ display: -webkit-flex;
+ display: flex;
+ -ms-flex-align: center;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ align-items: center;
+ }
+
+ .right-side-in-col-container {
+ float: none;
+ display: table-cell;
+ }
+}
+
+
+@media (min-width:992px) and (max-width: 1340px){
+
+ .left-side-in-col-container {
+ width: 35% !important;
+ }
+
+ .right-side-in-col-container {
+ width: 65% !important;
+ }
+
+ .demopage-title {
+ font-size: 3rem !important;
+ }
+
+ .demopage-subtitle {
+ font-size: 1.5em !important;
+ }
+
+
+}
diff --git a/src/app/static-pages/automation-static/automation-static.component.spec.ts b/src/app/static-pages/automation-static/automation-static.component.spec.ts
new file mode 100644
index 000000000000..595dca5310ae
--- /dev/null
+++ b/src/app/static-pages/automation-static/automation-static.component.spec.ts
@@ -0,0 +1,23 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { AutomationStaticComponent } from './automation-static.component';
+
+describe('AutomationStaticComponent', () => {
+ let component: AutomationStaticComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ AutomationStaticComponent ]
+ })
+ .compileComponents();
+
+ fixture = TestBed.createComponent(AutomationStaticComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/static-pages/automation-static/automation-static.component.ts b/src/app/static-pages/automation-static/automation-static.component.ts
new file mode 100644
index 000000000000..e400aca23e58
--- /dev/null
+++ b/src/app/static-pages/automation-static/automation-static.component.ts
@@ -0,0 +1,212 @@
+import { Component, OnInit,OnDestroy } from '@angular/core';
+import { Router } from '@angular/router';
+import { AuthService } from '../../core/auth.service';
+import { StaticPageBaseComponent } from './../static-page-base/static-page-base.component';
+import { Subscription } from 'rxjs';
+import { NotifyService } from '../../core/notify.service';
+import { ProjectPlanService } from '../../services/project-plan.service';
+import { TranslateService } from '@ngx-translate/core';
+import { UsersService } from '../../services/users.service';
+import { LoggerService } from '../../services/logger/logger.service';
+import { AppConfigService } from 'app/services/app-config.service';
+import { PLAN_NAME } from 'app/utils/util';
+
+@Component({
+ selector: 'appdashboard-automation-static',
+ templateUrl: './automation-static.component.html',
+ styleUrls: ['./automation-static.component.scss']
+})
+export class AutomationStaticComponent extends StaticPageBaseComponent implements OnInit {
+
+ tparams: any;
+ imageObject = [
+ {
+ image: 'assets/img/automations-static.jpeg',
+ thumbImage: 'assets/img/automations-static.jpeg'
+ },
+ // {
+ // image: 'assets/img/contacts-static-2.png',
+ // thumbImage: 'assets/img/contacts-static-2.png'
+ // }
+ ];
+
+ prjct_profile_type: string;
+ subscription_is_active: any;
+ prjct_profile_name: string;
+ subscription_end_date: Date;
+ browserLang: string;
+
+ subscription: Subscription;
+
+ projectId: string;
+
+ USER_ROLE: string;
+ onlyOwnerCanManageTheAccountPlanMsg: string;
+ learnMoreAboutDefaultRoles: string;
+ profile_name: string;
+ isChromeVerGreaterThan100: boolean;
+ PLAN_NAME = PLAN_NAME
+
+ constructor(
+ private router: Router,
+ public auth: AuthService,
+ private prjctPlanService: ProjectPlanService,
+ private notify: NotifyService,
+ public translate: TranslateService,
+ private usersService: UsersService,
+ private logger: LoggerService,
+ public appConfigService: AppConfigService
+ ) { super(translate)}
+
+ ngOnInit(): void {
+ this.getOSCODE();
+ this.getCurrentProject();
+ this.getProjectPlan();
+ this.getProjectUserRole();
+ this.getTranslationStrings();
+ this.getBrowserVersion();
+ this.tparams = {'plan_name': PLAN_NAME.C}
+ }
+
+ getBrowserVersion() {
+ this.auth.isChromeVerGreaterThan100.subscribe((isChromeVerGreaterThan100: boolean) => {
+ this.isChromeVerGreaterThan100 = isChromeVerGreaterThan100;
+ // console.log("[BOT-CREATE] isChromeVerGreaterThan100 ",this.isChromeVerGreaterThan100);
+ })
+ }
+
+ getOSCODE() {
+ this.public_Key = this.appConfigService.getConfig().t2y12PruGU9wUtEGzBJfolMIgK;
+ this.logger.log('[CANNED-RES-STATIC] AppConfigService getAppConfig public_Key', this.public_Key)
+ this.logger.log('[CANNED-RES-STATIC] public_Key', this.public_Key)
+
+ let keys = this.public_Key.split("-");
+ // this.logger.log('PUBLIC-KEY (Navbar) - public_Key keys', keys)
+
+ keys.forEach(key => {
+ // this.logger.log('NavbarComponent public_Key key', key)
+ if (key.includes("PAY")) {
+ this.logger.log('[CANNED-RES-STATIC] PUBLIC-KEY - key', key);
+ let pay = key.split(":");
+ // this.logger.log('PUBLIC-KEY (Navbar) - pay key&value', pay);
+ if (pay[1] === "F") {
+ this.payIsVisible = false;
+ this.logger.log('[CANNED-RES-STATIC] - pay isVisible', this.payIsVisible);
+ } else {
+ this.payIsVisible = true;
+ this.logger.log('[CANNED-RES-STATIC] - pay isVisible', this.payIsVisible);
+ }
+ }
+ });
+
+ if (!this.public_Key.includes("PAY")) {
+ this.payIsVisible = false;
+ this.logger.log('[CANNED-RES-STATIC] - pay isVisible', this.payIsVisible);
+ }
+ }
+
+
+ getProjectUserRole() {
+ this.usersService.project_user_role_bs.subscribe((user_role) => {
+ this.USER_ROLE = user_role;
+ this.logger.log('[CANNED-RES-STATIC] - PROJECT USER ROLE: ', this.USER_ROLE);
+ });
+ }
+
+ getTranslationStrings() {
+ this.translateModalOnlyOwnerCanManageProjectAccount()
+ }
+
+ translateModalOnlyOwnerCanManageProjectAccount() {
+ this.translate.get('OnlyUsersWithTheOwnerRoleCanManageTheAccountPlan')
+ .subscribe((translation: any) => {
+ // this.logger.log('[DEPTS-STATIC] onlyOwnerCanManageTheAccountPlanMsg text', translation)
+ this.onlyOwnerCanManageTheAccountPlanMsg = translation;
+ });
+
+
+ this.translate.get('LearnMoreAboutDefaultRoles')
+ .subscribe((translation: any) => {
+ // this.logger.log('[DEPTS-STATIC] onlyOwnerCanManageTheAccountPlanMsg text', translation)
+ this.learnMoreAboutDefaultRoles = translation;
+ });
+ }
+
+ getBrowserLang() {
+ this.browserLang = this.translate.getBrowserLang();
+ }
+
+
+ getCurrentProject() {
+ this.auth.project_bs.subscribe((project) => {
+ // this.logger.log('[DEPTS-STATIC] - project ', project)
+
+ if (project) {
+ this.projectId = project._id
+ this.logger.log('[CANNED-RES-STATIC] - project Id ', this.projectId)
+ }
+ });
+ }
+
+ getProjectPlan() {
+ this.subscription = this.prjctPlanService.projectPlan$.subscribe((projectProfileData: any) => {
+ this.logger.log('[CANNED-RES-STATIC] GET PROJECT PROFILE', projectProfileData)
+ if (projectProfileData) {
+ this.prjct_profile_type = projectProfileData.profile_type;
+ this.subscription_is_active = projectProfileData.subscription_is_active;
+ this.subscription_end_date = projectProfileData.subscription_end_date
+ this.profile_name = projectProfileData.profile_name
+ this.buildPlanName(projectProfileData.profile_name, this.browserLang, this.prjct_profile_type);
+
+ if (this.prjct_profile_type === 'payment' && this.subscription_is_active === false) {
+
+ if (this.USER_ROLE === 'owner') {
+
+ if (this.profile_name !== PLAN_NAME.C) {
+
+ this.notify.displaySubscripionHasExpiredModal(true, this.profile_name, this.subscription_end_date)
+
+ } else if (this.profile_name === PLAN_NAME.C) {
+
+ this.notify.displayEnterprisePlanHasExpiredModal(true, this.profile_name, this.subscription_end_date);
+ }
+ }
+
+ }
+ }
+ }, err => {
+ this.logger.error('[CANNED-RES-STATIC] GET PROJECT PROFILE - ERROR', err);
+ }, () => {
+ this.logger.log('[CANNED-RES-STATIC] GET PROJECT PROFILE * COMPLETE *');
+ });
+ }
+
+ goToPricing() {
+ this.logger.log('[CNTCTS-STATIC] - goToPricing projectId ', this.projectId);
+ if (this.payIsVisible) {
+ if (this.USER_ROLE === 'owner') {
+ if (this.prjct_profile_type === 'payment' && this.subscription_is_active === false) {
+ this.notify._displayContactUsModal(true, 'upgrade_plan');
+ } else {
+ this.router.navigate(['project/' + this.projectId + '/pricing']);
+ // this.notify.presentContactUsModalToUpgradePlan(true);
+ }
+ } else {
+ this.presentModalOnlyOwnerCanManageTheAccountPlan();
+ }
+ } else {
+ this.notify._displayContactUsModal(true, 'upgrade_plan');
+ }
+ }
+
+ presentModalOnlyOwnerCanManageTheAccountPlan() {
+ // https://github.com/t4t5/sweetalert/issues/845
+ this.notify.presentModalOnlyOwnerCanManageTheAccountPlan(this.onlyOwnerCanManageTheAccountPlanMsg, this.learnMoreAboutDefaultRoles)
+ }
+
+
+ ngOnDestroy() {
+ this.subscription.unsubscribe();
+ }
+
+}
diff --git a/src/assets/img/automations-static.jpeg b/src/assets/img/automations-static.jpeg
new file mode 100644
index 000000000000..c1bf174c6667
Binary files /dev/null and b/src/assets/img/automations-static.jpeg differ