Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabWidget might be redundant #146

Open
Pooya-Oladazimi opened this issue Oct 11, 2024 · 3 comments
Open

TabWidget might be redundant #146

Pooya-Oladazimi opened this issue Oct 11, 2024 · 3 comments
Labels
question Further information is requested

Comments

@Pooya-Oladazimi
Copy link
Collaborator

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: #145

Is there any usecase for having a standalone TabWidget?

@Pooya-Oladazimi Pooya-Oladazimi added the question Further information is requested label Oct 11, 2024
@jusa3
Copy link
Collaborator

jusa3 commented Oct 18, 2024

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.

@Pooya-Oladazimi
Copy link
Collaborator Author

@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;

.....

@jusa3
Copy link
Collaborator

jusa3 commented Oct 18, 2024

Right, I see what you mean. This could definitely be optimised by implementing it as a special case for the MetadataWidget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants