-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
feat: Added display message for normal users for protected images #8854
feat: Added display message for normal users for protected images #8854
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Codecov Report
@@ Coverage Diff @@
## main #8854 +/- ##
==========================================
- Coverage 47.81% 47.80% -0.01%
==========================================
Files 64 64
Lines 19942 19946 +4
Branches 4823 4824 +1
==========================================
Hits 9536 9536
- Misses 9162 9166 +4
Partials 1244 1244
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
html/js/product-multilingual.js
Outdated
@@ -704,24 +714,26 @@ function get_recents(tagfield) { | |||
|
|||
var $this = $(this); | |||
var id = $this.attr('id'); | |||
var clas= $this.attr("data-info"); |
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.
the variable is named "clas" because "class" is a protected word? As the attribute we read is not the class anyway, could we rename the variable to data_info maybe?
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.
I tested it, it is working well, thank you!
html/js/product-multilingual.js
Outdated
@@ -427,16 +427,26 @@ function update_nutrition_image_copy() { | |||
|
|||
function update_display(imagefield, first_display) { | |||
|
|||
var display_url = imagefield_url[imagefield]; | |||
var flag=0; |
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 a bit strange to use the imagefield to specify that the image is protected, and then removing "protect_" etc.
Could you just add a parameter to update_display() ? update_display(imagefield, protected, first_display). It would be clearer that way I think, and we would not need to have the flag, modifiedimagefield etc.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
Perfect, thank you!
What
when the image is uploaded, a message “Image received” is displayed only, no need to display cropping tool for normal users.
Screenshot
Related issue(s) and discussion