-
Notifications
You must be signed in to change notification settings - Fork 1
create case #46
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: dev
Are you sure you want to change the base?
create case #46
Conversation
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.
Pull Request Overview
This PR separates case creation and editing into distinct views by introducing a dedicated editcase.jsp page. The refactoring simplifies the usercase.jsp to handle only case creation, while editcase.jsp manages case editing with pre-populated values. Additionally, the PR adds processing status tracking to cases with UI support for starting and monitoring processing jobs.
- Separated case creation (
usercase.jsp) and editing (editcase.jsp) into distinct views - Added
ProcessingStatusenum and processing workflow withProcessingController - Updated case listing to display processing status with action buttons
- Refactored
CaseControllerto route between create/edit views and simplified save logic
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/webapp/template/usercase.jsp | Simplified to handle only case creation with basic form fields |
| src/main/webapp/template/editcase.jsp | New file for editing existing cases with pre-populated values |
| src/main/webapp/template/listcases.jsp | Added status column and processing action buttons |
| src/main/webapp/css/styles.css | Added secondary action button styling |
| src/main/resources/tiles.xml | Registered editcase view definition |
| src/main/resources/paContext.xml | Registered ProcessingController bean and URL mapping |
| src/main/java/org/freeeed/search/web/model/ProcessingStatus.java | New enum for case processing states |
| src/main/java/org/freeeed/search/web/model/Case.java | Added status field to Case model |
| src/main/java/org/freeeed/search/web/controller/ProcessingController.java | New controller for handling case processing actions |
| src/main/java/org/freeeed/search/web/controller/CaseController.java | Refactored to route to create/edit views and simplified case save logic |
| src/main/java/org/freeeed/search/web/WebConstants.java | Renamed constant from EDIT_PROJECT_PAGE to EDIT_CASE_PAGE |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </span> | ||
| </td> | ||
| </tr> | ||
| <td><textarea class="form-control" name="description" placeholder="Project Descrition"></textarea></td> |
Copilot
AI
Oct 29, 2025
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.
Corrected spelling of 'Descrition' to 'Description'.
| <td><textarea class="form-control" name="description" placeholder="Project Descrition"></textarea></td> | |
| <td><textarea class="form-control" name="description" placeholder="Project Description"></textarea></td> |
| function disableButton(id) { | ||
| var button = document.getElementById('processButton' + id); | ||
| button.disabled = true; | ||
| button.innerText = 'Cancel Processing'; | ||
| } |
Copilot
AI
Oct 29, 2025
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 function disableButton is defined but never called in this file or the diff. If this function is unused, consider removing it to avoid dead code.
| function disableButton(id) { | |
| var button = document.getElementById('processButton' + id); | |
| button.disabled = true; | |
| button.innerText = 'Cancel Processing'; | |
| } |
| Long caseId = Long.parseLong(caseIdStr); | ||
| c = caseDao.findCase(caseId); | ||
| } |
Copilot
AI
Oct 29, 2025
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.
Potential uncaught 'java.lang.NumberFormatException'.
| Long caseId = Long.parseLong(caseIdStr); | |
| c = caseDao.findCase(caseId); | |
| } | |
| try { | |
| Long caseId = Long.parseLong(caseIdStr); | |
| c = caseDao.findCase(caseId); | |
| } catch (NumberFormatException e) { | |
| errors.add("Invalid case ID format"); | |
| c = new Case(); | |
| } |
| if (caseIdStr == null) { | ||
| c = new Case(); | ||
| } else { | ||
| Long caseId = Long.parseLong(caseIdStr); |
Copilot
AI
Oct 29, 2025
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 variable 'caseId' is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Long'.
| if ("process".equals(action)) { | ||
| try { | ||
| String caseIdStr = (String) valueStack.get("id"); | ||
| Long caseId = Long.parseLong(caseIdStr); |
Copilot
AI
Oct 29, 2025
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 variable 'caseId' is only assigned values of primitive type and is never 'null', but it is declared with the boxed type 'Long'.
| Long caseId = Long.parseLong(caseIdStr); | |
| long caseId = Long.parseLong(caseIdStr); |
Due to browser security we can not allow users choosing the complete path but we are capturing the file and folder name.
In this PR I also removed the edit functionality.