diff --git a/composer.json b/composer.json index 4380905..75a61c8 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "sschreier/administration-dashboard", "description": "a extension which customizing the administration dashboard", - "version": "1.1.1", + "version": "1.2.0", "type": "shopware-platform-plugin", "license": "proprietary", "authors": [ @@ -11,7 +11,7 @@ } ], "require": { - "shopware/administration": "~6.5.0" + "shopware/administration": "~6.6.0" }, "extra": { "shopware-plugin-class": "Sschreier\\AdministrationDashboard\\SschreierAdministrationDashboard", diff --git a/src/Resources/app/administration/src/main.js b/src/Resources/app/administration/src/main.js index d449264..9c6ea7e 100644 --- a/src/Resources/app/administration/src/main.js +++ b/src/Resources/app/administration/src/main.js @@ -1,2 +1,3 @@ -import './module/sw-dashboard/page/sw-dashboard-index'; -import './module/sw-dashboard/component/sw-dashboard-statistics'; +import './module/sw-dashboard/acl'; + +import './module/sw-dashboard/'; diff --git a/src/Resources/app/administration/src/module/sw-dashboard/acl/index.js b/src/Resources/app/administration/src/module/sw-dashboard/acl/index.js index 2809d77..c132869 100644 --- a/src/Resources/app/administration/src/module/sw-dashboard/acl/index.js +++ b/src/Resources/app/administration/src/module/sw-dashboard/acl/index.js @@ -1,33 +1,32 @@ -if (Shopware.Service('privileges')) { - Shopware.Service('privileges').addPrivilegeMappingEntry({ +Shopware.Service('privileges') + .addPrivilegeMappingEntry({ category: 'additional_permissions', parent: null, key: 'dashboard', roles: { intro: { - privileges: [], + privileges: ['dashboard:intro'], dependencies: [] }, welcome: { - privileges: [], + privileges: ['dashboard:welcome'], dependencies: [] }, feedback: { - privileges: [], + privileges: ['dashboard:feedback'], dependencies: [] }, stats_today: { - privileges: [], + privileges: ['dashboard:stats:today'], dependencies: [] }, statistics_count: { - privileges: [], + privileges: ['dashboard:statistics:count'], dependencies: [] }, statistics_sum: { - privileges: [], + privileges: ['dashboard:statistics:sum'], dependencies: [] } } }); -} diff --git a/src/Resources/app/administration/src/module/sw-dashboard/component/sw-dashboard-statistics/index.ts b/src/Resources/app/administration/src/module/sw-dashboard/component/sw-dashboard-statistics/index.ts index 98dacb7..41c7798 100644 --- a/src/Resources/app/administration/src/module/sw-dashboard/component/sw-dashboard-statistics/index.ts +++ b/src/Resources/app/administration/src/module/sw-dashboard/component/sw-dashboard-statistics/index.ts @@ -1,11 +1,9 @@ -import './../../acl'; - import template from './sw-dashboard-statistics.html.twig'; -Shopware.Component.override('sw-dashboard-statistics', { +export default { template, inject: { acl: 'acl' }, -}); +}; diff --git a/src/Resources/app/administration/src/module/sw-dashboard/index.ts b/src/Resources/app/administration/src/module/sw-dashboard/index.ts new file mode 100644 index 0000000..f78c9a1 --- /dev/null +++ b/src/Resources/app/administration/src/module/sw-dashboard/index.ts @@ -0,0 +1,2 @@ +Shopware.Component.override('sw-dashboard-statistics', () => import('./component/sw-dashboard-statistics')); +Shopware.Component.override('sw-dashboard-index', () => import('./page/sw-dashboard-index')); diff --git a/src/Resources/app/administration/src/module/sw-dashboard/page/sw-dashboard-index/index.js b/src/Resources/app/administration/src/module/sw-dashboard/page/sw-dashboard-index/index.js index eda205e..3a2df48 100644 --- a/src/Resources/app/administration/src/module/sw-dashboard/page/sw-dashboard-index/index.js +++ b/src/Resources/app/administration/src/module/sw-dashboard/page/sw-dashboard-index/index.js @@ -1,14 +1,10 @@ -import './../../acl'; - import template from './sw-dashboard-index.html.twig'; import './sw-dashboard-index.scss'; import deDE from './../../snippet/de-DE.json'; import enGB from './../../snippet/en-GB.json'; -const { Component } = Shopware; - -Component.override('sw-dashboard-index', { +export default { template, snippets: { @@ -19,4 +15,4 @@ Component.override('sw-dashboard-index', { inject: { acl: 'acl' }, -}); +}; diff --git a/src/Resources/app/administration/src/module/sw-dashboard/page/sw-dashboard-index/sw-dashboard-index.scss b/src/Resources/app/administration/src/module/sw-dashboard/page/sw-dashboard-index/sw-dashboard-index.scss index 3677820..9c49548 100644 --- a/src/Resources/app/administration/src/module/sw-dashboard/page/sw-dashboard-index/sw-dashboard-index.scss +++ b/src/Resources/app/administration/src/module/sw-dashboard/page/sw-dashboard-index/sw-dashboard-index.scss @@ -10,6 +10,9 @@ margin-top: 0; } + /* + * necessary for the "Today's statistics" from sw-dashboard-statistics, otherwise only the headline and the intro will be hidden, but not the table + */ .sw-card { display: none; diff --git a/src/Resources/config/plugin.png b/src/Resources/config/plugin.png index 822a1e9..a0bf295 100644 Binary files a/src/Resources/config/plugin.png and b/src/Resources/config/plugin.png differ diff --git a/src/Resources/public/administration/js/sschreier-administration-dashboard.js b/src/Resources/public/administration/js/sschreier-administration-dashboard.js index 4293afd..2c68925 100644 --- a/src/Resources/public/administration/js/sschreier-administration-dashboard.js +++ b/src/Resources/public/administration/js/sschreier-administration-dashboard.js @@ -1 +1 @@ -!function(e){var n={};function t(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return e[a].call(s.exports,s,s.exports,t),s.l=!0,s.exports}t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var s in e)t.d(a,s,function(n){return e[n]}.bind(null,s));return a},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p=(window.__sw__.assetPath + '/bundles/sschreieradministrationdashboard/'),t(t.s="Y3/o")}({"/UZg":function(e,n){Shopware.Service("privileges")&&Shopware.Service("privileges").addPrivilegeMappingEntry({category:"additional_permissions",parent:null,key:"dashboard",roles:{intro:{privileges:[],dependencies:[]},welcome:{privileges:[],dependencies:[]},feedback:{privileges:[],dependencies:[]},stats_today:{privileges:[],dependencies:[]},statistics_count:{privileges:[],dependencies:[]},statistics_sum:{privileges:[],dependencies:[]}}})},LDQ1:function(e){e.exports=JSON.parse('{"sw-privileges":{"additional_permissions":{"dashboard":{"label":"Dashboard","intro":"Hide greeting","welcome":"Hide checklist area","feedback":"Hide feedback area","stats_today":"Hide today\'s statistics","statistics_count":"Hide Statistics Orders","statistics_sum":"Hide Statistics Turnover"}}}}')},P8hj:function(e,n,t){"use strict";function a(e,n){for(var t=[],a={},s=0;st.parts.length&&(a.parts.length=t.parts.length)}else{var r=[];for(s=0;s\n {% block sw_dashboard_index_inner_before %}{% endblock %}\n {% parent() %}\n {% block sw_dashboard_index_inner_after %}{% endblock %}\n \n {% block sw_dashboard_index_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_index_content_intro_card %}\n {% block sw_dashboard_index_content_intro_card_before %}{% endblock %}\n \n {% block sw_dashboard_index_content_intro_card_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_index_content_info_grid %}\n {% block sw_dashboard_index_content_info_grid_before %}{% endblock %}\n \n {% block sw_dashboard_index_content_info_grid_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_index_content_info__grid_inner_welcome_card %}\n {% block sw_dashboard_index_content_info__grid_inner_welcome_card_before %}{% endblock %}\n \n {% block sw_dashboard_index_content_info__grid_inner_welcome_card_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_index_content_grid_info_inner_feedback_card %}\n {% block sw_dashboard_index_content_grid_info_inner_feedback_card_before %}{% endblock %}\n \n {% block sw_dashboard_index_content_grid_info_inner_feedback_card_after %}{% endblock %}\n{% endblock %}\n",snippets:{"de-DE":a,"en-GB":s},inject:{acl:"acl"}});Shopware.Component.override("sw-dashboard-statistics",{template:"{% block sw_dashboard_statistics_intro_stats_headline %}\n {% block sw_dashboard_statistics_intro_stats_headline_before %}{% endblock %}\n \n {% block sw_dashboard_statistics_intro_stats_headline_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_statistics_intro_stats_today %}\n {% block sw_dashboard_statistics_intro_stats_today_before %}{% endblock %}\n \n {% block sw_dashboard_statistics_intro_stats_today_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_statistics_count %}\n {% block sw_dashboard_statistics_count_before %}{% endblock %}\n \n {% block sw_dashboard_statistics_count_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_statistics_sum %}\n {% block sw_dashboard_statistics_sum_before %}{% endblock %}\n \n {% block sw_dashboard_statistics_sum_after %}{% endblock %}\n{% endblock %}\n",inject:{acl:"acl"}})},xspp:function(e,n,t){var a=t("yAPE");a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,t("P8hj").default)("4bcc1fe9",a,!0,{})},yAPE:function(e,n,t){}}); \ No newline at end of file +(function(){var e,t,n,r,i,o,a,s,d={750:function(){Shopware.Service("privileges").addPrivilegeMappingEntry({category:"additional_permissions",parent:null,key:"dashboard",roles:{intro:{privileges:["dashboard:intro"],dependencies:[]},welcome:{privileges:["dashboard:welcome"],dependencies:[]},feedback:{privileges:["dashboard:feedback"],dependencies:[]},stats_today:{privileges:["dashboard:stats:today"],dependencies:[]},statistics_count:{privileges:["dashboard:statistics:count"],dependencies:[]},statistics_sum:{privileges:["dashboard:statistics:sum"],dependencies:[]}}})},351:function(e,t,n){Shopware.Component.override("sw-dashboard-statistics",()=>n.e(166).then(n.bind(n,166))),Shopware.Component.override("sw-dashboard-index",()=>n.e(527).then(n.bind(n,527)))}},u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={id:e,exports:{}};return d[e](n,n.exports,c),n.exports}c.m=d,c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.f={},c.e=function(e){return Promise.all(Object.keys(c.f).reduce(function(t,n){return c.f[n](e,t),t},[]))},c.u=function(e){return"static/js/"+({166:"24dbea49dc69127448c2",527:"67ef2b5b207f03bd1d80"})[e]+".js"},c.miniCssF=function(e){return"static/css/"+e+".css"},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e={},t="administration:",c.l=function(n,r,i,o){if(e[n]){e[n].push(r);return}if(void 0!==i)for(var a,s,d=document.getElementsByTagName("script"),u=0;u.sw-card{display:block} \ No newline at end of file +.sw-page__outer{position:relative;height:100%}.sw-page__outer .sw-dashboard-index__welcome-text{margin-bottom:32px}.sw-page__outer .sw-dashboard-index__card-grid{margin-top:0}.sw-page__outer .sw-card{display:none}.sw-page__outer .sw-card.sw-dashboard-statistics__statistics-count,.sw-page__outer .sw-card.sw-dashboard-statistics__statistics-sum{display:block}.sw-page__outer .sw-dashboard-statistics__card-headline+div>.sw-card{display:block} diff --git a/src/Resources/public/static/js/24dbea49dc69127448c2.js b/src/Resources/public/static/js/24dbea49dc69127448c2.js new file mode 100644 index 0000000..30d6c6a --- /dev/null +++ b/src/Resources/public/static/js/24dbea49dc69127448c2.js @@ -0,0 +1 @@ +"use strict";(window["webpackJsonpPluginsschreier-administration-dashboard"]=window["webpackJsonpPluginsschreier-administration-dashboard"]||[]).push([[166],{166:function(t,s,a){a.r(s),a.d(s,{default:function(){return n}});var n={template:"{% block sw_dashboard_statistics_intro_stats_headline %}\n {% block sw_dashboard_statistics_intro_stats_headline_before %}{% endblock %}\n \n {% block sw_dashboard_statistics_intro_stats_headline_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_statistics_intro_stats_today %}\n {% block sw_dashboard_statistics_intro_stats_today_before %}{% endblock %}\n \n {% block sw_dashboard_statistics_intro_stats_today_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_statistics_count %}\n {% block sw_dashboard_statistics_count_before %}{% endblock %}\n \n {% block sw_dashboard_statistics_count_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_statistics_sum %}\n {% block sw_dashboard_statistics_sum_before %}{% endblock %}\n \n {% block sw_dashboard_statistics_sum_after %}{% endblock %}\n{% endblock %}\n",inject:{acl:"acl"}}}}]); \ No newline at end of file diff --git a/src/Resources/public/static/js/67ef2b5b207f03bd1d80.js b/src/Resources/public/static/js/67ef2b5b207f03bd1d80.js new file mode 100644 index 0000000..65654b7 --- /dev/null +++ b/src/Resources/public/static/js/67ef2b5b207f03bd1d80.js @@ -0,0 +1 @@ +(window["webpackJsonpPluginsschreier-administration-dashboard"]=window["webpackJsonpPluginsschreier-administration-dashboard"]||[]).push([[527],{390:function(){},527:function(e,n,a){"use strict";a.r(n),a.d(n,{default:function(){return t}}),a(622);var t={template:"{% block sw_dashboard_index %}\n {% block sw_dashboard_index_before %}{% endblock %}\n
\n {% block sw_dashboard_index_inner_before %}{% endblock %}\n {% parent() %}\n {% block sw_dashboard_index_inner_after %}{% endblock %}\n
\n {% block sw_dashboard_index_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_index_content_intro_card %}\n {% block sw_dashboard_index_content_intro_card_before %}{% endblock %}\n \n {% block sw_dashboard_index_content_intro_card_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_index_content_info_grid %}\n {% block sw_dashboard_index_content_info_grid_before %}{% endblock %}\n \n {% block sw_dashboard_index_content_info_grid_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_index_content_info__grid_inner_welcome_card %}\n {% block sw_dashboard_index_content_info__grid_inner_welcome_card_before %}{% endblock %}\n \n {% block sw_dashboard_index_content_info__grid_inner_welcome_card_after %}{% endblock %}\n{% endblock %}\n\n{% block sw_dashboard_index_content_grid_info_inner_feedback_card %}\n {% block sw_dashboard_index_content_grid_info_inner_feedback_card_before %}{% endblock %}\n \n {% block sw_dashboard_index_content_grid_info_inner_feedback_card_after %}{% endblock %}\n{% endblock %}\n",snippets:{"de-DE":JSON.parse('{"sw-privileges":{"additional_permissions":{"dashboard":{"label":"Dashboard","intro":"Begr\xfc\xdfung ausblenden","welcome":"Checkliste ausblenden","feedback":"Feedback ausblenden","stats_today":"Statistik des Tages ausblenden","statistics_count":"Statistiken Bestellungen ausblenden","statistics_sum":"Statistiken Umsatz ausblenden"}}}}'),"en-GB":JSON.parse('{"sw-privileges":{"additional_permissions":{"dashboard":{"label":"Dashboard","intro":"Hide greeting","welcome":"Hide checklist area","feedback":"Hide feedback area","stats_today":"Hide today\'s statistics","statistics_count":"Hide Statistics Orders","statistics_sum":"Hide Statistics Turnover"}}}}')},inject:{acl:"acl"}}},622:function(e,n,a){var t=a(390);t.__esModule&&(t=t.default),"string"==typeof t&&(t=[[e.id,t,""]]),t.locals&&(e.exports=t.locals),a(346).Z("1e369c72",t,!0,{})},346:function(e,n,a){"use strict";function t(e,n){for(var a=[],t={},r=0;ra.parts.length&&(t.parts.length=a.parts.length)}else{for(var o=[],r=0;r