grandnode2 icon indicating copy to clipboard operation
grandnode2 copied to clipboard

Product spec attribute custom html

Open jithendrajp opened this issue 3 years ago • 6 comments

Resolves #200
Type: bugfix

Issue

Product specification attributes, If we select attribute type as Custom HTML Text, the Value field should be HTML Editor

Solution

Added show/hide for custom value text and custom HTML text

Breaking changes

NONE

Testing

  1. Navigate to a product - specification attribute
  2. .choose custom HTML Text from dropdown
  3. A HTML editor should visible .

jithendrajp avatar Jan 01 '22 16:01 jithendrajp

@jithendrajp Thanks for contributing! But is it a good way to prepare a form with two the same name field?

KrzysztofPajak avatar Jan 03 '22 07:01 KrzysztofPajak

@jithendrajp Thanks for contributing! But is it a good way to prepare a form with two the same name field?

Hi @KrzysztofPajak, Ideally Input textbox or HTML Editor only one will be visible at a time.

To make it more generic we can fix it in two ways.

  • Extending the model and adding a new property in the model and assigning it back to the same DB column in the controller.
  • Adding a new column in DB and extending the model as well

Which one do you prefer from the above two ways? So that I will modify accordingly and update the PR again.

jithendrajp avatar Jan 04 '22 06:01 jithendrajp

Maybe, the best will be to prepare a simple script that will be toggle assign editor or remove it from the CustomValue field

KrzysztofPajak avatar Jan 04 '22 13:01 KrzysztofPajak

Maybe, the best will be to prepare a simple script that will be toggle assign editor or remove it from the CustomValue field

Sure @KrzysztofPajak , that's a great idea, will correct it and update the PR

jithendrajp avatar Jan 05 '22 08:01 jithendrajp

Maybe, the best will be to prepare a simple script that will be toggle assign editor or remove it from the CustomValue field

Hi @KrzysztofPajak, I tried the above way that you suggested. But as editor controls and input fields are rendered from Backend, I am not able to control them at the DOM level. Any other suggestions?

jithendrajp avatar Jan 10 '22 05:01 jithendrajp

@KrzysztofPajak, can you please suggest?

Nikhil13x avatar Jan 11 '22 18:01 Nikhil13x