From feb191ca702e08a02331bdaacd0232a0428f931b Mon Sep 17 00:00:00 2001 From: vincent Date: Thu, 27 Oct 2022 08:52:21 +0200 Subject: [PATCH 1/2] (ui) Fix image bg and list items border --- .../javascript/components/store/product-item.tsx | 14 +------------- .../stylesheets/modules/store/products-list.scss | 2 -- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/app/frontend/src/javascript/components/store/product-item.tsx b/app/frontend/src/javascript/components/store/product-item.tsx index 6153eb6bd..298d231c9 100644 --- a/app/frontend/src/javascript/components/store/product-item.tsx +++ b/app/frontend/src/javascript/components/store/product-item.tsx @@ -43,18 +43,6 @@ export const ProductItem: React.FC = ({ product, onEdit, onDel }; }; - /** - * Returns CSS class from stock status - */ - const statusColor = (product: Product) => { - if (product.stock.internal < (product.quantity_min || 1) || - product.stock.external < (product.quantity_min || 1) || - (product.low_stock_threshold && product.stock.internal <= product.low_stock_threshold) || - (product.low_stock_threshold && product.stock.external <= product.low_stock_threshold)) { - return 'warning'; - } - return ''; - }; /** * Returns CSS class from stock status */ @@ -69,7 +57,7 @@ export const ProductItem: React.FC = ({ product, onEdit, onDel }; return ( -
+

{product.name}

diff --git a/app/frontend/src/stylesheets/modules/store/products-list.scss b/app/frontend/src/stylesheets/modules/store/products-list.scss index 80a33c329..4a4411bd1 100644 --- a/app/frontend/src/stylesheets/modules/store/products-list.scss +++ b/app/frontend/src/stylesheets/modules/store/products-list.scss @@ -20,7 +20,6 @@ border: 1px solid var(--gray-soft-dark); border-radius: var(--border-radius); background-color: var(--gray-soft-lightest); - &.warning { border-color: var(--alert-light); } .itemInfo { grid-area: 1 / 1 / 2 / 2; @@ -33,7 +32,6 @@ margin-right: 1.6rem; object-fit: contain; border-radius: var(--border-radius); - background-color: var(--gray-soft); } &-name { margin: 0; From 47d6f2e16564f7e618a68c86f090b2138670d018 Mon Sep 17 00:00:00 2001 From: vincent Date: Thu, 27 Oct 2022 09:55:15 +0200 Subject: [PATCH 2/2] (i18n) Add missing translation --- config/locales/app.admin.de.yml | 6 +- config/locales/app.admin.en.yml | 6 +- config/locales/app.admin.es.yml | 6 +- config/locales/app.admin.fr.yml | 100 +++++++++++++++++--------------- config/locales/app.admin.no.yml | 6 +- config/locales/app.admin.pt.yml | 6 +- config/locales/app.admin.zu.yml | 10 +++- 7 files changed, 84 insertions(+), 56 deletions(-) diff --git a/config/locales/app.admin.de.yml b/config/locales/app.admin.de.yml index 0e4abfc6e..500d66b63 100644 --- a/config/locales/app.admin.de.yml +++ b/config/locales/app.admin.de.yml @@ -2076,9 +2076,13 @@ de: damaged: "Damaged product" other_in: "Other (in)" other_out: "Other (out)" - clone_product_model: + clone_product_modal: clone_product: "Duplicate the product" clone: "Duplicate" + name: "Name" + sku: "URL" + is_show_in_store: "Available in the store" + active_price_info: "Is this product visible by the members on the store?" orders: heading: "Orders" create_order: "Create an order" diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index cc8984f6c..6405deca6 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -2076,9 +2076,13 @@ en: damaged: "Damaged product" other_in: "Other (in)" other_out: "Other (out)" - clone_product_model: + clone_product_modal: clone_product: "Duplicate the product" clone: "Duplicate" + name: "Name" + sku: "URL" + is_show_in_store: "Available in the store" + active_price_info: "Is this product visible by the members on the store?" orders: heading: "Orders" create_order: "Create an order" diff --git a/config/locales/app.admin.es.yml b/config/locales/app.admin.es.yml index 9e39a6606..b257eabe4 100644 --- a/config/locales/app.admin.es.yml +++ b/config/locales/app.admin.es.yml @@ -2076,9 +2076,13 @@ es: damaged: "Damaged product" other_in: "Other (in)" other_out: "Other (out)" - clone_product_model: + clone_product_modal: clone_product: "Duplicate the product" clone: "Duplicate" + name: "Name" + sku: "URL" + is_show_in_store: "Available in the store" + active_price_info: "Is this product visible by the members on the store?" orders: heading: "Orders" create_order: "Create an order" diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index 997c58167..ac87b2407 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -2012,57 +2012,57 @@ fr: name: "Nom du produit" sku: "Référence du produit (SKU)" slug: "URL" - is_show_in_store: "Available in the store" - is_active_price: "Activate the price" - active_price_info: "Is this product visible by the members on the store?" - price_and_rule_of_selling_product: "Price and rule for selling the product" - price: "Price of product" - quantity_min: "Minimum number of items for the shopping cart" - linking_product_to_category: "Linking this product to an existing category" - assigning_category: "Assigning a category" - assigning_category_info: "Information
You can only declare one category per product. If you assign this product to a sub-category, it will automatically be assigned to its parent category as well." - assigning_machines: "Assigning machines" - assigning_machines_info: "Information
You can link one or more machines from your workshop to your product. This product will then be subject to the filters on the catalogue view.
The machines selected below will be linked to the product." - product_description: "Product description" - product_description_info: "Information
This product description will be presented in the product sheet. You have a few editorial styles at your disposal to create the product sheet." + is_show_in_store: "Disponible dans la boutique" + is_active_price: "Activer le prix" + active_price_info: "Ce produit est-il visible par les membres dans la boutique ?" + price_and_rule_of_selling_product: "Prix et règle pour la vente du produit" + price: "Prix du produit" + quantity_min: "Nombre minimum d'articles pour la mise au panier" + linking_product_to_category: "Lier ce produit à une catégorie existante" + assigning_category: "Affectation d'une catégorie" + assigning_category_info: "Informations
Vous ne pouvez déclarer qu'une seule catégorie par produit. Si vous assignez ce produit à une sous-catégorie, il sera automatiquement assigné à sa catégorie parente." + assigning_machines: "Assigner des machines" + assigning_machines_info: "Informations
Vous pouvez lier une ou plusieurs machines de votre atelier à votre produit. Ce produit sera alors soumis aux filtres de la vue catalogue.
Les machines sélectionnées ci-dessous seront liées au produit." + product_description: "Description du produit" + product_description_info: "Informations
Cette description de produit sera présentée dans la fiche produit. Vous avez quelques styles éditoriaux à votre disposition pour créer la fiche produit." product_files: "Document" - product_files_info: "Information
Add documents related to this product. They will be presented in the product sheet, in a separate block. You can only upload PDF documents." - add_product_file: "Add a document" - product_images: "Visuals of the product" - product_images_info: "Advice
We advise you to use a square format, JPG or PNG. For JPG, please use white for the background colour. The main visual will be the first presented in the product sheet." - add_product_image: "Add a visual" - save: "Save" - clone: "Duplicate" + product_files_info: "Informations
Ajouter des documents liés à ce produit. Ils seront présentés dans la fiche produit, dans un bloc séparé. Vous ne pouvez télécharger que des documents PDF." + add_product_file: "Ajouter un document" + product_images: "Visuels du produit" + product_images_info: "Conseil
Nous vous conseillons d'utiliser un format carré, JPG ou PNG. Pour le JPG, veuillez utiliser le blanc pour la couleur de fond. Le visuel principal sera le premier présenté dans la fiche produit." + add_product_image: "Ajouter un visuel" + save: "Enregistrer" + clone: "Dupliquer" product_stock_form: - stock_up_to_date: "Stock up to date" + stock_up_to_date: "Stock à jour" date_time: "{DATE} - {TIME}" - ongoing_operations: "Ongoing stock operations" - save_reminder: "Don't forget to save your operations" - low_stock_threshold: "Define a low stock threshold" - stock_threshold_toggle: "Activate stock threshold" - stock_threshold_information: "Information
Define a low stock threshold and receive a notification when it's reached.
When the threshold is reached, the product quantity is labeled as low." - low_stock: "Low stock" - threshold_level: "Minimum threshold level" - threshold_alert: "Notify me when the threshold is reached" - events_history: "Events history" - event_type: "Events:" - reason: "Reason" - stocks: "Stock:" - internal: "Private stock" - external: "Public stock" - all: "All types" - remaining_stock: "Remaining stock" - type_in: "Add" - type_out: "Remove" - cancel: "Cancel this operation" + ongoing_operations: "Opérations de stock en cours" + save_reminder: "N'oubliez pas de sauvegarder vos opérations" + low_stock_threshold: "Définir un seuil de stock bas" + stock_threshold_toggle: "Activer le seuil de stock" + stock_threshold_information: "Informations
Définissez un seuil de stock bas et recevez une notification quand il est atteint.
Lorsque le seuil est atteint, la quantité de produit est étiquetée comme limitée." + low_stock: "Stock limité" + threshold_level: "Niveau de seuil minimum" + threshold_alert: "M'avertir lorsque le seuil est atteint" + events_history: "Historique des événements" + event_type: "Événements :" + reason: "Motif" + stocks: "Stock :" + internal: "Stock interne" + external: "Stock externe" + all: "Tous types" + remaining_stock: "Stock restant" + type_in: "Ajouter" + type_out: "Retirer" + cancel: "Annuler cette opération" product_stock_modal: - modal_title: "Manage stock" - internal: "Private stock" - external: "Public stock" - new_event: "New stock event" - addition: "Addition" - withdrawal: "Withdrawal" - update_stock: "Update stock" + modal_title: "Gérer le stock" + internal: "Stock interne" + external: "Stock externe" + new_event: "Nouvel événement de stock" + addition: "Ajout" + withdrawal: "Retrait" + update_stock: "Mettre à jour le stock" reason_type: "Raison" stocks: "Stock :" quantity: "Quantité" @@ -2076,9 +2076,13 @@ fr: damaged: "Produit endommagé" other_in: "Autre (entrant)" other_out: "Autre (sortant)" - clone_product_model: + clone_product_modal: clone_product: "Dupliquer le produit" clone: "Dupliquer" + name: "Nom" + sku: "URL" + is_show_in_store: "Disponible dans la boutique" + active_price_info: "Ce produit est-il visible par les membres dans la boutique ?" orders: heading: "Commandes" create_order: "Créer une commande" diff --git a/config/locales/app.admin.no.yml b/config/locales/app.admin.no.yml index 3ffb5c9a2..22d131dd4 100644 --- a/config/locales/app.admin.no.yml +++ b/config/locales/app.admin.no.yml @@ -2076,9 +2076,13 @@ damaged: "Damaged product" other_in: "Other (in)" other_out: "Other (out)" - clone_product_model: + clone_product_modal: clone_product: "Duplicate the product" clone: "Duplicate" + name: "Name" + sku: "URL" + is_show_in_store: "Available in the store" + active_price_info: "Is this product visible by the members on the store?" orders: heading: "Orders" create_order: "Create an order" diff --git a/config/locales/app.admin.pt.yml b/config/locales/app.admin.pt.yml index fdc33a03b..c0e2b9b57 100644 --- a/config/locales/app.admin.pt.yml +++ b/config/locales/app.admin.pt.yml @@ -2076,9 +2076,13 @@ pt: damaged: "Damaged product" other_in: "Other (in)" other_out: "Other (out)" - clone_product_model: + clone_product_modal: clone_product: "Duplicate the product" clone: "Duplicate" + name: "Name" + sku: "URL" + is_show_in_store: "Available in the store" + active_price_info: "Is this product visible by the members on the store?" orders: heading: "Orders" create_order: "Create an order" diff --git a/config/locales/app.admin.zu.yml b/config/locales/app.admin.zu.yml index ce875b481..cef50de9a 100644 --- a/config/locales/app.admin.zu.yml +++ b/config/locales/app.admin.zu.yml @@ -2076,9 +2076,13 @@ zu: damaged: "crwdns31528:0crwdne31528:0" other_in: "crwdns31530:0crwdne31530:0" other_out: "crwdns31532:0crwdne31532:0" - clone_product_model: - clone_product: "crwdns31534:0crwdne31534:0" - clone: "crwdns31536:0crwdne31536:0" + clone_product_modal: + clone_product: "crwdns31648:0crwdne31648:0" + clone: "crwdns31650:0crwdne31650:0" + name: "crwdns31652:0crwdne31652:0" + sku: "crwdns31654:0crwdne31654:0" + is_show_in_store: "crwdns31656:0crwdne31656:0" + active_price_info: "crwdns31658:0crwdne31658:0" orders: heading: "crwdns31538:0crwdne31538:0" create_order: "crwdns31540:0crwdne31540:0"