From 4b12411d6b671c6ccac9d93bf08f75554a332436 Mon Sep 17 00:00:00 2001 From: Juan Date: Thu, 1 Mar 2018 21:18:43 +0100 Subject: [PATCH] Style fixes --- client/client/src/index/index.html | 20 ++++---- client/client/src/index/index.js | 1 - client/client/src/index/item-client.html | 35 ++++++++----- client/client/src/index/item-client.js | 8 ++- client/client/src/index/style.scss | 18 ------- client/core/src/components/dialog/dialog.html | 5 +- client/item/src/list/item-product.html | 50 ++++++++++++------- client/item/src/list/item-product.js | 11 +++- client/item/src/list/list.html | 45 ++++++++--------- client/item/src/list/style.scss | 34 ++++--------- client/item/src/locale/es.yml | 2 + client/salix/src/styles/misc.scss | 33 ++++++++++++ e2e/helpers/components_selectors.js | 2 - e2e/helpers/selectors.js | 12 ++--- 14 files changed, 154 insertions(+), 122 deletions(-) diff --git a/client/client/src/index/index.html b/client/client/src/index/index.html index fa16c6f30..561348fa9 100644 --- a/client/client/src/index/index.html +++ b/client/client/src/index/index.html @@ -1,6 +1,6 @@
-
+
- - - - - - - -
+ + + + + + + + diff --git a/client/client/src/index/index.js b/client/client/src/index/index.js index e7e7ae032..6f49f2626 100644 --- a/client/client/src/index/index.js +++ b/client/client/src/index/index.js @@ -1,5 +1,4 @@ import ngModule from '../module'; -import './style.scss'; import './item-client'; export default class Controller { diff --git a/client/client/src/index/item-client.html b/client/client/src/index/item-client.html index b71c32b5c..8df97dd4f 100644 --- a/client/client/src/index/item-client.html +++ b/client/client/src/index/item-client.html @@ -1,12 +1,23 @@ - - -
{{::$ctrl.client.name}}
-
Id {{::$ctrl.client.id}}
-
Phone {{::$ctrl.client.phone | phone}}
-
Town/City {{::$ctrl.client.city}}
-
Email {{::$ctrl.client.email}}
-
- - - -
+ + + +
{{::$ctrl.client.name}}
+
Id {{::$ctrl.client.id}}
+
Phone {{::$ctrl.client.phone | phone}}
+
Town/City {{::$ctrl.client.city}}
+
Email {{::$ctrl.client.email}}
+
+ + + + +
+
diff --git a/client/client/src/index/item-client.js b/client/client/src/index/item-client.js index 7bd7c2eb0..5bacee25d 100644 --- a/client/client/src/index/item-client.js +++ b/client/client/src/index/item-client.js @@ -1,7 +1,13 @@ import ngModule from '../module'; class Controller { - preview() { + onClick(event) { + if (event.defaultPrevented) + event.stopImmediatePropagation(); + } + + preview(event) { + event.preventDefault(); this.list.openSummary(this.client); } } diff --git a/client/client/src/index/style.scss b/client/client/src/index/style.scss index 244ee2a12..0f2ee429f 100644 --- a/client/client/src/index/style.scss +++ b/client/client/src/index/style.scss @@ -1,21 +1,3 @@ vn-item-client { display: block; - vn-horizontal { - a { - display: block; - text-decoration: none; - color: inherit; - } - &:hover { - color: white; - background-color: #424242; - } - span { - font-size: .9em; - color: #666; - } - &:hover span { - color: #aaa; - } - } } \ No newline at end of file diff --git a/client/core/src/components/dialog/dialog.html b/client/core/src/components/dialog/dialog.html index 98223d6e5..1ce4eea58 100644 --- a/client/core/src/components/dialog/dialog.html +++ b/client/core/src/components/dialog/dialog.html @@ -1,5 +1,8 @@
-
diff --git a/client/item/src/list/item-product.html b/client/item/src/list/item-product.html index 99c004090..f74d312f4 100644 --- a/client/item/src/list/item-product.html +++ b/client/item/src/list/item-product.html @@ -1,23 +1,35 @@ - - - - - - -
Id: {{::$ctrl.item.id}}
-
Name: {{::$ctrl.item.name}}
-
Description: {{::$ctrl.item.description}}
-
Size: {{::$ctrl.item.size}}
-
Type: {{::$ctrl.item.itemType.name}}
-
- + + + + + - - - - +
{{::$ctrl.item.name}}
+
Id {{::$ctrl.item.id}}
+
Description {{::$ctrl.item.description}}
+
Size {{::$ctrl.item.size}}
+
Type {{::$ctrl.item.itemType.name}}
+ + + + + +
-
+ diff --git a/client/item/src/list/item-product.js b/client/item/src/list/item-product.js index 172c984e2..ff9b0f0a5 100644 --- a/client/item/src/list/item-product.js +++ b/client/item/src/list/item-product.js @@ -5,11 +5,18 @@ class ItemProduct { this.$http = $http; } - clone() { + onClick(event) { + if (event.defaultPrevented) + event.stopImmediatePropagation(); + } + + clone(event) { + event.preventDefault(); this.ItemList.cloneItem(this.item); } - preview() { + preview(event) { + event.preventDefault(); this.ItemList.showItemPreview(this.item); } } diff --git a/client/item/src/list/list.html b/client/item/src/list/list.html index 6c45c7567..3e200697e 100644 --- a/client/item/src/list/list.html +++ b/client/item/src/list/list.html @@ -1,6 +1,6 @@
-
+
- - - + +
- - - - - - - - - - - -

Do you want to clone this item?

-
- - - - -
-
\ No newline at end of file +
+ + + + + + + + + + \ No newline at end of file diff --git a/client/item/src/list/style.scss b/client/item/src/list/style.scss index 928be186a..bf9223d02 100644 --- a/client/item/src/list/style.scss +++ b/client/item/src/list/style.scss @@ -1,30 +1,14 @@ -@import "../../../salix/src/styles/colors"; vn-item-product { display: block; -} -vn-auto.item-product-link { - display: block; - text-decoration: none; - color: inherit; -} -vn-auto.item-product-link:hover { - color: $color-white; - background-color: $color-dark; -} -vn-auto.item-product-link i{ - opacity: .3; -} -vn-auto.item-product-link:hover i{ - color: $color-orange; - opacity: 1; - cursor: pointer; -} -vn-item-product img { - max-width: 150px; -} + .image { + height: 7em; + width: 7em; -.vn-item-product-name { - font-family: vn-font-bold; -} + & > img { + max-height: 100%; + max-width: 100%; + } + } +} \ No newline at end of file diff --git a/client/item/src/locale/es.yml b/client/item/src/locale/es.yml index 34edc2b66..ac2411e96 100644 --- a/client/item/src/locale/es.yml +++ b/client/item/src/locale/es.yml @@ -1,5 +1,6 @@ Items: Artículos Item: Artículo +View item: Ver artículo Category: Categoría Description: Descripción Size: Tamaño @@ -22,6 +23,7 @@ Date: Fecha Preview: Vista previa Clone: Clonar Do you want to clone this item?: ¿Desea clonar este artículo? +All it's properties will be copied: Todas sus propiedades serán copiadas Yes, clone: Si, clonar Value: Valor Priority: Prioridad \ No newline at end of file diff --git a/client/salix/src/styles/misc.scss b/client/salix/src/styles/misc.scss index 0a26d8949..3322546c7 100644 --- a/client/salix/src/styles/misc.scss +++ b/client/salix/src/styles/misc.scss @@ -144,3 +144,36 @@ vn-main-block { } } } + +.vn-list { + max-width: 36em; + margin: 0 auto; +} + +.vn-list-item { + display: block; + text-decoration: none; + color: inherit; + + &:hover { + color: white; + background-color: #424242; + + vn-label { + color: #aaa; + } + } + & > vn-horizontal > .buttons { + align-items: center; + + vn-icon { + opacity: .4; + color: #ffa410; + margin-left: .5em; + + &:hover { + opacity: 1; + } + } + } +} diff --git a/e2e/helpers/components_selectors.js b/e2e/helpers/components_selectors.js index 70d5a56fc..ea46353d6 100644 --- a/e2e/helpers/components_selectors.js +++ b/e2e/helpers/components_selectors.js @@ -11,8 +11,6 @@ export default { vnMainMenu: 'vn-main-menu > div', vnModuleContainer: 'vn-module-container > a', vnSearchBar: 'vn-searchbar > form > vn-horizontal', - vnItemClient: 'vn-item-client', - vnItemProduct: 'vn-item-product', vnFloatButton: 'vn-float-button > button', vnMenuItem: 'vn-menu-item > li > a', vnAutocomplete: 'vn-autocomplete', diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 16116b759..297cc93df 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -16,7 +16,7 @@ export default { clientsIndex: { searchClientInput: `${components.vnTextfield}`, searchButton: `${components.vnSearchBar} > vn-icon-button > button`, - searchResult: `${components.vnItemClient}:nth-child(1) > vn-horizontal > a`, + searchResult: `vn-item-client a`, createClientButton: `${components.vnFloatButton}` }, createClientView: { @@ -145,13 +145,13 @@ export default { }, itemsIndex: { createItemButton: `${components.vnFloatButton}`, - searchResult: `${components.vnItemProduct} > vn-horizontal > vn-one`, - searchResultPreviewButton: `${components.vnItemProduct}:nth-child(1) > vn-horizontal > vn-horizontal > vn-one:nth-child(2) > vn-icon > i`, - searchResultCloneButton: `${components.vnItemProduct} > vn-horizontal > vn-horizontal > vn-one:nth-child(1) > vn-icon > i`, - acceptClonationAlertButton: `vn-dialog.ng-isolate-scope.vn-dialog.shown > div > form > div.buttons > tpl-buttons > button:nth-child(2)`, + searchResult: `vn-item-product a`, + searchResultPreviewButton: `vn-item-product .buttons > [icon="icon-preview"]`, + searchResultCloneButton: `vn-item-product .buttons > [icon="icon-clone2"]`, + acceptClonationAlertButton: `vn-item-list [vn-id="clone"] [response="ACCEPT"]`, searchItemInput: `${components.vnTextfield}`, searchButton: `${components.vnSearchBar} > vn-icon-button > button`, - closeItemSummaryPreview: 'body > vn-app > vn-vertical > vn-vertical > ui-view > vn-item-list:nth-child(1) > div > vn-dialog > div > button > vn-icon' + closeItemSummaryPreview: 'vn-item-list [vn-id="preview"] button.close' }, itemCreateView: { name: `${components.vnTextfield}[name="name"]`,