Open Pooya-Oladazimi opened 1 month ago
No, I can't think of a use case yet. Same with the Synonym and CrossRef widgets. We created the MetadataWidget from the different components and it wasn't an additional effort to create a widget from each component. Once we had all these widgets, it seemed more efficient to use only the presentation components within the MetadataWidget, so we have the standalone TabWidget now. Why do you ask? Maybe there will be a use case in the future.
@jusa3
I was just slightly irritated by maintaining and double-implementing tab hide/show for it. I was wondering why am I doing the same thing in two places. Not urgent though.
export type TabWidgetProps = ApiObj & OptionalEntityTypeObj & OptionalOntologyIdObj & ForcedIriObj & TermParameterObj & UseLegacyObj & TabList;
export type MetadataWidgetProps = ApiObj &
OptionalEntityTypeObj &
OptionalOntologyIdObj &
ForcedIriObj &
TermParameterObj &
UseLegacyObj &
OnNavigateToOntology &
TabList &
{
/**
* The term backlink. User can use this to make the term's label a link. For example, a link to the term page on a terminology service.
*/
termLink?: string;
};
function TabWidget(props: TabWidgetProps) {
const { iri, api, ontologyId, entityType, parameter, useLegacy, hierarchyTab, crossRefTab, terminologyInfoTab, altNamesTab, ...rest } = props;
.....
function MetadataWidget(props: MetadataWidgetProps) {
const { iri, api, ontologyId, entityType, parameter, useLegacy, onNavigateToOntology, hierarchyTab, crossRefTab, terminologyInfoTab, altNamesTab, termLink } = props;
.....
Right, I see what you mean. This could definitely be optimised by implementing it as a special case for the MetadataWidget.
The TabWidget's use case is not entirely clear. It can be seen as a special case for the MetadataWidget. If we hide the term label, description, and iri in MetadataWidget, it becomes a TabWidget.
I noticed this during this issue implementation: https://github.com/ts4nfdi/terminology-service-suite/pull/145
Is there any usecase for having a standalone TabWidget?