Skip to content

OBPIH-6112 Add attributes section with inputs#4527

Merged
awalkowiak merged 11 commits intofeature/product-supplier-list-redesignfrom
OBPIH-6112
Mar 4, 2024
Merged

OBPIH-6112 Add attributes section with inputs#4527
awalkowiak merged 11 commits intofeature/product-supplier-list-redesignfrom
OBPIH-6112

Conversation

@alannadolny
Copy link
Collaborator

No description provided.


if (entityTypeCode) {
query += " join a.entityTypeCodes etc where etc = :entityTypeCode"
argumentsList += [entityTypeCode: EntityTypeCode.PRODUCT_SUPPLIER]
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't it be ?

 argumentsList += [entityTypeCode: entityTypeCode]

attributesWithInputTypes.map(({ attribute, Input }) => {
const errorMessage = errors?.[attribute?.id]?.message;
return (
<Controller
Copy link
Collaborator

Choose a reason for hiding this comment

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

key is missing


.attributes-section {
display: grid;
grid-template-columns: repeat(3, 1fr);
Copy link
Collaborator

Choose a reason for hiding this comment

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

wouldn't class form-grid-3 work for you? It's the same as this one, with only difference that is gap: 8px

@@ -0,0 +1,6 @@
const entityTypeCode = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be defined as EntityTypeCode

params: {
entityType: entityTypeCode.PRODUCT_SUPPLIER,
},
}));
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's add an AbortController

if (!attribute?.allowOther) {
return {
attribute: { ...attribute, options: mapAttributeOptions(attribute) },
Input: SelectField,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be lower-case (I know long time ago I've introduced a StartIcon, but I believe it was wrong)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If you mean the SelectField it's just our select component, it should be capitalized.

Copy link
Collaborator

Choose a reason for hiding this comment

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

no, I meant the property name

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok, now I see the usage of that, so this makes sense.

value: z.string(),
label: z.string(),
})
.nullish()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think .optional() should also be added, otherwise it might still be considered as required, but I don't remember the exact case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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;
}

@awalkowiak awalkowiak merged commit 4ebc50f into feature/product-supplier-list-redesign Mar 4, 2024
@awalkowiak awalkowiak deleted the OBPIH-6112 branch March 4, 2024 13:19
awalkowiak pushed a commit that referenced this pull request Mar 12, 2024
* 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
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