Skip to content

Conversation

@brennj
Copy link
Collaborator

@brennj brennj commented Oct 23, 2023

TODO: fill this in and explain why its a problem


const updateValues = (fieldValues) =>
const updateValues = (fieldValues) => {
['const', 'default', 'minimum', 'maximum', 'minLength', 'maxLength'].forEach((key) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

todo: I don't need to be explicit about the downsides of having a hardcoded list of keys right? So the best we can do for now is to extract this to a function/variable and add a little but important comment about it.

p.s. It's missing readOnly, description, and statement, which are very common too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

exactly, this was thrown together, will improve! ... i think it causes other problems for descriptions, need to investigate exactly what happens

if (key === 'value') {
// The value of the field should not be driven by the json-schema,
// unless it's a read-only field
// unless it's a read-only field or a forced value
Copy link
Collaborator

Choose a reason for hiding this comment

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

q: why do we need this line change?

expect(handleValidation({ ten_only: null }).formErrors).toBeUndefined();
});

it('Should clear the default from number when removed from condition', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

todo: Can you check the tests for schemaWithConditionalReadOnlyProperty? Now we should be able to remove the redundant conditional readOnly:false (because it's the default state) and still pass.

@brennj
Copy link
Collaborator Author

brennj commented Nov 6, 2023

Closing in favour of #57

@brennj brennj closed this Nov 6, 2023
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