Add report scrub issue page.

This commit is contained in:
Patrick Fic
2025-10-01 17:05:41 -07:00
parent ced1cd299c
commit 2704be74a9
5 changed files with 51 additions and 41 deletions

View File

@@ -40,17 +40,16 @@ async function ScrubEstimate({ job }) {
let estimateScrubberUrl;
switch (currentChannel) {
case "alpha":
estimateScrubberUrl = "https://4284-79287.el-alt.com/api/sendems"; //dev specific URL.
estimateScrubberUrl = "https://4284-79287.el-alt.com"; //dev specific URL.
break;
case "beta":
estimateScrubberUrl = "https://4284-79073.el-alt.com/api/sendems"; //Beta specific URL.
estimateScrubberUrl = "https://4284-79073.el-alt.com"; //Beta specific URL.
break;
default:
estimateScrubberUrl = "https://insurtechtoolkit.com/api/sendems"; //Production route.
estimateScrubberUrl = "https://insurtechtoolkit.com"; //Production route.
break;
}
//const estimateScrubberUrl = "https://insurtechtoolkit.com/api/sendems";
log.log(`Estimate Scrubber URL: [${currentChannel} |`, estimateScrubberUrl);
const sendingEntityId = "87330f61-412b-4251-baaa-d026565b23c5";
try {
@@ -117,7 +116,7 @@ async function ScrubEstimate({ job }) {
const jsonString = JSON.stringify(job);
formData.append("file", new Blob([jsonString], { type: "application/json" }), `${fileName}.json`);
const result = await axios.post(estimateScrubberUrl, formData, {
const result = await axios.post(`${estimateScrubberUrl}/api/sendems`, formData, {
auth: {
username: basicAuthUser,
password: basicAuthpassword
@@ -126,13 +125,14 @@ async function ScrubEstimate({ job }) {
});
const resultPDFUrl = result?.data?.report_link;
const reportIssueUrl = `${estimateScrubberUrl}/pcontactUs.aspx?apiKey=${esApiKey}&file=${fileName}.json`
// log.log("Estimate Scrubber Result:", result.data, resultPDFUrl);
const b = BrowserWindow.getAllWindows()[0];
b.webContents.send(ipcTypes.app.toRenderer.scrubResults, {
jobid: job.id,
items: result.data?.identified_item,
pdfUrl: resultPDFUrl
pdfUrl: resultPDFUrl,
reportIssueUrl
});
// const pdfWindow = new BrowserWindow({

View File

@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."bodyshops" add column "carfax_exclude" boolean
-- not null default 'False';

View File

@@ -0,0 +1,2 @@
alter table "public"."bodyshops" add column "carfax_exclude" boolean
not null default 'False';

View File

@@ -3,7 +3,7 @@
"productName": "ImEX RPS",
"author": "ImEX Systems Inc. <support@thinkimex.com>",
"description": "ImEX RPS",
"version": "1.4.2-alpha.17",
"version": "1.4.2-alpha.18",
"main": "electron/main.js",
"homepage": "./",
"dependencies": {

View File

@@ -134,36 +134,23 @@ export function EstimateScrubberResults({ bodyshop, jobid, job, esResults }) {
return (
<div style={{ padding: "16px" }}>
<Space direction="vertical" size="large" style={{ width: "100%" }}>
{/* Search Input */}
<div>
<Space>
<Input
placeholder="Search"
prefix={<SearchOutlined />}
value={searchText}
onChange={(e) => setSearchText(e.target.value)}
allowClear
style={{ maxWidth: 400 }}
/>
{searchText && (
<div style={{ marginTop: "8px" }}>
<Text type="secondary">
Showing {filteredItems.length} of {esResults.items.length} items
</Text>
</div>
)}
<Space>
<Input
placeholder="Search"
prefix={<SearchOutlined />}
value={searchText}
onChange={(e) => setSearchText(e.target.value)}
allowClear
style={{ maxWidth: 400 }}
/>
{searchText && (
<div style={{ marginTop: "8px" }}>
<Text type="secondary">
Showing {filteredItems.length} of {esResults.items.length} items
</Text>
</div>
)}
<Space wrap size={"small"}>
{Object.entries(groupedItems).map(([category, items]) => {
const config = categoryConfig[category] || { color: "default" };
return (
<Tag key={category} color={config.color}>
{category}: {items.length}
</Tag>
);
})}
</Space>
</Space>
<Button
style={{ float: "right" }}
type="primary"
@@ -173,7 +160,26 @@ export function EstimateScrubberResults({ bodyshop, jobid, job, esResults }) {
>
View PDF
</Button>
</div>
<Button
style={{ float: "right" }}
type="link"
href={esResults?.reportIssueUrl}
target="_blank"
disabled={!esResults?.reportIssueUrl}
>
Report Scrubbing Issue
</Button>
</Space>
<Space wrap size={"small"}>
{Object.entries(groupedItems).map(([category, items]) => {
const config = categoryConfig[category] || { color: "default" };
return (
<Tag key={category} color={config.color}>
{category}: {items.length}
</Tag>
);
})}
</Space>
{/* Grouped Results */}
<Collapse defaultActiveKey={sortedCategories} expandIconPosition="right" size="large">
@@ -185,7 +191,7 @@ export function EstimateScrubberResults({ bodyshop, jobid, job, esResults }) {
<Panel
header={
<Space>
<span style={{ fontSize: "18px" }}>{config.icon}</span>
{/* <span style={{ fontSize: "18px" }}>{config.icon}</span> */}
<Text strong>{category}</Text>
<Badge
count={items.length}
@@ -211,8 +217,6 @@ export function EstimateScrubberResults({ bodyshop, jobid, job, esResults }) {
);
})}
</Collapse>
{/* Summary */}
</Space>
</div>
);