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

feat: add customizable form header to auto crud #1930

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

sissbruecker
Copy link
Contributor

@sissbruecker sissbruecker commented Dec 22, 2023

Adds a customizable header above the form in AutoCrud. By default it shows New item and Create item depending on whether a new item is created or an existing one edited. It's also possible to customize the header by providing a function that renders a custom JSX element based on the edited item and the disabled state of the form. The header is part of the AutoCrud for now instead of the AutoForm. Otherwise it would have been a challenge to move it into the header of the dialog that shows up on smaller screens.

Disabled:

Bildschirmfoto 2023-12-22 um 09 33 18

Editing:

Bildschirmfoto 2023-12-22 um 09 33 25

Creating:

Bildschirmfoto 2023-12-22 um 09 33 32

Fixes: #1664

Copy link

codecov bot commented Dec 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9d96e4a) 95.24% compared to head (193f41e) 95.25%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1930   +/-   ##
=======================================
  Coverage   95.24%   95.25%           
=======================================
  Files          52       52           
  Lines        3469     3474    +5     
  Branches      514      519    +5     
=======================================
+ Hits         3304     3309    +5     
  Misses        134      134           
  Partials       31       31           
Flag Coverage Δ
unittests 95.25% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Jan 3, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@taefi taefi merged commit 0d289d1 into main Jan 3, 2024
15 checks passed
@taefi taefi deleted the feat/auto-crud-form-header branch January 3, 2024 10:24
krissvaa added a commit that referenced this pull request Jan 3, 2024
krissvaa added a commit that referenced this pull request Jan 3, 2024
taefi pushed a commit that referenced this pull request Jan 3, 2024
Export type for AutoCrudForm headerRender

follow up for #1930
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Hilla 24.4.0.alpha1 and is also targeting the upcoming stable 24.4.0 version.

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.

[autocrud] Show header above form
3 participants