Skip to content

fix: Do not show errors for blank fields in datepicker and listwidget#7032

Merged
akash-codemonk merged 9 commits into
releasefrom
fix/empty-field-errors
Sep 16, 2021
Merged

fix: Do not show errors for blank fields in datepicker and listwidget#7032
akash-codemonk merged 9 commits into
releasefrom
fix/empty-field-errors

Conversation

@akash-codemonk

@akash-codemonk akash-codemonk commented Sep 1, 2021

Copy link
Copy Markdown
Contributor

Description

Fixes the issue where datepicker default date field shows an error in js mode when it is blank.
This is also fixes the issue where listData field of the ListWidget was showing 3 other errors when the field is black, this was due to an incorrect parsed value being set.
Also fixes the parsed value to how it was before for empty string "".

Related to #6885

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Jest tests

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Test coverage results 🧪

🟢 Total coverage has increased
// Code coverage diff between base branch:release and head branch: fix/empty-field-errors 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 54.88 (0.01) 36.94 (0.07) 34.23 (0) 55.4 (0.01)
🟢 app/client/src/utils/autocomplete/TernServer.ts 50.71 (0.24) 39.13 (0.87) 36.21 (0) 55.35 (0.27)
🔴 app/client/src/workers/validations.ts 79.15 (0.03) 68.96 (-0.31) 73.08 (0) 80.77 (-0.43)

Comment thread app/client/src/workers/validations.ts
Comment thread app/client/src/workers/validations.ts
rishabhsaxena
rishabhsaxena previously approved these changes Sep 7, 2021
@akash-codemonk

Copy link
Copy Markdown
Contributor Author

/ok-to-test sha=a3c6b5e

@akash-codemonk

Copy link
Copy Markdown
Contributor Author

/ok-to-test sha=7f15d70

1 similar comment
@akash-codemonk

Copy link
Copy Markdown
Contributor Author

/ok-to-test sha=7f15d70

@akash-codemonk

Copy link
Copy Markdown
Contributor Author

/ok-to-test sha=8830ed3

@akash-codemonk

Copy link
Copy Markdown
Contributor Author

/ok-to-test sha=56faefb

Comment thread app/client/src/workers/validations.ts Outdated
isValid: true,
parsed: config.params?.default || 0,
};
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

qq: We use the default value when it's an "" but not when it's null or undefined?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@akash-codemonk
akash-codemonk merged commit 71d7b26 into release Sep 16, 2021
@akash-codemonk
akash-codemonk deleted the fix/empty-field-errors branch September 16, 2021 05:32
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