From 3b8112ba9241f0a3b93999bb24eb5a0b12adda55 Mon Sep 17 00:00:00 2001 From: joerivanveen Date: Tue, 2 Jan 2024 12:01:57 +0100 Subject: [PATCH 1/2] feat(order-list): add myparcel actions --- composer.json | 7 +++++-- src/Resources/app/administration/src/main.js | 1 + .../src/module/sw-order/component/sw-grid/index.js | 6 ++++++ .../module/sw-order/component/sw-grid/naampje.html.twig | 5 +++++ .../src/module/sw-order/component/test.html.twig | 5 +++++ .../app/administration/src/module/sw-order/index.js | 6 ++++++ 6 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 src/Resources/app/administration/src/module/sw-order/component/sw-grid/index.js create mode 100644 src/Resources/app/administration/src/module/sw-order/component/sw-grid/naampje.html.twig create mode 100644 src/Resources/app/administration/src/module/sw-order/component/test.html.twig create mode 100644 src/Resources/app/administration/src/module/sw-order/index.js diff --git a/composer.json b/composer.json index 4984032..936cf49 100755 --- a/composer.json +++ b/composer.json @@ -68,6 +68,9 @@ ] }, "config": { - "optimize-autoloader": true + "optimize-autoloader": true, + "allow-plugins": { + "symfony/runtime": true + } } -} \ No newline at end of file +} diff --git a/src/Resources/app/administration/src/main.js b/src/Resources/app/administration/src/main.js index 67e79e9..a45b0fc 100644 --- a/src/Resources/app/administration/src/main.js +++ b/src/Resources/app/administration/src/main.js @@ -1,5 +1,6 @@ import './init/api-service.init'; import './module/my-parcel'; +import './module/sw-order'; import './service/myparcelApiTestService'; import './service/myparcelDropOffService' import './component/myparcel-api-test-button'; diff --git a/src/Resources/app/administration/src/module/sw-order/component/sw-grid/index.js b/src/Resources/app/administration/src/module/sw-order/component/sw-grid/index.js new file mode 100644 index 0000000..fe5ee7b --- /dev/null +++ b/src/Resources/app/administration/src/module/sw-order/component/sw-grid/index.js @@ -0,0 +1,6 @@ +import template from './naampje.html.twig'; +Shopware.Component.override('sw-order-list-grid-columns', { + template, +}); + +console.warn('hallo, ik wil de order list grid columns extenden'); diff --git a/src/Resources/app/administration/src/module/sw-order/component/sw-grid/naampje.html.twig b/src/Resources/app/administration/src/module/sw-order/component/sw-grid/naampje.html.twig new file mode 100644 index 0000000..bd60a9b --- /dev/null +++ b/src/Resources/app/administration/src/module/sw-order/component/sw-grid/naampje.html.twig @@ -0,0 +1,5 @@ +{% block sw_order_list_grid_columns %} + +NOEP + +{% endblock %} diff --git a/src/Resources/app/administration/src/module/sw-order/component/test.html.twig b/src/Resources/app/administration/src/module/sw-order/component/test.html.twig new file mode 100644 index 0000000..587819f --- /dev/null +++ b/src/Resources/app/administration/src/module/sw-order/component/test.html.twig @@ -0,0 +1,5 @@ +{% block sw_dashboard_index_content_intro_content_headline %} +

+ All ur base r belong to us! +

+{% endblock %} diff --git a/src/Resources/app/administration/src/module/sw-order/index.js b/src/Resources/app/administration/src/module/sw-order/index.js new file mode 100644 index 0000000..cca9b01 --- /dev/null +++ b/src/Resources/app/administration/src/module/sw-order/index.js @@ -0,0 +1,6 @@ +import './component/sw-grid' + +import template from './component/test.html.twig'; +Shopware.Component.override('sw-dashboard-index', { + template +}); From 729b2675f591fec44b3b174686f08f4e919b0ac7 Mon Sep 17 00:00:00 2001 From: Joeri van Veen Date: Mon, 15 Apr 2024 12:48:40 +0200 Subject: [PATCH 2/2] wip --- src/Resources/app/administration/src/main.js | 2 +- .../sw-order/component/sw-grid/index.js | 6 --- .../component/sw-grid/naampje.html.twig | 5 -- .../module/sw-order/component/test.html.twig | 5 -- .../src/module/sw-order/index.js | 6 --- .../sw-order-list/sw-order-list.html.twig | 25 ++++++++++ .../page/sw-order-list/sw-order-list.js | 46 +++++++++++++++++++ 7 files changed, 72 insertions(+), 23 deletions(-) delete mode 100644 src/Resources/app/administration/src/module/sw-order/component/sw-grid/index.js delete mode 100644 src/Resources/app/administration/src/module/sw-order/component/sw-grid/naampje.html.twig delete mode 100644 src/Resources/app/administration/src/module/sw-order/component/test.html.twig delete mode 100644 src/Resources/app/administration/src/module/sw-order/index.js create mode 100644 src/Resources/app/administration/src/module/sw-order/page/sw-order-list/sw-order-list.html.twig create mode 100644 src/Resources/app/administration/src/module/sw-order/page/sw-order-list/sw-order-list.js diff --git a/src/Resources/app/administration/src/main.js b/src/Resources/app/administration/src/main.js index a45b0fc..b163e5e 100644 --- a/src/Resources/app/administration/src/main.js +++ b/src/Resources/app/administration/src/main.js @@ -1,6 +1,6 @@ import './init/api-service.init'; import './module/my-parcel'; -import './module/sw-order'; +import './module/sw-order/page/sw-order-list/sw-order-list'; import './service/myparcelApiTestService'; import './service/myparcelDropOffService' import './component/myparcel-api-test-button'; diff --git a/src/Resources/app/administration/src/module/sw-order/component/sw-grid/index.js b/src/Resources/app/administration/src/module/sw-order/component/sw-grid/index.js deleted file mode 100644 index fe5ee7b..0000000 --- a/src/Resources/app/administration/src/module/sw-order/component/sw-grid/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import template from './naampje.html.twig'; -Shopware.Component.override('sw-order-list-grid-columns', { - template, -}); - -console.warn('hallo, ik wil de order list grid columns extenden'); diff --git a/src/Resources/app/administration/src/module/sw-order/component/sw-grid/naampje.html.twig b/src/Resources/app/administration/src/module/sw-order/component/sw-grid/naampje.html.twig deleted file mode 100644 index bd60a9b..0000000 --- a/src/Resources/app/administration/src/module/sw-order/component/sw-grid/naampje.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% block sw_order_list_grid_columns %} - -NOEP - -{% endblock %} diff --git a/src/Resources/app/administration/src/module/sw-order/component/test.html.twig b/src/Resources/app/administration/src/module/sw-order/component/test.html.twig deleted file mode 100644 index 587819f..0000000 --- a/src/Resources/app/administration/src/module/sw-order/component/test.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% block sw_dashboard_index_content_intro_content_headline %} -

- All ur base r belong to us! -

-{% endblock %} diff --git a/src/Resources/app/administration/src/module/sw-order/index.js b/src/Resources/app/administration/src/module/sw-order/index.js deleted file mode 100644 index cca9b01..0000000 --- a/src/Resources/app/administration/src/module/sw-order/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import './component/sw-grid' - -import template from './component/test.html.twig'; -Shopware.Component.override('sw-dashboard-index', { - template -}); diff --git a/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/sw-order-list.html.twig b/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/sw-order-list.html.twig new file mode 100644 index 0000000..61a16d9 --- /dev/null +++ b/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/sw-order-list.html.twig @@ -0,0 +1,25 @@ +{% block sw_order_list_grid_columns_billing_address %} + {% parent %} + + + +{% endblock %} + + {% block sw_order_list_grid_columns_actions_view %} +{# #} +{# {{ $tc('sw-myparcel.orders.buttons.createConsignmentsButton') }}#} +{# #} + + {{ $tc('sw-myparcel.orders.buttons.createConsignmentsButton') }} + + {% parent %} + {% endblock %} diff --git a/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/sw-order-list.js b/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/sw-order-list.js new file mode 100644 index 0000000..f040e68 --- /dev/null +++ b/src/Resources/app/administration/src/module/sw-order/page/sw-order-list/sw-order-list.js @@ -0,0 +1,46 @@ +import template from './sw-order-list.html.twig'; +const { Component } = Shopware; + +// Uitleg via Bjorn https://gist.github.com/bheijink/b8ff3b98818a2cc6db995ecfb2bb06ea + +Component.override('sw-order-list', { + template, + + methods: { + getOrderColumns() { + var thisOrderColumns = this.$super('getOrderColumns'); + thisOrderColumns.splice(1, 0, { + property: 'afbeelding', + label: 'Afbeelding', + routerLink: 'sw.order.detail', + allowResize: true, + isImage: true, + primary: true + }, { + property: 'download', + label: 'Download', + routerLink: 'sw.order.detail', + allowResize: true, + primary: true + }, { + property: 'quantitycount', + label: 'Totaal aantal', + routerLink: 'sw.order.detail', + allowResize: true, + primary: true + }); + return thisOrderColumns; + }, + // getOrderActions() { + // var thisOrderActions = this.$super('getOrderActions'); + // thisOrderActions.splice(1, 0, { + // property: 'quantitycount', + // label: 'Totaal aantal', + // routerLink: 'sw.order.detail', + // allowResize: true, + // primary: true + // } ); + // return thisOrderActions; + // } + } +}); \ No newline at end of file