Fixed Query by example adding and editing broken#636
Merged
yingbull merged 3 commits intoSep 26, 2025
Conversation
…button not opening the correct edit page to add the edits before favoriting, fixed the edit button not doing anything when clicked, fixed the delete reseting the page when clicked
Reviewer's guide (collapsed on small PRs)Reviewer's GuideCorrects multi-add and edit redirects for query favorites by refactoring action logic and cleans up the JSP by removing redundant scripts, standardizing form submission, and pre-filling date inputs. Class diagram for updated RptByExamplesFavorite2Action logicclassDiagram
class RptByExamplesFavorite2Action {
-String providerNo
-String newQuery
-String newName
-String favoriteName
-String query
-String toDelete
-String id
+String execute()
+void deleteQuery(String id)
+void write2Database(String providerNo, String favoriteName, String queryWithEscapeChar)
}
class ReportByExamplesFavoriteDao {
+List<ReportByExamplesFavorite> findByQuery(String query)
}
class RptByExampleQueryBeanHandler {
+RptByExampleQueryBeanHandler(String providerNo)
}
RptByExamplesFavorite2Action --> ReportByExamplesFavoriteDao
RptByExamplesFavorite2Action --> RptByExampleQueryBeanHandler
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
There was a problem hiding this comment.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/main/webapp/oscarReport/RptViewAllQueryByExamples.jsp:106` </location>
<code_context>
<input type="button"
value="<fmt:setBundle basename="oscarResources"/><fmt:message key="oscarReport.RptByExample.MsgAddToFavorite"/>"
- onclick="set('<c:out value="${escapedQuery}" escapeXml="true"/>'); submitFavouriteForm();" />
+ onclick="set('<c:out value="${escapedQuery}" escapeXml="true"/>'); submit();" />
</tr>
</c:forEach>
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Using submit() directly may cause issues if the button is not inside a form.
Make sure submit() is called on the intended form element to avoid issues, especially if multiple forms exist or the button is outside a form.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
yingbull
approved these changes
Sep 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Query by example in the administration page had broken adding functionality (adding a new query favourite was only allowed once, after that it was overwritten), as well as it didn't lead to the edit page after adding. And the editing functionality didn't lead to the correct page for editing.
I also looked into making the code a bit simpler without breaking anything for better readability
Summary by Sourcery
Fix broken add and edit flows for query favorites and streamline related code and JSP
Bug Fixes:
Enhancements: