Merge pull request #51 in DEFINMA/definma-ui from test-site-additions to master
* commit 'ab45dd6b5b0bb6e8a1c719f7519831902601c6c3': Adjust CSP to support pdfmake Add Test Mode banner when running in test container
This commit is contained in:
commit
bd6917e15f
@ -1,4 +1,4 @@
|
||||
add_header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'; connect-src https://*.apps.de1.bosch-iot-cloud.com; form-action 'none'; frame-ancestors 'none'; base-uri 'self'";
|
||||
add_header Content-Security-Policy "default-src 'none'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'; connect-src https://*.apps.de1.bosch-iot-cloud.com; form-action 'none'; frame-ancestors 'none'; base-uri 'self'";
|
||||
add_header X-Frame-Options DENY;
|
||||
add_header X-DNS-Prefetch-Control off;
|
||||
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains";
|
||||
|
@ -52,6 +52,7 @@
|
||||
</a>
|
||||
</ng-template>
|
||||
<span class="dev-label" *ngIf="devMode">DEVELOPMENT</span>
|
||||
<span class="dev-label" *ngIf="testMode">TESTING</span>
|
||||
DeFinMa
|
||||
</div>
|
||||
</rb-full-header>
|
||||
|
@ -6,7 +6,6 @@ import {HelpComponent} from './help/help.component';
|
||||
import {DataService} from './services/data.service';
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
@ -17,6 +16,7 @@ export class AppComponent implements OnInit{
|
||||
bugReport = {do: '', work: ''}; // Data from bug report inputs
|
||||
isDocumentation = false; // True if user is on documentation pages
|
||||
devMode = false;
|
||||
testMode = false;
|
||||
|
||||
constructor(
|
||||
public login: LoginService,
|
||||
@ -27,6 +27,9 @@ export class AppComponent implements OnInit{
|
||||
public d: DataService
|
||||
) {
|
||||
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 => {
|
||||
if (event instanceof NavigationStart) {
|
||||
this.isDocumentation = /\/documentation/.test(event.url);
|
||||
@ -80,5 +83,3 @@ export class AppComponent implements OnInit{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user