]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix: fix unshared items display
authorshamoon <4887959+shamoon@users.noreply.github.com>
Fri, 28 Mar 2025 12:47:10 +0000 (05:47 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Fri, 28 Mar 2025 12:47:10 +0000 (05:47 -0700)
src-ui/messages.xlf
src-ui/src/app/pipes/object-name.pipe.spec.ts
src-ui/src/app/pipes/object-name.pipe.ts

index 22b7584ffbc816b1d4336a3301ed6b5ec03f23f1..683d6db5b248e426277fffafb1ee5bb1106ad42b 100644 (file)
         </context-group>
         <context-group purpose="location">
           <context context-type="sourcefile">src/app/pipes/object-name.pipe.ts</context>
-          <context context-type="linenumber">43</context>
+          <context context-type="linenumber">40</context>
+        </context-group>
+        <context-group purpose="location">
+          <context context-type="sourcefile">src/app/pipes/object-name.pipe.ts</context>
+          <context context-type="linenumber">46</context>
         </context-group>
       </trans-unit>
       <trans-unit id="2504502765849142619" datatype="html">
index ebe44af7da82e024da8863d147f3be448a95185f..85505d254f63a4b8164f84df7bf2598da65774c8 100644 (file)
@@ -50,7 +50,7 @@ describe('ObjectNamePipe', () => {
     })
   })
 
-  it('should return empty string if object not found', (done) => {
+  it('should return Private string if object not found', (done) => {
     const mockObjects = {
       results: [{ id: 2, name: 'Object 2' }],
       count: 1,
@@ -60,7 +60,7 @@ describe('ObjectNamePipe', () => {
     jest.spyOn(objectService, 'listAll').mockReturnValue(of(mockObjects))
 
     pipe.transform(1).subscribe((result) => {
-      expect(result).toBe('')
+      expect(result).toBe('Private')
       done()
     })
   })
index 89c8613b7b3976c9f45da692b1bbf9499f9e9c6b..5590ed342f1d7c7b0830f76e9b580e6248279230 100644 (file)
@@ -35,7 +35,10 @@ export abstract class ObjectNamePipe implements PipeTransform {
       return this.objectService.listAll().pipe(
         map((objects) => {
           this.objects = objects.results
-          return this.objects.find((o) => o.id === obejctId)?.name || ''
+          return (
+            this.objects.find((o) => o.id === obejctId)?.name ||
+            $localize`Private`
+          )
         }),
         catchError(() => of(''))
       )