- 
                Notifications
    
You must be signed in to change notification settings  - Fork 30.3k
 
[FIX] web,website: resolve wrongly set default color of color palette #166961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] web,website: resolve wrongly set default color of color palette #166961
Conversation
33f9ffb    to
    8198fb9      
    Compare
  
    8198fb9    to
    07e247a      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello. The fix looks good. Could you add a test? Thanks
07e247a    to
    69183e8      
    Compare
  
    a9439f5    to
    e26d0e9      
    Compare
  
    | 
           Hello @aab-odoo , I have a written test. Could you review once?  | 
    
48156a8    to
    1a09103      
    Compare
  
    | 
           Hello @FrancoisGe This PR is ready and waiting your review on it thanks!  | 
    
| @@ -0,0 +1,69 @@ | |||
| /** @odoo-module **/ | |||
| 
               | 
          |||
| import wTourUtils from "@website/js/tours/tour_utils"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It s probably easier to do a unit test in js. Or I miss something ? It s strange to do a test in website to fix something in web.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @FrancoisGe i believe though the changes are made in colorpicker.js but the functionality these changes have brought is visible in editor or website where the color picker is shown, and in my opinion the test too should be written there only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FrancoisGe We tried to write the qunit test case but with backend we were not able to produce such case and hence we have written tour for the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I didn't see your ping. If I don't answer after 2 days, you can ping me directly on discord :)
Mmh, in 18.0 we should write a qunit test in community/addons/html_editor/static/tests/color_selector.test.js.
Ok for the tour in 17. (The best solution, it s probably to create a test file specific for ColorPicker)
Hello @FrancoisGe i believe though the changes are made in
colorpicker.jsbut the functionality these changes have brought is visible in editor or website where the color picker is shown, and in my opinion the test too should be written there only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FrancoisGe, We will write QUnit tests in version 18.0. For now, we have created a separate file for the test tour, named colorpicker.js
| 
           Hello @FrancoisGe awaiting your review on this! Thanks!  | 
    
Steps to reproduce: 1. Take any snippet and select any custom gradient color. 2. Reopen the background color - The selected custom gradient color is not retained as expected. Before version 16, we used wysiwyg, which called the start function to set selected colors easily. In version 17, we switched to OwlJS. Now, color picker always setting the default color as selected color. Therefore, it displays the default color instead of the selected color. This commit resolves the issue by ensuring the start function sets the selected color, replacing the default color, and updating RGBA values accordingly. Task-3631963
1a09103    to
    cf518a0      
    Compare
  
    | 
           @robodoo r+  | 
    
Steps to reproduce: 1. Take any snippet and select any custom gradient color. 2. Reopen the background color - The selected custom gradient color is not retained as expected. Before version 16, we used wysiwyg, which called the start function to set selected colors easily. In version 17, we switched to OwlJS. Now, color picker always setting the default color as selected color. Therefore, it displays the default color instead of the selected color. This commit resolves the issue by ensuring the start function sets the selected color, replacing the default color, and updating RGBA values accordingly. Task-3631963 closes #166961 Signed-off-by: Francois Georis (fge) <fge@odoo.com>

Steps to reproduce:
Before version 16, we used wysiwyg, which called the start function to set selected colors easily. In version 17, we switched to OwlJS. Now, color picker always setting the default color as selected color. Therefore, it displays the default color instead of the selected color.
After this PR, the selected color will be set in the start function by replacing the default color, and updating RGBA values accordingly.
Task-3631963