AW-3488 Make startpage configurable
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// angular modules
|
||||
import { NgModule, APP_INITIALIZER, ModuleWithProviders, Injector, Optional, SkipSelf } from '@angular/core';
|
||||
import { NgModule, APP_INITIALIZER, ModuleWithProviders, Injector, Optional, SkipSelf,InjectionToken } from '@angular/core';
|
||||
import { CommonModule, DatePipe } from '@angular/common';
|
||||
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
@@ -66,6 +66,7 @@ import { AvatarComponent } from './components/avatar/avatar.component';
|
||||
import { AvatarModule } from 'ngx-avatar';
|
||||
import { ImageCropperModule } from 'ngx-image-cropper';
|
||||
|
||||
export const FM_COMMON_STARTPAGE = new InjectionToken<string>('fm-common-startpage');
|
||||
|
||||
export {
|
||||
SafePipe,
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<button type="button" class="btn btn-outline-secondary apponly" (click)="handleToggleMenu($event)"><i class="fal fa-bars" aria-hidden="true"></i></button>
|
||||
<router-outlet name="menu" class="ml-4"></router-outlet>
|
||||
<div class="collapse navbar-collapse pageonly">
|
||||
<a class="btn btn-primary ml-auto" role="button" [routerLink]="['/map']">
|
||||
<a class="btn btn-primary ml-auto" role="button" [routerLink]="[ startPage == null?'/map':startPage]">
|
||||
<span *ngIf="(user|async)==null" i18n>Sign in</span>
|
||||
<span *ngIf="(user|async)!=null" i18n>To app</span>
|
||||
</a>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit, OnDestroy, Inject, ViewEncapsulation, RendererFactory2, PLATFORM_ID, ChangeDetectionStrategy, HostListener, Input } from '@angular/core';
|
||||
import { Component, OnInit, OnDestroy, Inject, Optional,ViewEncapsulation, RendererFactory2, PLATFORM_ID, ChangeDetectionStrategy, HostListener, Input } from '@angular/core';
|
||||
import { Router, NavigationStart, NavigationEnd, RouteConfigLoadStart, RouteConfigLoadEnd, ActivatedRoute, PRIMARY_OUTLET } from '@angular/router';
|
||||
import { Meta, Title, MetaDefinition } from '@angular/platform-browser'; import { DOCUMENT } from "@angular/common";
|
||||
import { Subscription, Observable } from 'rxjs';
|
||||
@@ -6,6 +6,7 @@ import { distinctUntilChanged } from 'rxjs/operators';
|
||||
import { Store, Action } from '@ngrx/store';
|
||||
import { IUser } from '../../models/user';
|
||||
import { OAuthService, OAuthErrorEvent } from 'angular-oauth2-oidc';
|
||||
import { FM_COMMON_STARTPAGE} from '../../common.module';
|
||||
|
||||
//AppCommon
|
||||
import { IEventMessage } from '../../models/event.message';
|
||||
@@ -51,6 +52,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
@Input() showUploadProgress: boolean = true;
|
||||
|
||||
constructor(
|
||||
@Optional() @Inject(FM_COMMON_STARTPAGE) public startPage: string,
|
||||
public router: Router,
|
||||
private activatedRoute$: ActivatedRoute,
|
||||
private title$: Title,
|
||||
|
Reference in New Issue
Block a user