diff --git a/.circleci/config.yml b/.circleci/config.yml index 5d0d78c8..ba44eb30 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,8 @@ jobs: key: v1-dependencies-{{ checksum "package.json" }} # run tests! - - run: npm run test + # - run: npm run test + - run: npm run test:ci:local - store_test_results: path: /tmp/test-results diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index f9cfe04c..ae75ea83 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,19 +1,28 @@ -# Professional Support -Please fill this form to get quick and professional support (bug report / feature request / help implementing / etc.): -[https://goo.gl/forms/9KobHoFkjSMtGC2K3](https://goo.gl/forms/9KobHoFkjSMtGC2K3) +## I'm submitting a... -# Community Support -To allow for a faster response, please read carefully: + +

+[ ] Regression (a behavior that used to work and stopped working in a new release)
+[ ] Bug report  
+[ ] Feature request
+[ ] Documentation issue or request
+
-Please look for an answer in the docs before submitting an issue: -angular2-tree.readme.io. +## What is the current behavior? -In case you are reporting a bug, or requesting help, please reproduce it in a GIT repo or fork this online template: -https://plnkr.co/edit/IU8cKYHL7h2YeFMdcAzE?p=preview + -If you are unable to reproduce, please: -- paste your package.json -- say which browser you are using -- paste your nodes and options and whatever code your feel will help reproduce the error +## Expected behavior: -Thank you and happy programming + + +## Minimal reproduction of the problem with instructions: + + + +## Version of affected browser(s),operating system(s), npm, node and angular-tree-component: + +## Other information: diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 00000000..0bcfb421 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,25 @@ +--- +name: Bug Report +about: Report a bug or regression in functionality +--- + + + +## Minimal reproduction of the bug/regression with instructions: + + + + + +## Expected behavior: + + + +## Versions of Angular Tree Component, Angular, Node, affected browser(s) and operating system(s): + +## Other information: + +## I would be willing to submit a PR to fix this issue + +[ ] Yes (Assistance will be provided if you need help to submit a pull request) +[ ] No diff --git a/.github/ISSUE_TEMPLATE/documentation-report.md b/.github/ISSUE_TEMPLATE/documentation-report.md new file mode 100644 index 00000000..a4ea47a0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation-report.md @@ -0,0 +1,13 @@ +--- +name: Documentation Report +about: Report missing or inaccurate documentation +--- + + + +## Other information: + +## I would be willing to submit a PR for the docs :heart: + +[ ] Yes (Assistance will be provided if you need help to submit a pull request) +[ ] No diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 00000000..9873ee29 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,15 @@ +--- +name: Feature Request +about: Submit a Request For Consideration +--- + + + +## Describe any alternatives/workarounds you're currently using + +## Other information: + +## If accepted, I would be willing to submit a PR for this feature + +[ ] Yes (Assistance will be provided if you need help to submit a pull request) +[ ] No diff --git a/.github/ISSUE_TEMPLATE/support-request.md b/.github/ISSUE_TEMPLATE/support-request.md new file mode 100644 index 00000000..c8dde917 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support-request.md @@ -0,0 +1,10 @@ +--- +name: Support Request +about: I need general help +--- + +## Support Requests should not be opened as issues and should be handled in the following ways: + +### On [StackOverflow](https://stackoverflow.com/questions/tagged/angular-tree-component) using the `angular-tree-component` tag + +### In our slack support channel at https://angular-tree-component.herokuapp.com/ diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..b5f281c5 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,39 @@ +## PR Checklist +Please check if your PR fulfills the following requirements: + +- [ ] The commit message follows our guidelines: https://github.com/CirclonGroup/angular-tree-component/blob/master/CONTRIBUTING.md#commit-message-guidelines +- [ ] Tests for the changes have been added (for bug fixes / features) + +## PR Type +What kind of change does this PR introduce? + + + +``` +[ ] Bugfix +[ ] Feature +[ ] Code style update (formatting, local variables) +[ ] Refactoring (no functional changes, no api changes) +[ ] Build related changes +[ ] CI related changes +[ ] Documentation content changes +[ ] Other... Please describe: +``` + +## What is the current behavior? + + +Closes # + +## What is the new behavior? + +## Does this PR introduce a breaking change? + +``` +[ ] Yes +[ ] No +``` + + + +## Other information diff --git a/.gitignore b/.gitignore index 141b9b71..2f777902 100644 --- a/.gitignore +++ b/.gitignore @@ -31,10 +31,12 @@ Thumbs.db # Node Files # /node_modules /bower_components +/projects/**/node_modules npm-debug.log # Coverage # /coverage/ +/xunit/ # Typing # /src/typings/tsd/ @@ -48,6 +50,7 @@ npm-debug.log /public/dist/ /src/*/dist/ .webpack.json +/projects/**/package-lock.json # Doc # @@ -64,4 +67,4 @@ testScreenshots testResults e2eResults -e2e/dist \ No newline at end of file +e2e/dist diff --git a/CHANGELOG.md b/CHANGELOG.md index f5338399..e9a55b4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,279 @@ + +# 11.0.3 (2021-02-18) + +### Bug Fixes + +* return TreeNode for first and last child ([#893](https://github.com/CirclonGroup/angular-tree-component/issues/893)) ([c0792c3](https://github.com/CirclonGroup/angular-tree-component/commit/c0792c3)), closes ([#893](https://github.com/CirclonGroup/angular-tree-component/issues/893)) + + +# 11.0.2 (2021-02-16) + +### Bug Fixes + +* merge default and optional action mappings ([#891](https://github.com/CirclonGroup/angular-tree-component/issues/891)) ([4b2d8a9](https://github.com/CirclonGroup/angular-tree-component/commit/4b2d8a9)), closes ([#891](https://github.com/CirclonGroup/angular-tree-component/issues/891)) + + +# 11.0.1 (2021-02-16) + +### Bug Fixes + +* remove log calls ([#889](https://github.com/CirclonGroup/angular-tree-component/issues/889)) ([eb055aa](https://github.com/CirclonGroup/angular-tree-component/commit/22e0d85)), closes ([#889](https://github.com/CirclonGroup/angular-tree-component/issues/889)) + + +# 11.0.0 (2021-02-15) + +### Features + +* update to angular 11 ([4528c96](https://github.com/CirclonGroup/angular-tree-component/commit/4528c96)) +* remove lodash-es ([f639c98](https://github.com/CirclonGroup/angular-tree-component/commit/f639c98)) + +### BREAKING CHANGES + +BEFORE: + +getNodeById(predicate) - predicate needs to support lodash find method + +AFTER: + +getNodeById(predicate) - predicate needs to support javaScript find method + + +# 10.0.2 (2020-12-21) + +### Bug Fixes + +* update lodash-es ([#862](https://github.com/CirclonGroup/angular-tree-component/issues/862)) ([22e0d85](https://github.com/CirclonGroup/angular-tree-component/commit/22e0d85)), closes ([#862](https://github.com/CirclonGroup/angular-tree-component/issues/862)) + + +# 10.0.1 (2020-12-11) + +### Bug Fixes + +* do not load whole child collection with virtual scroll ([#463](https://github.com/CirclonGroup/angular-tree-component/issues/463)) ([a62fc73](https://github.com/CirclonGroup/angular-tree-component/commit/a62fc73)) + + +# 10.0.0 (2020-07-29) + +### Code Refactoring + +* remove unused polyfill ([#847](https://github.com/CirclonGroup/angular-tree-component/issues/847)) ([5a1a14e](https://github.com/CirclonGroup/angular-tree-component/commit/5a1a14e)), closes ([#847](https://github.com/CirclonGroup/angular-tree-component/issues/847)) + + +# 10.0.0-beta.0 (2020-07-22) + +### Features + +* Update to Angular 10 ([5338eb4](https://github.com/CirclonGroup/angular-tree-component/commit/5338eb4)) + +### BREAKING CHANGES + +BEFORE: + +No minimum Angular version set + +AFTER: + +Angular v10 minimum dependencies + + +# 9.0.3 (2020-07-20) + +### Build + +* add license to library package.json ([#843](https://github.com/CirclonGroup/angular-tree-component/issues/843)) ([23476c8](https://github.com/CirclonGroup/angular-tree-component/commit/23476c8)), closes ([#843](https://github.com/CirclonGroup/angular-tree-component/issues/843)) + + +# 9.0.2 (2020-07-15) + +### Bug Fixes + +* include mobx as dependency ([a96f2bc](https://github.com/CirclonGroup/angular-tree-component/commit/a96f2bc)) + + +# 9.0.1 (2020-07-15) + +### BREAKING CHANGES + +* move to new npm package scope + +BEFORE: + +package.json: + +``` +"dependencies": { + ... + "angular-tree-component": "^8.5.6", + ... +} +``` + +AFTER: + +package.json + +``` +"dependencies": { + ... + "@circlon/angular-tree-component": "^9.0.1", + ... +} +``` + +* move css file to css folder instead of dist + +BEFORE: + +Import angular tree css: + +``` +@import 'http://github.com/~angular-tree-component/dist/angular-tree-component.css'; +``` + +AFTER: + +package.json + +``` +@import 'http://github.com/~@circlon/angular-tree-component/css/angular-tree-component.css'; +``` + + +# 9.0.0 (2020-07-10) + +### Bug Fixes + +* Use correct ITreeOptions input in TreeComponent instead of TreeOptions ([#795](https://github.com/CirclonGroup/angular-tree-component/issues/795)) ([62f0c02](https://github.com/CirclonGroup/angular-tree-component/commit/62f0c02)), closes ([#795](https://github.com/CirclonGroup/angular-tree-component/issues/795)) + +### Features + +* Update to Angular 9 ([37feac56](https://github.com/CirclonGroup/angular-tree-component/commit/37feac56)) + +### Code Refactoring + +* use on example app and move app to projects ([5ded257](https://github.com/CirclonGroup/angular-tree-component/commit/5ded257)) +* move library to projects and use ng-packagr for build ([a04ea64](https://github.com/CirclonGroup/angular-tree-component/commit/a04ea64)) + +### BREAKING CHANGES + +* Provide TreeDraggedElement in root ([50dee1b](https://github.com/CirclonGroup/angular-tree-component/commit/50dee1b)) + +BEFORE: + +Import TreeModule with `TreeModule.forRoot()` in base module. + +``` +@NgModule({ + imports: [ + TreeModule.forRoot() + ] +}) +export class MyModule {} +``` + +AFTER: + +Import TreeModule with `TreeModule` in all modules. + +``` +@NgModule({ + imports: [ + TreeModule + ] +}) +export class MyModule {} +``` + + +# 8.5.6 (2020-14-02) +* Fixed mobxAutorun to treeMobxAutorun + + +# 8.5.5 (2020-14-02) +* Support Angular 9 by removing dependency to mobx-angular (copied code inside) + + +# 8.5.4 (2020-12-02) +* Support Angular 9 by upgrading mobx-angular to 3.1.1 + + +# 8.5.2 (2019-03-12) +* Fixed computed value after updating model, because parent was null and we got a race-condition + + +# 8.5.1 (2019-07-11) +* Changed options input to ITreeOptions + + +# 8.5.0 (2019-06-11) +* Support IVY by removing transitive dependency on Renderer via mobx-angular + + +# 8.4.1 (2019-01-10) +* Exporting TreeNodeWrapperComponent and TreeAnimateOpenDirective from main module +* Added openCollective message post install + + +# 8.4.0 (2019-19-05) +* Added 'from' node on moveNode event + + +# 8.3.0 (2019-22-02) +* Extended selection-api for nodes +* Setting option scrollOnActivate to true did not prevent scrolling when clicking a node + + +# 8.2.1 (2019-21-02) +* Moved @types/lodash to devDeps + + +# 8.2.0 (2018-29-12) +* Added allowDragoverStyling option + + +# 8.1.0 (2018-25-12) +* Added public calculateExpandedNodes +* Fixed loading async children in large tree + + +# 8.0.5 (2018-25-12) +* Fixed non triState checkboxes to reflect expected behaviour + + +# 8.0.4 (2018-22-12) +* Fixed non triState checkboxes +* Fixed checkboxes example to switch expander and checkbox + + +# 8.0.3 (2018-20-12) +* Fixed Warning on state bind + + +# 8.0.2 (2018-11-12) +* Checkbox keep parent selection on async childs + + +# 8.0.1 (2018-04-12) +* Unsubscribe to prevent memory leaks + + +# 8.0.0 (2018-04-08) +* Breaking change - Upgrade to Angular6 and Renderer2 +* Breaking change - load TreeDraggedElement in forRoot to support lazy loading + + +# 7.2.1 (2018-21-06) +* remove _canMoveNode validation from the copyNode function, fix #608 - PR #609 +* Add event parameter to onScroll, fix #534 #537 - PR #537 +* Optimize onChanges update, fix #534 #537 - PR #537 +* Fixed example with Angular6 +* Moved @lodash/types from devDependency to dependency + + +# 7.2.0 (2018-14-05) +* Added nodeActivate and nodeDeactivate events for IE11 - issue #387 +* Added scrollContainer option to allow scrolling in external container - issue #92 + # 7.1.0 (2018-24-03) * Breaking change - Renamed SELECT action to ACTIVATE diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..114f2b8a --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at os-group@circlon.de. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..f8824a0f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,147 @@ +# How to contribute + +Thank you for reading this, we always welcome help make this project even better! Without the help from our contributors this project would not be possible. + +## Code of Conduct +Please read and follow our [Code of Conduct][coc]. + +## Setup + +Run `npm install` to install dependencies. + +Run `npm run build:lib` to build. + +Run `npm run start:example-app` to start the example app. + +### Testing + +Run `npm install` to install dependencies. + +Run `npm run build:lib` to build. + +Run `npm run test:ci:local` to test the same way the build validation will test. + +## Submission Guidelines + +### Submitting a feature request + +You can open an issue and request a new feature. Please add some information on what you would like, how it should work. Small features can be added directly as a Pull Request without opening an issue first. + +### Submitting a bug report + +Search through other issues to see if there is already a previous issue for the bug. Provide a small reproduction using a StackBlitz project or a GitHub repo. + +### Submitting a Pull Request + +- Please test your code by running the tests. +- Rebase your branch against the current master. We might ask you to rebase again once your branch is out of date. +- If you add new functionality please also add tests to validate this. +- Reference issues as a PR comment. +- Follow our code guidelines. + +## Commit Message Guidelines + +We have very precise rules over how our git commit messages can be formatted. This leads to **more +readable messages** that are easy to follow when looking through the **project history**. But also, +we use the git commit messages to **generate the Angular Tree Component change log**. + +### Commit Message Format + +Each commit message consists of a **header**, a **body** and a **footer**. The header has a special +format that includes a **type**, a **scope**, and a **subject**: + +``` +(): + + + +