From 933ec9cf0fa1a5181f3f4ed40a0ca5e4dc92e764 Mon Sep 17 00:00:00 2001
From: kontrollanten <6680299+kontrollanten@users.noreply.github.com>
Date: Wed, 29 May 2024 11:43:34 +0200
Subject: [PATCH 1/5] chore: fix eslint for vs code
---
.eslintrc.json => .eslintrc.cjs | 5 +++--
client/{.eslintrc.json => .eslintrc.cjs} | 7 ++++---
2 files changed, 7 insertions(+), 5 deletions(-)
rename .eslintrc.json => .eslintrc.cjs (97%)
rename client/{.eslintrc.json => .eslintrc.cjs} (97%)
diff --git a/.eslintrc.json b/.eslintrc.cjs
similarity index 97%
rename from .eslintrc.json
rename to .eslintrc.cjs
index 17afd1b835c..af0b9c9e44f 100644
--- a/.eslintrc.json
+++ b/.eslintrc.cjs
@@ -1,4 +1,4 @@
-{
+module.exports = {
"extends": "standard-with-typescript",
"root": true,
"rules": {
@@ -146,6 +146,7 @@
"project": [
"./tsconfig.eslint.json"
],
- "EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true
+ "EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true,
+ "tsconfigRootDir": __dirname
}
}
diff --git a/client/.eslintrc.json b/client/.eslintrc.cjs
similarity index 97%
rename from client/.eslintrc.json
rename to client/.eslintrc.cjs
index d00e6e7abbc..5c2e1ae3255 100644
--- a/client/.eslintrc.json
+++ b/client/.eslintrc.cjs
@@ -1,4 +1,4 @@
-{
+module.exports = {
"root": true,
"ignorePatterns": [
"projects/**/*",
@@ -15,10 +15,11 @@
"tsconfig.eslint.json"
],
"EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true,
- "createDefaultProgram": false
+ "createDefaultProgram": false,
+ "tsconfigRootDir": __dirname,
},
"extends": [
- "../.eslintrc.json",
+ "../.eslintrc.cjs",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
From 7b9adce5d0bc58e045e00fe44e426f3160c6ac18 Mon Sep 17 00:00:00 2001
From: kontrollanten <6680299+kontrollanten@users.noreply.github.com>
Date: Thu, 12 Sep 2024 09:53:13 +0200
Subject: [PATCH 2/5] feat(client/videos-list): infinite scroll SEO
Add a "Load more" button in the bottom to help search engine bots to
navigate to the next page. In order to debug this functionality, add
?finiteScroll=true to the URL.
---
.../videos-list.component.html | 6 +++
.../videos-list.component.ts | 46 +++++++++++++------
2 files changed, 39 insertions(+), 13 deletions(-)
diff --git a/client/src/app/shared/shared-video-miniature/videos-list.component.html b/client/src/app/shared/shared-video-miniature/videos-list.component.html
index e6f735e7c62..5b9bc786286 100644
--- a/client/src/app/shared/shared-video-miniature/videos-list.component.html
+++ b/client/src/app/shared/shared-video-miniature/videos-list.component.html
@@ -81,4 +81,10 @@
+
+
diff --git a/client/src/app/shared/shared-video-miniature/videos-list.component.ts b/client/src/app/shared/shared-video-miniature/videos-list.component.ts
index 14db74ed9fe..0ffded05cac 100644
--- a/client/src/app/shared/shared-video-miniature/videos-list.component.ts
+++ b/client/src/app/shared/shared-video-miniature/videos-list.component.ts
@@ -1,6 +1,6 @@
import { NgClass, NgFor, NgIf, NgTemplateOutlet } from '@angular/common'
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, booleanAttribute } from '@angular/core'
-import { ActivatedRoute, RouterLink, RouterLinkActive } from '@angular/router'
+import { ActivatedRoute, NavigationEnd, Router, RouterLink, RouterLinkActive } from '@angular/router'
import {
AuthService,
ComponentPaginationLight,
@@ -18,7 +18,7 @@ import { ResultList, UserRight, VideoSortField } from '@peertube/peertube-models
import { logger } from '@root-helpers/logger'
import debug from 'debug'
import { Observable, Subject, Subscription, forkJoin, fromEvent, of } from 'rxjs'
-import { concatMap, debounceTime, map, switchMap } from 'rxjs/operators'
+import { concatMap, debounceTime, filter, map, switchMap } from 'rxjs/operators'
import { InfiniteScrollerDirective } from '../shared-main/common/infinite-scroller.directive'
import { ButtonComponent } from '../shared-main/buttons/button.component'
import { FeedComponent } from '../shared-main/feeds/feed.component'
@@ -67,7 +67,8 @@ enum GroupDate {
VideoFiltersHeaderComponent,
InfiniteScrollerDirective,
VideoMiniatureComponent,
- GlobalIconComponent
+ GlobalIconComponent,
+ RouterLink
]
})
export class VideosListComponent implements OnInit, OnChanges, OnDestroy {
@@ -97,7 +98,7 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy {
@Input() displayOptions: MiniatureDisplayOptions
- @Input({ transform: booleanAttribute }) disabled = false
+ @Input({ transform: booleanAttribute }) disabled: boolean
@Output() filtersChanged = new EventEmitter()
@Output() videosLoaded = new EventEmitter