appsmith
appsmith copied to clipboard
[Bug]-[1400]:Download action is not working in button widget when configured as second action
Description
Download action is not working when configured as a second action i.e 1st action is to run query and 2nd action is to download. Two problems I can see - (1) filename missing error pops up even when filename is provided (2) JS function written inside JS editor box is lost. https://user-images.githubusercontent.com/1757421/107853992-08871e80-6e3f-11eb-8e5e-af73b0cf3f25.mov
Steps to reproduce the behaviour:
- Create a button widget
- Add 1st action as run query
- Add onSuccess action as download.
- Click on the button widget.
Important Details
- Version: Cloud
- OS: Linux
- Browser: Chrome
@Nikhil-Nandagopal This looks like it is an action creator issue.
@sumitsum lowering priority since you don't need to send a function into the download field, you can pass the actual value there directly. Also anonymous functions work!
Please add your planning poker estimate with ZenHub @sumitsum
This error is cause by this line https://github.com/appsmithorg/appsmith/blob/release/app/client/src/components/editorComponents/ActionCreator/index.tsx#L140
Regex breaks when we have a closing )
WIDGET_PROPERTY_UPDATE
- updatedValue contains "=> download" 6m usage: 700
Stats
| Stat | Values |
|---|---|
| Reach | 700 |
| Effort (months) | 0.25 |
@rohan-arthur this would happen for any widget though it's reported for button
@Nikhil-Nandagopal , WIDGET_PROPERTY_UPDATE should include all properties I guess?
@rohan-arthur yes it will
@ramsaptami could you verify if the issue still exists?
Closing this as it seems to be working as expected now
@ramsaptami this isn't working for me. In fact it's clearing the data in the download configuration and it's completely broken
https://user-images.githubusercontent.com/3897254/186181351-34fe7609-d631-4c5b-bd41-b04cbe0588c1.mov
My bad for prematurely closing this issue, I missed watching the video attached.
Tested using direct widget binding {{Table1.selectedRows}} or {{Chart1.chartData}} which works fine but the original issue still exists as mentioned in Nikhil's comment above
@rimildeyjsr could you check this as a part of the action selector refactor epic?
I'm not able to re-produce this issue now. @ramsaptami Can you please test on your side and close it?
cc @bharath31
@rimildeyjsr @bharath31 this is not completely fixed - Original issue mentions two problem which seems to be working for normal data (1) filename missing error pops up even when filename is provided (2) JS function written inside JS editor box is lost. But there is no download and error if user provides data - {{function (){return "ababab"}()}} and 2 observation can be seen
https://github.com/appsmithorg/appsmith/assets/80756091/34183fd3-fb47-4581-a9f2-5650807527e1
@Rishabh-Rathod could you please take a stab at this?
@Rishabh-Rathod could you please take a stab at this?
This seems to be working fine for me. @AnandiKulkarni in the above example .txt extension was missed.
@Rishabh-Rathod @bharath31: Code is not getting evaluated and saved for : '{{function () { return "ababab";}()}} ' where user has not wrapped the function in(), but in widget such as text,input,default values of button above code gets evaluated and saved. Download works fine for code : '{{(function () { return "ababab";})()}} '
@bharath31 please suggest
When using function () { return "ababab";}() in the browser it results in the error mentioned below.
closing this issue as per discussion in standup