-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add Fusion views (part 1) #1
Conversation
Commit some files generated by vaadin-maven-plugin.
…ion and Thymeleaf
Update main-layout.ts to have the navigation menu at the top instead of on the side. Based on top menu option in start.vaadin.com.
Add custom index.html for Fusion based on the layout.html used by the Thymeleaf based views.
Add header and image to the Fusion Home page.
Fix icon-font-path to bootstrap fonts.
Use @JsonIdentityInfo in Owner and Pet classes to prevent Stackoverflow exception when fetching owner data via Fusion endpoint (owner and pet reference each other).
Add FindOwnersView, OwnerDetailsView and OwnersListView. OwnerDetailsView is still WIP.
This prevents "Already had POJO for id" errors when trying to modify/save Owner (via Fusion endpoint) which has a reference to pets.
Add names for routes and use `router.urlForName()` instead of `router.urlForPath()` to simplify getting URLs for to routes. Add routes for edit-owner, add-pet, edit-pet and add-visit views (not yet implemented).
Just using a basic template based on the original Thymeleaf template for now without added styles.
frontend/views/vets-view.ts
Outdated
|
||
constructor() { | ||
super(); | ||
VetEndpoint.list().then( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The endpoint calls are a bit inconsistent: some are in connectedCallbacks, some in firstUpdated, some in the constructor. Would be good to have them consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess connectedCallback
would be a good default (when immediately loading data) unless there's a good reason to use something else in a specific case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use connectedCallback()
for all other similar cases except for one in owners-list-view.ts
where we need onBeforeEnter()
to be able to use a router redirect in one case.
Add error handling to CreateOrUpdateOwnerView.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
frontend/views/vets-view.ts
Outdated
|
||
constructor() { | ||
super(); | ||
VetEndpoint.list().then( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
src/main/java/org/springframework/samples/petclinic/owner/OwnerEndpoint.java
Outdated
Show resolved
Hide resolved
- Get rid of unnecessary processing of `router.location` here. The initial value for the last name comes via attribute when needed (from `OwnersListView`). - Use a change event listener to update a `lastName` property for reactive programming approach instead of using a `Ref` to get the value in `findOwner()`. - Only add the `lastName` search parameter to the `targetUrl` when `lastName` is not empty (cleaner URL after navigation in this case).
@marcushellberg I pushed couple of last updates that I didn't have time to finish yesterday. Now all of your comments should have been handled. Could you please review the new changes and check the couple of unresolved conversations above? I think this is starting to be ready to merge (then I'll do a new PR for the couple of views that still need to be implemented). |
Description
Add some initial Fusion views. The new views are still WIP but working/usable.