Merge branch 'develop' into release/1.2

This commit is contained in:
Michael Auer
2020-12-15 14:11:28 +01:00
8 changed files with 61 additions and 66 deletions

View File

@@ -1,41 +1,8 @@
<lib-offline-overlay>
<!-- lib offline depends on these three elements to be present inside of it -->
<app-header
[ngClass]="{ loading: loading }"
*ngIf="authenticated"
></app-header>
<app-content
[ngClass]="{ loading: loading }"
*ngIf="authenticated"
></app-content>
<app-header [ngClass]="{ loading: loading }" *ngIf="authenticated"></app-header>
<app-content [ngClass]="{ loading: loading }" *ngIf="authenticated"></app-content>
<app-menu [ngClass]="{ loading: loading }" *ngIf="authenticated"></app-menu>
<img
*ngIf="loading"
src="/assets/images/Icon_Loading.svg"
class="app-loader"
/>
<img *ngIf="loading" src="/assets/images/Icon_Loading.svg" class="app-loader" />
</lib-offline-overlay>
<router-outlet></router-outlet>
<script *ngIf="includeGoogleAnalytics">
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
(i[r] =
i[r] ||
function () {
(i[r].q = i[r].q || []).push(arguments);
}),
(i[r].l = 1 * new Date());
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
})(
window,
document,
'script',
'https://www.google-analytics.com/analytics.js',
'ga'
);
ga('create', 'UA-76423009-5', 'auto');
</script>

View File

@@ -1,4 +1,4 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Component, Inject, OnDestroy, OnInit, Renderer2 } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
import { Store } from '@ngxs/store';
import { Subject } from 'rxjs';
@@ -9,6 +9,7 @@ import { ModuleSwitcher } from './core/models/app-switcher.enum';
import { AppState } from './core/store/state/app.state';
import { AppConfiguration } from './app-configuration';
import { NativeContainerService } from 'shared/lib/barcode-scanner';
import { DOCUMENT } from '@angular/common';
@Component({
selector: 'app-root',
@@ -31,7 +32,9 @@ export class AppComponent implements OnInit, OnDestroy {
private appService: AppService,
private router: Router,
private store: Store,
private nativeContainer: NativeContainerService
private nativeContainer: NativeContainerService,
@Inject(DOCUMENT) private document: Document,
private renderer: Renderer2
) {
// intialisations done only when app loads
this.appService.appLoadInitialisations();
@@ -54,6 +57,10 @@ export class AppComponent implements OnInit, OnDestroy {
this.loading = false;
this.containerNotificationMessage();
});
if (this.includeGoogleAnalytics) {
this.initGoogleAnalytics();
}
}
ngOnDestroy() {
@@ -67,4 +74,26 @@ export class AppComponent implements OnInit, OnDestroy {
this.nativeContainer.sendMessage({ userAuthenticated: this.ssoService.isAuthenticated() });
}
}
private initGoogleAnalytics() {
const htmlScript: HTMLScriptElement = this.renderer.createElement('script');
htmlScript.text = `
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
(i[r] =
i[r] ||
function () {
(i[r].q = i[r].q || []).push(arguments);
}),
(i[r].l = 1 * new Date());
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-76423009-5', 'auto');
`;
this.renderer.appendChild(this.document.body, htmlScript);
}
}

View File

@@ -1,11 +1,6 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {
NgModule,
ErrorHandler,
LOCALE_ID,
APP_INITIALIZER,
} from '@angular/core';
import { NgModule, ErrorHandler, LOCALE_ID, APP_INITIALIZER } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
@@ -32,10 +27,7 @@ import { AppState } from './core/store/state/app.state';
import { CartEntryState } from './core/store/state/cart-entry.state';
import { BranchState } from './core/store/state/branches.state';
import { SsoModule, SsoInterface } from 'sso';
import {
SsoAuthorizationInterceptor,
HttpErrorHandlerInterceptor,
} from './core/interceptors';
import { SsoAuthorizationInterceptor, HttpErrorHandlerInterceptor } from './core/interceptors';
import { DatePipe } from '@angular/common';
import { CountryState } from './core/store/state/countries.state';
import { HimaSalesErrorHandler } from './core/error/hima-sales.error-handler';
@@ -93,9 +85,7 @@ export function noop() {
return function () {};
}
export function remissionModuleOptionsFactory(
config: AppConfiguration
): RemissionModuleOptions {
export function remissionModuleOptionsFactory(config: AppConfiguration): RemissionModuleOptions {
return config.remissionModuleOptions;
}

View File

@@ -222,7 +222,7 @@
[primary]="true"
[load]="true"
[stayOnPage]="true"
[disabled]="inTheCartButtonDisabled"
[disabled]="inTheCartButtonDisabled || (showAvLoading | async)"
(loaded)="contentLoaded()"
(action)="openModal()"
#addtocart

View File

@@ -11,18 +11,15 @@
id="shelf-search-input"
[formControl]="searchForm"
(keyup)="onKeyup($event)"
tabindex="1"
/>
<span class="isa-input-warning" *ngIf="!!errorMessage?.length">{{
errorMessage
}}</span>
<span class="isa-input-warning" *ngIf="!!errorMessage?.length">{{ errorMessage }}</span>
<button
class="isa-input-reset"
type="reset"
*ngIf="
(!isFetchingData && searchQuery$ | async | showSearchResetPipe) ||
errorMessage
"
*ngIf="(!isFetchingData && searchQuery$ | async | showSearchResetPipe) || errorMessage"
(click)="resetForm()"
tabindex="-1"
></button>
<ng-container [ngSwitch]="isFetchingData">
<div class="spinner isa-mt-16" *ngSwitchCase="true"></div>
@@ -30,11 +27,10 @@
*ngSwitchDefault
#submitButton
class="isa-input-submit"
[class.scan]="
isIPad | appShowScanButton: (searchQuery$ | async):errorMessage
"
[class.scan]="isIPad | appShowScanButton: (searchQuery$ | async):errorMessage"
type="submit"
(click)="handleBtnClick(submitButton)"
tabindex="2"
></button>
</ng-container>
</div>

View File

@@ -112,6 +112,10 @@
cursor: pointer;
}
.search-icon:focus {
outline: none;
}
.clear-icon {
z-index: 2;
width: 24px;

View File

@@ -26,6 +26,7 @@ import { AutocompleteResults } from './models/autocomplete-results.model';
type="text"
#search
autofocus
tabindex="1"
/>
<span *ngIf="error && (!load || !loading)" class="error-message">{{ error }}</span>
<img
@@ -33,8 +34,16 @@ import { AutocompleteResults } from './models/autocomplete-results.model';
*ngIf="input.length && (!load || !loading)"
class="clear-icon"
[src]="branchColorMode ? '/assets/images/close-branch.svg' : '/assets/images/close.svg'"
tabindex="-1"
/>
<img
*ngIf="!load || !loading"
(keyup.enter)="emitSearch(input)"
(click)="emitSearch(input)"
class="search-icon"
src="/assets/images/Search_Icon.svg"
tabindex="2"
/>
<img *ngIf="!load || !loading" (click)="emitSearch(input)" class="search-icon" src="/assets/images/Search_Icon.svg" />
<div class="spinner" *ngIf="load && loading"></div>
</div>
<div

6
package-lock.json generated
View File

@@ -3262,7 +3262,7 @@
},
"@isa/catsearch-api": {
"version": "0.0.56",
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel@Local/npm/registry/@isa/catsearch-api/-/catsearch-api-0.0.56.tgz",
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/@isa/catsearch-api/-/catsearch-api-0.0.56.tgz",
"integrity": "sha1-VQWugpfYeSER3UnIsYOQVtnd5FA=",
"requires": {
"tslib": "^1.9.0"
@@ -3270,7 +3270,7 @@
},
"@isa/print-api": {
"version": "0.0.56",
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel@Local/npm/registry/@isa/print-api/-/print-api-0.0.56.tgz",
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/@isa/print-api/-/print-api-0.0.56.tgz",
"integrity": "sha1-8cSMtEczwDnSe/C8piozLDmVYMA=",
"requires": {
"tslib": "^1.9.0"
@@ -3278,7 +3278,7 @@
},
"@isa/remi-api": {
"version": "0.0.56",
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel@Local/npm/registry/@isa/remi-api/-/remi-api-0.0.56.tgz",
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/@isa/remi-api/-/remi-api-0.0.56.tgz",
"integrity": "sha1-bQBbsKL7D+j+nrB26qIOaobBjmc=",
"requires": {
"tslib": "^1.9.0"