You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/10/01 12:13:00 UTC
[jira] [Commented] (METRON-1749) Update Angular to latest release
in Management UI
[ https://issues.apache.org/jira/browse/METRON-1749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16633914#comment-16633914 ]
ASF GitHub Bot commented on METRON-1749:
----------------------------------------
GitHub user sardell opened a pull request:
https://github.com/apache/metron/pull/1217
METRON-1749: Update Angular to latest release in Management UI
## Contributor Comments
Link to ASF JIRA ticket: https://issues.apache.org/jira/browse/METRON-1749
This Pull Request contains work which updates the Management UI's version of Angular from version 2.0.0 to version 6.1.8. A few benefits we get from this:
* We gain new Angular features, such as Ahead-of-Time compiling, the new HttpClient library, `ng update` and Http Interceptors.
* All npm dependencies now pass an npm vulnerability audit.
* We are able to use rxjs version 6, which includes easier import paths and pipe method chaining.
### Changes Included
* Update to Angular 6.1.8 and related dependencies.
* Change angular-cli.json to angular.json and update file schema.
* Update karma.conf.js schema.
* Update scripts to use the Ahead-of-Time flag.
* Update name of scss file containing fonts to `_fonts.scss`.
* Switch from HttpModule and the Http service to HttpClientModule and the HttpClient service.
* Replace the deprecated `OpaqueToken` with `InjectionToken`.
* Replace the Observable `emit` method with `next`.
* Update Observables to use the pipe() method for operators.
* Update rxjs operator names, import statements and usage.
* Remove lines in templates accessing service properties.
* Remove passing event payloads if event handler method does not accept parameters.
* Remove .compileComponents() since it is no longer needed because webpack inlines templates and css before tests are run.
* Remove assertions testing Angular libraries.
* Update unit tests to use the [HttpClientTestingModule and HttpTestingController to mock responses](https://angular.io/guide/http#testing-http-requests).
* Move default headers to an HttpInterceptor.
* Format changed files to comply with rules set in tslint.config and make it easier to find errors while upgrading.
### Testing
To test with unit tests, please follow the instructions listed in the Testing section of the Management UI README.
To test manually, please follow the instructions listed in the Development section of the Management UI README and visit http://localhost:4200.
### Other Considerations
* We have a handful of nested Observable subscriptions in the Management UI. We would be better off [using an operator like switchMap instead](https://stackoverflow.com/questions/42888604/rxjs-observables-nested-subscriptions).
* I updated the font paths to use absolute paths because of [this issue](https://github.com/angular/angular-cli/issues/6599). We should watch this issue in hopes that Angular's compiler gives us an option in the future to change the default path it applies.
* The dialog box is currently implemented as a class without a template that utilizes jQuery to manipulate element class attributes. This is slightly confusing because it does not adhere to Angular best practices, and I see no advantage to the way it's currently implemented. I think this class would be much better off as an Angular component using either the class binding shorthand syntax or NgClass instead of jQuery to handle class additions/removals.
## Pull Request Checklist
Thank you for submitting a contribution to Apache Metron.
Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions.
Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) for complete smoke testing guides.
In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).
- [ ] Does your PR title start with METRON-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)?
### For code changes:
- [ ] Have you included steps to reproduce the behavior or problem that is being changed or addressed?
- [ ] Have you included steps or a guide to how the change may be verified and tested manually?
- [ ] Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:
```
mvn -q clean integration-test install && dev-utilities/build-utils/verify_licenses.sh
```
- [ ] Have you written or updated unit tests and or integration 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)?
- [ ] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via `site-book/target/site/index.html`:
```
cd site-book
mvn site
```
#### 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.
It is also recommended that [travis-ci](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sardell/metron METRON-1749
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/metron/pull/1217.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 #1217
----
commit 59cc059b3f48bd46fe9f4cd6ecb5e1b35b1a968e
Author: Shane Ardell <sa...@...>
Date: 2018-09-04T10:13:13Z
update angular cli config file
commit d7be4534017db4829cc4b34ecdccf123331ceeca
Author: Shane Ardell <sa...@...>
Date: 2018-09-04T10:14:54Z
update tsconfig files
commit 83ce0aebb11e6e5bd1aa290536e524888399395e
Author: Shane Ardell <sa...@...>
Date: 2018-09-04T11:04:43Z
update karma configuration
commit ee2b7ecc2307c14e4cdb6931e56577c9af2d2c5d
Author: Shane Ardell <sa...@...>
Date: 2018-09-04T11:22:23Z
update angular node module
commit 262417b284230341dc0c088f3b96ab3b19c9cb71
Author: Shane Ardell <sa...@...>
Date: 2018-09-04T11:40:39Z
update shell start script
commit 51640e597eb4c8c73b465858c74d19e4b00f673d
Author: Shane Ardell <sa...@...>
Date: 2018-09-04T12:02:15Z
fix font path issue
link to issue and temporary workaround: https://github.com/angular/angular-cli/issues/6599
commit a4d7d8366ee9a1bd747de3808bfaaa228ad5a020
Author: Shane Ardell <sa...@...>
Date: 2018-09-04T12:18:36Z
replace OpaqueToken with InjectionToken
commit 1ca16dd02b6d10415cd026a33e3b0bb42ff2fc8d
Author: Shane Ardell <sa...@...>
Date: 2018-09-04T12:20:07Z
add http interceptor for default headers
commit 1ce53c328dee49f58f6e373908e0556d64f9bb8d
Author: Shane Ardell <sa...@...>
Date: 2018-09-04T12:21:33Z
update router to use NgModule decorator
commit 392605894158394c75225046b95266239ef683ef
Author: Shane Ardell <sa...@...>
Date: 2018-09-04T15:40:12Z
change private vars used in template to public
commit 8902a28b275640e06df9774e1d1235193e4d0cc9
Author: Shane Ardell <sa...@...>
Date: 2018-09-05T09:18:10Z
update rest error class
commit 86cc9447b7d7d8751a74bfea94b0f915b79e0066
Author: Shane Ardell <sa...@...>
Date: 2018-09-05T10:13:10Z
move service logic out of nav template
commit 6e0d83e27d2f8987e483a98a63400695e868f200
Author: Shane Ardell <sa...@...>
Date: 2018-09-05T10:23:46Z
remove unnecessary arguments from function calls
commit 5dd4ce7748dc0f8730b24c709f418757f37c69f0
Author: Shane Ardell <sa...@...>
Date: 2018-09-05T12:02:24Z
update to use RxJS 6 operators
commit 9a149dbc895cf057986357718389f2cb6d024c3a
Author: Shane Ardell <sa...@...>
Date: 2018-09-24T10:43:53Z
include assets and env files
commit dcbfa271352b98c14c22be09df7b4e5fb97bf13a
Author: Shane Ardell <sa...@...>
Date: 2018-09-24T10:46:48Z
update karma config format
commit cf2e5f66a9bf0fe64d07cc84f98c9edc7f548a2c
Author: Shane Ardell <sa...@...>
Date: 2018-09-24T10:47:44Z
update angular version to 6.1.8
commit 0d87c9311f93641aea518fbf7f0f8d3209784fd3
Author: Shane Ardell <sa...@...>
Date: 2018-09-24T11:09:47Z
remove blanket import of rxjs operators
commit 578ff72c0427912b136503deaefd1e7b9ba04280
Author: Shane Ardell <sa...@...>
Date: 2018-09-24T11:12:53Z
replace isAuthenticated() with routerLinkActive
commit 2aac5c99d82b2ce0990a761f5133650b5be74413
Author: Shane Ardell <sa...@...>
Date: 2018-09-24T11:40:09Z
remove and update deprecated methods and imports in components
commit 768f64a2b5ad9dd1d54fedbc4b8fd0e29fbb8b3f
Author: Shane Ardell <sa...@...>
Date: 2018-09-24T11:43:00Z
change event emitter to behavior subject
commit 2958dde6c4c2db1d1cd56d97ac24ab5d344c2ca2
Author: Shane Ardell <sa...@...>
Date: 2018-09-24T12:04:43Z
update service specs to use HttpClientTestingModule
commit 726a2110286312680fcde4eae8f46706ca2166e2
Author: Shane Ardell <sa...@...>
Date: 2018-09-24T12:07:31Z
update return types
commit eb4d82ab7d4e0dcf3f2454a68255f32ec8980d96
Author: Shane Ardell <sa...@...>
Date: 2018-09-24T12:09:23Z
update throw to throwError
commit 3e697ac4c6ce332354c20b3d4fd6b5ee9f21294d
Author: Shane Ardell <sa...@...>
Date: 2018-09-24T12:10:27Z
update to use subscription on test function
commit 14e2c97c664b109355d60f6251c2468c97f4d251
Author: Shane Ardell <sa...@...>
Date: 2018-09-24T12:12:11Z
update files to match new syntax requirements
commit 8cf97f9416b722eae9238219b930ee111eaee2f4
Author: Shane Ardell <sa...@...>
Date: 2018-09-24T12:14:21Z
merge master into METRON-1749
Conflicts:
package-lock.json
commit 5deb1d6d951a9b830d575fd072ea0898b8384707
Author: Shane Ardell <sa...@...>
Date: 2018-09-25T13:36:47Z
remove commented out code
commit 491899b003823d1e7813325dd3eaf687f100ea40
Author: Shane Ardell <sa...@...>
Date: 2018-09-25T13:37:27Z
match return name used elsewhere
commit 228195b7057d915e5ec85e2bd5ff3d2a6ba9ff0d
Author: Shane Ardell <sa...@...>
Date: 2018-09-27T13:21:12Z
add option to preserve whitespace
----
> Update Angular to latest release in Management UI
> -------------------------------------------------
>
> Key: METRON-1749
> URL: https://issues.apache.org/jira/browse/METRON-1749
> Project: Metron
> Issue Type: Improvement
> Reporter: Shane Ardell
> Priority: Major
>
> Currently, the Management UI is on Angular v2. Not only has there been many updates and improvements to Angular, that release is no longer supported by the Angular team. This means critical fixes and security patches are no longer being done.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)