Last Read Filter + A lot of bug fixes (#3312)

This commit is contained in:
Joe Milazzo 2024-10-27 09:39:10 -05:00 committed by GitHub
parent 953d80de1a
commit 6b13db129e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 620 additions and 198 deletions

View file

@ -11,6 +11,7 @@ import {TranslocoDirective} from "@jsverse/transloco";
import {NgTemplateOutlet} from "@angular/common";
import {SafeHtmlPipe} from "../../../_pipes/safe-html.pipe";
import {filter, fromEvent, tap} from "rxjs";
import {AbstractControl, FormControl} from "@angular/forms";
@Component({
selector: 'app-setting-item',
@ -36,6 +37,7 @@ export class SettingItemComponent {
@Input() subtitle: string | undefined = undefined;
@Input() labelId: string | undefined = undefined;
@Input() toggleOnViewClick: boolean = true;
@Input() control: AbstractControl<any> | null = null;
@Output() editMode = new EventEmitter<boolean>();
/**
@ -67,6 +69,7 @@ export class SettingItemComponent {
.pipe(
filter((event: Event) => {
if (!this.toggleOnViewClick) return false;
if (this.control != null && this.control.invalid) return false;
const mouseEvent = event as MouseEvent;
const selection = window.getSelection();
@ -86,6 +89,7 @@ export class SettingItemComponent {
if (!this.toggleOnViewClick) return;
if (!this.canEdit) return;
if (this.control != null && this.control.invalid) return;
this.isEditMode = !this.isEditMode;
this.editMode.emit(this.isEditMode);