Skip to content

Document availabilty doesn't consider viewcode in public view #3619

@PascalRepond

Description

@PascalRepond

Bug description:

When searching for documents in the public view, the brief view shows "availability". But in an organisation viewcode, the component says : "available" if any item is available in another organisation, even if all items in my org are not available.

https://github.com/rero/rero-ils-ui/blob/7e458420971c8b61c3abc399f722541dc55487f8/projects/admin/src/app/api/document-api.service.ts#L63-L65

This component calls /api/document/<document.pid>/availability to check if the document is available but it forgets to pass the viewcode parameter to the backend.

Expected behavior:

In a viewcode, if no item is available in my organisation, the document should not display as "available", even if items in other organisations are available.

Steps to Reproduce:

  1. Find a document that is not available (for example, all items on loan) in your organisation but is available in others
  2. Look at this document brief view in the public view (organisation viewcode)
  3. See that it says "available"

Context

  • Versions: >=1.19.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    UIUser interface or user experiencebugBreaks something but is not blockingclient requestIssue reported by production librariesf: public uiPublic interface, as opposed to the professional interface

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions