mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-03-31 13:35:08 -05:00
Fix: fix unshared items display
This commit is contained in:
parent
fd45e81a83
commit
b4b2a92225
@ -5461,7 +5461,11 @@
|
||||
</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">
|
||||
|
@ -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()
|
||||
})
|
||||
})
|
||||
|
@ -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(''))
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user