Skip to content

fix: hide "Open in app" for plugins without an app entrypoint (DHIS2-21739)#3335

Draft
karolinelien wants to merge 2 commits into
masterfrom
DHIS2-21739-hide-open-in-app-without-entrypoint
Draft

fix: hide "Open in app" for plugins without an app entrypoint (DHIS2-21739)#3335
karolinelien wants to merge 2 commits into
masterfrom
DHIS2-21739-hide-open-in-app-without-entrypoint

Conversation

@karolinelien

@karolinelien karolinelien commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Implements DHIS2-21739

Description

Plugin-only apps (installed without an app entrypoint in d2.config.js, e.g. Capture Growth Chart) are served with a pluginLaunchUrl but no launchUrl — there is no standalone app to open. Despite this, the dashboard item's ⋯ menu still showed an "Open in {app}" option. Clicking it navigated to a broken relative URL (.../dhis-web-dashboard/undefinedundefined) and 404'd, because the app URL was built by concatenating `${appDetails.launchUrl}${newState.appUrl}` where both parts were undefined.

This PR:

  • Only exposes the "Open in {app}" option when the app actually has a launch URL (openInAppEnabled = allowVisOpenInApp && !!appUrl). The ⋯ menu is still shown for such plugins when "View fullscreen" is available.
  • Stops the reducer from stringifying undefined when there is no launchUrl, so appUrl is undefined (not "undefinedundefined") for entrypoint-less plugins.

AI Assisted.


Quality checklist

Add N/A to items that are not applicable.

  • Tested with and without global shell
  • Cypress and/or Jest tests added/updated
  • Docs added — N/A
  • d2-ci dependency replaced (requires https://github.com/dhis2/analytics/pull/XXX) — N/A
  • Small screen tested
  • Offline tested
  • Tester approved (name)

ToDos

  • todo

Known issues

  • issue

Screenshots

supporting text

…21739)

Plugin-only apps have a pluginLaunchUrl but no launchUrl, so there is no
standalone app to open. The dashboard item menu still showed "Open in {app}"
and the reducer built the href as `${launchUrl}${appUrl}`, producing the
literal string "undefinedundefined" and a 404 on click.

Only expose the "Open in" option when the app actually has a launch URL, and
stop concatenating undefined when building the app URL.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dhis2-bot

Copy link
Copy Markdown
Contributor

🚀 Deployed on https://pr-3335.dashboard.netlify.dhis2.org

@dhis2-bot
dhis2-bot temporarily deployed to netlify July 16, 2026 18:28 Inactive
Extract the item-details reducer from AppItem into a pure module so the
URL-building logic can be unit-tested directly, and add a regression spec
covering plugins without an app entrypoint (no launchUrl no longer yields
an "undefinedundefined" href). Also drop the unused item prop passed to
ItemContextMenu.

AI Assisted

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants