Skip to content

NIFI-11287: detect dependent properties when the property it depends on references a parameter (UI)#7117

Merged
mcgilman merged 8 commits into
apache:mainfrom
mtien-apache:NIFI-11287
May 11, 2023
Merged

NIFI-11287: detect dependent properties when the property it depends on references a parameter (UI)#7117
mcgilman merged 8 commits into
apache:mainfrom
mtien-apache:NIFI-11287

Conversation

@mtien-apache
Copy link
Copy Markdown
Contributor

!-- Licensed to the Apache Software Foundation (ASF) under one or more -->

Summary

NIFI-11287 (UI)
To test:

  • add the Compress Content processor to the canvas
  • for property "Mode", select between "compress" and "decompress". You should see the "Compress Level" dependent property show and hide
  • create and add a parameter context with a parameter that has a value of "decompress"
  • back in the processor configurations, configure the "Mode" property with the new parameter. The "Compress Level" property should hide.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 11
    • JDK 17

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

Copy link
Copy Markdown
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

Thanks for working on this improvement @mtien-apache! The automated builds failed due to several JavaScript syntax issues, such as defining a default value for option on line 1882.

@mtien-apache
Copy link
Copy Markdown
Contributor Author

Thanks for reviewing, @exceptionfactory! I fixed the syntax errors and addressed your comments. Would you look again?

Copy link
Copy Markdown
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

Thanks for correcting the syntax issues @mtien-apache. I noted a couple additional questions on the implementation itself.

@mtien-apache
Copy link
Copy Markdown
Contributor Author

I changed the way jqeury.propertytable retrieves the parameter context when calling loadProperties. Instead of a deferred, loadProperties will now check for a new parameter, type, and if it's a processor-configuration or controller-service, then it will make an ajax request to get the parameter context.

@exceptionfactory can you check again? Thanks!

Copy link
Copy Markdown
Contributor

@mcgilman mcgilman left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @mtien-apache and thanks for the review @exceptionfactory. I think we can simplify the code within the Property Table because we should already be able to fetch the Parameter Context.

Copy link
Copy Markdown
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

Thanks for making the additional changes @mtien-apache, I will defer to @mcgilman for final review.

Copy link
Copy Markdown
Contributor

@mcgilman mcgilman left a comment

Choose a reason for hiding this comment

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

Thanks @mtien-apache!

@mcgilman mcgilman merged commit 09cef4f into apache:main May 11, 2023
asfgit pushed a commit that referenced this pull request May 11, 2023
…on references a parameter (UI) (#7117)

* NIFI-11287: detect dependent properties when the property it depends on references a parameter

* address review feedback

* address more review comments

* - loadProperties checks type before getting the parameter context
- retrieve the parameter context with ajax call from inside the class

* add type parameter to all places calling loadProperties

* get reference parameters by invoking provided callbacks from the client

* check for user permissions before requesting for referenced parameters

* address review feedback

This closes #7117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants