Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Manage dashboard access rights per Group and per User (in addition to per Profile)

### Changed

- Make the plugin compatible with the Content Security Policy

## [1.5.0] - 2026-10-06

### Added
Expand Down
4 changes: 2 additions & 2 deletions inc/dashboard.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ function ($dashboard) use ($viewable, $profileId) {
'current_dashboard',
array_combine(array_column($dashboards, 'id'), array_column($dashboards, 'name')),
[
'on_change' => ($is_helpdesk) ? 'location.href = location.origin+location.pathname+"?uuid="+$(this).val()' : 'reloadTab("uuid=" + $(this).val());',
'value' => $currentUuid,
'add_data_attributes' => ['metabase-dashboard-switch' => ($is_helpdesk) ? 'helpdesk' : 'central'],
'value' => $currentUuid,
],
);

Expand Down
9 changes: 9 additions & 0 deletions public/metabase.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,13 @@ $(function() {
}
});
});

// jQuery event: select2 triggers change on the native select
$(document).on("change", "select[data-metabase-dashboard-switch]", function() {
if ($(this).data('metabaseDashboardSwitch') === 'helpdesk') {
location.href = location.origin + location.pathname + "?uuid=" + $(this).val();
} else {
reloadTab("uuid=" + $(this).val());
}
});
});
13 changes: 7 additions & 6 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ function plugin_init_metabase()
function plugin_version_metabase()
{
return [
'name' => 'Metabase',
'version' => PLUGIN_METABASE_VERSION,
'author' => '<a href="http://www.teclib.com">Teclib\'</a>',
'license' => 'GPLv2+',
'homepage' => 'https://github.com/pluginsGLPI/metabase',
'requirements' => [
'name' => 'Metabase',
'version' => PLUGIN_METABASE_VERSION,
'author' => '<a href="http://www.teclib.com">Teclib\'</a>',
'license' => 'GPLv2+',
'homepage' => 'https://github.com/pluginsGLPI/metabase',
'csp_compliant' => true,
'requirements' => [
'glpi' => [
'min' => PLUGIN_METABASE_MIN_GLPI,
'max' => PLUGIN_METABASE_MAX_GLPI,
Expand Down