OBPIH-6019 Header with action buttons for Product Sources create/edit form#4489
Conversation
| ); | ||
| }; | ||
|
|
||
| export default CreateProductSupplierHeader; |
There was a problem hiding this comment.
I'd say that a better name for those components would be ProductSupplierFormHeader since this will be used for both create/edit
| <div className="create-page-title"> | ||
| <span className="create-page-tile-main-content"> | ||
| {productSupplier | ||
| ? productSupplier?.name |
There was a problem hiding this comment.
nitpicky (no need to change) - if you say productSupplier ? ..., you don't need to use null safes in the productSupplier.name because if it was falsy, you would trigger the fallback.
| <span className="create-page-title-source-code"> | ||
| ( | ||
| {productSupplier?.code} | ||
| ) |
There was a problem hiding this comment.
does the eslint shout if you put it in one line like
{`(${productSupplier?.code})`}There was a problem hiding this comment.
Yeah, that is the reason why it is split into new lines.
| list: () => `${PRODUCT_SUPPLIER_URL.base}/list`, | ||
| create: () => `${PRODUCT_SUPPLIER_URL.base}/create`, | ||
| edit: (id) => `${PRODUCT_SUPPLIER_URL.base}/edit/${id}`, | ||
| edit: (id) => `${PRODUCT_SUPPLIER_URL.base}/create/${id}`, |
There was a problem hiding this comment.
maybe let's do it later (at the end), so we can still edit product sources if we wanted to test something (assuming we click the Edit from the list page)
There was a problem hiding this comment.
you can still access the old page manually
There was a problem hiding this comment.
I know we can, this is why I wrote this: "(assuming we click the Edit from the list page)".
But let's leave it, as accessing edit through show page should not be "frustrating"
| list: () => `${PRODUCT_SUPPLIER_URL.base}/list`, | ||
| create: () => `${PRODUCT_SUPPLIER_URL.base}/create`, | ||
| edit: (id) => `${PRODUCT_SUPPLIER_URL.base}/edit/${id}`, | ||
| edit: (id) => `${PRODUCT_SUPPLIER_URL.base}/create/${id}`, |
There was a problem hiding this comment.
I know we can, this is why I wrote this: "(assuming we click the Edit from the list page)".
But let's leave it, as accessing edit through show page should not be "frustrating"
| from 'components/productSupplier/create/ProductSupplierFormHeader'; | ||
| import PageWrapper from 'wrappers/PageWrapper'; | ||
|
|
||
| const ProductSupplierForm = () => ( |
There was a problem hiding this comment.
you've forgotten to inject the translations on that page.
useTranslation('productSupplier');b696f53 to
56414d0
Compare
… form (#4489) * OBPIH-6019 Add openConfirmationModal to exports in useProductSupplierActions hook * OBPIH-6019 Add new route for create page and change redirects to it * OBPIH-6019 Rename some list components to be more generic * OBPIH-6019 Add new translations * OBPIH-6019 Add redirect button component * OBPIH-6019 Add hook for create page and create header components * OBPIH-6019 Add styling and product supplier get url * OBPIH-6019 Change naming of components * OBPIH-6019 Add translation hook to create page
No description provided.