diff --git a/angular/src/app/app.module.ts b/angular/src/app/app.module.ts index a7a934e..9e1cf6b 100644 --- a/angular/src/app/app.module.ts +++ b/angular/src/app/app.module.ts @@ -1,7 +1,5 @@ import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; -import { RouterModule } from '@angular/router'; - import { LoyalityProgramComponent } from './pages/loyality-program/loyality-program.component'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; @@ -33,7 +31,6 @@ import { ShareButtonsModule } from 'ngx-sharebuttons/buttons'; import { ShareIconsModule } from 'ngx-sharebuttons/icons'; import { MessagingService } from './services/messaging.service'; import { NotFoundComponent } from './pages/not-found/not-found.component'; -import { DownloadAppDirective } from './directives/download-app.directive'; import { MatIconModule } from '@angular/material/icon'; import { GuestCardComponent } from './pages/guest-card/guest-card.component'; import { QrCodeModule } from 'ng-qrcode'; @@ -46,7 +43,6 @@ import { LoginComponent } from './pages/login/login.component'; import { NgxMatIntlTelInputComponent } from 'ngx-mat-intl-tel-input'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; -import { FocusNextInputDirective } from './directives/focus-next-input.directive'; import { MatSnackBarModule } from '@angular/material/snack-bar'; import { MAT_BOTTOM_SHEET_DATA, @@ -72,7 +68,6 @@ import { DirectivesModule } from './directives/directives.module'; UserDataComponent, RefSystemComponent, NotFoundComponent, - DownloadAppDirective, GuestCardComponent, AccordionComponent, LastOrderComponent, diff --git a/angular/src/app/directives/directives.module.ts b/angular/src/app/directives/directives.module.ts index 7eed56e..28b7064 100644 --- a/angular/src/app/directives/directives.module.ts +++ b/angular/src/app/directives/directives.module.ts @@ -1,12 +1,13 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FocusNextInputDirective } from './focus-next-input.directive'; +import { DownloadAppDirective } from './download-app.directive'; @NgModule({ imports: [ CommonModule ], - declarations: [FocusNextInputDirective], - exports: [FocusNextInputDirective] + declarations: [FocusNextInputDirective, DownloadAppDirective], + exports: [FocusNextInputDirective, DownloadAppDirective] }) export class DirectivesModule { } diff --git a/angular/src/app/directives/download-app.directive.ts b/angular/src/app/directives/download-app.directive.ts index 12f9154..40eaa18 100644 --- a/angular/src/app/directives/download-app.directive.ts +++ b/angular/src/app/directives/download-app.directive.ts @@ -5,6 +5,7 @@ import { OnInit, Renderer2, } from '@angular/core'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MessageService } from 'primeng/api'; @Directive({ @@ -17,7 +18,8 @@ export class DownloadAppDirective implements OnInit { constructor( private messageService: MessageService, public renderer: Renderer2, - private el: ElementRef + private el: ElementRef, + private _snackBar: MatSnackBar, ) {} ngOnInit(): void { @@ -57,10 +59,8 @@ export class DownloadAppDirective implements OnInit { event.preventDefault(); } if (this.deviceType === 'ios') { - this.messageService.add({ - severity: 'custom', - summary: `Для установки нажмите на кнопку поделиться в Вашем браузере и выберите пункт 'На экран «Домой»'`, - life: 5000, + this._snackBar.open(`Для установки нажмите на кнопку поделиться в Вашем браузере и выберите пункт 'На экран «Домой»'`, '', { + duration: 5000, }); return; } @@ -69,14 +69,16 @@ export class DownloadAppDirective implements OnInit { severity: 'error', summary: 'Не поддерживается в Вашем браузере!', }); + this._snackBar.open('Не поддерживается в Вашем браузере!', '', { + duration: 3000, + }); return; } this.deferredPrompt.prompt(); this.deferredPrompt.userChoice.then((res: any) => { if (res.outcome === 'accepted') { - this.messageService.add({ - severity: 'custom', - summary: 'Спасибо за установку!', + this._snackBar.open('Спасибо за установку!', '', { + duration: 3000, }); } this.deferredPrompt = null; diff --git a/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.html b/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.html index e3df091..c3ba5c6 100644 --- a/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.html +++ b/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.html @@ -1,5 +1,6 @@

{{title}}

-
+ +
diff --git a/angular/src/app/presentation-options/default-option/default-option.module.ts b/angular/src/app/presentation-options/default-option/default-option.module.ts index a6713cb..f007201 100644 --- a/angular/src/app/presentation-options/default-option/default-option.module.ts +++ b/angular/src/app/presentation-options/default-option/default-option.module.ts @@ -19,6 +19,7 @@ import { NgxMatIntlTelInputComponent } from 'ngx-mat-intl-tel-input'; import { MatInputModule } from '@angular/material/input'; import { DirectivesModule } from 'src/app/directives/directives.module'; import { LoyalityProgramComponent } from './pages/loyality-program/loyality-program.component'; +import {MatButtonModule} from '@angular/material/button'; @NgModule({ declarations: [ @@ -44,7 +45,8 @@ import { LoyalityProgramComponent } from './pages/loyality-program/loyality-prog NgxMatIntlTelInputComponent, ReactiveFormsModule, MatInputModule, - DirectivesModule + DirectivesModule, + MatButtonModule ], bootstrap: [IndexComponent], }) diff --git a/angular/src/app/services/wp-json.service.ts b/angular/src/app/services/wp-json.service.ts index 534cb02..20f973c 100644 --- a/angular/src/app/services/wp-json.service.ts +++ b/angular/src/app/services/wp-json.service.ts @@ -45,7 +45,7 @@ export class WpJsonService { getCustomerInfo(systemId: string, token: string, url: string): Observable { return this._request(`customer_info/${systemId}/${token}/`, 'GET', null, false, url).pipe( switchMap((response) => { - if (response.customer_info.errorCode !== 'Customer_CustomerNotFound') { + if (response?.customer_info?.errorCode !== 'Customer_CustomerNotFound') { return of(response) } else { return this.newCustomer(systemId, token, url).pipe(