Skip to content
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: Power User Script online version #2836

Closed
wants to merge 8 commits into from
Closed

feat: Power User Script online version #2836

wants to merge 8 commits into from

Conversation

teolemon
Copy link
Member

@teolemon teolemon commented Jan 7, 2020

@hangy
Copy link
Member

hangy commented Jan 7, 2020

Do you want to maintain the user script in this repository from now on?

@stephanegigandet
Copy link
Contributor

@hangy : the idea is to make it available directly in Product Opener, for some users, without requiring installing things.

@CharlesNepote @teolemon : live on https://fr.openfoodfacts.dev/ for admins only right now, we may want to think of how to surface it, e.g. make it an option in the user profile or something.

@CharlesNepote
Copy link
Member

On the one hand the Power User Script is useful for some people but:

  • it needs manual install for each user
  • it needs manual deployment for each user when updated
  • we have an enhanced version (in this PR) which allow mass editing, but we think it's not good to give it for everybody.

So we would like to try if Power User Script can be launched directly on the server side, but reserved for admins and moderators (due to mass edit). Also it would be a good thing to make it optional for users: an option should allow each users to activate it or not.

On the other hand:

  • it will be more difficult for me to maintain the enhanced script because it needs far more work: launch docker, maintain a recent database of OFF products, etc. Nowadays it's very easy to me to code this script: just launching the browser that's all. Maybe I'll continue to code it as a Greasemonkey script, and publish new functionalities on Product Opener from time to time.
  • the script could conflict with other things and deactivate it will be done by the script itself (not yet coded), which is not very clean.

IMHO what is sure is that we need easier ways to prototype user scripts / enhanced UI / test UIs / "labs" functionalities. Wikipedia allows users script. We should find a very simple way to do it: both easy for front-end devs and users.

@teolemon
Copy link
Member Author

teolemon commented Apr 2, 2020

I just rebased the branch

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2020

Stale pull request message

@@ -7193,6 +7201,10 @@ HTML
my $html;

# init javascript code
# Kept those 3 lines during the rebase. Not evident if needed @CharlesNepote
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CharlesNepote I rebased the Power User Script branch. but I was not sure about those 3 lines. Can I delete them ?

@sonarcloud
Copy link

sonarcloud bot commented Jan 29, 2021

SonarCloud Quality Gate failed.

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 18 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@teolemon teolemon mentioned this pull request Aug 21, 2021
8 tasks
@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label Feb 18, 2022
@teolemon teolemon changed the title Power User Script online version feat: Power User Script online version Feb 27, 2022
@teolemon teolemon requested a review from a team as a code owner February 27, 2022 16:49
@sonarcloud
Copy link

sonarcloud bot commented Feb 27, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability E 1 Vulnerability
Security Hotspot E 4 Security Hotspots
Code Smell A 82 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions github-actions bot removed the 💥 Merge Conflicts 💥 Merge Conflicts label Feb 27, 2022
@teolemon teolemon self-assigned this Apr 28, 2022
if(proPlatform) {
var publicURL = document.URL.replace(/\.pro\./gi, ".");
console.log("publicURL: "+publicURL);
$(".sidebar p:first").after('<p>> <a href="'+publicURL+'">Product public URL</a></p>');

Check failure

Code scanning / SonarCloud

DOM updates should not lead to cross-site scripting (XSS) attacks

<!--SONAR_ISSUE_KEY:AYR2hy6PeGvyqGHWXmS3-->Change this code to prevent execution of arbitrary client-side code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=openfoodfacts_openfoodfacts-server&issues=AYR2hy6PeGvyqGHWXmS3&open=AYR2hy6PeGvyqGHWXmS3&pullRequest=2836">SonarCloud</a></p>
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label Nov 16, 2022
@sonarcloud
Copy link

sonarcloud bot commented Nov 16, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability E 1 Vulnerability
Security Hotspot E 4 Security Hotspots
Code Smell A 171 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions github-actions bot removed the 💥 Merge Conflicts 💥 Merge Conflicts label Nov 17, 2022
@stephanegigandet
Copy link
Contributor

@teolemon @CharlesNepote I'm going through old PRs. This one is 4 years old. I suggest that we close it, and that we decide on what we want to do first, as there are many different ways we could make power user script, or part of it, more easily available to some users.

@teolemon
Copy link
Member Author

teolemon commented Apr 4, 2024

Fine by me. I will prioritize the associated issue.

@alexgarel alexgarel closed this Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

5 participants