Add Test Mode banner when running in test container
This commit is contained in:
		@@ -52,6 +52,7 @@
 | 
				
			|||||||
			</a>
 | 
								</a>
 | 
				
			||||||
		</ng-template>
 | 
							</ng-template>
 | 
				
			||||||
		<span class="dev-label" *ngIf="devMode">DEVELOPMENT</span>
 | 
							<span class="dev-label" *ngIf="devMode">DEVELOPMENT</span>
 | 
				
			||||||
 | 
							<span class="dev-label" *ngIf="testMode">TESTING</span>
 | 
				
			||||||
		DeFinMa
 | 
							DeFinMa
 | 
				
			||||||
	</div>
 | 
						</div>
 | 
				
			||||||
</rb-full-header>
 | 
					</rb-full-header>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,7 +6,6 @@ import {HelpComponent} from './help/help.component';
 | 
				
			|||||||
import {DataService} from './services/data.service';
 | 
					import {DataService} from './services/data.service';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
@Component({
 | 
					@Component({
 | 
				
			||||||
	selector: 'app-root',
 | 
						selector: 'app-root',
 | 
				
			||||||
	templateUrl: './app.component.html',
 | 
						templateUrl: './app.component.html',
 | 
				
			||||||
@@ -16,7 +15,8 @@ export class AppComponent implements OnInit{
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	bugReport = {do: '', work: ''};  // Data from bug report inputs
 | 
						bugReport = {do: '', work: ''};  // Data from bug report inputs
 | 
				
			||||||
	isDocumentation = false;         // True if user is on documentation pages
 | 
						isDocumentation = false;         // True if user is on documentation pages
 | 
				
			||||||
		devMode = false;
 | 
						devMode = false;
 | 
				
			||||||
 | 
						testMode = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	constructor(
 | 
						constructor(
 | 
				
			||||||
		public login: LoginService,
 | 
							public login: LoginService,
 | 
				
			||||||
@@ -27,6 +27,9 @@ export class AppComponent implements OnInit{
 | 
				
			|||||||
		public d: DataService
 | 
							public d: DataService
 | 
				
			||||||
	) {
 | 
						) {
 | 
				
			||||||
		this.devMode = isDevMode();
 | 
							this.devMode = isDevMode();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// The site is considered to be in test mode when it is deployed inside the definma-test container
 | 
				
			||||||
 | 
							this.testMode = window.location.hostname === 'definma-test.apps.de1.bosch-iot-cloud.com';
 | 
				
			||||||
		this.router.events.subscribe(event => {
 | 
							this.router.events.subscribe(event => {
 | 
				
			||||||
			if (event instanceof NavigationStart) {
 | 
								if (event instanceof NavigationStart) {
 | 
				
			||||||
				this.isDocumentation = /\/documentation/.test(event.url);
 | 
									this.isDocumentation = /\/documentation/.test(event.url);
 | 
				
			||||||
@@ -80,5 +83,3 @@ export class AppComponent implements OnInit{
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user