Skip to content

Feature: Refactor mdTranslatorAPI URL and itisProxyUrl to have no default, and added configuration validation #763

Merged
hmaier-fws merged 1 commit intodevelopfrom
dvonanderson/enhancement/itis-proxy-url
Jun 11, 2025
Merged

Feature: Refactor mdTranslatorAPI URL and itisProxyUrl to have no default, and added configuration validation #763
hmaier-fws merged 1 commit intodevelopfrom
dvonanderson/enhancement/itis-proxy-url

Conversation

@dvonanderson
Copy link
Copy Markdown
Contributor

@dvonanderson dvonanderson commented Jun 5, 2025

Overview

This PR adds validation checks for external service URLs before attempting to use them. Specifically, it adds modal alerts when users try to use features that require the mdTranslator API or ITIS Proxy URL without having these services configured in settings.

Changes

  1. XML Import Validation
  • Added a check in the import route to verify if mdTranslatorAPI is configured before attempting to translate XML and JSON files

  • If the API URL is not configured, a modal is shown to the user explaining the issue

  • The modal provides options to either go to settings to configure the API or cancel the operation

  1. ITIS Taxonomy Integration
  • Added a similar check in the taxonomy collection route to verify if itisProxyUrl is configured before attempting to add taxa from ITIS

  • If the ITIS Proxy URL is not configured, a modal is shown to the user explaining the issue

  • The modal provides the same options to configure the URL or cancel

  1. Modal Component Enhancements
  • Updated the md-modal component to better handle action passing

  • Ensured compatibility with existing usages of the modal component throughout the application

  • Added support for direct action handling in the modal buttons

Closing issues

closes #725
closes #762
closes #737
closes #736

Pull Request

  • Please check if the PR fulfills these requirements

    • The commit message follows our guidelines
    • Tests for the changes have been added (for bug fixes / features)
      - [ ] Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Feature

  • What is the current behavior? (You can also link to an open issue here)
    Refactor default mdTranslator and itisProxy URLs #725
    Expose the `itis-proxy-url' as a user setting #762
    Trap for missing mdTranslator API URL #738
    Remove the default mdTranslatorAPI value from the setting.js file #737
    Derive itisProxyUrl from the mdTranslatorAPI value #736
    Previously, when users attempted to use features requiring external services without having them configured, they would encounter confusing errors or the application would silently fail. These changes provide clear feedback to users about what's missing and guide them directly to where they can configure the necessary settings.

  • What is the new behavior (if this is a feature change)?
    This PR adds validation checks for external service URLs before attempting to use them. Specifically, it adds modal alerts when users try to use features that require the mdTranslator API or ITIS Proxy URL without having these services configured in settings.

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    If the user has a current mdTranslatorAPI endpoint their won't be any changes to that field other than, there is no more defaultAPI hard-coded to the application. However they will have to provide a itisProxyUrl if they are using any taxonomy in the records.

  • Other information:

Untitled.video.mp4
mdtranslator.mp4

@dvonanderson dvonanderson requested a review from hmaier-fws June 5, 2025 16:43
@dvonanderson dvonanderson self-assigned this Jun 5, 2025
@dvonanderson dvonanderson added new feature Add new functionality not currently available maintenance Minor updates or code refactoring not impacting current functions labels Jun 5, 2025
Copy link
Copy Markdown
Contributor

@hmaier-fws hmaier-fws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK. Validation for a missing translator API occurs in a few places where it shouldn't so I'm leaving #738 open and will a new comment.

@hmaier-fws hmaier-fws merged commit 4bcc804 into develop Jun 11, 2025
@hmaier-fws hmaier-fws deleted the dvonanderson/enhancement/itis-proxy-url branch January 26, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Minor updates or code refactoring not impacting current functions new feature Add new functionality not currently available

Projects

None yet

2 participants