Skip to content

Commit

Permalink
established the compatibility with Shopware from version 6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sschreier committed Nov 27, 2023
1 parent d704b66 commit dbb6696
Show file tree
Hide file tree
Showing 16 changed files with 157 additions and 158 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# A extension which customizing the administration dashboard for Shopware 6
# An extension which customizing the administration dashboard for Shopware 6

The _administration dashboard can be customized_ via the extension. For this purpose, it offers under "_Settings_" -> "_System_"> "_Users & permissions_" -> "_Roles_" in the area "_Additional permissions_" a new area "_Dashboard_" in which you can _hide_ the following areas of the dashboard for the selected role:
- the _greeting_
- the _banner_
- the _checklist_ area
- the _feedback_ area
- the _today's statistics_
- the _statistics of the orders_
- the _statistics of the turnover_.

For the _statistics_, the checkbox "_View_" under "_Orders_" and "_Orders_" must be activated.

The _Administrator_ account always see all areas on the dashboard, because he has no own role.

## How to install the extension
Expand Down Expand Up @@ -58,17 +59,17 @@ bin/console plugin:install --activate SschreierAdministrationDashboard

## Images

### administration dashboard without the areas for the _banner_, the _checklist_ and the _feedback_
### administration dashboard without the areas for the _checklist_ and the _feedback_

![administration dashboard without the areas for the banner, the checklist and the feedback](https://www.sebastianschreier.de/plugins/SschreierAdministrationDashboard/SschreierAdministrationDashboard-Image1.jpg)
![administration dashboard without the areas for the checklist and the feedback](https://www.sebastianschreier.de/plugins/SschreierAdministrationDashboard/SschreierAdministrationDashboard-Image1.jpg)

### administration dashboard without the areas for the _greeting_, the _banner_, the _checklist_ and the _feedback_
### administration dashboard without the areas for the _greeting_, the _checklist_ and the _feedback_

![administration dashboard without the areas for the greeting, the banner, the checklist and the feedback](https://www.sebastianschreier.de/plugins/SschreierAdministrationDashboard/SschreierAdministrationDashboard-Image2.jpg)
![administration dashboard without the areas for the greeting, the checklist and the feedback](https://www.sebastianschreier.de/plugins/SschreierAdministrationDashboard/SschreierAdministrationDashboard-Image2.jpg)

### administration dashboard without the areas for the _banner_, the _checklist_, the _feedback_, the _today's statistics_, the _statistics of the orders_ and the _statistics of the turnover_
### administration dashboard without the areas for the _checklist_, the _feedback_, the _today's statistics_, the _statistics of the orders_ and the _statistics of the turnover_

![administration dashboard without the areas for the banner, the checklist, the feedback, the today's statistics, the statistics of the orders and the statistics of the turnover](https://www.sebastianschreier.de/plugins/SschreierAdministrationDashboard/SschreierAdministrationDashboard-Image3.jpg)
![administration dashboard without the areas for the checklist, the feedback, the today's statistics, the statistics of the orders and the statistics of the turnover](https://www.sebastianschreier.de/plugins/SschreierAdministrationDashboard/SschreierAdministrationDashboard-Image3.jpg)

### new area "_Dashboard_" under "_Settings_" -> "_System_"> "_Users & permissions_" -> "_Roles_" in the area "_Additional permissions_" in which you can _hide_ the areas of the dashboard for the selected role

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sschreier/administration-dashboard",
"description": "a extension which customizing the administration dashboard",
"version": "1.0.1",
"version": "1.1.0",
"type": "shopware-platform-plugin",
"license": "proprietary",
"authors": [
Expand All @@ -11,7 +11,7 @@
}
],
"require": {
"shopware/administration": "~6.4.10"
"shopware/administration": "~6.5.0"
},
"extra": {
"shopware-plugin-class": "Sschreier\\AdministrationDashboard\\SschreierAdministrationDashboard",
Expand Down
3 changes: 2 additions & 1 deletion src/Resources/app/administration/src/main.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import './module/sw-dashboard-index';
import './module/sw-dashboard/page/sw-dashboard-index';
import './module/sw-dashboard/component/sw-dashboard-statistics';

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ if (Shopware.Service('privileges')) {
privileges: [],
dependencies: []
},
campaign_banner: {
privileges: [],
dependencies: []
},
welcome: {
privileges: [],
dependencies: []
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import './../../acl';

import template from './sw-dashboard-statistics.html.twig';

Shopware.Component.override('sw-dashboard-statistics', {
template,

inject: {
acl: 'acl'
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% block sw_dashboard_statistics_intro_stats_headline %}
{% block sw_dashboard_statistics_intro_stats_headline_before %}{% endblock %}
<template v-if="acl.can('admin') || !acl.can('dashboard.stats_today')">
{% block sw_dashboard_statistics_intro_stats_headline_inner_before %}{% endblock %}
{% parent() %}
{% block sw_dashboard_statistics_intro_stats_headline_inner_after %}{% endblock %}
</template>
{% block sw_dashboard_statistics_intro_stats_headline_after %}{% endblock %}
{% endblock %}

{% block sw_dashboard_statistics_intro_stats_today %}
{% block sw_dashboard_statistics_intro_stats_today_before %}{% endblock %}
<template v-if="acl.can('admin') || !acl.can('dashboard.stats_today')">
{% block sw_dashboard_statistics_intro_stats_today_inner_before %}{% endblock %}
{% parent() %}
{% block sw_dashboard_statistics_intro_stats_today_inner_after %}{% endblock %}
</template>
{% block sw_dashboard_statistics_intro_stats_today_after %}{% endblock %}
{% endblock %}

{% block sw_dashboard_statistics_grid %}
{% block sw_dashboard_statistics_grid_before %}{% endblock %}
<template v-if="acl.can('admin') || !acl.can('dashboard.stats_today')">
{% block sw_dashboard_statistics_grid_inner_before %}{% endblock %}
{% parent() %}
{% block sw_dashboard_statistics_grid_inner_after %}{% endblock %}
</template>
{% block sw_dashboard_statistics_grid_after %}{% endblock %}
{% endblock %}

{% block sw_dashboard_statistics_count %}
{% block sw_dashboard_statistics_count_before %}{% endblock %}
<template v-if="acl.can('admin') || !acl.can('dashboard.statistics_count')">
{% block sw_dashboard_statistics_count_inner_before %}{% endblock %}
{% parent() %}
{% block sw_dashboard_statistics_count_inner_after %}{% endblock %}
</template>
{% block sw_dashboard_statistics_count_after %}{% endblock %}
{% endblock %}

{% block sw_dashboard_statistics_sum %}
{% block sw_dashboard_statistics_sum_before %}{% endblock %}
<template v-if="acl.can('admin') || !acl.can('dashboard.statistics_sum')">
{% block sw_dashboard_statistics_sum_inner_before %}{% endblock %}
{% parent() %}
{% block sw_dashboard_statistics_sum_inner_after %}{% endblock %}
</template>
{% block sw_dashboard_statistics_sum_after %}{% endblock %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import './acl';
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';
import deDE from './../../snippet/de-DE.json';
import enGB from './../../snippet/en-GB.json';

const { Component } = Shopware;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% block sw_dashboard_index %}
{% block sw_dashboard_index_before %}{% endblock %}
<div class="sw-page__outer">
{% block sw_dashboard_index_inner_before %}{% endblock %}
{% parent() %}
{% block sw_dashboard_index_inner_after %}{% endblock %}
</div>
{% block sw_dashboard_index_after %}{% endblock %}
{% endblock %}

{% block sw_dashboard_index_content_intro_card %}
{% block sw_dashboard_index_content_intro_card_before %}{% endblock %}
<template v-if="acl.can('admin') || !acl.can('dashboard.intro')">
{% block sw_dashboard_index_content_intro_card_inner_before %}{% endblock %}
{% parent() %}
{% block sw_dashboard_index_content_intro_card_inner_after %}{% endblock %}
</template>
{% block sw_dashboard_index_content_intro_card_after %}{% endblock %}
{% endblock %}

{% block sw_dashboard_index_content_info_grid %}
{% block sw_dashboard_index_content_info_grid_before %}{% endblock %}
<template v-if="acl.can('admin') || (!acl.can('dashboard.welcome') || !acl.can('dashboard.feedback'))">
{% block sw_dashboard_index_content_info_grid_inner_before %}{% endblock %}
{% parent() %}
{% block sw_dashboard_index_content_info_grid_inner_after %}{% endblock %}
</template>
{% block sw_dashboard_index_content_info_grid_after %}{% endblock %}
{% endblock %}

{% block sw_dashboard_index_content_info__grid_inner_welcome_card %}
{% block sw_dashboard_index_content_info__grid_inner_welcome_card_before %}{% endblock %}
<template v-if="acl.can('admin') || !acl.can('dashboard.welcome')">
{% block sw_dashboard_index_content_info__grid_inner_welcome_card_inner_before %}{% endblock %}
{% parent() %}
{% block sw_dashboard_index_content_info__grid_inner_welcome_card_inner_after %}{% endblock %}
</template>
{% block sw_dashboard_index_content_info__grid_inner_welcome_card_after %}{% endblock %}
{% endblock %}

{% block sw_dashboard_index_content_grid_info_inner_feedback_card %}
{% block sw_dashboard_index_content_grid_info_inner_feedback_card_before %}{% endblock %}
<template v-if="acl.can('admin') || !acl.can('dashboard.feedback')">
{% block sw_dashboard_index_content_grid_info_inner_feedback_card_inner_before %}{% endblock %}
{% parent() %}
{% block sw_dashboard_index_content_grid_info_inner_feedback_card_inner_after %}{% endblock %}
</template>
{% block sw_dashboard_index_content_grid_info_inner_feedback_card_after %}{% endblock %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.sw-page__outer {
position: relative;
height: 100%;

.sw-dashboard-index__welcome-text {
margin-bottom: 32px;
}

.sw-dashboard-index__card-grid {
margin-top: 0;
}

.sw-card {
display: none;

&.sw-dashboard-statistics__statistics-count,
&.sw-dashboard-statistics__statistics-sum {
display: block;
}
}

.sw-dashboard-statistics__card-headline + div > .sw-card {
display: block;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"dashboard": {
"label": "Dashboard",
"intro": "Begrüßung ausblenden",
"campaign_banner": "Banner ausblenden",
"welcome": "Checkliste ausblenden",
"feedback": "Feedback ausblenden",
"stats_today": "Statistik des Tages ausblenden",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"dashboard": {
"label": "Dashboard",
"intro": "Hide greeting",
"campaign_banner": "Hide banner",
"welcome": "Hide checklist area",
"feedback": "Hide feedback area",
"stats_today": "Hide today's statistics",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dbb6696

Please sign in to comment.