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

2563 users should not be able to add places assigned on the contacts form #2648

Conversation

Sepehr-Sobhani
Copy link
Contributor

Copy link
Contributor

@BCerki BCerki left a comment

Choose a reason for hiding this comment

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

Looks great!
Could add a regression vitest

@@ -1,7 +1,7 @@
import { RJSFSchema } from "@rjsf/utils";
import provinceOptions from "@bciers/data/provinces.json";
import SectionFieldTemplate from "@bciers/components/form/fields/SectionFieldTemplate";
import { InlineArrayFieldTemplate } from "@bciers/components/form/fields";
import { ArrayFieldTemplate } from "@bciers/components/form/fields";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it better to use this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not entirely sure why it was originally used, but these two field templates are quite similar. When I used them interchangeably, they appeared identical. The only noticeable difference was the note prop, which I assume we would also need in the ArrayField. That said, I aimed to minimize the usage of InlineArrayFieldTemplate and instead reuse ArrayFieldTemplate.

Additionally, the removable prop on the ArrayFieldTemplate perfectly aligned with the requirements of this feature. I avoided modifying InlineArrayFieldTemplate to replicate the same removable prop behaviour, as it seemed unnecessary.

…form

Signed-off-by: SeSo <sobhani.sepehr@gmail.com>
…ide component

Signed-off-by: SeSo <sobhani.sepehr@gmail.com>
Signed-off-by: SeSo <sobhani.sepehr@gmail.com>
@Sepehr-Sobhani Sepehr-Sobhani force-pushed the 2563-users-should-not-be-able-to-add-places-assigned-on-the-contacts-form branch from b9fb27a to f24d49f Compare January 7, 2025 21:04
@Sepehr-Sobhani Sepehr-Sobhani merged commit 506a288 into develop Jan 7, 2025
42 checks passed
@Sepehr-Sobhani Sepehr-Sobhani deleted the 2563-users-should-not-be-able-to-add-places-assigned-on-the-contacts-form branch January 7, 2025 21:36
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