appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Bug]: Add JS for icon property in buttons

Open somangshu opened this issue 2 years ago • 11 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

EX: Starting with the button widget, We see that the button color cannot be dynamically changed and the one in the table widget can. This is an Inconsistency and similar situations can be see across these properties.

We propose we look at this from the other way around and make all properties JS convertible, and then check what are the failing scenarios.

  • [ ] What changes do we need to this from the platform POV.

Steps To Reproduce

  1. D&D button widget
  2. try setting the button color dynamically
  3. see that you do not really have access to JS

Environment

Production

Version

Cloud

somangshu avatar Feb 14 '22 12:02 somangshu

@riodeuno @vuiets your thought here please

somangshu avatar Feb 14 '22 12:02 somangshu

@somangshu this is becoming a headache now.

I have assigned a similar issue to @vibhandikyash #11387 where the idea is to convert all fields to JS first in a dp and see which fields don't need JS and remove JS option for those.

Can we discuss about this issue in slack/sync once and move ahead?

dilippitchika avatar Feb 25 '22 05:02 dilippitchika

@dilippitchika surely we can do that, Our idea is to find a change to enable it everywhere rather than making the changes individually. Hence I needed an input from @riodeuno. Feel free to start a thread around this.

somangshu avatar Feb 28 '22 11:02 somangshu

@dilippitchika @somangshu @vivekverma2312
Here is how we can go about it:

  1. Enable JS for all properties which don't have it. Except for the ones which are nested or have panels (For example; Table columns (panel) and Table level styling vs Column level styling (nesting))
  2. When enabling, please take into account any side-effects or any potential breaking changes to existing applications.
  3. All new JS convertible properties will now need to have a validation.
  4. Finally, as always, we need someone from the QA team to be involved in the process from the start to finish. This will ensure that we are testing these changes while communicating the caveats properly.

The first point talks about an exception because, there is not fixed sequence to evaluations, unless one property depends on another. I can discuss this in detail when we come it.

riodeuno avatar Mar 02 '22 08:03 riodeuno

Thanks @riodeuno

@dilippitchika we will need to a way to list and track all scenarios. We can work on this together if you have a template in mind, We will keep @vivekverma2312 informed about all the discussion.

The only thing is that this looks like high effort from the PRD / Dev / QA POV. We might have to push this back to later. Let me know if you agree / disagree

somangshu avatar Mar 02 '22 13:03 somangshu

Missed this for some reason, I will create a template and track this forward.

dilippitchika avatar Apr 05 '22 07:04 dilippitchika

We have fixed a lot of these in the property pane project. Adding ones that got missed out

We need the icon property to have JS in button, button group and menu buttons.

dilippitchika avatar Oct 13 '22 11:10 dilippitchika

Hey can I work on this

sanjus-robotic-studio avatar Oct 19 '22 14:10 sanjus-robotic-studio

Greetings @sanjus-robotic-studio thanks for showing interest 🎉 , This is all yours. Assigning this to you now.

Please don't forget to read the Contribution Guidelines. Would appreciate if you can open a PR within the next 2 days. let us know here

dilippitchika avatar Oct 19 '22 16:10 dilippitchika

Hey @dilippitchika I have raised a pr for this error

sanjus-robotic-studio avatar Oct 20 '22 15:10 sanjus-robotic-studio

Thanks for this @sanjus-robotic-studio, @Tooluloope can you please review this pr and run it through our workflows?

CC @somangshu

dilippitchika avatar Oct 20 '22 17:10 dilippitchika

Checked in Button, Button group and Menu button, JS option for Icon property is present only for Button widget. It is not present in Button group and Menu button.

image image

Sripriya93 avatar Oct 28 '22 06:10 Sripriya93

@sanjus-robotic-studio can you also add it in menu button and button groups?

dilippitchika avatar Oct 28 '22 07:10 dilippitchika

Ok sure

sanjus-robotic-studio avatar Oct 28 '22 16:10 sanjus-robotic-studio

But in the previous Pr itself I have added it. Can you check and let me know

sanjus-robotic-studio avatar Oct 28 '22 16:10 sanjus-robotic-studio

You are right, i can see it there, but not in our environment. Let me ask someone to check, @Tooluloope @yaldram can one of you check?

dilippitchika avatar Oct 28 '22 17:10 dilippitchika

@sanjus-robotic-studio Could you help fix this?

CC @dilippitchika

https://user-images.githubusercontent.com/31691737/199193670-ee7ff157-f456-48ce-b566-674196b67a0a.mov

Tooluloope avatar Nov 01 '22 08:11 Tooluloope

@Tooluloope, will try to fix it

sanjus-robotic-studio avatar Nov 01 '22 09:11 sanjus-robotic-studio

@Tooluloope, will try to fix it

Thank you @sanjus-robotic-studio

Tooluloope avatar Nov 01 '22 09:11 Tooluloope

@Tooluloope can you check this ? https://github.com/appsmithorg/appsmith/pull/18031

sanjus-robotic-studio avatar Nov 01 '22 11:11 sanjus-robotic-studio