]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
rxjs7 compatibility 355/head
authorMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Mon, 14 Mar 2022 23:23:14 +0000 (16:23 -0700)
committerMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Mon, 14 Mar 2022 23:23:14 +0000 (16:23 -0700)
src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts
src-ui/src/app/components/document-detail/document-detail.component.ts

index 0f7218f0676c91061b2f16ac0a9504f44cce53cd..9a16b4426d81abe89cf4cf7e07bdda307a4c042b 100644 (file)
@@ -356,7 +356,7 @@ export class FilterableDropdownComponent {
       if (this.editing) {
         this.selectionModel.reset()
       }
-      this.open.next()
+      this.open.next(this)
     } else {
       this.filterText = ''
       if (this.applyOnClose && this.selectionModel.isDirty()) {
index 88f77160a9d33f2b9c7c809ddb96a4686f350125..4d705131ef21ee8d9246915582380c85f0e36584 100644 (file)
@@ -206,18 +206,18 @@ export class DocumentDetailComponent
         })
       )
       .pipe(takeUntil(this.unsubscribeNotifier))
-      .subscribe(
-        ({ doc, dirty }) => {
+      .subscribe({
+        next: ({ doc, dirty }) => {
           this.openDocumentService.setDirty(doc.id, dirty)
         },
-        (error) => {
+        error: (error) => {
           this.router.navigate(['404'])
-        }
-      )
+        },
+      })
   }
 
   ngOnDestroy(): void {
-    this.unsubscribeNotifier.next()
+    this.unsubscribeNotifier.next(this)
     this.unsubscribeNotifier.complete()
   }
 
@@ -226,25 +226,25 @@ export class DocumentDetailComponent
     this.documentsService
       .getMetadata(doc.id)
       .pipe(first())
-      .subscribe(
-        (result) => {
+      .subscribe({
+        next: (result) => {
           this.metadata = result
         },
-        (error) => {
+        error: (error) => {
           this.metadata = null
-        }
-      )
+        },
+      })
     this.documentsService
       .getSuggestions(doc.id)
       .pipe(first())
-      .subscribe(
-        (result) => {
+      .subscribe({
+        next: (result) => {
           this.suggestions = result
         },
-        (error) => {
+        error: (error) => {
           this.suggestions = null
-        }
-      )
+        },
+      })
     this.title = this.documentTitlePipe.transform(doc.title)
     this.documentForm.patchValue(doc)
   }
@@ -315,17 +315,17 @@ export class DocumentDetailComponent
     this.documentsService
       .update(this.document)
       .pipe(first())
-      .subscribe(
-        (result) => {
+      .subscribe({
+        next: (result) => {
           this.close()
           this.networkActive = false
           this.error = null
         },
-        (error) => {
+        error: (error) => {
           this.networkActive = false
           this.error = error.error
-        }
-      )
+        },
+      })
   }
 
   saveEditNext() {
@@ -351,8 +351,8 @@ export class DocumentDetailComponent
         })
       )
       .pipe(first())
-      .subscribe(
-        ({ updateResult, nextDocId, closeResult }) => {
+      .subscribe({
+        next: ({ updateResult, nextDocId, closeResult }) => {
           this.error = null
           this.networkActive = false
           if (closeResult && updateResult && nextDocId) {
@@ -360,11 +360,11 @@ export class DocumentDetailComponent
             this.titleInput?.focus()
           }
         },
-        (error) => {
+        error: (error) => {
           this.networkActive = false
           this.error = error.error
-        }
-      )
+        },
+      })
   }
 
   close() {