From 3787a3bff11d2259705015fe0d46ad0235f30682 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Tue, 3 Sep 2024 13:22:10 +0200 Subject: [PATCH 1/3] Revert "chore: fix lint" This reverts commit 20f53dff3f85dfaf97ce33785b7b675d54eabc73. --- .../autocomplete-textarea/autocomplete-textarea.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts index 0dc983d6..29dabac7 100644 --- a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts +++ b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts @@ -28,6 +28,7 @@ import { debounceTime } from 'rxjs/operators'; import { TransliterationService } from '../../transliteration.service'; import { EmojiInputService } from '../emoji-input.service'; import { CustomTemplatesService } from '../../custom-templates.service'; +import { ThemeService } from '../../theme.service'; /** * The `AutocompleteTextarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message. From 5a8ae44793783ebb6015c0b3d10fa1ed18fce386 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Tue, 3 Sep 2024 13:22:40 +0200 Subject: [PATCH 2/3] Revert "chore: fix unit test" This reverts commit f952d6a4b1d710977bacbe639cfd64605c112474. --- .../autocomplete-textarea.component.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts index 29dabac7..3fe8f4a4 100644 --- a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts +++ b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts @@ -133,6 +133,7 @@ export class AutocompleteTextareaComponent private transliterationService: TransliterationService, private emojiInputService: EmojiInputService, private customTemplatesService: CustomTemplatesService, + private themeService: ThemeService, private cdRef: ChangeDetectorRef ) { this.searchTerm$.pipe(debounceTime(300)).subscribe((searchTerm) => { @@ -199,7 +200,7 @@ export class AutocompleteTextareaComponent } if (changes.value && !this.value && this.messageInput) { this.messageInput.nativeElement.style.height = 'auto'; - this.chatClientService?.chatClient?.logger?.( + this.chatClientService.chatClient.logger( 'info', '[Autocomplete textarea] Value reset, adjusting textarea height to auto' ); @@ -210,7 +211,7 @@ export class AutocompleteTextareaComponent this.messageInput && this.isViewInited ) { - this.chatClientService?.chatClient?.logger?.( + this.chatClientService.chatClient.logger( 'info', '[Autocomplete textarea] Value changed' ); @@ -224,7 +225,7 @@ export class AutocompleteTextareaComponent ngAfterViewInit(): void { this.isViewInited = true; - this.chatClientService?.chatClient?.logger?.( + this.chatClientService.chatClient.logger( 'info', '[Autocomplete textarea] View inited' ); @@ -262,7 +263,7 @@ export class AutocompleteTextareaComponent inputChanged() { this.valueChange.emit(this.messageInput.nativeElement.value); - this.chatClientService?.chatClient?.logger?.( + this.chatClientService.chatClient.logger( 'info', '[Autocomplete textarea] Input changed' ); @@ -284,12 +285,12 @@ export class AutocompleteTextareaComponent private adjustTextareaHeight() { const necessaryHeight = `${this.messageInput.nativeElement.scrollHeight}px`; if (this.messageInput.nativeElement.style.height === necessaryHeight) { - this.chatClientService?.chatClient?.logger?.( + this.chatClientService.chatClient.logger( 'info', `[Autocomplete textarea] No need to adjust textarea height` ); } else { - this.chatClientService?.chatClient?.logger?.( + this.chatClientService.chatClient.logger( 'info', `[Autocomplete textarea] Adjusting textarea height to ${necessaryHeight}` ); From 9adc5c6331631c1339241e2baa74617cab446931 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Tue, 3 Sep 2024 13:22:57 +0200 Subject: [PATCH 3/3] Revert "fix: add logs to autocomplete textarea" This reverts commit 6d41ab1c44058d17cd8494b48da0070cea6e7bde. --- .../autocomplete-textarea.component.ts | 32 ++----------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts index 3fe8f4a4..7c0748f4 100644 --- a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts +++ b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts @@ -200,10 +200,6 @@ export class AutocompleteTextareaComponent } if (changes.value && !this.value && this.messageInput) { this.messageInput.nativeElement.style.height = 'auto'; - this.chatClientService.chatClient.logger( - 'info', - '[Autocomplete textarea] Value reset, adjusting textarea height to auto' - ); this.updateMentionedUsersFromText(); } else if ( changes.value && @@ -211,10 +207,6 @@ export class AutocompleteTextareaComponent this.messageInput && this.isViewInited ) { - this.chatClientService.chatClient.logger( - 'info', - '[Autocomplete textarea] Value changed' - ); setTimeout(() => { if (this.messageInput.nativeElement.scrollHeight > 0) { this.adjustTextareaHeight(); @@ -225,10 +217,6 @@ export class AutocompleteTextareaComponent ngAfterViewInit(): void { this.isViewInited = true; - this.chatClientService.chatClient.logger( - 'info', - '[Autocomplete textarea] View inited' - ); if (this.messageInput.nativeElement.scrollHeight > 0) { this.adjustTextareaHeight(); } @@ -263,10 +251,6 @@ export class AutocompleteTextareaComponent inputChanged() { this.valueChange.emit(this.messageInput.nativeElement.value); - this.chatClientService.chatClient.logger( - 'info', - '[Autocomplete textarea] Input changed' - ); this.adjustTextareaHeight(); } @@ -283,20 +267,8 @@ export class AutocompleteTextareaComponent } private adjustTextareaHeight() { - const necessaryHeight = `${this.messageInput.nativeElement.scrollHeight}px`; - if (this.messageInput.nativeElement.style.height === necessaryHeight) { - this.chatClientService.chatClient.logger( - 'info', - `[Autocomplete textarea] No need to adjust textarea height` - ); - } else { - this.chatClientService.chatClient.logger( - 'info', - `[Autocomplete textarea] Adjusting textarea height to ${necessaryHeight}` - ); - this.messageInput.nativeElement.style.height = ''; - this.messageInput.nativeElement.style.height = necessaryHeight; - } + this.messageInput.nativeElement.style.height = ''; + this.messageInput.nativeElement.style.height = `${this.messageInput.nativeElement.scrollHeight}px`; } private transliterate(s: string) {