Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion efile_app/efile/api/dropdown_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def _prioritize_courts_by_location(courts, guessed_court="", user_zip=None, user
return courts

# Determine user county from zip code if provided
target_county = user_county
target_county = user_county or guessed_court
if user_zip and not target_county:
target_county = get_county_by_zip(user_zip)

Expand Down
2 changes: 1 addition & 1 deletion efile_app/efile/api/suffolk_api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def lookup_case(request):
api_url = f"{settings.EFSP_URL}/jurisdictions/{state}/codes/courts/{court}/case_types/{case_info['caseTypeCode']}"
case_resp = requests.get(api_url, headers=headers, timeout=30)
if case_resp.ok:
data = category_resp.json()
data = case_resp.json()
case_info["caseTypeName"] = data["name"]
break
else:
Expand Down
13 changes: 13 additions & 0 deletions efile_app/efile/migrations/0004_filingdraft_case_title.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [("efile", "0003_branch_aware_workflow")]

operations = [
migrations.AddField(
model_name="filingdraft",
name="case_title",
field=models.CharField(blank=True, max_length=500),
),
]
1 change: 1 addition & 0 deletions efile_app/efile/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class Status(models.TextChoices):

previous_case_id = models.CharField(max_length=255, blank=True)
docket_number = models.CharField(max_length=255, blank=True)
case_title = models.CharField(max_length=500, blank=True)

selected_payment_account_id = models.CharField(max_length=255, blank=True)
selected_payment_account_name = models.CharField(max_length=255, blank=True)
Expand Down
3 changes: 3 additions & 0 deletions efile_app/efile/services/drafts.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def set_current_step(draft: FilingDraft, current_step: WorkflowStepKey | str) ->
"existing_case": ("existing_case",),
"previous_case_id": ("case_tracking_id", "previous_case_id"),
"docket_number": ("case_docket_id", "case_number", "docket_number"),
"case_title": ("case_title", "case_title_text"),
"selected_payment_account_id": ("selected_payment_account", "payment_account_id"),
"selected_payment_account_name": ("selected_payment_account_name",),
"name_change_reason": ("reason_for_name_change", "reason_for_change"),
Expand Down Expand Up @@ -268,6 +269,7 @@ def read_case_data(draft: FilingDraft | None) -> dict[str, Any]:
_put(data, "document_type_name", draft.document_type_name)
_put(data, "previous_case_id", draft.previous_case_id)
_put(data, "docket_number", draft.docket_number)
_put(data, "case_title", draft.case_title)
_put(data, "selected_payment_account", draft.selected_payment_account_id)
_put(data, "selected_payment_account_name", draft.selected_payment_account_name)
_put(data, "optional_services", list(draft.optional_services or []))
Expand Down Expand Up @@ -497,6 +499,7 @@ def draft_snapshot(draft: FilingDraft | None) -> dict[str, Any] | None:
"document_type_name": draft.document_type_name,
"previous_case_id": draft.previous_case_id,
"docket_number": draft.docket_number,
"case_title": draft.case_title,
"selected_payment_account_id": draft.selected_payment_account_id,
"selected_payment_account_name": draft.selected_payment_account_name,
"optional_services": draft.optional_services,
Expand Down
110 changes: 110 additions & 0 deletions efile_app/efile/static/css/reorganized-flow.css
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,108 @@
margin: 0.35rem 0 0;
}

.lookup-fields {
display: grid;
gap: 1.25rem;
}

.lookup-state {
align-items: center;
background: #eef5ff;
border-radius: 10px;
color: #234d84;
display: flex;
gap: 0.8rem;
margin-top: 1rem;
padding: 1rem;
}

.lookup-state strong,
.lookup-state small {
display: block;
}

.lookup-state small {
color: #61748f;
}

.found-heading {
align-items: flex-start;
display: flex;
gap: 1rem;
}

.found-heading__icon {
align-items: center;
background: #e2f5e9;
border-radius: 50%;
color: #18733d;
display: flex;
flex: 0 0 auto;
height: 46px;
justify-content: center;
margin-top: 0.25rem;
width: 46px;
}

.case-summary {
border: 1px solid #dce3ec;
border-radius: 12px;
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
margin: 0;
overflow: hidden;
}

.case-summary>div {
border-top: 1px solid #e3e8ef;
padding: 1rem 1.2rem;
}

.case-summary>div:nth-child(even):not(.case-summary__primary) {
border-left: 1px solid #e3e8ef;
}

.case-summary__primary {
background: #f6f9fd;
border-top: 0 !important;
grid-column: 1 / -1;
}

.case-summary dt {
color: #6b788c;
font-size: 0.78rem;
font-weight: 700;
letter-spacing: 0.04em;
margin-bottom: 0.2rem;
text-transform: uppercase;
}

.case-summary dd {
color: #1c314d;
font-size: 1rem;
font-weight: 650;
margin: 0;
}

.case-summary__primary dd {
font-size: 1.2rem;
}

.confirmation-question {
margin-top: 1.5rem;
}

.confirmation-question strong {
color: #263c58;
font-size: 1.05rem;
}

.confirmation-question p {
color: #69768a;
margin: 0.25rem 0 0;
}

@media (max-width: 700px) {
.review-grid {
grid-template-columns: 1fr;
Expand All @@ -428,6 +530,14 @@
grid-template-columns: auto 1fr auto;
}

.case-summary {
grid-template-columns: 1fr;
}

.case-summary>div:nth-child(even):not(.case-summary__primary) {
border-left: 0;
}

.status-pill {
grid-column: 2;
}
Expand Down
86 changes: 86 additions & 0 deletions efile_app/efile/static/js/case-lookup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
(function() {
const form = document.getElementById("case-lookup-form");
if (!form) return;

const courtSelect = document.getElementById("court");
const caseNumber = document.getElementById("case-number");
const state = document.getElementById("lookup-state");
const errorBox = document.getElementById("lookup-error");
const submitButton = document.getElementById("find-case-button");
const guessedCourt = JSON.parse(document.getElementById("guessed-court").textContent || '""');
const selectedCourtCode = JSON.parse(document.getElementById("selected-court-code").textContent || '""');

async function loadCourts() {
try {
const response = await apiUtils.fetchJSON("/api/dropdowns/courts/", "GET", {
jurisdiction: apiUtils.getCurrentJurisdiction(),
guessed_court: guessedCourt,
});
if (!response.success) throw new Error(response.error || "Could not load courts.");
courtSelect.innerHTML = '<option value="">Choose a court</option>';
response.data.forEach((court) => {
const option = document.createElement("option");
option.value = court.value;
option.textContent = court.text;
if (court.value === selectedCourtCode || (!selectedCourtCode && (court.selected || court.default))) {
option.selected = true;
}
courtSelect.appendChild(option);
});
} catch (error) {
courtSelect.innerHTML = '<option value="">Courts could not be loaded</option>';
errorBox.textContent = error.message;
errorBox.hidden = false;
}
}

form.addEventListener("submit", async (event) => {
event.preventDefault();
errorBox.hidden = true;
state.hidden = false;
submitButton.disabled = true;

try {
const jurisdiction = apiUtils.getCurrentJurisdiction();
const lookup = await apiUtils.fetchJSON("/api/suffolk/lookup-case/", "GET", {
court: courtSelect.value,
caseNumber: caseNumber.value.trim(),
jurisdiction,
});
if (!lookup.success || !lookup.caseInfo?.caseTrackingID) {
throw new Error(lookup.error || "We could not find a matching case. Check the court and case number.");
}

const selectedCourt = courtSelect.selectedOptions[0];
const caseInfo = lookup.caseInfo;
const saveResponse = await fetch(window.location.href, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-CSRFToken": apiUtils.getCSRFToken(),
},
body: JSON.stringify({
court: courtSelect.value,
court_name: selectedCourt?.textContent?.replace(" (Recommended)", "") || "",
case_tracking_id: caseInfo.caseTrackingID,
case_docket_id: caseInfo.caseDocketID || caseNumber.value.trim(),
case_title: caseInfo.caseTitle || "",
case_category_code: caseInfo.caseCategoryCode || "",
case_category_name: caseInfo.caseCategoryName || "",
case_type_code: caseInfo.caseTypeCode || "",
case_type_name: caseInfo.caseTypeName || "",
}),
});
const saved = await saveResponse.json();
if (!saveResponse.ok || !saved.success) throw new Error(saved.error || "Could not save the case.");
window.location.href = saved.redirect_url;
} catch (error) {
errorBox.textContent = error.message;
errorBox.hidden = false;
state.hidden = true;
submitButton.disabled = false;
}
});

loadCourts();
})();
83 changes: 83 additions & 0 deletions efile_app/efile/templates/efile/case_confirmation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{% extends "efile/workflow_base.html" %}
{% load i18n %}
{% block title %}
{% translate "Confirm your court case" %}
{% endblock title %}
{% block workflow_content %}
<section class="workflow-card workflow-card--narrow">
<div class="workflow-eyebrow">{% translate "Confirm case" %}</div>
<div class="found-heading">
<span class="found-heading__icon"><i class="fa-solid fa-check"></i></span>
<div>
<h1>{% translate "Is this your court case?" %}</h1>
<p class="workflow-lede">{% translate "Check the details before adding this filing to the case." %}</p>
</div>
</div>
<dl class="case-summary">
<div class="case-summary__primary">
<dt>{% translate "Case name" %}</dt>
<dd>
{% if case.case_title %}
{{ case.case_title }}
{% else %}
{% translate "Case title not available" %}
{% endif %}
</dd>
Comment thread
Copilot marked this conversation as resolved.
</div>
<div>
<dt>{% translate "Case number" %}</dt>
<dd>
{{ case.docket_number }}
</dd>
</div>
<div>
<dt>{% translate "Court" %}</dt>
<dd>
{{ case.court_name|default:case.court_code }}
</dd>
</div>
<div>
<dt>{% translate "Case category" %}</dt>
<dd>
{% if case.case_category_name %}
{{ case.case_category_name }}
{% elif case.case_category_code %}
{{ case.case_category_code }}
{% else %}
{% translate "Not available" %}
{% endif %}
</dd>
</div>
Comment thread
Copilot marked this conversation as resolved.
<div>
<dt>{% translate "Case type" %}</dt>
<dd>
{% if case.case_type_name %}
{{ case.case_type_name }}
{% elif case.case_type_code %}
{{ case.case_type_code }}
{% else %}
{% translate "Not available" %}
{% endif %}
</dd>
</div>
</dl>
<form method="post">
{% csrf_token %}
<div class="confirmation-question">
<strong>{% translate "Does this match your case?" %}</strong>
<p>{% translate "Choosing Yes will attach your documents to this case." %}</p>
</div>
<div class="workflow-actions workflow-actions--confirmation">
<button class="btn btn-outline-secondary"
type="submit"
name="confirmed"
value="no">
<i class="fa-solid fa-arrow-left"></i> {% translate "No, search again" %}
</button>
<button class="btn btn-primary" type="submit" name="confirmed" value="yes">
{% translate "Yes, this is my case" %} <i class="fa-solid fa-arrow-right"></i>
</button>
</div>
</form>
</section>
{% endblock workflow_content %}
Loading