[
https://issues.apache.org/jira/browse/NIFI-3360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15858418#comment-15858418
]
ASF GitHub Bot commented on NIFI-3360:
--------------------------------------
GitHub user scottyaslan opened a pull request:
https://github.com/apache/nifi/pull/1487
[NIFI-3360] Modularize Canvas
Most of this PR simply adds UMD (Universal Module Definition) boilerplate
around NIFI's existing modules and re-orders the loading of the scripts on the
page to match dependencies. However some refactoring was required.
Changes to be aware of:
1. Created new method nf.Graph.reload() to be called from
nf.CanvasUtils.reloadConnectionSourceAndDestination since nf.Graph module has
references to the canvas graph component controllers
2. moved nf.CanvasUtils.enterGroup to nf.ProcessGroup.enterGroup
3. nf.CanvasUtils.editable(...) now has nf.Connectable and nf.Draggable
passed as args since the canvas graph components now have private references to
the nf.Draggable and nf.Connectable controllers and can pass them along (rather
than injecting nf.Connectable and nf.Draggable into nf.CanvasUtils)
4. nf-canvas-bootstrap.js leverages the Inversion Of Control design pattern
to remove circular dependencies and allow the Nifi js modules to be unit tested
using mocks of the injected controllers
5. nf.CanvasUtils now has a reference to the nf.Canvas (see
nf-canvas-bootstrap.js) and now acts as a proxy for calls to the nf.Canvas
6. nf.CanvasUtils now has a reference to the nf.Graph (see
nf-canvas-bootstrap.js) and a new method nf.CanvasUtils.getComponentByType()
that allows dependent modules to get canvas graph component controllers
*********************************************************************************
Thank you for submitting a contribution to Apache NiFi.
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?
### 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?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] 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 travis-ci for build
issues and submit an update to your PR as soon as possible.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/scottyaslan/nifi NIFI-3360
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/1487.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1487
----
commit 3d938d0620eaaa07003b5f73522168ebafe9466f
Author: Scott Aslan <[email protected]>
Date: 2017-02-03T23:09:16Z
[NIFI-3360] taking bottom up approach to modularizing the canvas...wrapping
modulaes with UMD and keep the app loading
commit 5b727354af9458152da6f4a0774539efebc27566
Author: Scott Aslan <[email protected]>
Date: 2017-02-08T18:09:31Z
[NIFI-3360] taking top down approach from this point and leveraging
inversion of control desgin pattern
----
> Modularize canvas directory
> ---------------------------
>
> Key: NIFI-3360
> URL: https://issues.apache.org/jira/browse/NIFI-3360
> Project: Apache NiFi
> Issue Type: Sub-task
> Components: Core UI
> Reporter: Scott Aslan
> Assignee: Scott Aslan
>
> Need to modularize (re-package) UI components to promote maintainability and
> eventual reusability for UI extensions. Components are already conceptually
> modular however circular references exists which should not be allowed. Need
> to re-package functions to eliminate circular
> references.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)