Skip to content

Commit

Permalink
JASPER-124: Enhancements to Court File Search (#30)
Browse files Browse the repository at this point in the history
* - allow fileHomeAgencyId as blank
- Refactor layout to follow Wireframes
- Added missing behaviors from identified during demo/feedback.

* - Break "Civil" to "Family" and "Small Claims"
- Allow to get non supreme Criminal and Civil Case Details
- Implement Add Files and Add File and View buttons (WIP)
- Added Files to View section

* - Changes to save selected case files to Vuex Store
- Updates to Criminal Case Details to make it reloadable when other case detail is selected

* - Added searchCriteria and searchResuts in state
- Integrate Civil Case Details with Court File Search
- Implement Add Files and Remove

* Finalized Court File Search

* Revert changes to search by id of criminal/civil file

* Resolved SonarCloud issues.

* Addressed sonar cloud issues

* Refactor to reduce duplicate code which addresses SonarCloud findings.

* Removed unused import to resolve sonar cloud findings.

---------

Co-authored-by: Ronaldo Macapobre <[email protected]>
  • Loading branch information
ronaldo-macapobre and Ronaldo Macapobre authored Oct 3, 2024
1 parent 1ab9510 commit 7d6ff1b
Show file tree
Hide file tree
Showing 12 changed files with 667 additions and 250 deletions.
42 changes: 21 additions & 21 deletions jc-interface-client/Clients/FileServicesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace JCCommon.Clients.FileServices
using System = global::System;

[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")]
public partial class FileServicesClient
public partial class FileServicesClient
{
private System.Net.Http.HttpClient _httpClient;
private System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings;
Expand Down Expand Up @@ -476,10 +476,10 @@ public virtual async System.Threading.Tasks.Task<FileResponse> FilesDocumentAsyn
if (applicationCd == null)
throw new System.ArgumentNullException("applicationCd");
request_.Headers.TryAddWithoutValidation("applicationCd", ConvertToString(applicationCd, System.Globalization.CultureInfo.InvariantCulture));

if (correlationId != null)
request_.Headers.TryAddWithoutValidation("correlationId", ConvertToString(correlationId, System.Globalization.CultureInfo.InvariantCulture));

request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/octet-stream"));

Expand All @@ -506,19 +506,19 @@ public virtual async System.Threading.Tasks.Task<FileResponse> FilesDocumentAsyn
var status_ = (int)response_.StatusCode;
if (status_ == 400)
{
string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
string responseText_ = (response_.Content == null) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("Bad request.", status_, responseText_, headers_, null);
}
else
if (status_ == 404)
{
string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
string responseText_ = (response_.Content == null) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("Document was not found.", status_, responseText_, headers_, null);
}
else
if (status_ == 500)
{
string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
string responseText_ = (response_.Content == null) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("Unexpected error.", status_, responseText_, headers_, null);
}
else
Expand Down Expand Up @@ -574,16 +574,16 @@ public virtual async System.Threading.Tasks.Task<FileSearchResponse> FilesCrimin
if (searchMode == null)
throw new System.ArgumentNullException("searchMode");

if (fileHomeAgencyId == null)
throw new System.ArgumentNullException("fileHomeAgencyId");

if (filePermissions == null)
throw new System.ArgumentNullException("filePermissions");

var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append("files/criminal?");
urlBuilder_.Append(System.Uri.EscapeDataString("searchMode") + "=").Append(System.Uri.EscapeDataString(ConvertToString(searchMode, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
urlBuilder_.Append(System.Uri.EscapeDataString("fileHomeAgencyId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(fileHomeAgencyId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
if (fileHomeAgencyId != null)
{
urlBuilder_.Append(System.Uri.EscapeDataString("fileHomeAgencyId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(fileHomeAgencyId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
if (fileNumberTxt != null)
{
urlBuilder_.Append(System.Uri.EscapeDataString("fileNumberTxt") + "=").Append(System.Uri.EscapeDataString(ConvertToString(fileNumberTxt, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
Expand Down Expand Up @@ -1312,16 +1312,16 @@ public virtual async System.Threading.Tasks.Task<FileSearchResponse> FilesCivilG
if (searchMode == null)
throw new System.ArgumentNullException("searchMode");

if (fileHomeAgencyId == null)
throw new System.ArgumentNullException("fileHomeAgencyId");

if (filePermissions == null)
throw new System.ArgumentNullException("filePermissions");

var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append("files/civil?");
urlBuilder_.Append(System.Uri.EscapeDataString("searchMode") + "=").Append(System.Uri.EscapeDataString(ConvertToString(searchMode, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
urlBuilder_.Append(System.Uri.EscapeDataString("fileHomeAgencyId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(fileHomeAgencyId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
if (fileHomeAgencyId != null)
{
urlBuilder_.Append(System.Uri.EscapeDataString("fileHomeAgencyId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(fileHomeAgencyId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
if (fileNumberTxt != null)
{
urlBuilder_.Append(System.Uri.EscapeDataString("fileNumberTxt") + "=").Append(System.Uri.EscapeDataString(ConvertToString(fileNumberTxt, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
Expand Down Expand Up @@ -2207,7 +2207,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu
var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name);
if (field != null)
{
var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute))
var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute))
as System.Runtime.Serialization.EnumMemberAttribute;
if (attribute != null)
{
Expand All @@ -2219,17 +2219,17 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu
return converted == null ? string.Empty : converted;
}
}
else if (value is bool)
else if (value is bool)
{
return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant();
}
else if (value is byte[])
{
return System.Convert.ToBase64String((byte[]) value);
return System.Convert.ToBase64String((byte[])value);
}
else if (value.GetType().IsArray)
{
var array = System.Linq.Enumerable.OfType<object>((System.Array) value);
var array = System.Linq.Enumerable.OfType<object>((System.Array)value);
return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo)));
}

Expand Down Expand Up @@ -6971,8 +6971,8 @@ public ApiException(string message, int statusCode, string response, System.Coll

#pragma warning restore 1591
#pragma warning restore 1573
#pragma warning restore 472
#pragma warning restore 114
#pragma warning restore 108
#pragma warning restore 472
#pragma warning restore 114
#pragma warning restore 108
#pragma warning restore 3016
#pragma warning restore 8603
5 changes: 4 additions & 1 deletion web/src/assets/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,7 @@ $yiq-contrasted-threshold: 150 !default;

// Customize the light and dark text colors for use in our YIQ color contrast function.
$yiq-text-dark: $gray-900 !default;
$yiq-text-light: $white !default;
$yiq-text-light: $white !default;

// Base font-size
$base-font-size: 1rem;
69 changes: 46 additions & 23 deletions web/src/components/civil/CivilCaseDetails.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div style="overflow:hidden">
<div class="main-container" style="overflow:hidden">
<b-card bg-variant="light" v-if="!isMounted && !isDataReady">
<b-overlay :show="true">
<b-card style="min-height: 100px;" />
Expand All @@ -14,13 +14,12 @@

<b-card bg-variant="light" v-if="isMounted && !isDataReady">
<b-card style="min-height: 100px;">
<span v-if="errorCode == 404"
>This <b>File-Number '{{ this.civilFileInformation.fileNumber }}'</b> doesn't exist in the
<b>civil</b> records.</span
>
<span v-if="errorCode == 404">This <b>File-Number '{{ this.civilFileInformation.fileNumber }}'</b> doesn't exist
in
the
<b>civil</b> records.</span>
<span v-else-if="errorCode == 200 || errorCode == 204">
Bad Data in <b>File-Number '{{ this.civilFileInformation.fileNumber }}'</b>.</span
>
Bad Data in <b>File-Number '{{ this.civilFileInformation.fileNumber }}'</b>.</span>
<span v-else-if="errorCode == 403"> You are not authorized to access this file. </span>
<span v-else>
Server is not responding. <b>({{ errorText }})</b>
Expand All @@ -36,29 +35,23 @@

<b-card no-body>
<b-row cols="2">
<b-col md="2" cols="2" style="overflow: auto;">
<b-col md="3" cols="3" style="overflow: auto;">
<court-files-selector v-if="isDataReady && selectedFiles.length > 0" :files="selectedFiles"
@reload-case-details="reloadCaseDetails" targetCaseDetails="CivilCaseDetails" />
<civil-side-panel v-if="isDataReady" />
</b-col>
<b-col col md="10" cols="10" style="overflow: auto;">
<b-col col md="9" cols="9" class="px-0" style="overflow: auto;">
<civil-header-top v-if="isDataReady" />
<civil-header v-if="isDataReady" />

<b-row class="ml-0" v-if="showAllDocuments">
<h2 style="white-space: pre" v-if="isDataReady">
{{ selectedSideBar }}
</h2>
<custom-overlay
v-if="isDataReady"
:show="!downloadCompleted"
style="padding: 0 1rem; margin-left:auto; margin-right:2rem;"
>
<b-button
v-if="enableArchive"
@click="downloadAllDocuments()"
size="md"
variant="info"
style="padding: 0 1rem; margin-left:auto; margin-right:2rem;"
>
<custom-overlay v-if="isDataReady" :show="!downloadCompleted"
style="padding: 0 1rem; margin-left:auto; margin-right:2rem;">
<b-button v-if="enableArchive" @click="downloadAllDocuments()" size="md" variant="info"
style="padding: 0 1rem; margin-left:auto; margin-right:2rem;">
Download All Documents
</b-button>
</custom-overlay>
Expand Down Expand Up @@ -104,6 +97,7 @@ import CivilParties from "@components/civil/CivilParties.vue";
import CivilHeaderTop from "@components/civil/CivilHeaderTop.vue";
import CivilHeader from "@components/civil/CivilHeader.vue";
import CivilSidePanel from "@components/civil/CivilSidePanel.vue";
import CourtFilesSelector from "@components/shared/CourtFilesSelector.vue";
import {
civilFileInformationType,
partiesInfoType,
Expand All @@ -117,6 +111,7 @@ import {
AdjudicatorRestrictionsInfoType,
ArchiveInfoType,
DocumentRequestsInfoType,
KeyValueInfo,
} from "@/types/common";
import "@store/modules/CommonInformation";
import "@store/modules/CivilFileInformation";
Expand All @@ -130,9 +125,11 @@ import {
import base64url from "base64url";
import shared from "../shared";
import { CourtDocumentType, DocumentData } from "@/types/shared";
import { civilShowSectionsType } from '@/types/civil';
const civilState = namespace("CivilFileInformation");
const commonState = namespace("CommonInformation");
import {civilShowSectionsType} from '@/types/civil';
const selectedCourtFilesState = namespace('CourtFileSearchInformation');
@Component({
components: {
Expand All @@ -146,6 +143,7 @@ import {civilShowSectionsType} from '@/types/civil';
CivilSidePanel,
CivilHeaderTop,
CivilHeader,
CourtFilesSelector,
CustomOverlay,
},
})
Expand Down Expand Up @@ -174,6 +172,9 @@ export default class CivilCaseDetails extends Vue {
@civilState.Action
public UpdateShowSections!: (newShowSections: civilShowSectionsType) => void
@selectedCourtFilesState.Getter('selectedFiles')
public selectedFiles!: KeyValueInfo[];
leftPartiesInfo: partiesInfoType[] = [];
rightPartiesInfo: partiesInfoType[] = [];
adjudicatorRestrictionsInfo: AdjudicatorRestrictionsInfoType[] = [];
Expand Down Expand Up @@ -215,7 +216,7 @@ export default class CivilCaseDetails extends Vue {
public navigateToSection(section): void {
if (section) {
const sections = this.showSections;
for(const item of this.sidePanelTitles) {
for (const item of this.sidePanelTitles) {
if (item == section)
sections[item] = true;
else
Expand Down Expand Up @@ -583,13 +584,35 @@ export default class CivilCaseDetails extends Vue {
public navigateToLandingPage() {
this.$router.push({ name: "Home" });
}
private reloadCaseDetails(): void {
// Reset the properties to load new case details.
this.civilFileInformation.fileNumber = this.$route.params.fileNumber;
this.isMounted = false;
this.isDataReady = false;
this.partiesJson.length = 0;
this.adjudicatorRestrictionsJson.length = 0;
this.documentsDetailsJson.length = 0;
this.providedDocumentsDetailsJson.length = 0;
this.categories.length = 0;
this.providedDocumentCategories.length = 0;
this.leftPartiesInfo.length = 0;
this.rightPartiesInfo.length = 0;
this.adjudicatorRestrictionsInfo.length = 0;
this.documentsInfo.length = 0;
this.providedDocumentsInfo.length = 0;
this.summaryDocumentsInfo.length = 0;
this.getFileDetails();
}
}
</script>

<style scoped>
.card {
border: white;
}
body {
overflow-x: hidden;
}
Expand Down
Loading

0 comments on commit 7d6ff1b

Please sign in to comment.