diff --git a/Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/Grid.ts b/Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/Grid.ts index 353af8a3524b43d24688d271feaf5b952c478a95..2aa1f8c647c7d9857b6fb0070a7a348bda75e3ed 100644 --- a/Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/Grid.ts +++ b/Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/Grid.ts @@ -83,7 +83,7 @@ class Grid { ]; }); - (new AjaxRequest(TYPO3.settings.ajaxUrls['ext-dashboard-save-widget-positions'])).post({ + (new AjaxRequest(TYPO3.settings.ajaxUrls['dashboard_save_widget_positions'])).post({ widgets: widgets }).then(async (response: AjaxResponse): Promise<any> => { await response.resolve(); diff --git a/Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/WidgetContentCollector.ts b/Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/WidgetContentCollector.ts index 709327a10c5b3eb30142961123960a7718760436..f30c8bc77ff1a8d15a99485b60eb9ce61a153fd1 100644 --- a/Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/WidgetContentCollector.ts +++ b/Build/Sources/TypeScript/dashboard/Resources/Public/TypeScript/WidgetContentCollector.ts @@ -29,7 +29,7 @@ class WidgetContentCollector { const widgetContentElement = triggerElement.querySelector('.widget-content'); const widgetErrorElement = triggerElement.querySelector('.widget-error'); - const sentRequest = (new AjaxRequest(TYPO3.settings.ajaxUrls['ext-dashboard-get-widget-content'])) + const sentRequest = (new AjaxRequest(TYPO3.settings.ajaxUrls['dashboard_get_widget_content'])) .withQueryArguments({ widget: triggerElement.dataset.widgetKey, }) diff --git a/typo3/sysext/dashboard/Configuration/Backend/AjaxRoutes.php b/typo3/sysext/dashboard/Configuration/Backend/AjaxRoutes.php index 5e8f44894846fdf3dae0cbe550a149f6b9ced37f..da9445b9928d45ddf0dc5f799f297b6a44ddfdbd 100644 --- a/typo3/sysext/dashboard/Configuration/Backend/AjaxRoutes.php +++ b/typo3/sysext/dashboard/Configuration/Backend/AjaxRoutes.php @@ -2,13 +2,13 @@ return [ // Get the content of a widget - 'ext-dashboard-get-widget-content' => [ - 'path' => '/ext/dashboard/widget/content', + 'dashboard_get_widget_content' => [ + 'path' => '/dashboard/widget/content', 'target' => TYPO3\CMS\Dashboard\Controller\WidgetAjaxController::class . '::getContent' ], // Save positions of the widgets - 'ext-dashboard-save-widget-positions' => [ - 'path' => '/ext/dashboard/widget/positions/save', + 'dashboard_save_widget_positions' => [ + 'path' => '/dashboard/widget/positions/save', 'target' => TYPO3\CMS\Dashboard\Controller\WidgetAjaxController::class . '::savePositions' ], ]; diff --git a/typo3/sysext/dashboard/Configuration/Backend/Routes.php b/typo3/sysext/dashboard/Configuration/Backend/Routes.php index 1e597458aebfebd1d3eb3e9edf3efbdf9c2de166..39a3aca8379f661dfd7ca16faa187691b6382a2c 100644 --- a/typo3/sysext/dashboard/Configuration/Backend/Routes.php +++ b/typo3/sysext/dashboard/Configuration/Backend/Routes.php @@ -2,7 +2,7 @@ return [ 'dashboard' => [ - 'path' => '/ext/dashboard', + 'path' => '/dashboard', 'target' => \TYPO3\CMS\Dashboard\Controller\DashboardController::class . '::handleRequest', ], ]; diff --git a/typo3/sysext/dashboard/Resources/Public/JavaScript/Grid.js b/typo3/sysext/dashboard/Resources/Public/JavaScript/Grid.js index ad97067b277b95bb694c39840337cd7c39546a6d..7f6f59588dc2d798c3e08aaee41ac5c8ef46d657 100644 --- a/typo3/sysext/dashboard/Resources/Public/JavaScript/Grid.js +++ b/typo3/sysext/dashboard/Resources/Public/JavaScript/Grid.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","muuri","TYPO3/CMS/Core/Ajax/AjaxRequest","TYPO3/CMS/Core/Event/RegularEvent"],(function(e,t,a,r,s){"use strict";return new class{constructor(){this.selector=".dashboard-grid",this.initialize()}initialize(){const e={dragEnabled:!0,dragSortHeuristics:{sortInterval:50,minDragDistance:10,minBounceBackAngle:1},layoutDuration:400,layoutEasing:"ease",dragPlaceholder:{enabled:!0,duration:400,createElement:e=>e.getElement().cloneNode(!0)},dragSortPredicate:{action:"move",threshold:30},dragStartPredicate:{handle:".js-dashboard-move-widget"},dragReleaseDuration:400,dragReleaseEasing:"ease",layout:{fillGaps:!1,rounding:!1}};if(null!==document.querySelector(this.selector)){const t=new a(this.selector,e);t.on("dragStart",()=>{document.querySelectorAll(".dashboard-item").forEach(e=>{e.classList.remove("dashboard-item--enableSelect")})}),t.on("dragReleaseEnd",()=>{document.querySelectorAll(".dashboard-item").forEach(e=>{e.classList.add("dashboard-item--enableSelect")}),this.saveItems(t)}),new s("widgetContentRendered",()=>{t.refreshItems().layout()}).delegateTo(document,".dashboard-item")}}saveItems(e){let t=e.getItems().map((function(e){return[e.getElement().getAttribute("data-widget-key"),e.getElement().getAttribute("data-widget-hash")]}));new r(TYPO3.settings.ajaxUrls["ext-dashboard-save-widget-positions"]).post({widgets:t}).then(async e=>{await e.resolve()})}}})); \ No newline at end of file +define(["require","exports","muuri","TYPO3/CMS/Core/Ajax/AjaxRequest","TYPO3/CMS/Core/Event/RegularEvent"],(function(e,t,a,r,s){"use strict";return new class{constructor(){this.selector=".dashboard-grid",this.initialize()}initialize(){const e={dragEnabled:!0,dragSortHeuristics:{sortInterval:50,minDragDistance:10,minBounceBackAngle:1},layoutDuration:400,layoutEasing:"ease",dragPlaceholder:{enabled:!0,duration:400,createElement:e=>e.getElement().cloneNode(!0)},dragSortPredicate:{action:"move",threshold:30},dragStartPredicate:{handle:".js-dashboard-move-widget"},dragReleaseDuration:400,dragReleaseEasing:"ease",layout:{fillGaps:!1,rounding:!1}};if(null!==document.querySelector(this.selector)){const t=new a(this.selector,e);t.on("dragStart",()=>{document.querySelectorAll(".dashboard-item").forEach(e=>{e.classList.remove("dashboard-item--enableSelect")})}),t.on("dragReleaseEnd",()=>{document.querySelectorAll(".dashboard-item").forEach(e=>{e.classList.add("dashboard-item--enableSelect")}),this.saveItems(t)}),new s("widgetContentRendered",()=>{t.refreshItems().layout()}).delegateTo(document,".dashboard-item")}}saveItems(e){let t=e.getItems().map((function(e){return[e.getElement().getAttribute("data-widget-key"),e.getElement().getAttribute("data-widget-hash")]}));new r(TYPO3.settings.ajaxUrls["dashboard_save_widget_positions"]).post({widgets:t}).then(async e=>{await e.resolve()})}}})); diff --git a/typo3/sysext/dashboard/Resources/Public/JavaScript/WidgetContentCollector.js b/typo3/sysext/dashboard/Resources/Public/JavaScript/WidgetContentCollector.js index 7e3bf0d2d451bc92c95107a3130e273c77275d7f..edd702aa284e7442d9ca1b9de534f8440a72580b 100644 --- a/typo3/sysext/dashboard/Resources/Public/JavaScript/WidgetContentCollector.js +++ b/typo3/sysext/dashboard/Resources/Public/JavaScript/WidgetContentCollector.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","TYPO3/CMS/Core/Ajax/AjaxRequest"],(function(e,t,n){"use strict";return new class{constructor(){this.selector=".dashboard-item",this.initialize()}initialize(){document.querySelectorAll(this.selector).forEach(e=>{const t=e.querySelector(".widget-waiting"),s=e.querySelector(".widget-content"),i=e.querySelector(".widget-error");new n(TYPO3.settings.ajaxUrls["ext-dashboard-get-widget-content"]).withQueryArguments({widget:e.dataset.widgetKey}).get().then(async n=>{const i=await n.resolve();let r;null!==s&&(s.innerHTML=i.content,s.classList.remove("hide")),null!==t&&t.classList.add("hide");const a={bubbles:!0};r=Object.keys(i.eventdata).length>0?new CustomEvent("widgetContentRendered",Object.assign(Object.assign({},a),{detail:i.eventdata})):new Event("widgetContentRendered",a),e.dispatchEvent(r)}).catch(n=>{null!==i&&i.classList.remove("hide"),null!==t&&t.classList.add("hide"),console.warn(`Error while retrieving widget [${e.dataset.widgetKey}] content: ${n.message}`)})})}}})); \ No newline at end of file +define(["require","exports","TYPO3/CMS/Core/Ajax/AjaxRequest"],(function(e,t,n){"use strict";return new class{constructor(){this.selector=".dashboard-item",this.initialize()}initialize(){document.querySelectorAll(this.selector).forEach(e=>{const t=e.querySelector(".widget-waiting"),s=e.querySelector(".widget-content"),i=e.querySelector(".widget-error");new n(TYPO3.settings.ajaxUrls["dashboard_get_widget_content"]).withQueryArguments({widget:e.dataset.widgetKey}).get().then(async n=>{const i=await n.resolve();let r;null!==s&&(s.innerHTML=i.content,s.classList.remove("hide")),null!==t&&t.classList.add("hide");const a={bubbles:!0};r=Object.keys(i.eventdata).length>0?new CustomEvent("widgetContentRendered",Object.assign(Object.assign({},a),{detail:i.eventdata})):new Event("widgetContentRendered",a),e.dispatchEvent(r)}).catch(n=>{null!==i&&i.classList.remove("hide"),null!==t&&t.classList.add("hide"),console.warn(`Error while retrieving widget [${e.dataset.widgetKey}] content: ${n.message}`)})})}}})); diff --git a/typo3/sysext/dashboard/ext_localconf.php b/typo3/sysext/dashboard/ext_localconf.php index 402eae82906a6e649803f4688fef706189912e4a..494c6434306818589a72cfb8e570da5927067f07 100644 --- a/typo3/sysext/dashboard/ext_localconf.php +++ b/typo3/sysext/dashboard/ext_localconf.php @@ -4,21 +4,15 @@ if (!defined('TYPO3_MODE')) { die('Access denied.'); } -call_user_func(static function () { - if (TYPO3_MODE === 'BE') { - if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['dashboard_rss'])) { - $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['dashboard_rss'] = [ - 'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, - 'backend' => \TYPO3\CMS\Core\Cache\Backend\FileBackend::class, - 'options' => [ - 'defaultLifetime' => 900, - ], - ]; - } +if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['dashboard_rss'])) { + $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['dashboard_rss'] = [ + 'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, + 'backend' => \TYPO3\CMS\Core\Cache\Backend\FileBackend::class, + 'options' => [ + 'defaultLifetime' => 900, + ], + ]; +} - /** - * Set starting module to dashboard if users didn't change it - */ - $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUC']['startModule'] = 'dashboard'; - } -}); +// Set starting module to dashboard if users didn't change it +$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUC']['startModule'] = 'dashboard'; diff --git a/typo3/sysext/dashboard/ext_tables.php b/typo3/sysext/dashboard/ext_tables.php index 92d5954a6842ed76361ec0956ecaa3f83a824b96..417d91d640e069a522104942526ffd326e3eea5e 100644 --- a/typo3/sysext/dashboard/ext_tables.php +++ b/typo3/sysext/dashboard/ext_tables.php @@ -2,10 +2,6 @@ defined('TYPO3_MODE') or die(); -$GLOBALS['TBE_MODULES']['_configuration']['dashboard'] = [ - 'labels' => 'LLL:EXT:dashboard/Resources/Private/Language/locallang_mod.xlf', - 'name' => 'dashboard' -]; \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule( 'dashboard', '',