Skip to content

fix(ui): Marketplace plugin UI state not dynamically updating - #25057

Open
eduardomozart wants to merge 7 commits into
glpi-project:11.0/bugfixesfrom
eduardomozart:fix-issue-25056
Open

fix(ui): Marketplace plugin UI state not dynamically updating#25057
eduardomozart wants to merge 7 commits into
glpi-project:11.0/bugfixesfrom
eduardomozart:fix-issue-25056

Conversation

@eduardomozart

@eduardomozart eduardomozart commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

When updating or installing a plugin via the GLPI Marketplace, the UI correctly exposed the action buttons (e.g. "Enable") upon completion. However, the rest of the plugin card and the global marketplace UI did not dynamically update to reflect the new state, requiring a manual page refresh.

This PR addresses multiple frontend UI state inconsistencies that occur after a successful plugin update via AJAX:

  1. Version String: The displayed version string for the plugin failed to dynamically update (Closes Marketplace plugin version does not visually update after extraction without a page refresh #25056). The backend now passes the latest version back in a hidden data-new-version attribute alongside the buttons, which the frontend extracts to update the version string dynamically.
  2. Updatable Background State: The .bg-warning-subtle highlight class is now correctly stripped from the plugin card's .main container once the plugin has been successfully updated.
  3. Updatable Plugins Counter: The global "X plugin(s) to update" warning alert counter is now correctly decremented without refreshing the page. If the count reaches 0, the alert is automatically removed from the DOM.

Changes Made

  • src/Glpi/Marketplace/View.php: Modified getButtons() to append the plugin's latest version inside a hidden <span class="new-version" data-new-version="..."> alongside the buttons HTML when the plugin exists locally.
  • js/marketplace.js: Updated the AJAX .done() callback handling marketplace actions to extract the data-new-version attribute and update the span.version DOM element. Added logic to remove .bg-warning-subtle and decrement the alert-important global updatable counter dynamically.

Screenshots (if appropriate):

Gravacao.de.Tela.2026-07-31.as.00.40.09.mov

@eduardomozart eduardomozart changed the title fix(ui): Marketplace plugin version not dynamically updating in UI fix(ui): Marketplace plugin UI state not dynamically updating Jul 31, 2026
Comment thread js/marketplace.js Outdated
Co-authored-by: Curtis Conard <cconard96@gmail.com>
@eduardomozart
eduardomozart requested a review from cconard96 August 2, 2026 20:43
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.

Marketplace plugin version does not visually update after extraction without a page refresh

2 participants