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

Standardizing Validator Functions for Object props #12921

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

tiffcoding
Copy link

Summary

This pull request focuses on standardizing the validation logic for Object-type props across several components in the Kolibri project by replacing ad-hoc validators with a reusable objectValidator utility. This improves consistency, documentation, and error reporting for these props.

References

Related Issue: #8903

Reviewer guidance

Check each affected component (FacilityAdminCredentialsForm.vue, NotificationCard.vue, GroupRow.vue, and SelectGroup.vue) to ensure they correctly reject invalid Object props and accept valid ones.

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Dec 9, 2024
validator(val) {
return val.name && val.id && val.baseurl;
},
validator: objectValidator({
Copy link
Member

Choose a reason for hiding this comment

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

Where is objectValidator coming from here?

Copy link
Author

Choose a reason for hiding this comment

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

#8878 Hello, I was following the structure mentioned in this PR!

Copy link
Member

Choose a reason for hiding this comment

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

I think what @nucleogenesis means is that you will need to import this function from somewhere.

These are the functions available for import, for example:

import { validateObject, objectWithDefaults } from 'kolibri/utils/objectSpecs';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants