From b352fc10e7f1d4864896cb42076fe54eadcbaae6 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 20 Mar 2024 14:44:06 +0100 Subject: [PATCH 1/2] refs #6532 redirect grafana, remove mermas --- modules/item/front/index.js | 1 - modules/item/front/waste/detail/index.html | 43 ---------------- modules/item/front/waste/detail/index.js | 7 --- modules/item/front/waste/detail/style.scss | 25 --------- modules/item/front/waste/index/index.html | 51 +------------------ modules/item/front/waste/index/index.js | 22 ++------ modules/item/front/waste/index/index.spec.js | 53 -------------------- 7 files changed, 5 insertions(+), 197 deletions(-) delete mode 100644 modules/item/front/waste/detail/index.html delete mode 100644 modules/item/front/waste/detail/index.js delete mode 100644 modules/item/front/waste/detail/style.scss delete mode 100644 modules/item/front/waste/index/index.spec.js diff --git a/modules/item/front/index.js b/modules/item/front/index.js index d2ffcc8fb..354477d4d 100644 --- a/modules/item/front/index.js +++ b/modules/item/front/index.js @@ -20,7 +20,6 @@ import './botanical'; import './barcode'; import './summary'; import './waste/index/'; -import './waste/detail'; import './fixed-price'; import './fixed-price-search-panel'; import './item-type'; diff --git a/modules/item/front/waste/detail/index.html b/modules/item/front/waste/detail/index.html deleted file mode 100644 index 1b44088bf..000000000 --- a/modules/item/front/waste/detail/index.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - -
- -
{{detail.family}} ({{detail.buyer}})
-
- - - - Item - Percentage - Dwindle - Total - - - - - - - {{::waste.itemFk}} - - - {{::(waste.percentage / 100) | percentage: 2}} - {{::waste.dwindle | currency: 'EUR'}} - {{::waste.total | currency: 'EUR'}} - - - -
-
-
- - \ No newline at end of file diff --git a/modules/item/front/waste/detail/index.js b/modules/item/front/waste/detail/index.js deleted file mode 100644 index 2949a493b..000000000 --- a/modules/item/front/waste/detail/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import ngModule from '../../module'; -import Section from 'salix/components/section'; - -ngModule.vnComponent('vnItemWasteDetail', { - template: require('./index.html'), - controller: Section -}); diff --git a/modules/item/front/waste/detail/style.scss b/modules/item/front/waste/detail/style.scss deleted file mode 100644 index 55a6eb2ef..000000000 --- a/modules/item/front/waste/detail/style.scss +++ /dev/null @@ -1,25 +0,0 @@ -@import "variables"; - -vn-item-waste { - .header { - margin-bottom: 16px; - text-transform: uppercase; - font-size: 1.25rem; - line-height: 1; - padding: 7px; - padding-bottom: 7px; - padding-bottom: 4px; - font-weight: lighter; - background-color: #fde6ca; - border-bottom: 1px solid #f7931e; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - - vn-table vn-th.waste-family, - vn-table vn-td.waste-family { - max-width: 64px; - width: 64px - } -} \ No newline at end of file diff --git a/modules/item/front/waste/index/index.html b/modules/item/front/waste/index/index.html index f1475c1b3..7fb3b870e 100644 --- a/modules/item/front/waste/index/index.html +++ b/modules/item/front/waste/index/index.html @@ -1,49 +1,2 @@ - - - - - - - - Buyer - Family - Percentage - Dwindle - Total - - - - - - {{::detail.buyer}} - {{::detail.family}} - {{::(detail.percentage / 100) | percentage: 2}} - {{::detail.dwindle | currency: 'EUR'}} - {{::detail.total | currency: 'EUR'}} - - - - - - - - {{::waste.family}} - {{::(waste.percentage / 100) | percentage: 2}} - {{::waste.dwindle | currency: 'EUR'}} - {{::waste.total | currency: 'EUR'}} - - - - - - + + diff --git a/modules/item/front/waste/index/index.js b/modules/item/front/waste/index/index.js index b11f54b08..86d9d3778 100644 --- a/modules/item/front/waste/index/index.js +++ b/modules/item/front/waste/index/index.js @@ -5,27 +5,11 @@ import './style.scss'; export default class Controller extends Section { constructor($element, $) { super($element, $); - - this.getWasteConfig(); } - getWasteConfig() { - return this.wasteConfig = JSON.parse(localStorage.getItem('wasteConfig')) || {}; - } - - setWasteConfig() { - localStorage.setItem('wasteConfig', JSON.stringify(this.wasteConfig)); - } - - toggleHidePanel(detail) { - if (!this.wasteConfig[detail.buyer]) { - this.wasteConfig[detail.buyer] = { - hidden: true - }; - } else - this.wasteConfig[detail.buyer].hidden = !this.wasteConfig[detail.buyer].hidden; - - this.setWasteConfig(); + async $onInit() { + this.$state.go('item.index'); + window.location.href = 'https://grafana.verdnatura.es/d/TTNXQAxVk'; } } diff --git a/modules/item/front/waste/index/index.spec.js b/modules/item/front/waste/index/index.spec.js deleted file mode 100644 index fd7332f68..000000000 --- a/modules/item/front/waste/index/index.spec.js +++ /dev/null @@ -1,53 +0,0 @@ -import './index.js'; -import crudModel from 'core/mocks/crud-model'; - -describe('Item', () => { - describe('Component vnItemWasteIndex', () => { - let $scope; - let controller; - - beforeEach(ngModule('item')); - - beforeEach(inject(($componentController, $rootScope) => { - $scope = $rootScope.$new(); - $scope.model = crudModel; - const $element = angular.element(''); - controller = $componentController('vnItemWasteIndex', {$element, $scope}); - })); - - describe('getWasteConfig / setWasteConfig', () => { - it('should return the local storage wasteConfig', () => { - const result = controller.getWasteConfig(); - - expect(result).toEqual({}); - }); - - it('should set and return the local storage wasteConfig', () => { - controller.wasteConfig = {salesPerson: {hidden: true}}; - controller.setWasteConfig(); - - const result = controller.getWasteConfig(); - - expect(result).toEqual(controller.wasteConfig); - }); - }); - - describe('toggleHidePanel()', () => { - it('should make details hidden by default', () => { - controller.wasteConfig = {}; - - controller.toggleHidePanel({buyer: 'salesPerson'}); - - expect(controller.wasteConfig.salesPerson.hidden).toEqual(true); - }); - - it('should toggle hidden false', () => { - controller.wasteConfig = {salesPerson: {hidden: true}}; - - controller.toggleHidePanel({buyer: 'salesPerson'}); - - expect(controller.wasteConfig.salesPerson.hidden).toEqual(false); - }); - }); - }); -}); -- 2.40.1 From 5d5dc9583ace8dbfd65c75d03473eb0179597b61 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 27 Mar 2024 14:44:46 +0100 Subject: [PATCH 2/2] refs #6532 change url --- .../templates/email/buyer-week-waste/buyer-week-waste.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/print/templates/email/buyer-week-waste/buyer-week-waste.html b/print/templates/email/buyer-week-waste/buyer-week-waste.html index d8b7a622b..ecec9c215 100644 --- a/print/templates/email/buyer-week-waste/buyer-week-waste.html +++ b/print/templates/email/buyer-week-waste/buyer-week-waste.html @@ -28,10 +28,10 @@

- \ No newline at end of file + -- 2.40.1