diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index 44024837e..0f239074a 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -391,7 +391,7 @@ export class AnnotationWrapper implements IListable, Record { if (entry.reason) { content += entry.reason + '\n\n'; //remove leading and trailing commas and whitespaces - content = content.replace(/^[, ]*|[, ]*$/g, ''); + content = content.replace(/(^[, ]*)|([, ]*$)/g, ''); content = content.substring(0, 1).toUpperCase() + content.substring(1); } diff --git a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts index fc4aae6cd..8d4bd718e 100644 --- a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts +++ b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts @@ -84,8 +84,6 @@ export class UserProfileScreenComponent extends BaseFormComponent implements OnI try { if (this.profileChanged) { const value = this.form.getRawValue() as IProfile; - // delete value.language; - // delete value.darkTheme; if (this.emailChanged) { const dialogRef = this._dialogService.openDialog('confirmPassword', null, null); diff --git a/apps/red-ui/src/app/modules/dossier-overview/config.service.ts b/apps/red-ui/src/app/modules/dossier-overview/config.service.ts index a28454e4c..d5ad67d43 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/config.service.ts +++ b/apps/red-ui/src/app/modules/dossier-overview/config.service.ts @@ -285,12 +285,12 @@ export class ConfigService { label: this._translateService.instant(workflowFileStatusTranslations[status]), }), ); - + statusFilters.sort((a, b) => StatusSorter[a.id] - StatusSorter[b.id]); filterGroups.push({ slug: 'statusFilters', label: this._translateService.instant('filters.documents-status'), icon: 'red:status', - filters: statusFilters.sort((a, b) => StatusSorter[a.id] - StatusSorter[b.id]), + filters: statusFilters, checker: keyChecker('workflowStatus'), }); } @@ -336,13 +336,13 @@ export class ConfigService { }, }), ); - + needsWorkFilters.sort(RedactionFilterSorter.byKey); filterGroups.push({ slug: 'needsWorkFilters', label: this._translateService.instant('filters.needs-work'), icon: 'red:needs-work', filterTemplate: needsWorkFilterTemplate, - filters: needsWorkFilters.sort(RedactionFilterSorter.byKey), + filters: needsWorkFilters, checker: (file: File, filter: INestedFilter) => annotationFilterChecker(file, filter, this._userService.currentUser.id), matchAll: true, }); diff --git a/apps/red-ui/src/app/modules/dossiers-listing/config.service.ts b/apps/red-ui/src/app/modules/dossiers-listing/config.service.ts index 11880d5c6..e50a6e8ef 100644 --- a/apps/red-ui/src/app/modules/dossiers-listing/config.service.ts +++ b/apps/red-ui/src/app/modules/dossiers-listing/config.service.ts @@ -144,12 +144,12 @@ export class ConfigService { label: this._translateService.instant(workflowFileStatusTranslations[status]), }), ); - + statusFilters.sort((a, b) => StatusSorter[a.id] - StatusSorter[b.id]); filterGroups.push({ slug: 'statusFilters', label: this._translateService.instant('filters.documents-status'), icon: 'red:status', - filters: statusFilters.sort((a, b) => StatusSorter[a.id] - StatusSorter[b.id]), + filters: statusFilters, checker: (dossier: Dossier, filter: INestedFilter) => this._dossierStatusChecker(dossier, filter), }); @@ -180,13 +180,13 @@ export class ConfigService { }, }), ); - + needsWorkFilters.sort((a, b) => RedactionFilterSorter[a.id] - RedactionFilterSorter[b.id]); filterGroups.push({ slug: 'needsWorkFilters', label: this._translateService.instant('filters.needs-work'), icon: 'red:needs-work', filterTemplate: needsWorkFilterTemplate, - filters: needsWorkFilters.sort((a, b) => RedactionFilterSorter[a.id] - RedactionFilterSorter[b.id]), + filters: needsWorkFilters, checker: (dossier: Dossier, filter: INestedFilter) => this._annotationFilterChecker(dossier, filter), matchAll: true, }); diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts index c48a9f3a5..a637a1dad 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts @@ -410,32 +410,32 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnDestroy private _navigatePages($event: KeyboardEvent) { const pageIdx = this.displayedPages.indexOf(this.activeViewerPage); - if ($event.key === 'ArrowDown') { - if (pageIdx !== -1) { - // If active page has annotations - if (pageIdx !== this.displayedPages.length - 1) { - this.pdf.navigateTo(this.displayedPages[pageIdx + 1]); - } - } else { - // If active page doesn't have annotations - const nextPage = this._nextPageWithAnnotations(); - if (nextPage) { - this.pdf.navigateTo(nextPage); - } - } - } else { - if (pageIdx !== -1) { - // If active page has annotations - if (pageIdx !== 0) { - this.pdf.navigateTo(this.displayedPages[pageIdx - 1]); - } - } else { + if ($event.key !== 'ArrowDown') { + if (pageIdx === -1) { // If active page doesn't have annotations const prevPage = this._prevPageWithAnnotations(); if (prevPage) { this.pdf.navigateTo(prevPage); } + return; } + // If active page has annotations + if (pageIdx !== 0) { + this.pdf.navigateTo(this.displayedPages[pageIdx - 1]); + } + return; + } + if (pageIdx === -1) { + // If active page doesn't have annotations + const nextPage = this._nextPageWithAnnotations(); + if (nextPage) { + this.pdf.navigateTo(nextPage); + } + return; + } + // If active page has annotations + if (pageIdx !== this.displayedPages.length - 1) { + this.pdf.navigateTo(this.displayedPages[pageIdx + 1]); } }