tango-app-ui-auth 3.3.1-beta.11 → 3.3.1-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -77,7 +77,7 @@ class AuthService {
77
77
  return this.http.post(`${this.middlewareApiUrl}/request-callback`, data);
78
78
  }
79
79
  isClientnameTaken(data) {
80
- return this.http.get(`${this.leadApiUrl}/isExists?clientName=${data}`);
80
+ return this.http.post(`${this.leadApiUrl}/isClientExist`, data);
81
81
  }
82
82
  isEmailTaken(data) {
83
83
  return this.http.get(`${this.leadApiUrl}/isExists?corporateEmail=${data}`);
@@ -556,7 +556,10 @@ class Step1Component {
556
556
  }));
557
557
  }
558
558
  onClientNameBlur() {
559
- this.subscriptions.push(this.authService.isClientnameTaken(this.aboutForm?.get('clientName')?.value).subscribe({
559
+ const data = {
560
+ clientName: this.aboutForm?.get('clientName')?.value
561
+ };
562
+ this.subscriptions.push(this.authService.isClientnameTaken(data).subscribe({
560
563
  next: (res) => {
561
564
  this.isClientNameTaken = res.data.isExists;
562
565
  this.cd.detectChanges();
@@ -564,7 +567,10 @@ class Step1Component {
564
567
  }));
565
568
  }
566
569
  onEmailBlur() {
567
- this.subscriptions.push(this.authService.isEmailTaken(this.aboutForm?.get('corporateEmail')?.value).subscribe({
570
+ const data = {
571
+ corporateEmail: this.aboutForm?.get('corporateEmail')?.value
572
+ };
573
+ this.subscriptions.push(this.authService.isClientnameTaken(data).subscribe({
568
574
  next: (res) => {
569
575
  this.isEmailTaken = res.data.isExists;
570
576
  this.cd.detectChanges();
@@ -572,7 +578,10 @@ class Step1Component {
572
578
  }));
573
579
  }
574
580
  onMobileNumberBlur() {
575
- this.subscriptions.push(this.authService.isMobileTaken(this.aboutForm?.get('mobileNumber')?.value).subscribe({
581
+ const data = {
582
+ mobileNumber: this.aboutForm?.get('mobileNumber')?.value
583
+ };
584
+ this.subscriptions.push(this.authService.isClientnameTaken(data).subscribe({
576
585
  next: (res) => {
577
586
  this.isMobileTaken = res.data.isExists;
578
587
  this.cd.detectChanges();
@@ -1359,15 +1368,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
1359
1368
  class TangoAuthSignupComponent {
1360
1369
  setterService;
1361
1370
  pageInfo;
1371
+ gs;
1372
+ router;
1362
1373
  formsCount = 3;
1363
1374
  account$ = new BehaviorSubject('');
1364
1375
  currentStep$ = new BehaviorSubject(1);
1365
1376
  isCurrentFormValid$ = new BehaviorSubject(false);
1366
1377
  prevStepdata;
1367
1378
  subscriptions = [];
1368
- constructor(setterService, pageInfo) {
1379
+ authlocalStorageToken;
1380
+ constructor(setterService, pageInfo, gs, router) {
1369
1381
  this.setterService = setterService;
1370
1382
  this.pageInfo = pageInfo;
1383
+ this.gs = gs;
1384
+ this.router = router;
1385
+ this.subscriptions.push(this.gs.environment.subscribe((env) => {
1386
+ if (env) {
1387
+ this.authlocalStorageToken = `${env.appVersion}-${env.USERDATA_KEY}`;
1388
+ this.authlocalStorageToken = localStorage.getItem(this.authlocalStorageToken);
1389
+ }
1390
+ }));
1371
1391
  }
1372
1392
  ngOnDestroy() {
1373
1393
  this.subscriptions.forEach((subscription) => {
@@ -1375,6 +1395,9 @@ class TangoAuthSignupComponent {
1375
1395
  });
1376
1396
  }
1377
1397
  ngOnInit() {
1398
+ if (this.authlocalStorageToken) {
1399
+ this.router.navigate(['/manage']);
1400
+ }
1378
1401
  this.subscriptions.push(this.setterService.$stepper.subscribe((data) => {
1379
1402
  if (data?.prev) {
1380
1403
  this.prevStep();
@@ -1405,13 +1428,13 @@ class TangoAuthSignupComponent {
1405
1428
  }
1406
1429
  this.currentStep$.next(prevStep);
1407
1430
  }
1408
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TangoAuthSignupComponent, deps: [{ token: ConversionService }, { token: i4.PageInfoService }], target: i0.ɵɵFactoryTarget.Component });
1431
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TangoAuthSignupComponent, deps: [{ token: ConversionService }, { token: i4.PageInfoService }, { token: i4.GlobalStateService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component });
1409
1432
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: TangoAuthSignupComponent, selector: "lib-tango-auth-signup", ngImport: i0, template: "<div class=\"row me-0\">\r\n <lib-vertical class=\"col-lg-4 col-xl-3 col-xxl-3 p-0\"></lib-vertical>\r\n\r\n <!--begin::Content-->\r\n <div class=\" col-lg-8 col-xl-9 col-xxl-9 mb-10\">\r\n <div class=\"current\">\r\n <ng-container *ngIf=\"currentStep$.value === 1\">\r\n <lib-step1 class=\"w-100 \" [prevStepdata]='prevStepdata' [updateParentModel]=\"updateAccount\" [defaultValues]=\"account$.value\"></lib-step1>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"currentStep$.value === 2\">\r\n <lib-step2 class=\"w-100 \" [updateParentModel]=\"updateAccount\" [defaultValues]=\"account$.value\"></lib-step2>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"currentStep$.value === 3\">\r\n <lib-step3 class=\"w-100 \"></lib-step3>\r\n </ng-container>\r\n </div>\r\n\r\n <!-- <div class=\"d-flex flex-stack py-2\">\r\n <div class=\"mr-2\">\r\n <ng-container *ngIf=\"currentStep$.value == 2\">\r\n <button type=\"button\" class=\"btn btn-lg btn-light-primary me-5\" (click)=\"prevStep()\">\r\n Previous\r\n </button>\r\n </ng-container>\r\n \r\n </div>\r\n\r\n </div> -->\r\n <!-- <div *ngIf=\"currentStep$.value !== 3\" class=\"my-5 d-flex flex-column flex-md-row flex-md-stack pt-3 container-fluid\">\r\n <div class=\"text-gray-900 order-2 order-md-1 ms-10\">\r\n <span class=\"text-muted fw-semibold me-1\">\u00A9 2024 </span>\r\n <a target=\"_blank\" class=\"text-gray-800 text-hover-primary\">Tango IT solutions</a>\r\n </div>\r\n <ul class=\"menu menu-gray-600 menu-hover-primary fw-semibold order-1 me-10\">\r\n <li class=\"menu-item\"><a target=\"_blank\" href=\"https://tangoeye.ai/#aboutus\" class=\"menu-link px-5\">About us</a></li>\r\n <li class=\"menu-item\"><a target=\"_blank\" href=\"https://tangoeye.ai/#contact\" class=\"menu-link px-5\">Contact Us</a></li>\r\n <li class=\"menu-item\"><a target=\"_blank\" href=\"https://tangoeye.ai/privacy-policy-2/\" class=\"menu-link px-5\">Privacy & policy</a></li>\r\n </ul>\r\n </div> -->\r\n </div>\r\n <!-- </div> -->\r\n </div>\r\n <!--end::Content-->\r\n<!-- </div> -->", styles: [""], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: Step1Component, selector: "lib-step1" }, { kind: "component", type: Step2Component, selector: "lib-step2" }, { kind: "component", type: Step3Component, selector: "lib-step3" }, { kind: "component", type: VerticalComponent, selector: "lib-vertical" }] });
1410
1433
  }
1411
1434
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TangoAuthSignupComponent, decorators: [{
1412
1435
  type: Component,
1413
1436
  args: [{ selector: 'lib-tango-auth-signup', template: "<div class=\"row me-0\">\r\n <lib-vertical class=\"col-lg-4 col-xl-3 col-xxl-3 p-0\"></lib-vertical>\r\n\r\n <!--begin::Content-->\r\n <div class=\" col-lg-8 col-xl-9 col-xxl-9 mb-10\">\r\n <div class=\"current\">\r\n <ng-container *ngIf=\"currentStep$.value === 1\">\r\n <lib-step1 class=\"w-100 \" [prevStepdata]='prevStepdata' [updateParentModel]=\"updateAccount\" [defaultValues]=\"account$.value\"></lib-step1>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"currentStep$.value === 2\">\r\n <lib-step2 class=\"w-100 \" [updateParentModel]=\"updateAccount\" [defaultValues]=\"account$.value\"></lib-step2>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"currentStep$.value === 3\">\r\n <lib-step3 class=\"w-100 \"></lib-step3>\r\n </ng-container>\r\n </div>\r\n\r\n <!-- <div class=\"d-flex flex-stack py-2\">\r\n <div class=\"mr-2\">\r\n <ng-container *ngIf=\"currentStep$.value == 2\">\r\n <button type=\"button\" class=\"btn btn-lg btn-light-primary me-5\" (click)=\"prevStep()\">\r\n Previous\r\n </button>\r\n </ng-container>\r\n \r\n </div>\r\n\r\n </div> -->\r\n <!-- <div *ngIf=\"currentStep$.value !== 3\" class=\"my-5 d-flex flex-column flex-md-row flex-md-stack pt-3 container-fluid\">\r\n <div class=\"text-gray-900 order-2 order-md-1 ms-10\">\r\n <span class=\"text-muted fw-semibold me-1\">\u00A9 2024 </span>\r\n <a target=\"_blank\" class=\"text-gray-800 text-hover-primary\">Tango IT solutions</a>\r\n </div>\r\n <ul class=\"menu menu-gray-600 menu-hover-primary fw-semibold order-1 me-10\">\r\n <li class=\"menu-item\"><a target=\"_blank\" href=\"https://tangoeye.ai/#aboutus\" class=\"menu-link px-5\">About us</a></li>\r\n <li class=\"menu-item\"><a target=\"_blank\" href=\"https://tangoeye.ai/#contact\" class=\"menu-link px-5\">Contact Us</a></li>\r\n <li class=\"menu-item\"><a target=\"_blank\" href=\"https://tangoeye.ai/privacy-policy-2/\" class=\"menu-link px-5\">Privacy & policy</a></li>\r\n </ul>\r\n </div> -->\r\n </div>\r\n <!-- </div> -->\r\n </div>\r\n <!--end::Content-->\r\n<!-- </div> -->" }]
1414
- }], ctorParameters: () => [{ type: ConversionService }, { type: i4.PageInfoService }] });
1437
+ }], ctorParameters: () => [{ type: ConversionService }, { type: i4.PageInfoService }, { type: i4.GlobalStateService }, { type: i3.Router }] });
1415
1438
 
1416
1439
  class TangoAuthForgotPasswordComponent {
1417
1440
  toast;