From 41dfa9f9a1662159a30b1623b167a13d7efa5381 Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 21 Feb 2018 09:28:17 +0100 Subject: [PATCH 1/3] creacion de ACL en diferentes modelos --- client/item/routes.json | 7 +++---- client/item/src/list/item-product.html | 7 +++++-- client/item/src/list/list.html | 4 ++-- client/item/src/list/preview.svg | 11 +++++++++++ client/item/src/list/style.css | 4 ++-- services/item/common/models/expence.json | 10 +++++++++- services/item/common/models/genus.json | 10 +++++++++- services/item/common/models/ink.json | 10 +++++++++- services/item/common/models/intrastat.json | 10 +++++++++- services/item/common/models/item-botanical.json | 10 +++++++++- services/item/common/models/item-type.json | 10 +++++++++- services/item/common/models/itemLog.json | 10 +++++++++- services/item/common/models/origin.json | 10 +++++++++- services/item/common/models/producer.json | 10 +++++++++- services/item/common/models/specie.json | 10 +++++++++- services/item/common/models/tag.json | 10 +++++++++- services/item/common/models/tax-class.json | 10 +++++++++- services/item/common/models/tax-code.json | 10 +++++++++- services/item/common/models/tax-type.json | 10 +++++++++- 19 files changed, 149 insertions(+), 24 deletions(-) create mode 100644 client/item/src/list/preview.svg diff --git a/client/item/routes.json b/client/item/routes.json index b3941d555..aa594234a 100644 --- a/client/item/routes.json +++ b/client/item/routes.json @@ -13,8 +13,7 @@ { "url": "/list", "state": "item.index", - "component": "vn-item-list", - "acl": ["developer"] + "component": "vn-item-list" }, { "url": "/create", @@ -36,8 +35,8 @@ }, "menu": { "description": "Basic data", - "icon": "folder" - } + "icon": "folder", + }, }, { "url" : "/tags", diff --git a/client/item/src/list/item-product.html b/client/item/src/list/item-product.html index 4fde108fd..4b2ddcec6 100644 --- a/client/item/src/list/item-product.html +++ b/client/item/src/list/item-product.html @@ -1,14 +1,17 @@ - + - +
Id: {{$ctrl.item.id}}
Name: {{$ctrl.item.name}}
Description: {{$ctrl.item.description}}
Size: {{$ctrl.item.size}}
Type: {{$ctrl.item.itemType.name}}
+ + preview +
diff --git a/client/item/src/list/list.html b/client/item/src/list/list.html index b3bee2570..d41a15c2a 100644 --- a/client/item/src/list/list.html +++ b/client/item/src/list/list.html @@ -13,9 +13,9 @@ - + - + diff --git a/client/item/src/list/preview.svg b/client/item/src/list/preview.svg new file mode 100644 index 000000000..5d56b5f34 --- /dev/null +++ b/client/item/src/list/preview.svg @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/client/item/src/list/style.css b/client/item/src/list/style.css index ca53151b9..dbf7aa1ac 100644 --- a/client/item/src/list/style.css +++ b/client/item/src/list/style.css @@ -1,12 +1,12 @@ vn-item-product { display: block; } -a.item-product-link { +vn-auto.item-product-link { display: block; text-decoration: none; color: inherit; } -a.item-product-link:hover { +vn-auto.item-product-link:hover { color: white; background-color: #424242; } diff --git a/services/item/common/models/expence.json b/services/item/common/models/expence.json index a8bf47569..79af34988 100644 --- a/services/item/common/models/expence.json +++ b/services/item/common/models/expence.json @@ -25,5 +25,13 @@ "model": "TaxType", "foreignKey": "taxTypeFk" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/genus.json b/services/item/common/models/genus.json index 4f269200b..1026e6f05 100644 --- a/services/item/common/models/genus.json +++ b/services/item/common/models/genus.json @@ -24,5 +24,13 @@ "change_date_time": { "type": "date" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/ink.json b/services/item/common/models/ink.json index 7b8647369..04117aa3b 100644 --- a/services/item/common/models/ink.json +++ b/services/item/common/models/ink.json @@ -18,5 +18,13 @@ "showOrder": { "type": "number" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/intrastat.json b/services/item/common/models/intrastat.json index 38347031d..e536e2581 100644 --- a/services/item/common/models/intrastat.json +++ b/services/item/common/models/intrastat.json @@ -27,5 +27,13 @@ "model": "TaxCode", "foreignKey": "taxCodeFk" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/item-botanical.json b/services/item/common/models/item-botanical.json index 655f0d48c..a2bab397a 100644 --- a/services/item/common/models/item-botanical.json +++ b/services/item/common/models/item-botanical.json @@ -32,5 +32,13 @@ "model": "Specie", "foreignKey": "specieFk" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/item-type.json b/services/item/common/models/item-type.json index d72fdba69..eec3af490 100644 --- a/services/item/common/models/item-type.json +++ b/services/item/common/models/item-type.json @@ -18,5 +18,13 @@ "life": { "type": "Number" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/itemLog.json b/services/item/common/models/itemLog.json index 9198bcb25..4f784b74f 100644 --- a/services/item/common/models/itemLog.json +++ b/services/item/common/models/itemLog.json @@ -34,5 +34,13 @@ "model": "Account", "foreignKey": "userFk" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } diff --git a/services/item/common/models/origin.json b/services/item/common/models/origin.json index 9860d677f..c381600bf 100644 --- a/services/item/common/models/origin.json +++ b/services/item/common/models/origin.json @@ -18,5 +18,13 @@ "name": { "type": "String" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/producer.json b/services/item/common/models/producer.json index 941b50842..81a36f8d1 100644 --- a/services/item/common/models/producer.json +++ b/services/item/common/models/producer.json @@ -15,5 +15,13 @@ "name": { "type": "String" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/specie.json b/services/item/common/models/specie.json index c8f9818fc..afa669af3 100644 --- a/services/item/common/models/specie.json +++ b/services/item/common/models/specie.json @@ -31,5 +31,13 @@ "model": "Genus", "foreignKey": "genus_id" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/tag.json b/services/item/common/models/tag.json index 3a2097f97..0df56ef10 100644 --- a/services/item/common/models/tag.json +++ b/services/item/common/models/tag.json @@ -26,5 +26,13 @@ "unit": { "type": "String" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } diff --git a/services/item/common/models/tax-class.json b/services/item/common/models/tax-class.json index d5746d699..46bcba87e 100644 --- a/services/item/common/models/tax-class.json +++ b/services/item/common/models/tax-class.json @@ -18,5 +18,13 @@ "code": { "type": "String" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/tax-code.json b/services/item/common/models/tax-code.json index d2c803ea5..dfd69139e 100644 --- a/services/item/common/models/tax-code.json +++ b/services/item/common/models/tax-code.json @@ -42,5 +42,13 @@ "model": "Link", "foreignKey": "linkFk" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file diff --git a/services/item/common/models/tax-type.json b/services/item/common/models/tax-type.json index e8573156d..4e30446b0 100644 --- a/services/item/common/models/tax-type.json +++ b/services/item/common/models/tax-type.json @@ -31,5 +31,13 @@ "model": "Country", "foreignKey": "countryFk" } - } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] } \ No newline at end of file From 26b8bcfe94d9b8cd4539787368cf1d37315c0c61 Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 21 Feb 2018 09:43:13 +0100 Subject: [PATCH 2/3] cambio de los permisos del menu --- client/item/routes.json | 15 ++++++++++----- client/item/src/list/item-product.html | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/client/item/routes.json b/client/item/routes.json index aa594234a..1a85e9504 100644 --- a/client/item/routes.json +++ b/client/item/routes.json @@ -35,8 +35,9 @@ }, "menu": { "description": "Basic data", - "icon": "folder", + "icon": "folder" }, + "acl": ["buyer"] }, { "url" : "/tags", @@ -48,7 +49,8 @@ "menu": { "description": "Tags", "icon": "folder" - } + }, + "acl": ["buyer"] }, { "url" : "/history", @@ -72,7 +74,8 @@ "menu": { "description": "Niche", "icon": "folder" - } + }, + "acl": ["buyer","replenisher"] }, { "url" : "/botanical", @@ -84,7 +87,8 @@ "menu": { "description": "Botanical", "icon": "folder" - } + }, + "acl": ["buyer"] },{ "url" : "/barcode", "state": "item.card.itemBarcode", @@ -95,7 +99,8 @@ "menu": { "description": "Barcode", "icon": "folder" - } + }, + "acl": ["buyer","replenisher"] },{ "url" : "/summary", "state": "item.card.summary", diff --git a/client/item/src/list/item-product.html b/client/item/src/list/item-product.html index 4b2ddcec6..198fe7b04 100644 --- a/client/item/src/list/item-product.html +++ b/client/item/src/list/item-product.html @@ -1,9 +1,9 @@ - + - +
Id: {{$ctrl.item.id}}
Name: {{$ctrl.item.name}}
Description: {{$ctrl.item.description}}
From 2f0f7a0ff2a6d6fca633e49195ce235fcbe82ff0 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Wed, 21 Feb 2018 11:03:55 +0100 Subject: [PATCH 3/3] updated a selector for vnItemProduct componenet --- e2e/helpers/selectors.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 0c3b89808..6ca1e2412 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -135,7 +135,7 @@ export default { }, itemsIndex: { createItemButton: `${components.vnFloatButton}`, - searchResult: `${components.vnItemProduct} > vn-horizontal`, + searchResult: `${components.vnItemProduct} > vn-horizontal > vn-one`, searchItemInput: `${components.vnTextfield}`, searchButton: `${components.vnSearchBar} > vn-icon-button > button` }, @@ -160,6 +160,16 @@ export default { firstCodeInput: `vn-horizontal:nth-child(2) > ${components.vnTextfield}`, thirdCodeInput: `vn-horizontal:nth-child(4) > ${components.vnTextfield}`, submitNichesButton: `${components.vnSubmit}` + }, + itemBotanical: { + botanicalButton: `${components.vnMenuItem}[ui-sref="item.card.botanical"]`, + botanicalInput: `vn-horizontal:nth-child(2) > ${components.vnTextfield}`, + genusSelect: `${components.vnAutocomplete}[field="$ctrl.botanical.genusFk"] > vn-vertical > ${components.vnTextfield}`, + genusSelectOptionOne: `${components.vnAutocomplete}[field="$ctrl.botanical.genusFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(1)`, + genusSelectOptionTwo: `${components.vnAutocomplete}[field="$ctrl.botanical.genusFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`, + speciesSelect: `${components.vnAutocomplete}[field="$ctrl.botanical.specieFk"] > vn-vertical > ${components.vnTextfield}`, + speciesSelectOptionOne: `${components.vnAutocomplete}[field="$ctrl.botanical.specieFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(1)`, + speciesSelectOptionTwo: `${components.vnAutocomplete}[field="$ctrl.botanical.specieFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(2)`, + submitBotanicalButton: `${components.vnSubmit}` } }; -