-
Notifications
You must be signed in to change notification settings - Fork 0
"Show Next Dates" fixes #23
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
base: master
Are you sure you want to change the base?
Conversation
WalkthroughRefactors next-date generation to use a single CronExpression instance and direct item setting; removes a helper and a theme variant; changes grid height to 108px; and makes the vaadin-grid header visible by removing the CSS rule that hid it. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related issues
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/main/java/com/flowingcode/vaadin/addons/cronexpressionfield/CronExpressionField.java (2)
440-440: Consider the impact of fixed pixel height.The grid height was changed from a responsive "30%" to a fixed "108px". While this may be intentional to accommodate a specific number of rows plus the now-visible header, it reduces flexibility across different screen sizes and viewport heights.
437-441: Add validation before parsing the cron expression.The method checks if the input is not empty but doesn't validate that it's a valid cron expression before attempting to parse it in
generateNextDate(). If an invalid expression somehow reaches this point,CronExpression.parse()will throw an exception.Apply this diff to add validation:
private void showNextDates() { - if (!inputExpressionTf.getValue().isEmpty()) { + if (!inputExpressionTf.getValue().isEmpty() && validateCron(inputExpressionTf.getValue())) { grid.removeAllColumns(); grid.addColumn(date -> formatDate(date)); grid.setHeight("108px"); grid.setItems(q -> generateNextDate(LocalDateTime.now(), q.getOffset(), q.getLimit())); add(grid); } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/java/com/flowingcode/vaadin/addons/cronexpressionfield/CronExpressionField.java(1 hunks)src/main/resources/META-INF/frontend/styles/cron-expression-field-styles.css(0 hunks)
💤 Files with no reviewable changes (1)
- src/main/resources/META-INF/frontend/styles/cron-expression-field-styles.css
src/main/java/com/flowingcode/vaadin/addons/cronexpressionfield/CronExpressionField.java
Outdated
Show resolved
Hide resolved
721cdfb to
5872092
Compare
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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/main/java/com/flowingcode/vaadin/addons/cronexpressionfield/CronExpressionField.java (1)
440-440: Consider using relative height units for better responsiveness.The hard-coded
108pxheight may not adapt well to different screen sizes or user preferences. Consider using a relative unit like"10em"or keeping the percentage-based approach.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/java/com/flowingcode/vaadin/addons/cronexpressionfield/CronExpressionField.java(1 hunks)src/main/resources/META-INF/frontend/styles/cron-expression-field-styles.css(0 hunks)
💤 Files with no reviewable changes (1)
- src/main/resources/META-INF/frontend/styles/cron-expression-field-styles.css
🔇 Additional comments (1)
src/main/java/com/flowingcode/vaadin/addons/cronexpressionfield/CronExpressionField.java (1)
441-441: LGTM: Cleaner data provider approach.The direct lambda-based
setItemsapproach is more concise and readable than the previousDataProvider.fromCallbackspattern.
src/main/java/com/flowingcode/vaadin/addons/cronexpressionfield/CronExpressionField.java
Show resolved
Hide resolved
src/main/java/com/flowingcode/vaadin/addons/cronexpressionfield/CronExpressionField.java
Outdated
Show resolved
Hide resolved
Performance upgrade. Part of #22.
5872092 to
3f4196a
Compare
Fixes for #19, #20, #21 & #22
Summary by CodeRabbit
Style
Refactor