jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.54k stars 4.02k forks source link

Angular: Quick Filter buttons are not generated anymore #26356

Closed OmarHawk closed 4 months ago

OmarHawk commented 4 months ago
Overview of the issue

Until at least version 8.1.0, buttons for filtering the other side of the entity were generated (initial feature: #18370). This is at least in 8.5.0 not the case anymore, as the corresponding relationships are already filtered out beforehand, so the links are not generated anymore.

Motivation for or Use Case

Feature worked before and kind of all of the of the code for that is still in there.

Reproduce the error
  1. Have an application with a ManyToOne / OneToMany /ManyToMany relationship using Angular as frontend.
  2. Generate application
  3. Expect buttons in the list view pointing from one Entity to the filtered list of the other. (see #18370)
  4. Miss out these buttons
Related issues

Changes in #25140 are causing this, I think. Previously, the list of relationships passed to the client generator were unfiltered apart from the skipClient flag.

Suggest a Fix

get rid of the persistable/eagerload filtering here. Don't know, what effect this has elsewhere, should be tested - or only be changed for the Angular client in doubt: https://github.com/jhipster/generator-jhipster/blob/eee53c5b07512aaa09d09233476a51da47d9f323/generators/client/support/filter-entities.ts#L25-L29

by the way, the parts in the html of the Angular client are still there though and there you can also see the the contradictionary conditions:

https://github.com/jhipster/generator-jhipster/blob/eee53c5b07512aaa09d09233476a51da47d9f323/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.html.ejs#L178-L191

&& !persistableRelationship (Angular code) vs. persistableRelationship (filter-entities.ts)

JHipster Version(s)

8.5.0

JHipster configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
OmarHawk commented 4 months ago

I've tried my suggestion locally against my application and it indeed does fix this particular part of the generation.