From 8a6da66916c1e98d92d8f0f21f80c89f9e6adfb3 Mon Sep 17 00:00:00 2001
From: carlosjr <carlosjr@verdnatura.es>
Date: Mon, 30 Aug 2021 13:31:07 +0200
Subject: [PATCH] removed niche section

---
 modules/item/front/index.js              |  1 -
 modules/item/front/locale/es.yml         |  3 -
 modules/item/front/niche/index.html      | 72 ------------------------
 modules/item/front/niche/index.js        | 17 ------
 modules/item/front/routes.json           | 11 ----
 modules/item/front/summary/locale/es.yml |  1 -
 6 files changed, 105 deletions(-)
 delete mode 100644 modules/item/front/niche/index.html
 delete mode 100644 modules/item/front/niche/index.js

diff --git a/modules/item/front/index.js b/modules/item/front/index.js
index 8cb22ef40e..c328b1c8d8 100644
--- a/modules/item/front/index.js
+++ b/modules/item/front/index.js
@@ -16,7 +16,6 @@ import './log';
 import './request';
 import './request-search-panel';
 import './last-entries';
-import './niche';
 import './botanical';
 import './barcode';
 import './summary';
diff --git a/modules/item/front/locale/es.yml b/modules/item/front/locale/es.yml
index 6166622e57..27348d41c8 100644
--- a/modules/item/front/locale/es.yml
+++ b/modules/item/front/locale/es.yml
@@ -30,8 +30,6 @@ New species: Nueva especie
 New genus: Nuevo genus
 Add tag: Añadir etiqueta
 Remove tag: Quitar etiqueta
-Add niche: Añadir nicho
-Remove niche: Quitar nicho
 Add barcode: Añadir código de barras
 Remove barcode: Quitar código de barras
 Buyer: Comprador
@@ -56,7 +54,6 @@ Summary: Vista previa
 Basic data: Datos básicos
 Tax: IVA
 History: Historial
-Niches: Nichos
 Botanical: Botánico
 Barcodes: Códigos de barras
 Diary: Histórico
diff --git a/modules/item/front/niche/index.html b/modules/item/front/niche/index.html
deleted file mode 100644
index 1c376b90e1..0000000000
--- a/modules/item/front/niche/index.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<vn-crud-model
-    vn-id="model"
-    url="ItemNiches"
-    fields="['id', 'itemFk', 'warehouseFk', 'code']"
-    link="{itemFk: $ctrl.$params.id}"
-    data="niches"
-    auto-load="true">
-</vn-crud-model>
-<vn-watcher
-    vn-id="watcher"
-    data="niches"
-    form="form">
-</vn-watcher>
-<vn-crud-model
-    auto-load="true"
-    url="Warehouses"
-    data="warehouses"
-    order="name"
-    vn-id="warehouse-model">
-</vn-crud-model>
-<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
-    <vn-card class="vn-pa-lg">
-        <vn-horizontal ng-repeat="niche in niches track by $index">
-            <vn-autocomplete  vn-one vn-focus
-                data="warehouses"
-                label="Warehouse"
-                show-field="name"
-                value-field="id"
-                ng-model="niche.warehouseFk"
-                vn-acl="buyer,replenisher">
-            </vn-autocomplete>
-            <vn-textfield 
-                vn-three
-                label="Code"
-                ng-model="niche.code"
-                rule="ItemNiche"
-                vn-acl="buyer,replenisher">
-            </vn-textfield>
-            <vn-none>
-                <vn-icon-button
-                    vn-acl="buyer,replenisher"
-                    pointer
-                    vn-tooltip="Remove niche"
-                    icon="delete"
-                    ng-click="model.remove($index)">
-                </vn-icon-button>
-            </vn-none>
-        </vn-horizontal>
-        <vn-one>
-            <vn-icon-button
-                vn-acl="buyer, replenisher"
-                vn-tooltip="Add niche"
-                vn-bind="+"
-                icon="add_circle"
-                ng-click="model.insert()">
-            </vn-icon-button>
-        </vn-one>
-    </vn-card>
-    <vn-button-bar>
-        <vn-submit
-            disabled="!watcher.dataChanged()"
-            label="Save">
-        </vn-submit>
-        <!-- # #2680 Undo changes button bugs -->
-        <!-- <vn-button
-            class="cancel"
-            label="Undo changes"
-            disabled="!watcher.dataChanged()"
-            ng-click="watcher.loadOriginalData()">
-        </vn-button> -->
-    </vn-button-bar>
-</form>
\ No newline at end of file
diff --git a/modules/item/front/niche/index.js b/modules/item/front/niche/index.js
deleted file mode 100644
index 51621b7148..0000000000
--- a/modules/item/front/niche/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import ngModule from '../module';
-import Section from 'salix/components/section';
-
-export default class Controller extends Section {
-    onSubmit() {
-        this.$.watcher.check();
-        this.$.model.save().then(() => {
-            this.$.watcher.notifySaved();
-            this.$.watcher.updateOriginalData();
-        });
-    }
-}
-
-ngModule.vnComponent('vnItemNiche', {
-    template: require('./index.html'),
-    controller: Controller
-});
diff --git a/modules/item/front/routes.json b/modules/item/front/routes.json
index f6b3bfe293..8f3e037469 100644
--- a/modules/item/front/routes.json
+++ b/modules/item/front/routes.json
@@ -15,7 +15,6 @@
             {"state": "item.card.basicData", "icon": "settings"},
             {"state": "item.card.tags", "icon": "icon-tags"},
             {"state": "item.card.tax", "icon": "icon-tax"},
-            {"state": "item.card.niche", "icon": "place"},
             {"state": "item.card.botanical", "icon": "local_florist"}, 
             {"state": "item.card.itemBarcode", "icon": "icon-barcode"}, 
             {"state": "item.card.diary", "icon": "icon-transaction"}, 
@@ -79,16 +78,6 @@
             "description": "Tax",
             "acl": ["administrative","buyer"]
         },
-        {
-            "url" : "/niche",
-            "state": "item.card.niche",
-            "component": "vn-item-niche",
-            "description": "Niches",
-            "params": {
-                "item": "$ctrl.item"
-            },
-            "acl": ["buyer","replenisher"]
-        },
         {
             "url" : "/botanical",
             "state": "item.card.botanical",
diff --git a/modules/item/front/summary/locale/es.yml b/modules/item/front/summary/locale/es.yml
index 28e1e964b5..a87a04857f 100644
--- a/modules/item/front/summary/locale/es.yml
+++ b/modules/item/front/summary/locale/es.yml
@@ -1,4 +1,3 @@
-Niche: Nichos
 Barcode: Códigos de barras
 Other data: Otros datos
 Go to the item: Ir al artículo
\ No newline at end of file