From 3cc61b66e8d0c13196e661359a94c411bff6adc4 Mon Sep 17 00:00:00 2001
From: Sudharaka Palamakumbura
Date: Fri, 12 Jun 2020 16:22:46 -0700
Subject: [PATCH] fix: add ng2-adsense library for google adsense support
---
package.json | 1 +
.../com/asanka/tutor/config/SecurityConfiguration.java | 2 +-
src/main/webapp/app/home/home.component.html | 2 ++
src/main/webapp/app/home/home.module.ts | 4 ++++
src/main/webapp/index.html | 1 +
yarn.lock | 7 +++++++
6 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/package.json b/package.json
index f1acfbbe..d5d4fde0 100644
--- a/package.json
+++ b/package.json
@@ -29,6 +29,7 @@
"core-js": "3.2.1",
"moment": "2.26.0",
"ng-jhipster": "0.10.1",
+ "ng2-adsense": "6.0.3",
"ngx-cookie": "4.0.2",
"ngx-infinite-scroll": "7.1.0",
"ngx-webstorage": "4.0.2",
diff --git a/src/main/java/com/asanka/tutor/config/SecurityConfiguration.java b/src/main/java/com/asanka/tutor/config/SecurityConfiguration.java
index ec049c18..cb7fa45f 100644
--- a/src/main/java/com/asanka/tutor/config/SecurityConfiguration.java
+++ b/src/main/java/com/asanka/tutor/config/SecurityConfiguration.java
@@ -63,7 +63,7 @@ public void configure(HttpSecurity http) throws Exception {
.accessDeniedHandler(problemSupport)
.and()
.headers()
- .contentSecurityPolicy("default-src 'self' https://usebasin.com/ https://www.google-analytics.com/; frame-src 'self' https://www.youtube.com/ https://js.stripe.com/ https://repl.it/@SudharakaP/; img-src 'self' https://avatars.dicebear.com https://www.google-analytics.com/; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://js.stripe.com/v3/ https://www.google-analytics.com/ https://drive.google.com/; style-src 'self' 'unsafe-inline'")
+ .contentSecurityPolicy("default-src 'self' https://usebasin.com/ https://www.google-analytics.com/ https://pagead2.googlesyndication.com/ https://adservice.google.ca https://adservice.google.com https://www.googletagservices.com https://tpc.googlesyndication.com; frame-src 'self' https://www.youtube.com/ https://js.stripe.com/ https://repl.it/@SudharakaP/; img-src 'self' https://avatars.dicebear.com https://www.google-analytics.com/; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://js.stripe.com/v3/ https://www.google-analytics.com/ https://drive.google.com/ https://pagead2.googlesyndication.com/ https://adservice.google.ca https://adservice.google.com https://www.googletagservices.com https://tpc.googlesyndication.com; style-src 'self' 'unsafe-inline'")
.and()
.referrerPolicy(ReferrerPolicyHeaderWriter.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN)
.and()
diff --git a/src/main/webapp/app/home/home.component.html b/src/main/webapp/app/home/home.component.html
index adeb7e6d..cb691759 100644
--- a/src/main/webapp/app/home/home.component.html
+++ b/src/main/webapp/app/home/home.component.html
@@ -90,6 +90,7 @@ Revenue Neutral
+
@@ -120,6 +121,7 @@ Meet Our Team
aspires to improve and help uplift the education landscape of Sri Lanka.
+
diff --git a/src/main/webapp/app/home/home.module.ts b/src/main/webapp/app/home/home.module.ts
index 74dd59e8..fe08e410 100644
--- a/src/main/webapp/app/home/home.module.ts
+++ b/src/main/webapp/app/home/home.module.ts
@@ -7,11 +7,15 @@ import { MatButtonModule, MatInputModule, MatSnackBarModule } from '@angular/mat
import { EmailComponent } from './email/email.component';
import { EMAIL_ROUTE } from 'app/home/email/email.route';
import { ReactiveFormsModule } from '@angular/forms';
+import { AdsenseModule } from 'ng2-adsense';
@NgModule({
imports: [
OpenLearnrSharedModule,
RouterModule.forChild([HOME_ROUTE, ...EMAIL_ROUTE]),
+ AdsenseModule.forRoot({
+ adClient: 'ca-pub-8063185008208498'
+ }),
MatSnackBarModule,
MatButtonModule,
MatInputModule,
diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html
index c4faae31..115f0fec 100644
--- a/src/main/webapp/index.html
+++ b/src/main/webapp/index.html
@@ -11,6 +11,7 @@
+
diff --git a/yarn.lock b/yarn.lock
index 6828d077..ae1ef90c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -9084,6 +9084,13 @@ ng-jhipster@0.10.1:
dependencies:
tslib "^1.9.0"
+ng2-adsense@6.0.3:
+ version "6.0.3"
+ resolved "https://registry.yarnpkg.com/ng2-adsense/-/ng2-adsense-6.0.3.tgz#664b33ce7af67d9fae231098693731389716a5b0"
+ integrity sha512-+QPjmrgLjNtLun7Ms7JpexGAm0wiveCumQwPElkiGRTQTLiXG5Gay5QN3mmSfYo9azfSILMpZEouO9oDI4PwhA==
+ dependencies:
+ tslib "^1.9.0"
+
ngx-cookie@4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/ngx-cookie/-/ngx-cookie-4.0.2.tgz#dc0044826cc3482b723fa70ecc6cd12af057d862"