OBPIH-6112 Add attributes section with inputs#4527
OBPIH-6112 Add attributes section with inputs#4527awalkowiak merged 11 commits intofeature/product-supplier-list-redesignfrom
Conversation
|
|
||
| if (entityTypeCode) { | ||
| query += " join a.entityTypeCodes etc where etc = :entityTypeCode" | ||
| argumentsList += [entityTypeCode: EntityTypeCode.PRODUCT_SUPPLIER] |
There was a problem hiding this comment.
shouldn't it be ?
argumentsList += [entityTypeCode: entityTypeCode]| attributesWithInputTypes.map(({ attribute, Input }) => { | ||
| const errorMessage = errors?.[attribute?.id]?.message; | ||
| return ( | ||
| <Controller |
|
|
||
| .attributes-section { | ||
| display: grid; | ||
| grid-template-columns: repeat(3, 1fr); |
There was a problem hiding this comment.
wouldn't class form-grid-3 work for you? It's the same as this one, with only difference that is gap: 8px
src/js/consts/entityTypeCode.js
Outdated
| @@ -0,0 +1,6 @@ | |||
| const entityTypeCode = { | |||
There was a problem hiding this comment.
This should be defined as EntityTypeCode
| params: { | ||
| entityType: entityTypeCode.PRODUCT_SUPPLIER, | ||
| }, | ||
| })); |
There was a problem hiding this comment.
let's add an AbortController
| if (!attribute?.allowOther) { | ||
| return { | ||
| attribute: { ...attribute, options: mapAttributeOptions(attribute) }, | ||
| Input: SelectField, |
There was a problem hiding this comment.
I think this should be lower-case (I know long time ago I've introduced a StartIcon, but I believe it was wrong)
There was a problem hiding this comment.
If you mean the SelectField it's just our select component, it should be capitalized.
There was a problem hiding this comment.
no, I meant the property name
There was a problem hiding this comment.
ok, now I see the usage of that, so this makes sense.
| value: z.string(), | ||
| label: z.string(), | ||
| }) | ||
| .nullish() |
There was a problem hiding this comment.
I think .optional() should also be added, otherwise it might still be considered as required, but I don't remember the exact case.
There was a problem hiding this comment.
optional, nullable, and nullish are designated to cover a specific value, undefined or null. The nullish covers all of those cases. So the nullish includes optional within itself.
{
optional?: string | undefined;
nullable: string | null;
nullish?: string | null | undefined;
}
* OBPIH-6112 add entityTypeCode enum on frontend part * OBPIH-6112 add attribute service and controller + add attributes property in toJson * OBPIH-6112 add new translations * OBPIH-6112 add react redux action for handling attributes * OBPIH-6112 Add new section * OBPIH-6112 Handle dynamic form validation * OBPIH-6112 Add handling submitting values * OBPIH-6112 Fix triggering validation * OBPIH-6112 Add mapping default values * OBPIH-6112 Fix code styling * OBPIH-6112 Fixes after review
No description provided.