Skip to content

OBPIH-6019 Header with action buttons for Product Sources create/edit form#4489

Merged
awalkowiak merged 9 commits intofeature/product-supplier-list-redesignfrom
OBPIH-6019
Feb 6, 2024
Merged

OBPIH-6019 Header with action buttons for Product Sources create/edit form#4489
awalkowiak merged 9 commits intofeature/product-supplier-list-redesignfrom
OBPIH-6019

Conversation

@alannadolny
Copy link
Collaborator

No description provided.

);
};

export default CreateProductSupplierHeader;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the eslint shout if you put it in one line like

{`(${productSupplier?.code})`}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can still access the old page manually

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 = () => (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you've forgotten to inject the translations on that page.

useTranslation('productSupplier');

@awalkowiak awalkowiak merged commit 5e6c903 into feature/product-supplier-list-redesign Feb 6, 2024
@awalkowiak awalkowiak deleted the OBPIH-6019 branch February 6, 2024 15:12
awalkowiak pushed a commit that referenced this pull request Mar 12, 2024
… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants