appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Bug]-[1400]:Download action is not working in button widget when configured as second action

Open sumitsum opened this issue 4 years ago • 12 comments

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:

  1. Create a button widget
  2. Add 1st action as run query
  3. Add onSuccess action as download.
  4. Click on the button widget.

Important Details

  • Version: Cloud
  • OS: Linux
  • Browser: Chrome

sumitsum avatar Feb 13 '21 15:02 sumitsum

@Nikhil-Nandagopal This looks like it is an action creator issue.

hetunandu avatar Feb 15 '21 10:02 hetunandu

@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!

Nikhil-Nandagopal avatar Feb 22 '21 15:02 Nikhil-Nandagopal

Please add your planning poker estimate with ZenHub @sumitsum

hetunandu avatar Aug 25 '21 11:08 hetunandu

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 )

Screenshot 2021-09-06 at 17 22 15

vnodecg avatar Sep 06 '21 11:09 vnodecg

WIDGET_PROPERTY_UPDATE

  • updatedValue contains "=> download" 6m usage: 700

Stats

Stat Values
Reach 700
Effort (months) 0.25

rohan-arthur avatar Apr 21 '22 05:04 rohan-arthur

@rohan-arthur this would happen for any widget though it's reported for button

Nikhil-Nandagopal avatar Apr 21 '22 07:04 Nikhil-Nandagopal

@Nikhil-Nandagopal , WIDGET_PROPERTY_UPDATE should include all properties I guess?

rohan-arthur avatar Apr 28 '22 08:04 rohan-arthur

@rohan-arthur yes it will

Nikhil-Nandagopal avatar Apr 28 '22 09:04 Nikhil-Nandagopal

@ramsaptami could you verify if the issue still exists?

bharath31 avatar Aug 23 '22 07:08 bharath31

Closing this as it seems to be working as expected now

ramsaptami avatar Aug 23 '22 08:08 ramsaptami

@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

Nikhil-Nandagopal avatar Aug 23 '22 14:08 Nikhil-Nandagopal

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

ramsaptami avatar Aug 23 '22 14:08 ramsaptami

@rimildeyjsr could you check this as a part of the action selector refactor epic?

bharath31 avatar Nov 15 '22 13:11 bharath31

I'm not able to re-produce this issue now. @ramsaptami Can you please test on your side and close it?

cc @bharath31

ravikp7 avatar May 29 '23 06:05 ravikp7

@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

AnandiKulkarni avatar Jun 01 '23 07:06 AnandiKulkarni

@Rishabh-Rathod could you please take a stab at this?

bharath31 avatar Jun 02 '23 07:06 bharath31

@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.

rishabhrathod01 avatar Jun 23 '23 11:06 rishabhrathod01

@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

AnandiKulkarni avatar Jun 23 '23 13:06 AnandiKulkarni

When using function () { return "ababab";}() in the browser it results in the error mentioned below.

image

rishabhrathod01 avatar Jun 26 '23 07:06 rishabhrathod01

closing this issue as per discussion in standup

AnandiKulkarni avatar Jun 27 '23 05:06 AnandiKulkarni