Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Matei committed Dec 7, 2019
2 parents f8529b7 + 5fb3fab commit 72cf57a
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 13 deletions.
22 changes: 22 additions & 0 deletions angular.json
Expand Up @@ -44,6 +44,22 @@
}
],
"serviceWorker": true
},
"non-docker": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.non-docker.ts"
}
]
},
"prod-local-testing": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod-backend.local-testing.ts"
}
]
}
}
},
Expand All @@ -55,6 +71,12 @@
"configurations": {
"production": {
"browserTarget": "bookmarks:build:production"
},
"non-docker": {
"browserTarget": "bookmarks:build:non-docker"
},
"prod-backend": {
"browserTarget": "bookmarks:build:prod-local-testing"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "bookmarks.dev",
"version": "8.4.0",
"version": "8.5.0",
"license": "MIT",
"scripts": {
"ng": "ng",
Expand Down
@@ -1,4 +1,4 @@
export interface Webpage {
export interface WebpageData {
title: string;
metaDescription: string;
publishedOn?: Date;
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/user/userdata.store.ts
Expand Up @@ -75,7 +75,7 @@ export class UserDataStore {
this._userData.next(this.userData)
},
(errorResponse: HttpErrorResponse) => {
if (errorResponse.status === 404 && errorResponse.error.title === 'User data was not found') {
if (errorResponse.status === 404 && errorResponse.error.message === `User data NOT_FOUND for userId: ${this.userId}`) {
const initialUserData: UserData = {
userId: userId,
searches: [],
Expand Down
17 changes: 11 additions & 6 deletions src/app/public/bookmarks/public-bookmarks.service.ts
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';

import { Observable } from 'rxjs';
import { Webpage } from '../../core/model/webpage';
import { WebpageData } from '../../core/model/webpage-data';
import { Bookmark } from '../../core/model/bookmark';

import { environment } from 'environments/environment';
Expand Down Expand Up @@ -29,12 +29,17 @@ export class PublicBookmarksService {
return this.httpClient.get<Bookmark[]>(this.publicBookmarksApiBaseUrl, {params: params});
}

getScrapingData(url: string, youtubeVideoId: string): Observable<Webpage> {
const params = new HttpParams()
.set('url', url)
.set('youtubeVideoId', youtubeVideoId)
getScrapingData(location: string, youtubeVideoId: string): Observable<WebpageData> {
let params;
if (youtubeVideoId) {
params = new HttpParams()
.set('youtubeVideoId', youtubeVideoId)
} else {
params = new HttpParams()
.set('location', location);
}
return this.httpClient
.get<Webpage>(`${this.publicBookmarksApiBaseUrl}/scrape`, {params: params});
.get<WebpageData>(`${this.publicBookmarksApiBaseUrl}/scrape`, {params: params});
}

getPublicBookmarkByLocation(url: string): Observable<Bookmark> {
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/async-bookmark-list.component.ts
Expand Up @@ -181,7 +181,7 @@ export class AsyncBookmarkListComponent implements OnInit {
playYoutubeVideo(bookmark: Bookmark) {
const dialogConfig = new MatDialogConfig();

dialogConfig.disableClose = true;
dialogConfig.disableClose = false;
dialogConfig.autoFocus = true;

let relativeWidth = (this.innerWidth * 80) / 100; // take up to 80% of the screen size
Expand Down
@@ -1,6 +1,6 @@
<mat-dialog-content>
<div class="videoWrapper">
<iframe [src]='safeUrl' frameborder="0" allowfullscreen width="560" height="315"></iframe>
<iframe [src]='safeUrl' frameborder="0" allowfullscreen></iframe>
</div>
</mat-dialog-content>

Expand Down
Expand Up @@ -26,7 +26,7 @@ export class PlayYoutubeVideoDialogComponent implements OnInit {
}

close() {
this.dialogRef.close('DELETE_CANCELED');
this.dialogRef.close('Play Youtube Video Closed');
}

}
11 changes: 11 additions & 0 deletions src/environments/environment.non-docker.ts
@@ -0,0 +1,11 @@
export const environment = {
production: false,
APP_HOME_URL: 'http://localhost:4200',
API_URL: 'http://localhost:3000/api',
HOST: 'http://localhost:4200/',
keycloak: {
'realm': 'bookmarks',
'url': 'http://localhost:8380/auth',
'clientId': 'bookmarks'
}
};
2 changes: 1 addition & 1 deletion src/environments/environment.ts
Expand Up @@ -5,7 +5,7 @@ export const environment = {
HOST: 'http://localhost:4200/',
keycloak: {
'realm': 'bookmarks',
'url': 'http://localhost:8380/auth',
'url': 'http://localhost:8480/auth',
'clientId': 'bookmarks'
}
};
17 changes: 17 additions & 0 deletions src/styles.scss
Expand Up @@ -8,6 +8,12 @@ a {
color: #4078c0;
}

pre {
background-color: #f5f5f5;
border-radius: 3px;
padding: 12px 8px;
}

.navigation-space-buffer {
margin-top: 1rem;
}
Expand Down Expand Up @@ -71,6 +77,17 @@ ul.tags li:not(:last-child):after {
font-size: 1.18rem;
}

pre{
margin-bottom:1em;
padding:12px 8px;
width:auto;
max-height:600px;
overflow:auto;
font-family:Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,sans-serif;
font-size:13px;
background-color:#eff0f1;border-radius:3px
}

//highlight
.highlight {
background: yellow;
Expand Down

0 comments on commit 72cf57a

Please sign in to comment.