Uwazi: ToC not visible on library view

Created on 3 Apr 2020  ·  6Comments  ·  Source: huridocs/uwazi

ToC has it's own tab on the side-panel view of the library for each document.

Currently, it shows as "No table of Content" (which by the way is wrongly worded, it should read "No Table of Contents" - in plural) even if there is a ToC created for the document of that entity.

Originally reported in #2854

Bug Good First Issue Medium Sprint

All 6 comments

@RafaPolit should the TOC be loaded on demand when the user loads the side panel for a particular document?

My guess is yes, no need to populate the store with that until requested for.

Currently, the ToC is being loaded already with the search of documents, the reason that is doing not visible is that the component is only showing when a file is opened.
@RafaPolit Should we prevent the load of ToC at the search and implement a load like the references one?
The change in order to show the ToC is straightforward.

Since we recently implemented pagination, and given this is already loading the ToC, I'd go for fixing the minimum problem, which is just showing the ToC. We can add a tech debt to, maybe, not send the ToC on search, but I'd do that in a second iteration.

When there is more than one document with ToC, what is the expected content?
Should we show the ToC of the first document or maybe should we concatenate all the tables?

There is a logic to define which document would get shown if you would go into that document. That is the document's TOC that should be shown. It depends on the current language of the UI and also the available languages of the files, and finally the default language of the collection and the available languages of the files.

There is already an algorithm that picks that for when you enter a file. We should use that algorithm (if needed, abstracted so that it is not copied twice)

Was this page helpful?
0 / 5 - 0 ratings