Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validation custom forms #21

Open
wants to merge 24 commits into
base: development
Choose a base branch
from

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
src/webapp/reports/Reports.tsx Outdated Show resolved Hide resolved
src/data/CustomFormErrorsDefaultRepository.ts Outdated Show resolved Hide resolved
src/data/CustomFormErrorsDefaultRepository.ts Outdated Show resolved Hide resolved
src/data/CustomFormErrorsDefaultRepository.ts Outdated Show resolved Hide resolved
src/data/CustomFormErrorsDefaultRepository.ts Outdated Show resolved Hide resolved
src/data/CustomFormErrorsDefaultRepository.ts Outdated Show resolved Hide resolved
src/data/CustomFormErrorsDefaultRepository.ts Outdated Show resolved Hide resolved
src/data/CustomFormErrorsDefaultRepository.ts Outdated Show resolved Hide resolved
@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