Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Change WatchList layout
Fix issue with recordLimit not being applied
  • Loading branch information
Segi Hovav authored and Segi Hovav committed Dec 20, 2022
1 parent 52c75c4 commit fc75771
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 66 deletions.
80 changes: 16 additions & 64 deletions src/app/components/watchlist-detail/watchlist-detail.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,30 @@
</ion-row>
</ion-grid>

<a class="nooutline" *ngIf="detailObject?.IMDB_URL !== null" href="{{detailObject?.IMDB_URL}}" target="_blank">
<img *ngIf="detailObject?.IMDB_Poster !== null" class="poster" src="{{detailObject?.IMDB_Poster}}">
</a>

<img *ngIf="detailObject?.IMDB_URL === null && detailObject?.IMDB_Poster !== null" class="poster" src="{{detailObject?.IMDB_Poster}}">

<ion-row>
<ion-col [size]="10">
<ion-label>WatchList ID {{ detailObject?.WatchListID }}</ion-label>
</ion-col>

<ion-col [size]="2">
<ion-label>ID</ion-label>
<ion-label>Type: {{ dataService.getWatchListTypeName(detailObject?.WatchListTypeID) }}</ion-label>
</ion-col>

<ion-col [size]="1"></ion-col>
</ion-row>

<ion-col [size]="9">
<ion-label *ngIf="!isAdding">
{{ detailObject?.WatchListID }}
</ion-label>
<ion-row id="action_row" *ngIf="!isEditing && !isAdding">
<ion-col [size]="10">
<ion-button id="addToQueue" (click)="addToWatchListQueue(currWatchList)">Add to Queue</ion-button>
</ion-col>
</ion-row>

<ion-row>
<ion-col [size]="12"></ion-col>
<ion-col [size]="6">
<a class="nooutline" *ngIf="detailObject?.IMDB_URL !== null" href="{{detailObject?.IMDB_URL}}" target="_blank">
<img *ngIf="detailObject?.IMDB_Poster !== null" class="poster" src="{{detailObject?.IMDB_Poster}}">
</a>

<img *ngIf="detailObject?.IMDB_URL === null && detailObject?.IMDB_Poster !== null" class="poster" src="{{detailObject?.IMDB_Poster}}">
</ion-col>
</ion-row>

<ion-row>
Expand All @@ -70,32 +72,6 @@
</ion-col>
</ion-row>

<ion-row>
<ion-col [size]="12"></ion-col>
</ion-row>

<ion-row>
<ion-col [size]="2">
<ion-label>Type</ion-label>
</ion-col>

<ion-col [size]="1"></ion-col>

<ion-col [size]="9">
<ion-label *ngIf="!isAdding">
{{ dataService.getWatchListTypeName(detailObject?.WatchListTypeID) }}
</ion-label>

<ion-label *ngIf="isAdding && addItemID !== null && addItemID !== null">
{{ dataService.getWatchListTypeNameByWatchListItemID(addItemID) }}
</ion-label>
</ion-col>
</ion-row>

<ion-row>
<ion-col [size]="12"></ion-col>
</ion-row>

<ion-row>
<ion-col [size]="2">
<ion-label>Start Date</ion-label>
Expand All @@ -114,10 +90,6 @@
</ion-col>
</ion-row>

<ion-row>
<ion-col [size]="12"></ion-col>
</ion-row>

<ion-row>
<ion-col [size]="2">
<ion-label>End Date</ion-label>
Expand All @@ -136,10 +108,6 @@
</ion-col>
</ion-row>

<ion-row>
<ion-col [size]="12"></ion-col>
</ion-row>

<ion-row>
<ion-col [size]="3">
<ion-label>Source</ion-label>
Expand All @@ -161,8 +129,6 @@
</ion-row>

<ion-row *ngIf="(isAdding && addItemID !== '' && dataService.getWatchListTypeNameByWatchListItemID(addItemID) === 'TV') || (!isAdding && detailObject !== null && dataService.getWatchListTypeName(detailObject?.WatchListTypeID) === 'TV')">
<ion-col [size]="12"></ion-col>

<ion-col [size]="3">
<ion-label>Season</ion-label>
</ion-col>
Expand All @@ -178,10 +144,6 @@
</ion-col>
</ion-row>

<ion-row>
<ion-col [size]="12"></ion-col>
</ion-row>

<ion-row>
<ion-col [size]="2">
<ion-label>Notes</ion-label>
Expand All @@ -200,10 +162,6 @@
</ion-col>
</ion-row>

<ion-row>
<ion-col [size]="12"></ion-col>
</ion-row>

<ion-row>
<ion-col [size]="3">
<ion-label>Rating</ion-label>
Expand All @@ -217,12 +175,6 @@
<ion-icon *ngFor="let number of numSequence(dataService.ratingMax);let index=index" (click)="ratingClickHandler(index)" [name]="getRatingIcon(index)"></ion-icon>
</ion-col>
</ion-row>

<ion-row id="action_row" *ngIf="!isEditing && !isAdding">
<ion-col [size]="10">
<ion-button id="addToQueue" (click)="addToWatchListQueue(currWatchList)">Add to Queue</ion-button>
</ion-col>
</ion-row>
</ion-grid>

<ion-icon id="deleteIcon" name="trash-outline" *ngIf="!isAdding" (click)="deleteWatchList(currWatchList)"></ion-icon>
2 changes: 1 addition & 1 deletion src/app/components/watchlist-items/watchlist-items.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class WatchListItemsComponent implements DoCheck {
))
&& (
this.dataService.imdb_url_missing === true && wli.IMDB_URL === null
|| this.dataService.imdb_url_missing === false
|| this.dataService.imdb_url_missing === false && wli.IMDB_URL !== null
)
)
});
Expand Down
5 changes: 4 additions & 1 deletion src/app/components/watchlist/watchlist.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class WatchListComponent implements DoCheck {

ngDoCheck(): void {
if (typeof this.dataService.watchList !== 'undefined' && this.dataService.watchList.length > 0) {
this.filteredWatchList=this.dataService.watchList.filter((wl: IWatchList) => {
this.filteredWatchList=this.dataService.watchList.filter((wl: IWatchList, index: number) => {
return (
(this.dataService.searchTerm === ""
|| (this.dataService.searchTerm !== ""
Expand All @@ -31,6 +31,9 @@ export class WatchListComponent implements DoCheck {
|| (this.dataService.incompleteFilter !== true && wl.EndDate !== null))
)
});

if (this.filteredWatchList.length > this.dataService.recordLimit)
this.filteredWatchList.length = this.dataService.recordLimit;
}
}

Expand Down

0 comments on commit fc75771

Please sign in to comment.