1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-26 20:54:21 +01:00

(i18n) improve product category delete message

This commit is contained in:
vincent 2022-10-04 10:56:12 +02:00
parent 50e4b2ba0c
commit 4f58ea64d1
5 changed files with 12 additions and 7 deletions

View File

@ -73,7 +73,7 @@ export const ManageProductCategory: React.FC<ManageProductCategoryProps> = ({ pr
isOpen={isOpen} isOpen={isOpen}
toggleModal={toggleModal} toggleModal={toggleModal}
closeButton> closeButton>
{ (action === 'update' || action === 'delete') && <p className='subtitle'>{productCategory.name}</p>} { action === 'update' && <p className='subtitle'>{productCategory.name}</p>}
<ProductCategoryForm action={action} <ProductCategoryForm action={action}
productCategories={productCategories} productCategories={productCategories}
productCategory={productCategory} productCategory={productCategory}

View File

@ -6,8 +6,8 @@ import { FormInput } from '../../form/form-input';
import { FormSelect } from '../../form/form-select'; import { FormSelect } from '../../form/form-select';
import { ProductCategory } from '../../../models/product-category'; import { ProductCategory } from '../../../models/product-category';
import { FabButton } from '../../base/fab-button'; import { FabButton } from '../../base/fab-button';
import { FabAlert } from '../../base/fab-alert';
import ProductCategoryAPI from '../../../api/product-category'; import ProductCategoryAPI from '../../../api/product-category';
import { HtmlTranslate } from '../../base/html-translate';
interface ProductCategoryFormProps { interface ProductCategoryFormProps {
action: 'create' | 'update' | 'delete', action: 'create' | 'update' | 'delete',
@ -95,10 +95,8 @@ export const ProductCategoryForm: React.FC<ProductCategoryFormProps> = ({ action
<form onSubmit={handleSubmit(onSubmit)} name="productCategoryForm" className="product-category-form"> <form onSubmit={handleSubmit(onSubmit)} name="productCategoryForm" className="product-category-form">
{ action === 'delete' { action === 'delete'
? <> ? <>
<FabAlert level='danger'> <HtmlTranslate trKey="app.admin.store.product_category_form.delete.confirm" options={{ CATEGORY: productCategory?.name }} />
{t('app.admin.store.product_category_form.delete.confirm')} <FabButton type='submit'>{t('app.admin.store.product_category_form.delete.save')}</FabButton>
</FabAlert>
<FabButton type='submit'>{t('app.admin.store.product_category_form.save')}</FabButton>
</> </>
: <> : <>
<FormInput id='name' <FormInput id='name'

View File

@ -99,6 +99,7 @@
@import "modules/store/orders-dashboard"; @import "modules/store/orders-dashboard";
@import "modules/store/orders"; @import "modules/store/orders";
@import "modules/store/product-categories"; @import "modules/store/product-categories";
@import "modules/store/product-category-form";
@import "modules/store/product-form"; @import "modules/store/product-form";
@import "modules/store/product-stock-form"; @import "modules/store/product-stock-form";
@import "modules/store/product-stock-modal"; @import "modules/store/product-stock-modal";

View File

@ -0,0 +1,5 @@
.product-category-form {
span {
margin-bottom: 2.4rem;
}
}

View File

@ -1937,7 +1937,8 @@ en:
error: "Unable to modify the category: " error: "Unable to modify the category: "
success: "The category has been modified." success: "The category has been modified."
delete: delete:
confirm: "Do you really want to delete this product category?" confirm: "Do you really want to delete <strong>{CATEGORY}</strong>?<br>If it has sub-categories, they will also be deleted."
save: "Delete"
error: "Unable to delete the category: " error: "Unable to delete the category: "
success: "The category has been successfully deleted" success: "The category has been successfully deleted"
save: "Save" save: "Save"