Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • project/dashboards
  • issue/dashboards-3205095
  • issue/dashboards-3205096
  • issue/dashboards-3205269
  • issue/dashboards-3161955
  • issue/dashboards-3277778
  • issue/dashboards-3295719
  • issue/dashboards-3132349
  • issue/dashboards-3330023
  • issue/dashboards-3334514
  • issue/dashboards-3347975
  • issue/dashboards-3349570
  • issue/dashboards-3352151
  • issue/dashboards-3351661
  • issue/dashboards-3353660
  • issue/dashboards-3354493
  • issue/dashboards-3356296
  • issue/dashboards-3356327
  • issue/dashboards-3362260
  • issue/dashboards-3366586
  • issue/dashboards-3366951
  • issue/dashboards-3409306
  • issue/dashboards-3439495
  • issue/dashboards-3277709
  • issue/dashboards-3429751
  • issue/dashboards-3432048
  • issue/dashboards-3413086
  • issue/dashboards-3432759
  • issue/dashboards-3433312
  • issue/dashboards-3444736
  • issue/dashboards-3454509
  • issue/dashboards-3457907
  • issue/dashboards-3483234
  • issue/dashboards-3501454
34 results
Show changes
Commits on Source (15)
Showing
with 191 additions and 99 deletions
# List of words excluded from cspell validation for the project Dashboards.
# Mostly contains custom names: variables, modules, users, etc...
drow
fullmer
matomo
nshades
phplint
rlmumford
Seifert
UNIXTIME
webform
blockbasic
daycount
totalcount
# 'views.view.test_comment_count.yml': Binary identifier used for key.
MQNAY
# Exclude the 'chart.js' library from eslint validation.
js/es/
################
# GitLabCI template for Drupal projects.
#
# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification.
# It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained.
# As long as you include the project, ref and three files below, any future updates added by the Drupal Association will be used in your
# pipelines automatically. However, you can modify this template if you have additional needs for your project.
# The full documentation is on https://project.pages.drupalcode.org/gitlab_templates/
################
# For information on alternative values for 'ref' see https://project.pages.drupalcode.org/gitlab_templates/info/templates-version/
# To test a Drupal 7 project, change the first include filename from .main.yml to .main-d7.yml
include:
- project: $_GITLAB_TEMPLATES_REPO
ref: $_GITLAB_TEMPLATES_REF
file:
- "/includes/include.drupalci.main.yml"
- "/includes/include.drupalci.variables.yml"
- "/includes/include.drupalci.workflows.yml"
################
# Pipeline configuration variables are defined with default values and descriptions in the file
# https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml
# Uncomment the lines below if you want to override any of the variables. The following is just an example.
################
# variables:
# SKIP_ESLINT: '1'
# OPT_IN_TEST_NEXT_MAJOR: '1'
# _CURL_TEMPLATES_REF: 'main'
################
# Dashboards: Pipeline configuration variables and custom jobs, mostly:
# - Composer: Add external project dependencies used in sub-modules.
# - Cspell: Ignore certain files or keywords.
# - Phpstan: Validate sub-modules with all external dependencies installed.
################
#
# Custom variables overrides.
#
variables:
# Disable the default phpstan job in favor of the extended version below which
# installs all external project dependencies used in sub-modules.
SKIP_PHPSTAN: 1
# CSpell: Exclude the 'chart.js' library from cspell validation.
_CSPELL_IGNORE_PATHS: '"js/es/"'
#
# CSpell overrides and configuration.
#
cspell:
# Require spellcheck to pass.
allow_failure: false
#
# Composer overrides and configuration:
# - Add a custom composer job which requires external package dependencies,
# such as contrib modules needed by sub-modules, in particular for phpstan.
#
composer-with-dependencies:
after_script:
# Require test modules dependencies to pass phpstan validation.
- composer require drupal/layout_builder_restrictions drupal/matomo drupal/matomo_reporting_api
extends: composer
# Run phpstan job with all dependencies installed.
phpstan-with-dependencies:
needs:
- job: composer-with-dependencies
variables:
SKIP_PHPSTAN: 0
extends:
- .phpstan-base
# Dashbords # Dashboards
This module is heavily inspired from [Mini Layouts](https://drupal.org/project/mini_layouts). This module is heavily inspired from [Mini Layouts](https://drupal.org/project/mini_layouts).
...@@ -10,6 +10,7 @@ information, see ...@@ -10,6 +10,7 @@ information, see
## Features ## Features
- `>= 2.0.1` Gin support - `>= 2.0.1` Gin support
- Create dashboards with layout builder. - Create dashboards with layout builder.
- Possibility personalize dashboards per user. - Possibility personalize dashboards per user.
...@@ -27,7 +28,8 @@ Apply following patch to show dashboards in admin theme. ...@@ -27,7 +28,8 @@ Apply following patch to show dashboards in admin theme.
Only Drupal 8.8 Only Drupal 8.8
[#3005403: Cannot delete or edit a block that is placed in a section of the layout_builder](https://www.drupal.org/project/drupal/issues/3005403) [#3005403: Cannot delete or edit a block that is placed in a section of the layout_builder](https://www.drupal.org/project/drupal/issues/3005403)
There is a issue with Layout builder Restrictions < 2.2 . Layouts could not be saved if this module is enabled. There is a issue with Layout builder Restrictions < 2.2 .
Layouts could not be saved if this module is enabled.
[#3097098: Unable to save layout changes for Mini Layouts section storage plugins](https://www.drupal.org/project/layout_builder_restrictions/issues/3097098) [#3097098: Unable to save layout changes for Mini Layouts section storage plugins](https://www.drupal.org/project/layout_builder_restrictions/issues/3097098)
Apply Patch 11, so layout could be saved. Apply Patch 11, so layout could be saved.
...@@ -35,4 +37,4 @@ With version 2.2 all should work correct. ...@@ -35,4 +37,4 @@ With version 2.2 all should work correct.
## Maintainers ## Maintainers
- Erik Seifert - [Erik Seifert](https://www.drupal.org/u/sun) - Erik Seifert - [Erik Seifert](https://www.drupal.org/u/sun)
\ No newline at end of file
...@@ -13,7 +13,14 @@ ...@@ -13,7 +13,14 @@
"source": "https://git.drupalcode.org/project/dashboards" "source": "https://git.drupalcode.org/project/dashboards"
}, },
"require": { "require": {
"drupal/core": "^9.4 || ^10", "drupal/core": "^9.4 || ^10 || ^11",
"laminas/laminas-feed": "^2.17" "laminas/laminas-feed": "^2.17"
},
"suggest": {
"drupal/layout_builder_restrictions": "Manage which fields & layouts are available in Layout Builder.",
"drupal/matomo": "Reports site visitor analytics to a Matomo instance.",
"drupal/matomo_reporting_api": "Allows to retrieve reports from the Matomo API.",
"drupal/webform": "Enables the creation of webforms and questionnaires.",
"drupal/statistics": "Logs how many times content is viewed."
} }
} }
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
} }
.admin-item-with-image .image img { .admin-item-with-image .image img {
border-radius: var(--ginBorderDefault, 0px); /* The 'ginBorderDefault' value is provided by contrib theme 'gin'. */
/* stylelint-disable-next-line custom-property-pattern */
border-radius: var(--ginBorderDefault, 0);
} }
.admin-item-with-image .content { .admin-item-with-image .content {
......
[data-app="chart"] canvas { [data-app="chart"] canvas {
max-width: 100%; max-width: 100%;
padding: 1em 40px 1em 24px;
margin: 1.5rem 0.75rem; margin: 1.5rem 0.75rem;
padding: 1em 40px 1em 24px;
} }
.toolbar-bar .toolbar-item.toolbar-menu-administration-dashboard:before { .toolbar-bar .toolbar-item.toolbar-menu-administration-dashboard::before {
background-image: url("../images/dashboard.svg"); background-image: url("../images/dashboard.svg");
} }
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
@keyframes pulse-throbber { @keyframes pulse-throbber {
0% { 0% {
transform: scaleY(1);
opacity: 1; opacity: 1;
transform: scaley(1);
} }
100% { 100% {
transform: scaleY(0.5);
opacity: 0.2; opacity: 0.2;
transform: scaley(0.5);
} }
} }
...@@ -23,45 +23,45 @@ ...@@ -23,45 +23,45 @@
.dashboards-container span[data-big-pipe-placeholder-id] { .dashboards-container span[data-big-pipe-placeholder-id] {
position: relative; position: relative;
display: block; display: block;
margin: 20px auto;
width: 6px; width: 6px;
height: 30px; height: 30px;
background: rebeccaPurple; margin: 20px auto;
animation: pulse-throbber 0.2s infinite; animation: pulse-throbber 0.2s infinite;
animation-delay: 0.0666666667s; animation-delay: 0.06667s;
animation-direction: alternate; animation-direction: alternate;
background: rebeccapurple;
} }
.dashboard-layout-builder-form span[data-big-pipe-placeholder-id]:before, .dashboard-layout-builder-form span[data-big-pipe-placeholder-id]::before,
.dashboard-layout-builder-form span[data-big-pipe-placeholder-id]:after, .dashboard-layout-builder-form span[data-big-pipe-placeholder-id]::after,
.dashboards-container span[data-big-pipe-placeholder-id]:before, .dashboards-container span[data-big-pipe-placeholder-id]::before,
.dashboards-container span[data-big-pipe-placeholder-id]:after { .dashboards-container span[data-big-pipe-placeholder-id]::after {
content: "";
position: absolute; position: absolute;
top: 0;
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: rebeccaPurple; content: "";
top: 0;
animation: pulse-throbber 0.2s infinite; animation: pulse-throbber 0.2s infinite;
animation-direction: alternate; animation-direction: alternate;
background: rebeccapurple;
} }
.dashboard-layout-builder-form span[data-big-pipe-placeholder-id]:before, .dashboard-layout-builder-form span[data-big-pipe-placeholder-id]::before,
.dashboards-container span[data-big-pipe-placeholder-id]:before { .dashboards-container span[data-big-pipe-placeholder-id]::before {
left: -12px; left: -12px;
} }
.dashboard-layout-builder-form span[data-big-pipe-placeholder-id]:after, .dashboard-layout-builder-form span[data-big-pipe-placeholder-id]::after,
.dashboards-container span[data-big-pipe-placeholder-id]:after { .dashboards-container span[data-big-pipe-placeholder-id]::after {
left: 12px; left: 12px;
animation-delay: 0.1333333333s; animation-delay: 0.13333s;
} }
.layout--twocol-section.layout--twocol-section--50-50 { .layout--twocol-section.layout--twocol-section--50-50 {
display: flex; display: flex;
justify-content: space-between;
flex-wrap: unset; flex-wrap: unset;
justify-content: space-between;
gap: 15px; gap: 15px;
} }
...@@ -89,8 +89,8 @@ html.dashboard .toolbar .toolbar-bar .home-toolbar-tab { ...@@ -89,8 +89,8 @@ html.dashboard .toolbar .toolbar-bar .home-toolbar-tab {
} }
.gin-layer-wrapper .gin-layer-wrapper .gin-table-scroll-wrapper { .gin-layer-wrapper .gin-layer-wrapper .gin-table-scroll-wrapper {
padding-bottom: 0;
margin-bottom: 0; margin-bottom: 0;
padding-bottom: 0;
} }
.gin-layer-wrapper .panel__content, .gin-layer-wrapper .panel__content,
...@@ -105,4 +105,4 @@ html.dashboard .toolbar .toolbar-bar .home-toolbar-tab { ...@@ -105,4 +105,4 @@ html.dashboard .toolbar .toolbar-bar .home-toolbar-tab {
.dashboard-gin-panel.panel.card { .dashboard-gin-panel.panel.card {
padding: var(--space-s); padding: var(--space-s);
} }
\ No newline at end of file
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
} }
.layouts-dashboards-2 .drow { .layouts-dashboards-2 .drow {
flex: 1;
display: flex; display: flex;
flex: 1;
flex-direction: column; flex-direction: column;
} }
......
name: Dashboards name: Dashboards
description: "Dashboards based on layout builder." description: "Dashboards based on layout builder."
package: Dashboards package: Dashboards
core_version_requirement: ^9.4 || ^10 core_version_requirement: ^9.4 || ^10 || ^11
type: module type: module
configure: entity.dashboard.collection configure: entity.dashboard.collection
dependencies: dependencies:
- drupal:layout_builder - drupal:layout_builder
- drupal:views - drupal:views
test_dependencies:
- layout_builder_restrictions:layout_builder_restrictions
- matomo:matomo
- matomo_reporting_api:matomo_reporting_api
- webform:webform
...@@ -5,8 +5,8 @@ dashboards.collection: ...@@ -5,8 +5,8 @@ dashboards.collection:
description: 'Administer dashboard.' description: 'Administer dashboard.'
weight: 2 weight: 2
dashboards.dashboards_settings_form: dashboards.dashboards_settings_form:
title: 'Dashboard Settings' title: 'Dashboards Settings'
route_name: dashboards.dashboards_settings_form route_name: dashboards.dashboards_settings_form
description: 'Dashboard Settings' description: 'Configuration settings form for the Dashboards module.'
parent: system.admin_config_system parent: system.admin_config_system
weight: 99 weight: 99
...@@ -17,5 +17,5 @@ dashboard.view: ...@@ -17,5 +17,5 @@ dashboard.view:
dashboard.permissions: dashboard.permissions:
title: "Permissions" title: "Permissions"
route_name: entity.dashboard.permissions_form route_name: entity.dashboard.entity_permissions_form
base_route: entity.dashboard.canonical base_route: entity.dashboard.canonical
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Contains dashboards.module. * Contains dashboards.module.
*/ */
use Drupal\Core\Url;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Template\Attribute; use Drupal\Core\Template\Attribute;
...@@ -108,7 +107,7 @@ function dashboards_toolbar() { ...@@ -108,7 +107,7 @@ function dashboards_toolbar() {
foreach ($boards as $board) { foreach ($boards as $board) {
$links[] = [ $links[] = [
'title' => $board->label(), 'title' => $board->label(),
'url' => $board->toUrl(), 'url' => $board->toUrl('canonical'),
]; ];
} }
...@@ -118,7 +117,7 @@ function dashboards_toolbar() { ...@@ -118,7 +117,7 @@ function dashboards_toolbar() {
'tab' => [ 'tab' => [
'#type' => 'link', '#type' => 'link',
'#title' => t('Dashboards'), '#title' => t('Dashboards'),
'#url' => $first_board ->toUrl(), '#url' => $first_board->toUrl(),
'#attributes' => [ '#attributes' => [
'class' => ['toolbar-icon', 'toolbar-menu-administration-dashboard'], 'class' => ['toolbar-icon', 'toolbar-menu-administration-dashboard'],
], ],
...@@ -179,7 +178,6 @@ function dashboards_preprocess_block(&$variables) { ...@@ -179,7 +178,6 @@ function dashboards_preprocess_block(&$variables) {
$variables['attributes']['class'][] = 'card'; $variables['attributes']['class'][] = 'card';
} }
} }
} }
/** /**
......
dashboards.dashboards_settings_form: dashboards.dashboards_settings_form:
path: "/admin/config/dashboards/dashboardssettings" path: "/admin/system/dashboards-settings"
defaults: defaults:
_form: '\Drupal\dashboards\Form\DashboardsSettingsForm' _form: '\Drupal\dashboards\Form\DashboardsSettingsForm'
_title: "DashboardsSettingsForm" _title: "Dashboards Settings"
requirements: requirements:
_permission: "administer dashboards" _permission: "administer dashboards"
options: options:
_admin_route: TRUE _admin_route: TRUE
entity.dashboard.permissions_form:
path: "/admin/structure/dashboards/manage/{dashboard}/permissions"
defaults:
_title: "Manage permissions"
_form: 'Drupal\dashboards\Form\DashboardPermissionForm'
bundle_entity_type: dashboard
requirements:
_permission: "administer permissions"
options:
parameters:
bundle:
type: "entity:dashboard"
with_config_overrides: true
alias: dashboard
...@@ -2,14 +2,14 @@ import Chart from "chart.js/auto"; ...@@ -2,14 +2,14 @@ import Chart from "chart.js/auto";
import interpolate from "color-interpolate"; import interpolate from "color-interpolate";
import "mdn-polyfills/Node.prototype.before"; import "mdn-polyfills/Node.prototype.before";
import "mdn-polyfills/Array.prototype.includes"; import "mdn-polyfills/Array.prototype.includes";
const cmap = require("colormap"); const colorMap = require("colormap");
(({ behaviors }, $$, $, { dashboards }) => { (({ behaviors }, $$, $, { dashboards }) => {
let colors = cmap({ const colors = colorMap({
colormap: dashboards.colormap, colormap: dashboards.colormap,
format: "rgb", format: "rgb",
alpha: dashboards.alpha, alpha: dashboards.alpha,
nshades: dashboards.shades, nshades: dashboards.shades
}); });
const fontFamily = getComputedStyle( const fontFamily = getComputedStyle(
...@@ -19,11 +19,11 @@ const cmap = require("colormap"); ...@@ -19,11 +19,11 @@ const cmap = require("colormap");
behaviors.dashboardsChartTable = { behaviors.dashboardsChartTable = {
attach(context) { attach(context) {
const charts = $$(context, "[data-app=chart]:not(.processed)"); const charts = $$(context, "[data-app=chart]:not(.processed)");
charts.forEach((c) => { charts.forEach(c => {
c.classList.add("processed"); c.classList.add("processed");
let config = {}; const config = {};
for (let i = 0; i < c.attributes.length; i++) { for (let i = 0; i < c.attributes.length; i++) {
if (c.attributes[i].nodeName.indexOf("data-chart") == 0) { if (c.attributes[i].nodeName.indexOf("data-chart") === 0) {
config[c.attributes[i].nodeName] = c.attributes[i].nodeValue; config[c.attributes[i].nodeName] = c.attributes[i].nodeValue;
} }
} }
...@@ -32,7 +32,7 @@ const cmap = require("colormap"); ...@@ -32,7 +32,7 @@ const cmap = require("colormap");
}, },
getLabels(t) { getLabels(t) {
const labels = []; const labels = [];
$$(t, "thead th").forEach((v) => { $$(t, "thead th").forEach(v => {
labels.push(v.textContent); labels.push(v.textContent);
}); });
return labels; return labels;
...@@ -41,15 +41,15 @@ const cmap = require("colormap"); ...@@ -41,15 +41,15 @@ const cmap = require("colormap");
const t = $(e, "table"); const t = $(e, "table");
const dataset = { const dataset = {
labels: [], labels: [],
datasets: [], datasets: []
}; };
let data = []; const data = [];
let colormap = interpolate(colors); const colormap = interpolate(colors);
$$(t, "tbody tr td:first-child").forEach((v) => { $$(t, "tbody tr td:first-child").forEach(v => {
dataset.labels.push(v.textContent); dataset.labels.push(v.textContent);
}); });
$$(t, "tbody tr").forEach((v) => { $$(t, "tbody tr").forEach(v => {
$$(v, "td:last-child").forEach((td) => { $$(v, "td:last-child").forEach(td => {
data.push(td.textContent); data.push(td.textContent);
}); });
}); });
...@@ -59,7 +59,7 @@ const cmap = require("colormap"); ...@@ -59,7 +59,7 @@ const cmap = require("colormap");
dataset.datasets.push({ dataset.datasets.push({
data: data, data: data,
backgroundColor: [], backgroundColor: [],
label: $(t, "th:last-child").textContent, label: $(t, "th:last-child").textContent
}); });
for (var i in dataset.datasets) { for (var i in dataset.datasets) {
if (!dataset.datasets[i]) { if (!dataset.datasets[i]) {
...@@ -83,27 +83,27 @@ const cmap = require("colormap"); ...@@ -83,27 +83,27 @@ const cmap = require("colormap");
// } // }
const dataset = { const dataset = {
labels: $$(t, "tbody tr").map((v) => $(v, "td").textContent), labels: $$(t, "tbody tr").map(v => $(v, "td").textContent),
datasets: [], datasets: []
}; };
let colormap = interpolate(colors); const colormap = interpolate(colors);
let max = 0; let max = 0;
const rows = $$(t, "th") const rows = $$(t, "th")
.slice(1) .slice(1)
.map((v) => v.textContent); .map(v => v.textContent);
rows.forEach((v, i) => { rows.forEach((v, i) => {
dataset.datasets[i] = { dataset.datasets[i] = {
data: [], data: [],
label: v, label: v
}; };
}); });
$$(t, "tbody tr").forEach((v, i) => { $$(t, "tbody tr").forEach((v, i) => {
$$(v, "td") $$(v, "td")
.slice(1) .slice(1)
.forEach((d, ii) => { .forEach((d, ii) => {
let parsed = parseInt(d.textContent); const parsed = parseInt(d.textContent, 10);
if (!isNaN(parsed)) { if (!Number.isNaN(parsed)) {
dataset.datasets[ii].data.push(parsed); dataset.datasets[ii].data.push(parsed);
if (parsed > max) { if (parsed > max) {
max = parsed; max = parsed;
...@@ -113,10 +113,10 @@ const cmap = require("colormap"); ...@@ -113,10 +113,10 @@ const cmap = require("colormap");
} }
}); });
}); });
if (dataset.datasets.length == 1) { if (dataset.datasets.length === 1) {
dataset.datasets[0]["backgroundColor"] = []; dataset.datasets[0].backgroundColor = [];
for (var i = 0; i < dataset.datasets[0].data.length; i++) { for (var i = 0; i < dataset.datasets[0].data.length; i++) {
dataset.datasets[0]["backgroundColor"].push( dataset.datasets[0].backgroundColor.push(
colormap(((100 / dataset.datasets[0].data.length) * i) / 100) colormap(((100 / dataset.datasets[0].data.length) * i) / 100)
); );
} }
...@@ -142,7 +142,7 @@ const cmap = require("colormap"); ...@@ -142,7 +142,7 @@ const cmap = require("colormap");
"doughnut", "doughnut",
"polarArea", "polarArea",
"bubble", "bubble",
"scatter", "scatter"
]; ];
if (!type || !allowedBars.includes(type)) { if (!type || !allowedBars.includes(type)) {
type = "bar"; type = "bar";
...@@ -159,34 +159,34 @@ const cmap = require("colormap"); ...@@ -159,34 +159,34 @@ const cmap = require("colormap");
options: { options: {
tooltips: { tooltips: {
mode: "index", mode: "index",
intersect: false, intersect: false
}, },
hover: { hover: {
mode: "index", mode: "index",
intersect: false, intersect: false
}, },
legend: { legend: {
display: config["data-chart-display-legend"] ? true : false, display: config["data-chart-display-legend"] ? true : false,
}, }
}, }
}); });
$(e, "div").style.display = "none"; $(e, "div").style.display = "none";
const dialog = Drupal.dialog($(e, "table"), { const dialog = Drupal.dialog($(e, "table"), {
width: "80%", width: "80%",
height: "80%", height: "80%"
}); });
let modalLink = document.createElement("a"); const modalLink = document.createElement("a");
modalLink.innerHTML = Drupal.t("Show data"); modalLink.innerHTML = Drupal.t("Show data");
modalLink.classList.add( modalLink.classList.add(
"button", "button",
"button--secondary", "button--secondary",
"dashboard-button" "dashboard-button"
); );
modalLink.addEventListener("click", (e) => { modalLink.addEventListener("click", e => {
dialog.show(); dialog.show();
}); });
e.appendChild(modalLink); e.appendChild(modalLink);
}, }
}; };
})( })(
Drupal, Drupal,
......
...@@ -2,9 +2,9 @@ name: Dashboards comments ...@@ -2,9 +2,9 @@ name: Dashboards comments
description: 'Comment statistics.' description: 'Comment statistics.'
package: Dashboards package: Dashboards
core_version_requirement: ^9.4 || ^10 core_version_requirement: ^9.4 || ^10 || ^11
type: module type: module
dependencies: dependencies:
- drupal:comment - drupal:comment
- dashboards:dashboards - dashboards:dashboards
...@@ -4,11 +4,11 @@ namespace Drupal\dashboards_comments\Plugin\Dashboard; ...@@ -4,11 +4,11 @@ namespace Drupal\dashboards_comments\Plugin\Dashboard;
use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Database\Connection; use Drupal\Core\Database\Connection;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
use Drupal\dashboards\Plugin\DashboardBase;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\dashboards\Plugin\Dashboard\ChartTrait; use Drupal\dashboards\Plugin\Dashboard\ChartTrait;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface; use Drupal\dashboards\Plugin\DashboardBase;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
...@@ -57,7 +57,7 @@ class Comments extends DashboardBase { ...@@ -57,7 +57,7 @@ class Comments extends DashboardBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): static {
return new static( return new static(
$configuration, $configuration,
$plugin_id, $plugin_id,
...@@ -75,7 +75,7 @@ class Comments extends DashboardBase { ...@@ -75,7 +75,7 @@ class Comments extends DashboardBase {
public function buildSettingsForm(array $form, FormStateInterface $form_state, array $configuration): array { public function buildSettingsForm(array $form, FormStateInterface $form_state, array $configuration): array {
$options = [ $options = [
'totalcount' => $this->t('Total count'), 'totalcount' => $this->t('Total count'),
'daycount' => $this->t('Dayly count'), 'daycount' => $this->t('Daily count'),
]; ];
$form['count'] = [ $form['count'] = [
'#type' => 'select', '#type' => 'select',
......
...@@ -2,9 +2,9 @@ name: Dashboards matomo ...@@ -2,9 +2,9 @@ name: Dashboards matomo
description: 'Components for core statistics.' description: 'Components for core statistics.'
package: Dashboards package: Dashboards
core_version_requirement: ^9.4 || ^10 core_version_requirement: ^9.4 || ^10 || ^11
type: module type: module
dependencies: dependencies:
- matomo:matomo - matomo:matomo
- matomo_reporting_api:matomo_reporting_api - matomo_reporting_api:matomo_reporting_api
...@@ -46,7 +46,7 @@ class Browser extends MatomoBase { ...@@ -46,7 +46,7 @@ class Browser extends MatomoBase {
} }
catch (\Exception $ex) { catch (\Exception $ex) {
return [ return [
'#markup' => $plugin->t('Error occured: @error', ['@error' => $ex->getMessage()]), '#markup' => $plugin->t('Error occurred: @error', ['@error' => $ex->getMessage()]),
'#cache' => [ '#cache' => [
'max-age' => 0, 'max-age' => 0,
], ],
......
...@@ -42,7 +42,7 @@ class Country extends MatomoBase { ...@@ -42,7 +42,7 @@ class Country extends MatomoBase {
} }
catch (\Exception $ex) { catch (\Exception $ex) {
return [ return [
'#markup' => $plugin->t('Error occured: @error', ['@error' => $ex->getMessage()]), '#markup' => $plugin->t('Error occurred: @error', ['@error' => $ex->getMessage()]),
'#cache' => [ '#cache' => [
'max-age' => 0, 'max-age' => 0,
], ],
......