Skip to content

validation custom forms#21

Open
idelcano wants to merge 24 commits intodevelopmentfrom
feature/validate_improve_customforms
Open

validation custom forms#21
idelcano wants to merge 24 commits intodevelopmentfrom
feature/validate_improve_customforms

Conversation

@idelcano
Copy link
Contributor

@idelcano idelcano commented Mar 24, 2022

📌 References

📝 Implementation

🎨 Screenshots

🔥 Notes to the tester

To see some errors you could deassign some dataelements from the modules, and change the categoryoptioncombo of some dataelements

@ifoche ifoche requested a review from tokland April 1, 2022 10:06
@ifoche ifoche changed the title [DRAF] ]empty validation custom forms [DRAFT] empty validation custom forms Apr 1, 2022
@ifoche ifoche removed the request for review from tokland April 1, 2022 10:07
@idelcano idelcano requested a review from tokland April 4, 2022 07:59
@idelcano idelcano changed the title [DRAFT] empty validation custom forms Empty validation custom forms Apr 4, 2022
@idelcano idelcano changed the title Empty validation custom forms validation custom forms Apr 5, 2022
@idelcano
Copy link
Contributor Author

idelcano commented May 6, 2022

We have a false positive in dev:
Result:
ERROR Dataelement with UID: Ybz3qUCWYKC is not associated with CategoryOptionComboID: Xr12mI7VPn3

its due we have a piece of old code commented that points Ybz3qUCWYKC to Xr12mI7VPn3, but that dataelement is related with their valid categorycombo in the custom form.

Copy link
Contributor

@tokland tokland left a comment

Choose a reason for hiding this comment

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

Code looking very good after the last refactors! Code-wise, it's mergeable by me.

categoryCombos: { fields: { id: true, categoryOptionCombos: { id: true } } },
});

const data = await metadata$.getData();
Copy link
Contributor

Choose a reason for hiding this comment

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

const { dataSets } = ...

if (groups) {
return { dataElementId: groups[2], categoryOptionComboId: groups[4] };
}
});
Copy link
Contributor

Choose a reason for hiding this comment

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

map + compact to remove undefined values.

i18n.t("does not exist in dataset with UID:") +
" " +
id
);
Copy link
Contributor

Choose a reason for hiding this comment

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

i18n.t interpolation with {{ var }}

@@ -0,0 +1,3 @@
export interface DataSetsRepository {
validate(id: string): Promise<string[]>;
Copy link
Contributor

Choose a reason for hiding this comment

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

validateCustomForm

<Typography variant="h5">{i18n.t("Result:")}</Typography>
</div>

{_.map(errors, item => {
Copy link
Contributor

Choose a reason for hiding this comment

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

errors.map is ok to use

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.

2 participants