-
Notifications
You must be signed in to change notification settings - Fork 0
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
Moved the hide call on the new-rule-dialog to the end of the valid/su… #2
Conversation
Unable to locate .performanceTestingBot config file |
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
Processing PR updates... |
Thanks @2lambda123 for opening this PR! For COLLABORATOR 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.
@2lambda123
Thank you for your contribution to this repository! We appreciate your effort in opening pull request.
Happy coding!
Their most recently public accepted PR is: #1 |
Sweep: PR Reviewnifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/application.jsThe change ensures that the 'new-rule-dialog' is only closed after the new rule has been successfully added and the rule filter has been re-applied. |
PR Details of @2lambda123 in NorthropGrumman-nifi :
|
WalkthroughThe recent update to the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
undefined Disclaimer: This comment was entirely generated using AI. Be aware that the information provided may be incorrect. Current plan usage: 87.20% Have feedback or need help? |
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.
@2lambda123
Thank you for your contribution to this repository! We appreciate your effort in closing pull request.
Happy coding!
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.
Hey @2lambda123 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
// close the dialog | ||
$('#new-rule-dialog').modal('hide'); |
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.
issue: Duplicate code for closing the dialog
The code for closing the dialog is duplicated. Consider moving it outside the success and error callbacks to avoid redundancy and ensure the dialog is always closed regardless of the outcome.
$('#ok-dialog-content').text(error); | ||
$('#ok-dialog').modal('setHeaderText', 'Configuration Error').modal('show'); |
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 error handling mechanism directly displays the error message to the user without any sanitization or formatting. This approach can potentially expose sensitive information about the underlying system or lead to cross-site scripting (XSS) vulnerabilities if the error message contains user-controllable input. It's recommended to sanitize and format error messages before displaying them to the user to avoid revealing sensitive information or creating security vulnerabilities.
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.
Micro-Learning Topic: Cross-site scripting (Detected by phrase)
Matched on "cross-site scripting"
Cross-site scripting vulnerabilities occur when unescaped input is rendered into a page displayed to the user. When HTML or script is included in the input, it will be processed by a user's browser as HTML or script and can alter the appearance of the page or execute malicious scripts in their user context.
Try a challenge in Secure Code Warrior
Helpful references
- Prevent Cross-Site Scripting (XSS) in ASP.NET Core - A detailed Microsoft article on how to prevent cross-site scripting in ASP.NET Core.
- OWASP Cross Site Scripting (XSS) Software Attack - OWASP community page with comprehensive information about cross site scripting, and links to various OWASP resources to help detect or prevent it.
- OWASP Cross Site Scripting Prevention Cheat Sheet - This article provides a simple positive model for preventing XSS using output encoding properly.
@@ -396,13 +396,15 @@ var ua = { | |||
// re-apply the rule filter | |||
ua.applyRuleFilter(); | |||
} | |||
|
|||
// close the dialog | |||
$('#new-rule-dialog').modal('hide'); |
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 code directly manipulates the DOM to close a modal dialog, which is tightly coupling the JavaScript logic with the UI structure. This approach can lead to maintenance issues if the UI changes, as the JavaScript code will also need to be updated. It's recommended to abstract UI manipulations into separate functions or use a framework that provides more declarative ways to handle UI changes, improving the maintainability and modularity of the code.
Check out the playback for this Pull Request here. |
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/application.js (1 hunks)
Additional comments not posted (1)
nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/application.js (1)
401-401
: Move dialog hide call to ensure it only executes on successful rule creation.This change aligns with the PR's objective to ensure the dialog only closes upon successful validation, enhancing user experience by preventing the dialog from disappearing during an error state.
…ccess path
Thank you for submitting a contribution to Apache NiFi.
Please provide a short description of the PR here:
Description of PR
Enables X functionality; fixes bug NIFI-YYYY.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically
master
)?Is your initial contribution a single, squashed commit? Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not
squash
or use--force
when pushing to allow for clean monitoring of changes.For code changes:
mvn -Pcontrib-check clean install
at the rootnifi
folder?LICENSE
file, including the mainLICENSE
file undernifi-assembly
?NOTICE
file, including the mainNOTICE
file found undernifi-assembly
?.displayName
in addition to .name (programmatic access) for each of the new properties?For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.
Summary by CodeRabbit