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

[angular] Reduce event manager importance and usage #13111

Merged
merged 3 commits into from
Nov 21, 2020

Conversation

kaidohallik
Copy link
Contributor

This is follow up to #13096 - after thinking deeper about event manager and using ideas from #13073.

As there is not possible to apply strict type checking if using event manager then this usage should not be encouraged. So moved this to util subfolder instead of separate folder and put model to the same file where is service to reduce event manager visibility and importance.
Added also strict types instead of any to event manager. Now consumers must do type cast - so if they use event manager they take a conscious risk.
Added block "unreleased files and folders cleanup for v7 developers" to cleanup to delete files if developers regenerate with newer version in v7 development cycle.

This PR has 3 commits:

  • move event manager to new location
  • remove event manager from user delete (also simplifies user delete and list components)
  • remove event manager from entity delete (also simplifies entity delete and list components)

@DanielFran : last commit in this PR is related to your PR #13073 - it basically implements suggestion from #13073 (comment), if you disagree with last commit and want to do changes yourself then I can drop last commit and let this to you.


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (bellow reviewers) and adding skip-ci label, you can still see CI build result at your branch.

As there is not possible to apply strict type checking if using event manager then this usage should not be encouraged. So moved this to util subfolder instead of separate folder and put model to the same file where is service to reduce event manager visibility and importance.
Added also strict types instead of any to event manager. Now consumers must do type cast - so if they use event manager they take a conscious risk.
Added block "unreleased files and folders cleanup for v7 developers" to cleanup to delete files if developers regenerate with newer version in v7 development cycle.
@DanielFran
Copy link
Member

@kaidohallik no problem, will close the other PR.

Copy link
Member

@mshima mshima left a comment

Choose a reason for hiding this comment

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

LGTM

import { <%_ if (pagination !== 'no') { _%>HttpHeaders, <% } %>HttpResponse } from '@angular/common/http';
<%_ if (pagination === 'pagination') { _%>
import { ActivatedRoute, Router } from '@angular/router';
import { combineLatest } from 'rxjs';
Copy link
Contributor

Choose a reason for hiding this comment

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

this import seems unused

Copy link
Member

Choose a reason for hiding this comment

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

Looks right. Wondering why eslint didn’t complained.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is used in pagination-template, so this import is needed and is under right condition.
This is migrated from deleted row below.

Copy link
Contributor

Choose a reason for hiding this comment

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

indeed ;)

Copy link
Member

@DanielFran DanielFran left a comment

Choose a reason for hiding this comment

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

LGTM

@DanielFran DanielFran merged commit 401e467 into jhipster:main Nov 21, 2020
@kaidohallik kaidohallik deleted the reduce-event-manager branch November 21, 2020 18:09
@pascalgrimaud pascalgrimaud added this to the 7.0.0-beta.0 milestone Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants