From 55269c0460207ebd924fedeeb88fc0bca973b96d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Jun 2022 09:40:20 +0200 Subject: Fix search filters count --- client/src/app/+search/search-filters.component.ts | 8 +++--- .../shared/shared-search/advanced-search.model.ts | 31 ++++++++++------------ 2 files changed, 18 insertions(+), 21 deletions(-) (limited to 'client/src/app') diff --git a/client/src/app/+search/search-filters.component.ts b/client/src/app/+search/search-filters.component.ts index aaa4ecc5a..f9de04706 100644 --- a/client/src/app/+search/search-filters.component.ts +++ b/client/src/app/+search/search-filters.component.ts @@ -138,11 +138,11 @@ export class SearchFiltersComponent implements OnInit { private loadOriginallyPublishedAtYears () { this.originallyPublishedStartYear = this.advancedSearch.originallyPublishedStartDate ? new Date(this.advancedSearch.originallyPublishedStartDate).getFullYear().toString() - : null + : undefined this.originallyPublishedEndYear = this.advancedSearch.originallyPublishedEndDate ? new Date(this.advancedSearch.originallyPublishedEndDate).getFullYear().toString() - : null + : undefined } private loadFromDurationRange () { @@ -189,7 +189,7 @@ export class SearchFiltersComponent implements OnInit { this.advancedSearch.originallyPublishedStartDate = start.toISOString() } else { - this.advancedSearch.originallyPublishedStartDate = null + this.advancedSearch.originallyPublishedStartDate = undefined } if (this.originallyPublishedEndYear) { @@ -199,7 +199,7 @@ export class SearchFiltersComponent implements OnInit { this.advancedSearch.originallyPublishedEndDate = end.toISOString() } else { - this.advancedSearch.originallyPublishedEndDate = null + this.advancedSearch.originallyPublishedEndDate = undefined } } diff --git a/client/src/app/shared/shared-search/advanced-search.model.ts b/client/src/app/shared/shared-search/advanced-search.model.ts index e40fd2e66..1375820da 100644 --- a/client/src/app/shared/shared-search/advanced-search.model.ts +++ b/client/src/app/shared/shared-search/advanced-search.model.ts @@ -40,9 +40,6 @@ export class AdvancedSearch { searchTarget: SearchTargetType resultType: AdvancedSearchResultType - // Filters we don't want to count, because they are mandatory - private silentFilters = new Set([ 'sort', 'searchTarget' ]) - constructor (options?: { startDate?: string endDate?: string @@ -101,14 +98,7 @@ export class AdvancedSearch { } containsValues () { - const obj = this.toUrlObject() - for (const k of Object.keys(obj)) { - if (this.silentFilters.has(k)) continue - - if (this.isValidValue(obj[k])) return true - } - - return false + return this.size() !== 0 } reset () { @@ -193,12 +183,19 @@ export class AdvancedSearch { size () { let acc = 0 - const obj = this.toUrlObject() - for (const k of Object.keys(obj)) { - if (this.silentFilters.has(k)) continue - - if (this.isValidValue(obj[k])) acc++ - } + if (this.isValidValue(this.startDate) || this.isValidValue(this.endDate)) acc++ + if (this.isValidValue(this.originallyPublishedStartDate) || this.isValidValue(this.originallyPublishedEndDate)) acc++ + + if (this.isValidValue(this.nsfw)) acc++ + if (this.isValidValue(this.categoryOneOf)) acc++ + if (this.isValidValue(this.licenceOneOf)) acc++ + if (this.isValidValue(this.languageOneOf)) acc++ + if (this.isValidValue(this.tagsOneOf)) acc++ + if (this.isValidValue(this.tagsAllOf)) acc++ + if (this.isValidValue(this.durationMin) || this.isValidValue(this.durationMax)) acc++ + if (this.isValidValue(this.isLive)) acc++ + if (this.isValidValue(this.host)) acc++ + if (this.isValidValue(this.resultType)) acc++ return acc } -- cgit v1.2.3 From 9a872b03ddd7e4dea4d5bf9c4f290c4e47aec36e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Jun 2022 09:44:20 +0200 Subject: Fix upload banner icon margin --- .../actor-banner-edit.component.html | 14 ++++++++------ .../actor-banner-edit.component.scss | 4 ++++ 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'client/src/app') diff --git a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html index 266fc26c5..f675371d9 100644 --- a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html +++ b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html @@ -5,9 +5,7 @@
- - - +
+ + + + Upload a new banner + + diff --git a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.scss b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.scss index ec2de2528..90fcd81aa 100644 --- a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.scss +++ b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.scss @@ -25,3 +25,7 @@ margin-bottom: 0; } } + +my-global-icon { + margin: 0 5px; +} -- cgit v1.2.3 From 60ab5b99c76103d14c0f3ce7b3bba6d7451e2220 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Jun 2022 09:52:20 +0200 Subject: Fix filters error in console --- client/src/app/+my-library/my-videos/my-videos.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/src/app') diff --git a/client/src/app/+my-library/my-videos/my-videos.component.ts b/client/src/app/+my-library/my-videos/my-videos.component.ts index 64e56a250..91cc06702 100644 --- a/client/src/app/+my-library/my-videos/my-videos.component.ts +++ b/client/src/app/+my-library/my-videos/my-videos.component.ts @@ -67,7 +67,7 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { user: User - inputFilters: AdvancedInputFilter[] + inputFilters: AdvancedInputFilter[] = [] disabled = false -- cgit v1.2.3 From db129781cabca2c66d18cd1dcdfe40f87e9ec030 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Jun 2022 10:04:23 +0200 Subject: Fix button icon margin --- client/src/app/shared/shared-main/buttons/button.component.html | 2 +- client/src/app/shared/shared-main/buttons/button.component.scss | 6 ++++++ client/src/app/shared/shared-main/buttons/button.component.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'client/src/app') diff --git a/client/src/app/shared/shared-main/buttons/button.component.html b/client/src/app/shared/shared-main/buttons/button.component.html index 11c8ffedd..d1a4215e6 100644 --- a/client/src/app/shared/shared-main/buttons/button.component.html +++ b/client/src/app/shared/shared-main/buttons/button.component.html @@ -1,6 +1,6 @@ - + {{ label }} diff --git a/client/src/app/shared/shared-main/buttons/button.component.scss b/client/src/app/shared/shared-main/buttons/button.component.scss index c782ac3ef..c53b8f2e5 100644 --- a/client/src/app/shared/shared-main/buttons/button.component.scss +++ b/client/src/app/shared/shared-main/buttons/button.component.scss @@ -34,6 +34,12 @@ span[class$=-button] { @include button-with-icon(21px); width: 100%; // useful for ellipsis, allow to define a max-width on host component + + &.icon-only { + my-global-icon { + margin: 0; + } + } } .orange-button { diff --git a/client/src/app/shared/shared-main/buttons/button.component.ts b/client/src/app/shared/shared-main/buttons/button.component.ts index b97012d9a..52936a4d4 100644 --- a/client/src/app/shared/shared-main/buttons/button.component.ts +++ b/client/src/app/shared/shared-main/buttons/button.component.ts @@ -20,6 +20,7 @@ export class ButtonComponent { return { [this.className]: true, disabled: this.disabled, + 'icon-only': !this.label, 'responsive-label': this.responsiveLabel } } -- cgit v1.2.3 From a3d7aadb6dee3c23828672ddcc1227f412674e22 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Jun 2022 10:05:50 +0200 Subject: Fix my import expander icon Should not be displayed if there is no import error --- .../app/+my-library/my-video-imports/my-video-imports.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/src/app') diff --git a/client/src/app/+my-library/my-video-imports/my-video-imports.component.html b/client/src/app/+my-library/my-video-imports/my-video-imports.component.html index e0d4e8f14..1525d0bd1 100644 --- a/client/src/app/+my-library/my-video-imports/my-video-imports.component.html +++ b/client/src/app/+my-library/my-video-imports/my-video-imports.component.html @@ -24,7 +24,7 @@ - + -- cgit v1.2.3 From bffee1d538aa7b51b78d646a0d372b352c073cd8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Jun 2022 10:18:44 +0200 Subject: Fix classic select and ng select css inconsistency --- .../my-video-playlists/my-video-playlist-edit.component.scss | 5 +++++ .../app/+videos/+video-edit/video-add-components/video-send.scss | 2 +- .../+video-watch/shared/comment/video-comment-add.component.scss | 6 +++--- client/src/app/shared/shared-forms/markdown-textarea.component.scss | 1 - 4 files changed, 9 insertions(+), 5 deletions(-) (limited to 'client/src/app') diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.scss b/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.scss index 47c323d6d..840e449ea 100644 --- a/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.scss +++ b/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.scss @@ -20,6 +20,11 @@ input[type=text] { @include peertube-select-container(340px); } +my-select-channel { + display: block; + max-width: 340px; +} + input[type=submit] { @include peertube-button; @include orange-button; diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-send.scss b/client/src/app/+videos/+video-edit/video-add-components/video-send.scss index 7284ad00f..594999d66 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-send.scss +++ b/client/src/app/+videos/+video-edit/video-add-components/video-send.scss @@ -17,7 +17,7 @@ $width-size: 250px; align-items: center; .upload-icon { - @include apply-svg-color(#C6C6C6); + @include apply-svg-color($input-border-color); width: 90px; margin-bottom: 25px; diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.scss b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.scss index fb79991db..ae889dd38 100644 --- a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.scss +++ b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.scss @@ -57,8 +57,8 @@ form { width: $markdown-icon-width; svg { - color: #C6C6C6; - fill: #C6C6C6; + color: $input-border-color; + fill: $input-border-color; border-radius: 3px; } } @@ -67,7 +67,7 @@ form { &:active, &:hover { my-global-icon svg { - background-color: #C6C6C6; + background-color: $input-border-color; color: pvar(--mainBackgroundColor); fill: pvar(--mainBackgroundColor); } diff --git a/client/src/app/shared/shared-forms/markdown-textarea.component.scss b/client/src/app/shared/shared-forms/markdown-textarea.component.scss index 0b4872d46..5939bb999 100644 --- a/client/src/app/shared/shared-forms/markdown-textarea.component.scss +++ b/client/src/app/shared/shared-forms/markdown-textarea.component.scss @@ -4,7 +4,6 @@ $nav-preview-tab-height: 30px; $base-padding: 15px; -$input-border-color: #C6C6C6; $input-border-radius: 3px; @mixin in-small-view { -- cgit v1.2.3