appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

feat:allow local decimal sep. curr. & input widget

Open techbhavin opened this issue 3 years ago • 69 comments

Description

Currency widget should allow, to be used as decimal separator.

Fixes #14261

Type of change

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

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented on my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [x] 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

techbhavin avatar Aug 29 '22 13:08 techbhavin

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

Name Status Preview Updated
appsmith ✅ Ready (Inspect) Visit Preview Nov 1, 2022 at 7:58AM (UTC)

vercel[bot] avatar Aug 29 '22 13:08 vercel[bot]

/ok-to-test sha=b26ec81

techbhavin avatar Aug 29 '22 13:08 techbhavin

Unable to find test scripts. Please add necessary tests to the PR.

github-actions[bot] avatar Aug 29 '22 13:08 github-actions[bot]

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2949035052. Workflow: Appsmith External Integration Test Workflow. Commit: b26ec81. PR: 16380.

github-actions[bot] avatar Aug 29 '22 13:08 github-actions[bot]

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2949035052. Workflow: Appsmith External Integration Test Workflow. Commit: b26ec81. PR: 16380.

github-actions[bot] avatar Aug 30 '22 01:08 github-actions[bot]

/ok-to-test sha=b152732

techbhavin avatar Aug 30 '22 08:08 techbhavin

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2954791778. Workflow: Appsmith External Integration Test Workflow. Commit: b152732. PR: 16380.

github-actions[bot] avatar Aug 30 '22 08:08 github-actions[bot]

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2954791778. Commit: b152732. 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 295.69 291.48 295 290.72 305 295 295.58 4.83 1.93 1.72
painting 3.26 3.14 5.87 3.19 3.4 3.26 3.77 72.41 31.30 27.85
rendering 103.41 102.64 107.64 105.46 108.43 105.46 105.52 5.49 2.41 2.15
BIND_TABLE_DATA
scripting 1176.06 1182.71 1208.33 1233.98 1244.17 1208.33 1209.05 5.63 2.49 2.23
painting 13.35 15.33 12.83 14.74 24.32 14.74 16.11 71.32 29.17 26.07
rendering 400.28 426.77 417.68 442.43 475.2 426.77 432.47 17.32 6.55 5.86
CLICK_ON_TABLE_ROW
scripting 749.81 833.57 851.53 834.37 870.02 834.37 827.86 14.52 5.57 4.98
painting 8.33 7.89 12.54 10.49 11.43 10.49 10.14 45.86 19.63 17.55
rendering 285.09 291.92 299.05 294.94 298.08 294.94 293.82 4.75 1.92 1.71
UPDATE_POST_TITLE
scripting 1359.52 1257.19 1277.63 1341.25 1311.86 1311.86 1309.49 7.81 3.26 2.91
painting 17.38 23.34 12.87 15.66 16.51 16.51 17.15 61.05 22.45 20.06
rendering 433.12 435.91 433.52 450.34 449.73 435.91 440.52 3.91 1.99 1.78
OPEN_MODAL
scripting 533.61 543.28 549.12 491.01 579.98 543.28 539.4 16.49 5.96 5.33
painting 11.65 14.91 14.56 22.02 10.05 14.56 14.64 81.76 31.42 28.07
rendering 366.92 375.95 367.64 368.41 400.86 368.41 375.96 9.03 3.83 3.42
CLOSE_MODAL
scripting 282.06 294.67 292.99 326.17 324.93 294.67 304.16 14.50 6.61 5.91
painting 3.83 9.92 4.43 4.73 10.95 4.73 6.77 105.17 49.93 44.61
rendering 589.97 630.74 597.38 616.15 634.81 616.15 613.81 7.31 3.23 2.89
SELECT_WIDGET_MENU_OPEN
scripting 1081.22 1042.49 1171.21 1076.24 1214.82 1081.22 1117.2 15.43 6.49 5.80
painting 4.98 4.46 6.82 5.41 20.17 5.41 8.37 187.69 79.57 71.09
rendering 607.02 589.92 640.34 606.85 698.5 607.02 628.53 17.28 6.87 6.14
SELECT_WIDGET_SELECT_OPTION
scripting 140.24 132.03 135.13 147.23 156.88 140.24 142.3 17.46 7.01 6.27
painting 3.44 2.27 13.46 1.98 6.37 3.44 5.5 208.73 86.73 77.64
rendering 329.81 304.18 298.69 306.28 329.11 306.28 313.61 9.92 4.70 4.20

github-actions[bot] avatar Aug 30 '22 09:08 github-actions[bot]

/ok-to-test sha=c1f970c

techbhavin avatar Aug 30 '22 10:08 techbhavin

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2955432833. Workflow: Appsmith External Integration Test Workflow. Commit: c1f970c. PR: 16380.

github-actions[bot] avatar Aug 30 '22 10:08 github-actions[bot]

@techbhavin On binding with a text widget, the data in the input widget is seen as a . decimal instead of , a comma separator. Please do check the loom for more info:

https://www.loom.com/share/3ff3f7d4656b4677873726ed84700527

Language set to Spanish.

laveena-en avatar Aug 31 '22 13:08 laveena-en

Hey @laveena-en, Can you use {{Input1.inputText}} instead of {{Input1.text}}.

image

techbhavin avatar Sep 01 '22 10:09 techbhavin

Yeah this works Bhavin, thanks.

Query: However, @dilippitchika there's no auto-suggestion for inputText and user discoverability might be low. Can we go ahead with this?

laveena-en avatar Sep 01 '22 14:09 laveena-en

We have to add it in the autocomplete list @techbhavin , also how did we decide on the name inputText? Can we use displayText instead? It's much more inline with other widgets where similar logic is followed.

dilippitchika avatar Sep 02 '22 05:09 dilippitchika

/ok-to-test sha=e8f7fd6

techbhavin avatar Sep 02 '22 10:09 techbhavin

Hello @dilippitchika, inputText autocomplete suggestion is added. On the code side, the inputText name is already declared as a standard wise, and right now we can not rename displayText.

techbhavin avatar Sep 02 '22 10:09 techbhavin

@sbalaji1192 where is this inputText binding used? I don't want to confuse our users, Bhavin is suggesting it's already present in the widget.

dilippitchika avatar Sep 02 '22 10:09 dilippitchika

@dilippitchika @techbhavin InputText is used in the input widget internally.to preserve the entered text when the user is entering values like 1.0 while typing 1.02

sbalaji1192 avatar Sep 02 '22 10:09 sbalaji1192

@sbalaji1192 can't we create a new binding called displayText on the widget to show the formatted value?

dilippitchika avatar Sep 02 '22 11:09 dilippitchika

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2978436418. Workflow: Appsmith External Integration Test Workflow. Commit: e8f7fd6. PR: 16380.

github-actions[bot] avatar Sep 02 '22 11:09 github-actions[bot]

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2978436418. Commit: e8f7fd6. 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 306.22 301.63 328.26 340.61 283.67 306.22 312.08 18.25 7.21 6.45
painting 5.55 5.24 4.66 5.43 4.07 5.24 4.99 29.66 12.42 11.02
rendering 111.99 111.95 110.11 126.56 107.24 111.95 113.57 17.01 6.62 5.92
BIND_TABLE_DATA
scripting 1654.03 2004.7 1481.89 1786.69 1479.76 1654.03 1681.41 31.22 13.19 11.80
painting 15.49 37.4 6.46 18.36 15.75 15.75 18.69 165.54 60.94 54.47
rendering 459.18 871.83 426.42 495.8 432.49 459.18 537.14 82.92 35.20 31.49
CLICK_ON_TABLE_ROW
scripting 1133.19 1577.04 849.22 936.18 792.47 936.18 1057.62 74.18 30.05 26.88
painting 21.16 16.94 10.02 11.08 9.63 11.08 13.77 83.73 36.89 32.97
rendering 312.17 549.42 320.87 334.8 300.14 320.87 363.48 68.58 28.81 25.77
UPDATE_POST_TITLE
scripting 1502.3 2598.11 1392.91 1405.14 1303.67 1405.14 1640.43 78.91 32.92 29.44
painting 15.65 29.63 14.77 15.52 16.48 15.65 18.41 80.72 34.22 30.64
rendering 476.11 792.33 488.42 495.12 484.4 488.42 547.28 57.78 25.06 22.42
OPEN_MODAL
scripting 530.11 942.13 601.92 1099.44 483.76 601.92 731.47 84.17 37.34 33.40
painting 10.46 22.81 19.65 10.35 14.13 14.13 15.48 80.49 36.05 32.24
rendering 397.87 516.68 420.18 411.12 381.05 411.12 425.38 31.88 12.49 11.17
CLOSE_MODAL
scripting 336.57 510.5 383.38 339.53 298.41 339.53 373.68 56.76 21.99 19.67
painting 5.44 7.13 6.28 5.96 11.71 6.28 7.3 85.89 34.79 31.10
rendering 656.74 834.02 693.31 654.01 616.77 656.74 690.97 31.44 12.22 10.93
SELECT_WIDGET_MENU_OPEN
scripting 1125.47 1231.33 1145.04 1149.36 1172.28 1149.36 1164.7 9.09 3.50 3.13
painting 11.79 8.93 19.59 5.7 8.64 8.93 10.93 127.08 48.49 43.37
rendering 629.12 696.79 637.03 635.57 668.31 637.03 653.36 10.36 4.38 3.92
SELECT_WIDGET_SELECT_OPTION
scripting 197.58 164.86 132.9 164.61 148.15 164.61 161.62 40.02 14.90 13.33
painting 4.69 3.1 2.1 10.23 19.31 4.69 7.89 218.12 90.24 80.74
rendering 326.56 459.69 313.6 325.13 329.72 326.56 350.94 41.63 17.41 15.57

github-actions[bot] avatar Sep 02 '22 12:09 github-actions[bot]

/ok-to-test sha=417698b

techbhavin avatar Sep 07 '22 09:09 techbhavin

Tested this RP and working as Expected

  • Tested with different locale
  • Tested error message on wrong default input according to locale
  • Tested adding input & currency widget on container type widget
  • Tested with regex and other validations in widget

chandannkumar avatar Sep 07 '22 10:09 chandannkumar

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3007212046. Workflow: Appsmith External Integration Test Workflow. Commit: 417698b. PR: 16380.

github-actions[bot] avatar Sep 07 '22 11:09 github-actions[bot]

@sbalaji1192 is this PR in a state to get merged, some tests might be failing here, Need you to give me a sign off to merge this

somangshu avatar Sep 09 '22 10:09 somangshu

/ok-to-test sha=417698b

somangshu avatar Sep 09 '22 10:09 somangshu

Lets wait for the test and will give my final sign off @somangshu

sbalaji1192 avatar Sep 09 '22 10:09 sbalaji1192

/ok-to-test sha=417698b

somangshu avatar Sep 13 '22 06:09 somangshu

I am not sure what happened, But the test probably did not run

somangshu avatar Sep 13 '22 06:09 somangshu

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3042912355. Workflow: Appsmith External Integration Test Workflow. Commit: 417698b. PR: 16380.

github-actions[bot] avatar Sep 13 '22 06:09 github-actions[bot]