Skip to content

feat: Table widget V2 Inline editing validation for plain text & number column#15954

Merged
sbalaji1192 merged 9 commits intoreleasefrom
feat/table-editing-validation
Sep 13, 2022
Merged

feat: Table widget V2 Inline editing validation for plain text & number column#15954
sbalaji1192 merged 9 commits intoreleasefrom
feat/table-editing-validation

Conversation

@sbalaji1192
Copy link
Copy Markdown
Contributor

@sbalaji1192 sbalaji1192 commented Aug 12, 2022

Description

Now editable column has the option to validate the input text before saving.

Fixes #13670

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Cypress test cases were added to verify the feature

Table widget inline editing validation functionality

  1. should check that validation only appears when editable enabled
  2. should check that validation only appears for plain text and number
  3. should check that regex, valid & required appear for the plain text column
  4. should check that min, max, regex, valid & required appear for the number column
  5. should check the validation property for the plain text column
    a. Regex
    b. Valid
    c. Required
  6. should check validation property for number column
    a. Min
    b. Max
  7. should check the error message property
  8. should check the editable cell actions when there is a validation error
    a. save should only work when there is no error
    b. discard should only work when there is no error
  9. should check that the save/discard button is disabled when there is a validation error

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

@vercel
Copy link
Copy Markdown

vercel bot commented Aug 12, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
appsmith ✅ Ready (Inspect) Visit Preview Sep 9, 2022 at 8:19AM (UTC)

@github-actions github-actions bot added Widgets Product This label groups issues related to widgets Enhancement New feature or request Table Widget labels Aug 12, 2022
@sbalaji1192
Copy link
Copy Markdown
Contributor Author

/ok-to-test sha=382a612

@github-actions
Copy link
Copy Markdown

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2844660180.
Workflow: Appsmith External Integration Test Workflow.
Commit: 382a612.
PR: 15954.

@sbalaji1192
Copy link
Copy Markdown
Contributor Author

/ok-to-test sha=50013f6

@github-actions
Copy link
Copy Markdown

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2844712825.
Workflow: Appsmith External Integration Test Workflow.
Commit: 50013f6.
PR: 15954.

@github-actions
Copy link
Copy Markdown

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2844660180.
Commit: 382a612.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Median Mean SD.Sample SD.Population
SELECT_WIDGET_MENU_OPEN
scripting 1040.65 1051.19 1074.34 1022.41 1058.54 1051.19 1049.43 1.85 1.66
painting 9.96 5.15 12.21 6.24 6.22 6.24 7.96 37.69 33.67
rendering 813.88 814.71 810.65 818.85 811.29 813.88 813.88 0.40 0.36
SELECT_WIDGET_SELECT_OPTION
scripting 144 145.4 154.07 149.39 165.61 149.39 151.69 5.74 5.14
painting 3.8 3.53 4.99 4.39 4.92 4.39 4.33 15.01 13.39
rendering 305.06 298.77 292.65 300.51 299.54 299.54 299.31 1.49 1.33

@sbalaji1192
Copy link
Copy Markdown
Contributor Author

/ok-to-test sha=50013f6

@github-actions
Copy link
Copy Markdown

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2844840605.
Workflow: Appsmith External Integration Test Workflow.
Commit: 50013f6.
PR: 15954.

1 similar comment
@github-actions
Copy link
Copy Markdown

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2844840605.
Workflow: Appsmith External Integration Test Workflow.
Commit: 50013f6.
PR: 15954.

@github-actions
Copy link
Copy Markdown

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2844840605.
Commit: 50013f6.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Median Mean SD.Sample SD.Population
SELECT_WIDGET_MENU_OPEN
scripting 1056.49 1128.31 1145.76 1085.94 1117.38 1117.38 1106.78 3.21 2.87
painting 9.09 6.67 13.39 6.53 11.71 9.09 9.48 32.07 28.69
rendering 819.81 875.43 855.95 865.16 843.72 855.95 852.01 2.52 2.25
SELECT_WIDGET_SELECT_OPTION
scripting 169.73 183.22 150.69 178.94 173.43 173.43 171.2 7.34 6.57
painting 4.54 3.88 14.9 4.89 7.83 4.89 7.21 63.25 56.59
rendering 307.92 309.15 299.29 309.83 304.74 307.92 306.19 1.41 1.26

@Aishwarya-U-R
Copy link
Copy Markdown
Contributor

/ok-to-test sha=f635463

@github-actions
Copy link
Copy Markdown

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2846240465.
Workflow: Appsmith External Integration Test Workflow.
Commit: f635463.
PR: 15954.

@github-actions
Copy link
Copy Markdown

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2846240465.
Commit: f635463.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Median Mean SD.Sample SD.Population
SELECT_WIDGET_MENU_OPEN
scripting 1051.21 1105.3 1039.23 1042.06 1035.68 1042.06 1054.7 2.74 2.45
painting 11.05 9.94 7.06 13.16 5.41 9.94 9.32 33.26 29.83
rendering 825.53 847.72 832.39 823.06 813.91 825.53 828.52 1.52 1.36
SELECT_WIDGET_SELECT_OPTION
scripting 158.15 177.68 147.86 148.29 154.91 154.91 157.38 7.73 6.91
painting 3.52 3.07 3.8 8.18 8.79 3.8 5.47 50.64 45.34
rendering 307.04 306.18 310.12 302.13 294.96 306.18 304.09 1.92 1.72

@chandannkumar
Copy link
Copy Markdown

chandannkumar commented Aug 17, 2022

Observation: @sbalaji1192

  1. Regex validation is not working for Number column type
    image.png

  2. Valid field is not working for Number type column.
    https://www.loom.com/share/aa6a2da4ae004ab1923b645b4caa2d9f

  3. Error on the Table cell can seen outside the canvas as well.
    https://www.loom.com/share/cebd81a7029d46579472d4137fd285c7

  4. There is no auto-suggestion for configuring valid field on Number or Plain text column type.
    Like using {{editedValue.length < 10}} no auto-suggestion was suggesting these

@github-actions
Copy link
Copy Markdown

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Aug 25, 2022
@rishabhrathod01 rishabhrathod01 mentioned this pull request Sep 1, 2022
9 tasks
@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 2, 2022

This PR has been closed because of inactivity.

@github-actions github-actions bot closed this Sep 2, 2022
@sbalaji1192 sbalaji1192 reopened this Sep 5, 2022
@sbalaji1192 sbalaji1192 force-pushed the feat/table-editing-validation branch from 5f16cf4 to db95e0c Compare September 5, 2022 06:16
@github-actions github-actions bot added the High This issue blocks a user from building or impacts a lot of users label Sep 5, 2022
@sbalaji1192
Copy link
Copy Markdown
Contributor Author

/ok-to-test sha=db95e0c

@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 6, 2022

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2997494943.
Workflow: Appsmith External Integration Test Workflow.
Commit: db95e0c.
PR: 15954.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 6, 2022

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2997494943.
Commit: db95e0c.
Results:

Click to view performance test results

Run 1 (ms) Run 2 (ms) Run 3 (ms) Run 4 (ms) Run 5 (ms) Median (ms) Mean (ms) Range (%) SD.Sample (%) SD.Population (%)
SELECT_CATEGORY
scripting 244.6 981.21 261.92 278.49 247.71 261.92 402.79 182.88 80.35 71.86
painting 3.19 7.31 4.2 3.11 3.29 3.29 4.22 99.53 42.18 37.68
rendering 103.33 103.49 105.26 103.34 103.79 103.49 103.84 1.86 0.78 0.70
BIND_TABLE_DATA
scripting 1455 1415.85 1416.63 1429.66 1590.57 1429.66 1461.54 11.95 5.05 4.52
painting 17.5 14.09 16.92 14.64 13.98 14.64 15.43 22.81 10.76 9.66
rendering 510.71 424.42 438.12 433.49 430.08 433.49 447.36 19.29 7.99 7.15
CLICK_ON_TABLE_ROW
scripting 736.83 736.32 707.91 973.57 698.73 736.32 770.67 35.66 14.88 13.31
painting 10.08 10.49 12.13 9.98 10.42 10.42 10.62 20.24 8.19 7.34
rendering 304.01 304.04 297.27 302.59 298.16 302.59 301.21 2.25 1.08 0.97
UPDATE_POST_TITLE
scripting 1319.01 1108.07 1020.5 1069.49 987.07 1069.49 1100.83 30.15 11.85 10.60
painting 21.64 14.54 14.38 12.67 11.92 14.38 15.03 64.67 25.68 22.95
rendering 509.3 473.26 435.83 444.06 432.4 444.06 458.97 16.75 7.06 6.32
OPEN_MODAL
scripting 480.56 447.22 491.57 432.4 464.52 464.52 463.25 12.77 5.19 4.64
painting 8.08 14.01 20.39 8.25 10.47 10.47 12.24 100.57 42.08 37.58
rendering 394.24 394.64 392.09 368.53 373.23 392.09 384.55 6.79 3.28 2.94
CLOSE_MODAL
scripting 265.13 257.26 254.3 275.28 241.51 257.26 258.7 13.05 4.86 4.35
painting 4.73 4.52 4.53 4.89 19.77 4.73 7.69 198.31 87.91 78.54
rendering 333.58 329.16 334.19 357.36 342.53 334.19 339.36 8.31 3.29 2.94
SELECT_WIDGET_MENU_OPEN
scripting 1042.21 864.76 900.12 1014.09 985.99 985.99 961.43 18.46 7.89 7.06
painting 12.96 5.05 8.84 8.11 14.28 8.84 9.85 93.71 38.07 34.11
rendering 664.61 597.33 600.14 655.21 633.76 633.76 630.21 10.68 4.90 4.38
SELECT_WIDGET_SELECT_OPTION
scripting 111.09 99.66 103.96 124.16 102.53 103.96 108.28 22.63 9.07 8.12
painting 13.29 6.73 3.4 3.92 4.94 4.94 6.46 153.10 62.38 55.73
rendering 318.01 301.34 313.06 330.75 313.26 313.26 315.28 9.33 3.37 3.01

Copy link
Copy Markdown
Contributor

@ashit-rath ashit-rath left a comment

Choose a reason for hiding this comment

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

Couple of things I noticed while trying out the DP

  • The border here looks a bit weird to me as if the right and top border is thinner than the left and bottom ones. Can you verify once?

Screenshot 2022-09-07 at 10 06 25 AM

  • The validation sort of didn't work for me, is my binding incorrect here?

Screenshot 2022-09-07 at 10 12 48 AM

@sbalaji1192
Copy link
Copy Markdown
Contributor Author

@ashit-rath Regarding your two points

  1. I just zoomed in and had a closer look. the border seems to be fine. Can you try once as well?
  2. Binding is incorrect you should use editedValue instead currentRow.step. while entering value currentRow.step value points to older value.

@laveena-en
Copy link
Copy Markdown
Contributor

laveena-en commented Sep 7, 2022

@sbalaji1192 A couple of observations here:

Can we have the error toast to read "This field is required" instead of invalid text when a field is set to required. That would be consistent with the other widgets and differentiate from an actual invalid input.

Invalid values are being allowed even when the valid condition is set https://www.loom.com/share/26d45749c5c4467f90be537d70634191

The error text is seen on the canvas on re-sizing https://www.loom.com/share/4b607ba78f6f424e9b73552cec075e4c

ashit-rath
ashit-rath previously approved these changes Sep 7, 2022
@github-actions github-actions bot removed the Stale label Sep 8, 2022
@sbalaji1192
Copy link
Copy Markdown
Contributor Author

@laveena-en
#1 - fixed
#2 - not reproducible
#3 - not an issue. checked with @dilippitchika . we can ignore this.

@laveena-en
Copy link
Copy Markdown
Contributor

LGTM!

@sbalaji1192
Copy link
Copy Markdown
Contributor Author

/ok-to-test sha=b29cdf4

@sbalaji1192 sbalaji1192 merged commit afb9aa9 into release Sep 13, 2022
@sbalaji1192 sbalaji1192 deleted the feat/table-editing-validation branch September 13, 2022 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request High This issue blocks a user from building or impacts a lot of users Table Widget Widgets Product This label groups issues related to widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Validations for inline editing in input widget

5 participants