ts4nfdi / terminology-service-suite

The Terminology Service Suite project is a collection of interactive widgets designed to ease the integration of terminology service functions into third-party applications.
https://ts4nfdi.github.io/terminology-service-suite/comp/latest/
MIT License
16 stars 2 forks source link

fix(title): correct default value logic #128

Closed jusa3 closed 1 month ago

jusa3 commented 2 months ago

fix for https://github.com/ts4nfdi/terminology-service-suite/issues/112

Problem: Slow and and shows not found string instead of fall back text - the TitleWidget shows "No title available" even though default_value is set

Suggestion: widget could show the default_value string in addition to the loading spinner while the data is loading

Use case: In the StudyHub, we store the IRI and the label for keywords. I think that in some cases the IRIs are outdated and no longer load, so we would like to display the keyword label as fallback. Example: https://csh.nfdi4health.de/resource/9 under General information, open the tab "Details". 5/6 keywords don't load and do not show the fallback label.

Solution: The default TitleWidget shows the queried title if available (a). If not available, it shows a not available message (b) or the default value (c), if defined. While loading, a loading spinner is displayed beneath the text (d). If a title text is defined, it always shows the title text (e).

(a) image

(b) image

(c) image

(d) image

(e) image

jusa3 commented 1 month ago

:tada: This PR is included in version 2.7.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: