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

Add cancel button to variable name creation dialog #1

Merged
merged 1 commit into from
May 20, 2024
Merged

Conversation

2lambda123
Copy link
Owner

@2lambda123 2lambda123 commented May 20, 2024

This closes NIFI-6603

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:

  • Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
  • Have you written or updated unit tests to verify your changes?
  • Have you verified that the full build is successful on both JDK 8 and JDK 11?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
  • If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

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

  • New Features
    • Introduced a "Cancel" button in the variable registry with appropriate color settings and functionality to hide the modal.

Copy link

cr-gpt bot commented May 20, 2024

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

Copy link

git-greetings bot commented May 20, 2024

Thanks @2lambda123 for opening this PR!

For COLLABORATOR only :

  • To add labels, comment on the issue
    /label add label1,label2,label3

  • To remove labels, comment on the issue
    /label remove label1,label2,label3

Copy link

Unable to locate .performanceTestingBot config file

Copy link

@gitginie gitginie bot left a 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!

Copy link

sweep-ai bot commented May 20, 2024

Sweep: PR Review

nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-variable-registry.js

A "Cancel" button was added to the "New Variable" dialog to allow users to close the modal without adding a new variable.

Sweep Found These Issues


Copy link

Processing PR updates...

Copy link

coderabbitai bot commented May 20, 2024

Walkthrough

The recent update to the nf-variable-registry.js file introduces a new "Cancel" button configuration. This enhancement includes setting specific colors for the button and implementing a click handler to hide a modal, improving user experience and interface control.

Changes

File Path Change Summary
.../nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/... Added a "Cancel" button with color settings and a click handler to hide a modal in nf-variable-registry.js.

In the code a button gleams,
A "Cancel" click to end our dreams.
With colors bright and handlers tight,
It hides the modal out of sight.
🐇✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

quine-bot bot commented May 20, 2024

👋 Figuring out if a PR is useful is hard, hopefully this will help.

  • @2lambda123 has been on GitHub since 2019 and in that time has had 2217 public PRs merged
  • They haven't contributed to this repo before
  • Here's a good example of their work: HeyGenClone
  • From looking at their profile, they seem to be good with Shell and Makefile.

Their most recently public accepted PR is: 2lambda123/-mi-sdm439-android_device_xiaomi_mi439#2

Copy link

git-greetings bot commented May 20, 2024

First PR by @2lambda123

PR Details of @2lambda123 in NorthropGrumman-nifi :

OPEN CLOSED TOTAL
1 0 1

@2lambda123 2lambda123 merged commit 7106aa2 into master May 20, 2024
8 of 15 checks passed
@trafico-bot trafico-bot bot added the 🔍 Ready for Review Pull Request is not reviewed yet label May 20, 2024
Copy link

codeautopilot bot commented May 20, 2024

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?
Discord
Documentation
support@codeautopilot.com

Copy link

@gitginie gitginie bot left a 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!

@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully 🔍 Ready for Review Pull Request is not reviewed yet and removed 🔍 Ready for Review Pull Request is not reviewed yet labels May 20, 2024
@labels-and-badges labels-and-badges bot added the PR:size/S Denotes a Pull Request that changes 10-29 lines. label May 20, 2024
@trafico-bot trafico-bot bot removed the ✨ Merged Pull Request has been merged successfully label May 20, 2024
Comment on lines +1634 to +1635
click: function () {
this.modal('hide');

Choose a reason for hiding this comment

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

The use of this within the anonymous function for the click handler may not refer to the expected context, potentially leading to runtime errors when attempting to call modal('hide'). In JavaScript, the value of this inside an anonymous function does not automatically refer to the object that contains the function. To ensure the correct context is used, consider using arrow functions or binding the function to the correct context.

Comment on lines 1620 to 1622
click: function () {
addNewVariable();
}

Choose a reason for hiding this comment

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

The addNewVariable function is called without any arguments or context provided, which could potentially lead to issues if the function relies on specific arguments or this context. It's important to ensure that functions are called with the necessary context and parameters, especially in event handlers where the context might not be as expected. Consider verifying the definition of addNewVariable to ensure it is being called correctly and, if necessary, adjust the call to provide the required context or parameters.

Copy link

@sourcery-ai sourcery-ai bot left a 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: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.


},
{
buttonText: 'Cancel',
Copy link

Choose a reason for hiding this comment

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

suggestion: Consider using a more descriptive button text.

The button text 'Cancel' is clear, but it might be more user-friendly to use a more descriptive text like 'Cancel Changes' or 'Discard'. This can help users understand the action better.

Suggested change
buttonText: 'Cancel',
buttonText: 'Cancel Changes',

},
{
buttonText: 'Cancel',
color: {
Copy link

Choose a reason for hiding this comment

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

suggestion: Consider using a centralized color palette.

Instead of hardcoding the color values here, consider using a centralized color palette or theme. This will make it easier to maintain and ensure consistency across the application.

Suggested change
color: {
color: {
base: theme.colors.base,
hover: theme.colors.hover,

@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed 🔍 Ready for Review Pull Request is not reviewed yet labels May 20, 2024
Copy link

codesyncapp bot commented May 20, 2024

Check out the playback for this Pull Request here.

Copy link

@coderabbitai coderabbitai bot left a 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

Commits Files that changed from the base of the PR and between 441781c and 3cc311c.
Files selected for processing (1)
  • nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-variable-registry.js (1 hunks)
Additional comments not posted (1)
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-variable-registry.js (1)

1623-1636: Addition of the 'Cancel' button in the variable creation dialog.

This change aligns with the PR's objective to enhance user interaction by allowing them to opt-out of creating a new variable. The implementation correctly hides the modal upon cancellation, which is a standard practice for cancel actions in UI design.

@trafico-bot trafico-bot bot added 🔍 Ready for Review Pull Request is not reviewed yet and removed ✨ Merged Pull Request has been merged successfully labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR:size/S Denotes a Pull Request that changes 10-29 lines. 🔍 Ready for Review Pull Request is not reviewed yet size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant