hazo_collab_forms 3.1.7 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGE_LOG.md +207 -0
- package/README.md +3 -0
- package/dist/components/clarification/clarification_item_body.d.ts +19 -1
- package/dist/components/clarification/clarification_item_body.d.ts.map +1 -1
- package/dist/components/clarification/clarification_item_body.js +114 -6
- package/dist/components/clarification/clarification_item_body.js.map +1 -1
- package/dist/components/clarification/clarification_thread.js +1 -1
- package/dist/components/clarification/clarification_thread.js.map +1 -1
- package/dist/components/clarification/index.d.ts +2 -0
- package/dist/components/clarification/index.d.ts.map +1 -1
- package/dist/components/clarification/index.js +1 -0
- package/dist/components/clarification/index.js.map +1 -1
- package/dist/components/clarification/resolution_status_strip.d.ts +18 -0
- package/dist/components/clarification/resolution_status_strip.d.ts.map +1 -0
- package/dist/components/clarification/resolution_status_strip.js +20 -0
- package/dist/components/clarification/resolution_status_strip.js.map +1 -0
- package/dist/components/hazo_fb_form/context.d.ts +1 -1
- package/dist/components/hazo_fb_form/context.d.ts.map +1 -1
- package/dist/components/hazo_fb_form/hazo_fb_form.d.ts.map +1 -1
- package/dist/components/hazo_fb_form/hazo_fb_form.js +330 -113
- package/dist/components/hazo_fb_form/hazo_fb_form.js.map +1 -1
- package/dist/components/hazo_fb_form/hooks/use_fb_form_state.d.ts +3 -3
- package/dist/components/hazo_fb_form/hooks/use_fb_form_state.d.ts.map +1 -1
- package/dist/components/hazo_fb_form/hooks/use_fb_form_state.js +339 -46
- package/dist/components/hazo_fb_form/hooks/use_fb_form_state.js.map +1 -1
- package/dist/components/hazo_fb_form/hooks/use_llm_run.d.ts +3 -1
- package/dist/components/hazo_fb_form/hooks/use_llm_run.d.ts.map +1 -1
- package/dist/components/hazo_fb_form/hooks/use_llm_run.js +89 -11
- package/dist/components/hazo_fb_form/hooks/use_llm_run.js.map +1 -1
- package/dist/components/hazo_fb_form/shared/agent_stepper.js +1 -1
- package/dist/components/hazo_fb_form/shared/agent_stepper.js.map +1 -1
- package/dist/components/hazo_fb_form/shared/file_status_accordion.d.ts +9 -0
- package/dist/components/hazo_fb_form/shared/file_status_accordion.d.ts.map +1 -0
- package/dist/components/hazo_fb_form/shared/file_status_accordion.js +39 -0
- package/dist/components/hazo_fb_form/shared/file_status_accordion.js.map +1 -0
- package/dist/components/hazo_fb_form/shared/format.d.ts.map +1 -1
- package/dist/components/hazo_fb_form/shared/format.js +8 -3
- package/dist/components/hazo_fb_form/shared/format.js.map +1 -1
- package/dist/components/hazo_fb_form/shared/send_back_item_card.d.ts +7 -1
- package/dist/components/hazo_fb_form/shared/send_back_item_card.d.ts.map +1 -1
- package/dist/components/hazo_fb_form/shared/send_back_item_card.js +6 -3
- package/dist/components/hazo_fb_form/shared/send_back_item_card.js.map +1 -1
- package/dist/components/hazo_fb_form/types.d.ts +3 -1
- package/dist/components/hazo_fb_form/types.d.ts.map +1 -1
- package/dist/components/hazo_fb_form/views/back_office_view.js +1 -1
- package/dist/components/hazo_fb_form/views/back_office_view.js.map +1 -1
- package/dist/components/hazo_fb_form/views/clarifications_view.js +2 -2
- package/dist/components/hazo_fb_form/views/clarifications_view.js.map +1 -1
- package/dist/components/hazo_fb_form/views/front_office_view.d.ts.map +1 -1
- package/dist/components/hazo_fb_form/views/front_office_view.js +62 -41
- package/dist/components/hazo_fb_form/views/front_office_view.js.map +1 -1
- package/dist/components/hazo_fb_form/views/interim_view.js +3 -3
- package/dist/components/hazo_fb_form/views/interim_view.js.map +1 -1
- package/dist/components/hazo_fb_form/views/review_queue_view.d.ts.map +1 -1
- package/dist/components/hazo_fb_form/views/review_queue_view.js +22 -9
- package/dist/components/hazo_fb_form/views/review_queue_view.js.map +1 -1
- package/dist/components/hazo_validation_rule_editor/components/rule_editor.d.ts.map +1 -1
- package/dist/components/hazo_validation_rule_editor/components/rule_editor.js +32 -3
- package/dist/components/hazo_validation_rule_editor/components/rule_editor.js.map +1 -1
- package/dist/components/hazo_validation_rule_editor/components/variable_chain_input.d.ts +20 -0
- package/dist/components/hazo_validation_rule_editor/components/variable_chain_input.d.ts.map +1 -0
- package/dist/components/hazo_validation_rule_editor/components/variable_chain_input.js +34 -0
- package/dist/components/hazo_validation_rule_editor/components/variable_chain_input.js.map +1 -0
- package/dist/components/hazo_validation_rule_editor/context.d.ts +3 -2
- package/dist/components/hazo_validation_rule_editor/context.d.ts.map +1 -1
- package/dist/components/hazo_validation_rule_editor/context.js +15 -3
- package/dist/components/hazo_validation_rule_editor/context.js.map +1 -1
- package/dist/components/hazo_validation_rule_editor/types.d.ts +7 -1
- package/dist/components/hazo_validation_rule_editor/types.d.ts.map +1 -1
- package/dist/components/hazo_validation_rule_editor/validation_rule_editor.d.ts +1 -1
- package/dist/components/hazo_validation_rule_editor/validation_rule_editor.d.ts.map +1 -1
- package/dist/components/hazo_validation_rule_editor/validation_rule_editor.js +2 -2
- package/dist/components/hazo_validation_rule_editor/validation_rule_editor.js.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/shared/document_type_editor.d.ts +31 -0
- package/dist/components/shared/document_type_editor.d.ts.map +1 -0
- package/dist/components/shared/document_type_editor.js +60 -0
- package/dist/components/shared/document_type_editor.js.map +1 -0
- package/dist/components/shared/file_bar/file_bar.d.ts +7 -1
- package/dist/components/shared/file_bar/file_bar.d.ts.map +1 -1
- package/dist/components/shared/file_bar/file_bar.js +5 -3
- package/dist/components/shared/file_bar/file_bar.js.map +1 -1
- package/dist/components/shared/file_bar/file_bar_validation_dialog.js +4 -4
- package/dist/components/shared/file_bar/file_bar_validation_dialog.js.map +1 -1
- package/dist/components/shared/file_status_icon.d.ts +23 -0
- package/dist/components/shared/file_status_icon.d.ts.map +1 -0
- package/dist/components/shared/file_status_icon.js +38 -0
- package/dist/components/shared/file_status_icon.js.map +1 -0
- package/dist/components/shared/json_data_panel/json_data_panel.d.ts +1 -1
- package/dist/components/shared/json_data_panel/json_data_panel.d.ts.map +1 -1
- package/dist/components/shared/json_data_panel/json_data_panel.js +27 -2
- package/dist/components/shared/json_data_panel/json_data_panel.js.map +1 -1
- package/dist/components/shared/rule_result_card.d.ts.map +1 -1
- package/dist/components/shared/rule_result_card.js +5 -4
- package/dist/components/shared/rule_result_card.js.map +1 -1
- package/dist/components/thread_form/components/add_question_dialog.d.ts +12 -0
- package/dist/components/thread_form/components/add_question_dialog.d.ts.map +1 -0
- package/dist/components/thread_form/components/add_question_dialog.js +36 -0
- package/dist/components/thread_form/components/add_question_dialog.js.map +1 -0
- package/dist/components/thread_form/components/agent_compose_dialog.d.ts +30 -0
- package/dist/components/thread_form/components/agent_compose_dialog.d.ts.map +1 -0
- package/dist/components/thread_form/components/agent_compose_dialog.js +45 -0
- package/dist/components/thread_form/components/agent_compose_dialog.js.map +1 -0
- package/dist/components/thread_form/components/clarification.d.ts +14 -0
- package/dist/components/thread_form/components/clarification.d.ts.map +1 -0
- package/dist/components/thread_form/components/clarification.js +12 -0
- package/dist/components/thread_form/components/clarification.js.map +1 -0
- package/dist/components/thread_form/components/collected_data_view.d.ts +15 -0
- package/dist/components/thread_form/components/collected_data_view.d.ts.map +1 -0
- package/dist/components/thread_form/components/collected_data_view.js +121 -0
- package/dist/components/thread_form/components/collected_data_view.js.map +1 -0
- package/dist/components/thread_form/components/coverage_card.d.ts +11 -0
- package/dist/components/thread_form/components/coverage_card.d.ts.map +1 -0
- package/dist/components/thread_form/components/coverage_card.js +60 -0
- package/dist/components/thread_form/components/coverage_card.js.map +1 -0
- package/dist/components/thread_form/components/file_bar.d.ts +93 -0
- package/dist/components/thread_form/components/file_bar.d.ts.map +1 -0
- package/dist/components/thread_form/components/file_bar.js +251 -0
- package/dist/components/thread_form/components/file_bar.js.map +1 -0
- package/dist/components/thread_form/components/file_info_dialog.d.ts +15 -0
- package/dist/components/thread_form/components/file_info_dialog.d.ts.map +1 -0
- package/dist/components/thread_form/components/file_info_dialog.js +64 -0
- package/dist/components/thread_form/components/file_info_dialog.js.map +1 -0
- package/dist/components/thread_form/components/issue_group_tree.d.ts +20 -0
- package/dist/components/thread_form/components/issue_group_tree.d.ts.map +1 -0
- package/dist/components/thread_form/components/issue_group_tree.js +164 -0
- package/dist/components/thread_form/components/issue_group_tree.js.map +1 -0
- package/dist/components/thread_form/components/pdf_side_panel.d.ts +20 -0
- package/dist/components/thread_form/components/pdf_side_panel.d.ts.map +1 -0
- package/dist/components/thread_form/components/pdf_side_panel.js +63 -0
- package/dist/components/thread_form/components/pdf_side_panel.js.map +1 -0
- package/dist/components/thread_form/components/rule_decision_row.d.ts +31 -0
- package/dist/components/thread_form/components/rule_decision_row.d.ts.map +1 -0
- package/dist/components/thread_form/components/rule_decision_row.js +20 -0
- package/dist/components/thread_form/components/rule_decision_row.js.map +1 -0
- package/dist/components/thread_form/components/send_back_message.d.ts +32 -0
- package/dist/components/thread_form/components/send_back_message.d.ts.map +1 -0
- package/dist/components/thread_form/components/send_back_message.js +82 -0
- package/dist/components/thread_form/components/send_back_message.js.map +1 -0
- package/dist/components/thread_form/components/shared.d.ts +54 -0
- package/dist/components/thread_form/components/shared.d.ts.map +1 -0
- package/dist/components/thread_form/components/shared.js +136 -0
- package/dist/components/thread_form/components/shared.js.map +1 -0
- package/dist/components/thread_form/components/task_card.d.ts +90 -0
- package/dist/components/thread_form/components/task_card.d.ts.map +1 -0
- package/dist/components/thread_form/components/task_card.js +63 -0
- package/dist/components/thread_form/components/task_card.js.map +1 -0
- package/dist/components/thread_form/components/text_doc_check.d.ts +15 -0
- package/dist/components/thread_form/components/text_doc_check.d.ts.map +1 -0
- package/dist/components/thread_form/components/text_doc_check.js +16 -0
- package/dist/components/thread_form/components/text_doc_check.js.map +1 -0
- package/dist/components/thread_form/components/text_extraction.d.ts +14 -0
- package/dist/components/thread_form/components/text_extraction.d.ts.map +1 -0
- package/dist/components/thread_form/components/text_extraction.js +16 -0
- package/dist/components/thread_form/components/text_extraction.js.map +1 -0
- package/dist/components/thread_form/components/thread_composer.d.ts +15 -0
- package/dist/components/thread_form/components/thread_composer.d.ts.map +1 -0
- package/dist/components/thread_form/components/thread_composer.js +93 -0
- package/dist/components/thread_form/components/thread_composer.js.map +1 -0
- package/dist/components/thread_form/components/thread_timeline.d.ts +65 -0
- package/dist/components/thread_form/components/thread_timeline.d.ts.map +1 -0
- package/dist/components/thread_form/components/thread_timeline.js +225 -0
- package/dist/components/thread_form/components/thread_timeline.js.map +1 -0
- package/dist/components/thread_form/hooks/use_file_pipeline.d.ts +126 -0
- package/dist/components/thread_form/hooks/use_file_pipeline.d.ts.map +1 -0
- package/dist/components/thread_form/hooks/use_file_pipeline.js +760 -0
- package/dist/components/thread_form/hooks/use_file_pipeline.js.map +1 -0
- package/dist/components/thread_form/hooks/use_thread_form.d.ts +36 -0
- package/dist/components/thread_form/hooks/use_thread_form.d.ts.map +1 -0
- package/dist/components/thread_form/hooks/use_thread_form.js +126 -0
- package/dist/components/thread_form/hooks/use_thread_form.js.map +1 -0
- package/dist/components/thread_form/index.d.ts +33 -0
- package/dist/components/thread_form/index.d.ts.map +1 -0
- package/dist/components/thread_form/index.js +30 -0
- package/dist/components/thread_form/index.js.map +1 -0
- package/dist/components/thread_form/sample_data.d.ts +8 -0
- package/dist/components/thread_form/sample_data.d.ts.map +1 -0
- package/dist/components/thread_form/sample_data.js +658 -0
- package/dist/components/thread_form/sample_data.js.map +1 -0
- package/dist/components/thread_form/thread_form.d.ts +7 -0
- package/dist/components/thread_form/thread_form.d.ts.map +1 -0
- package/dist/components/thread_form/thread_form.js +1385 -0
- package/dist/components/thread_form/thread_form.js.map +1 -0
- package/dist/components/thread_form/types.d.ts +402 -0
- package/dist/components/thread_form/types.d.ts.map +1 -0
- package/dist/components/thread_form/types.js +23 -0
- package/dist/components/thread_form/types.js.map +1 -0
- package/dist/components/thread_form/utils/file_decision_state.d.ts +22 -0
- package/dist/components/thread_form/utils/file_decision_state.d.ts.map +1 -0
- package/dist/components/thread_form/utils/file_decision_state.js +37 -0
- package/dist/components/thread_form/utils/file_decision_state.js.map +1 -0
- package/dist/components/thread_form/utils/merge_send_back.d.ts +13 -0
- package/dist/components/thread_form/utils/merge_send_back.d.ts.map +1 -0
- package/dist/components/thread_form/utils/merge_send_back.js +23 -0
- package/dist/components/thread_form/utils/merge_send_back.js.map +1 -0
- package/dist/lib/autofill_handler.d.ts.map +1 -1
- package/dist/lib/autofill_handler.js +5 -44
- package/dist/lib/autofill_handler.js.map +1 -1
- package/dist/lib/classification_handler.d.ts +105 -0
- package/dist/lib/classification_handler.d.ts.map +1 -0
- package/dist/lib/classification_handler.js +342 -0
- package/dist/lib/classification_handler.js.map +1 -0
- package/dist/lib/content_gate_handler.d.ts +37 -0
- package/dist/lib/content_gate_handler.d.ts.map +1 -0
- package/dist/lib/content_gate_handler.js +126 -0
- package/dist/lib/content_gate_handler.js.map +1 -0
- package/dist/lib/index.d.ts +10 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +5 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/periodic_coverage_runner.d.ts +24 -0
- package/dist/lib/periodic_coverage_runner.d.ts.map +1 -0
- package/dist/lib/periodic_coverage_runner.js +121 -0
- package/dist/lib/periodic_coverage_runner.js.map +1 -0
- package/dist/lib/resolution_handler.d.ts +150 -0
- package/dist/lib/resolution_handler.d.ts.map +1 -0
- package/dist/lib/resolution_handler.js +597 -0
- package/dist/lib/resolution_handler.js.map +1 -0
- package/dist/lib/resolve_variable.d.ts +25 -0
- package/dist/lib/resolve_variable.d.ts.map +1 -0
- package/dist/lib/resolve_variable.js +77 -0
- package/dist/lib/resolve_variable.js.map +1 -0
- package/dist/lib/validation_handler.d.ts +27 -3
- package/dist/lib/validation_handler.d.ts.map +1 -1
- package/dist/lib/validation_handler.js +338 -288
- package/dist/lib/validation_handler.js.map +1 -1
- package/dist/types/clarification.d.ts +54 -0
- package/dist/types/clarification.d.ts.map +1 -1
- package/dist/types/fb_form_data.d.ts +273 -123
- package/dist/types/fb_form_data.d.ts.map +1 -1
- package/dist/types/fb_form_data.js +44 -58
- package/dist/types/fb_form_data.js.map +1 -1
- package/dist/types/fb_form_data_v1.d.ts +250 -0
- package/dist/types/fb_form_data_v1.d.ts.map +1 -0
- package/dist/types/fb_form_data_v1.js +117 -0
- package/dist/types/fb_form_data_v1.js.map +1 -0
- package/dist/types/fb_form_instance.d.ts +1 -1
- package/dist/types/fb_form_instance.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/validation.d.ts +134 -12
- package/dist/types/validation.d.ts.map +1 -1
- package/dist/utils/expectation_extractor.d.ts +31 -0
- package/dist/utils/expectation_extractor.d.ts.map +1 -0
- package/dist/utils/expectation_extractor.js +142 -0
- package/dist/utils/expectation_extractor.js.map +1 -0
- package/dist/utils/fb_data_adapter.d.ts +7 -2
- package/dist/utils/fb_data_adapter.d.ts.map +1 -1
- package/dist/utils/fb_data_adapter.js +58 -7
- package/dist/utils/fb_data_adapter.js.map +1 -1
- package/dist/utils/fb_data_adapter_v2.d.ts +17 -0
- package/dist/utils/fb_data_adapter_v2.d.ts.map +1 -0
- package/dist/utils/fb_data_adapter_v2.js +483 -0
- package/dist/utils/fb_data_adapter_v2.js.map +1 -0
- package/dist/utils/fb_data_helpers.d.ts +1 -1
- package/dist/utils/fb_data_helpers.d.ts.map +1 -1
- package/dist/utils/fb_data_mutations.d.ts +1 -1
- package/dist/utils/fb_data_mutations.d.ts.map +1 -1
- package/dist/utils/fb_data_mutations_v2.d.ts +46 -0
- package/dist/utils/fb_data_mutations_v2.d.ts.map +1 -0
- package/dist/utils/fb_data_mutations_v2.js +341 -0
- package/dist/utils/fb_data_mutations_v2.js.map +1 -0
- package/dist/utils/fb_data_queries.d.ts +81 -0
- package/dist/utils/fb_data_queries.d.ts.map +1 -0
- package/dist/utils/fb_data_queries.js +354 -0
- package/dist/utils/fb_data_queries.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/issue_bucketing.d.ts +36 -0
- package/dist/utils/issue_bucketing.d.ts.map +1 -0
- package/dist/utils/issue_bucketing.js +107 -0
- package/dist/utils/issue_bucketing.js.map +1 -0
- package/dist/utils/validation_result.d.ts +32 -0
- package/dist/utils/validation_result.d.ts.map +1 -0
- package/dist/utils/validation_result.js +55 -0
- package/dist/utils/validation_result.js.map +1 -0
- package/package.json +16 -4
|
@@ -166,7 +166,7 @@ export function FrontOfficeView() {
|
|
|
166
166
|
[attachment.file_id]: {
|
|
167
167
|
file_id: attachment.file_id,
|
|
168
168
|
file_name: attachment.file_name,
|
|
169
|
-
status: merged_errors.length > 0 ? 'failed' : (kept_prior.some(r => r.
|
|
169
|
+
status: merged_errors.length > 0 ? 'failed' : (kept_prior.some(r => r.issues.length > 0) ? 'failed' : 'passed'),
|
|
170
170
|
errors: merged_errors,
|
|
171
171
|
document_types: existing?.document_types ?? [],
|
|
172
172
|
rule_results: [...kept_prior, ...(enriched_rule_results ?? [])],
|
|
@@ -325,7 +325,7 @@ export function FrontOfficeView() {
|
|
|
325
325
|
});
|
|
326
326
|
const result = await res.json();
|
|
327
327
|
const rule_result = result.rule_results?.[0];
|
|
328
|
-
const passed = !rule_result
|
|
328
|
+
const passed = !rule_result || rule_result.issues.length === 0;
|
|
329
329
|
// Enrich clarification doc_references with actual file_ids
|
|
330
330
|
// Match by file_name first, then fallback. If no doc_references, assign all response files.
|
|
331
331
|
const clarifications = (result.clarifications ?? []).map((c) => ({
|
|
@@ -344,12 +344,12 @@ export function FrontOfficeView() {
|
|
|
344
344
|
mime_type: att.mime_type,
|
|
345
345
|
})),
|
|
346
346
|
}));
|
|
347
|
-
//
|
|
348
|
-
let details = rule_result?.issue_description;
|
|
347
|
+
// Prefer summary (rule-level explanation), fall back to the first issue's description or raw_response
|
|
348
|
+
let details = rule_result?.summary ?? rule_result?.issues[0]?.issue_description;
|
|
349
349
|
if (!details && rule_result?.raw_response) {
|
|
350
350
|
try {
|
|
351
351
|
const raw = typeof rule_result.raw_response === 'string' ? JSON.parse(rule_result.raw_response) : rule_result.raw_response;
|
|
352
|
-
details = raw?.
|
|
352
|
+
details = raw?.summary;
|
|
353
353
|
}
|
|
354
354
|
catch { /* ignore parse errors */ }
|
|
355
355
|
}
|
|
@@ -538,7 +538,7 @@ export function FrontOfficeView() {
|
|
|
538
538
|
if (s.id === 'doc_type_validation') {
|
|
539
539
|
const passed = vr?.status === 'passed' || vr?.status === 'skipped';
|
|
540
540
|
const checks_run = vr?.rule_results?.length ?? 0;
|
|
541
|
-
const checks_failed = vr?.rule_results?.filter(r => r.
|
|
541
|
+
const checks_failed = vr?.rule_results?.filter(r => r.issues.length > 0).length ?? 0;
|
|
542
542
|
return {
|
|
543
543
|
...s,
|
|
544
544
|
status: (passed ? 'passed' : 'failed'),
|
|
@@ -665,7 +665,7 @@ export function FrontOfficeView() {
|
|
|
665
665
|
const ids = new Set();
|
|
666
666
|
for (const [file_id, vr] of Object.entries(file_validation_results)) {
|
|
667
667
|
if (vr.status === 'passed') {
|
|
668
|
-
const has_rule_issues = vr.rule_results?.some(r => r.
|
|
668
|
+
const has_rule_issues = vr.rule_results?.some(r => r.issues.length > 0);
|
|
669
669
|
if (!has_rule_issues)
|
|
670
670
|
ids.add(file_id);
|
|
671
671
|
}
|
|
@@ -834,8 +834,13 @@ export function FrontOfficeView() {
|
|
|
834
834
|
const is_complete_in_data = complete_ids.has(item.id);
|
|
835
835
|
const is_confirmed = confirmed_response_ids.has(item.id);
|
|
836
836
|
const sent_version = sent_map.get(item.id);
|
|
837
|
+
// Force 'resolved' from authoritative sources:
|
|
838
|
+
// - data model has input_status: 'complete'
|
|
839
|
+
// - same-session confirm (OK button clicked)
|
|
840
|
+
// - instance was submitted AND sent version has a response (client can't edit after submit)
|
|
841
|
+
const is_submitted = active_instance?.status === 'client_submitted' || active_instance?.status === 'completed';
|
|
837
842
|
const sent_has_response = !!(sent_version?.response_choice);
|
|
838
|
-
if (is_complete_in_data || is_confirmed || sent_has_response) {
|
|
843
|
+
if (is_complete_in_data || is_confirmed || (is_submitted && sent_has_response)) {
|
|
839
844
|
return {
|
|
840
845
|
...item,
|
|
841
846
|
status: 'resolved',
|
|
@@ -843,10 +848,20 @@ export function FrontOfficeView() {
|
|
|
843
848
|
user_comment: item.user_comment || sent_version?.user_comment || pending_clarification_responses.get(item.id)?.user_comment,
|
|
844
849
|
};
|
|
845
850
|
}
|
|
851
|
+
// If sent version has a response but isn't resolved yet, preserve its actual status
|
|
852
|
+
// so the client can still edit their response until the agent reviews it
|
|
853
|
+
if (sent_version?.response_choice && !item.response_choice) {
|
|
854
|
+
return {
|
|
855
|
+
...item,
|
|
856
|
+
status: sent_version.status ?? 'responded',
|
|
857
|
+
response_choice: sent_version.response_choice,
|
|
858
|
+
user_comment: sent_version.user_comment,
|
|
859
|
+
};
|
|
860
|
+
}
|
|
846
861
|
}
|
|
847
862
|
return item;
|
|
848
863
|
});
|
|
849
|
-
}, [draft_clarifications, pending_clarification_responses, sent_clarifications, backoffice_rule_ids, confirmed_response_ids, form_data_entries]);
|
|
864
|
+
}, [draft_clarifications, pending_clarification_responses, sent_clarifications, backoffice_rule_ids, confirmed_response_ids, form_data_entries, active_instance?.status]);
|
|
850
865
|
const immediate_clarification_counts = useMemo(() => {
|
|
851
866
|
const counts = { pending: 0, responded: 0, resolved: 0, dismissed: 0, total: 0 };
|
|
852
867
|
for (const item of immediate_clarifications) {
|
|
@@ -861,7 +876,7 @@ export function FrontOfficeView() {
|
|
|
861
876
|
const result = {};
|
|
862
877
|
for (const [file_id, vr] of Object.entries(file_validation_results)) {
|
|
863
878
|
const rr = vr.rule_results ?? [];
|
|
864
|
-
const has_any_failures = rr.length > 0 && rr.some(r => r.
|
|
879
|
+
const has_any_failures = rr.length > 0 && rr.some(r => r.issues.length > 0);
|
|
865
880
|
if (has_any_failures) {
|
|
866
881
|
const has_clarifications = immediate_clarifications.some(item => item.doc_references?.some(r => r.file_id === file_id));
|
|
867
882
|
if (has_clarifications)
|
|
@@ -900,8 +915,8 @@ export function FrontOfficeView() {
|
|
|
900
915
|
badges[file_id] = { state: 'issues', issue_count: pending_count };
|
|
901
916
|
}
|
|
902
917
|
}
|
|
903
|
-
else if (vr.rule_results && vr.rule_results.some(r => r.
|
|
904
|
-
const issue_count = vr.rule_results.filter(r => r.
|
|
918
|
+
else if (vr.rule_results && vr.rule_results.some(r => r.issues.length > 0)) {
|
|
919
|
+
const issue_count = vr.rule_results.filter(r => r.issues.length > 0).length;
|
|
905
920
|
badges[file_id] = { state: 'issues', issue_count };
|
|
906
921
|
}
|
|
907
922
|
else if (vr.status === 'passed') {
|
|
@@ -1052,21 +1067,24 @@ export function FrontOfficeView() {
|
|
|
1052
1067
|
}, [set_pending_clarification_responses, update_clarification_response, front_form_data, on_front_change]);
|
|
1053
1068
|
// Stepper navigation
|
|
1054
1069
|
const go_next = useCallback(() => {
|
|
1055
|
-
//
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1070
|
+
// Confirm all pending clarification responses before advancing
|
|
1071
|
+
for (const [id, response] of pending_clarification_responses) {
|
|
1072
|
+
if (response.response_choice) {
|
|
1073
|
+
const is_sourced = active_instance?.sourced_clarification_ids?.includes(id);
|
|
1074
|
+
if (is_sourced) {
|
|
1075
|
+
handle_sourced_respond(id, response);
|
|
1076
|
+
}
|
|
1077
|
+
else {
|
|
1078
|
+
// Inline confirm: mark confirmed + persist
|
|
1079
|
+
set_confirmed_response_ids(prev => { const s = new Set(prev); s.add(id); return s; });
|
|
1080
|
+
update_clarification_response(id, response);
|
|
1063
1081
|
}
|
|
1064
1082
|
}
|
|
1065
1083
|
}
|
|
1066
1084
|
set_completed_steps(prev => { const s = new Set(prev); s.add(active_front_step); return s; });
|
|
1067
1085
|
set_active_front_step(prev => Math.min(prev + 1, 2));
|
|
1068
1086
|
set_viewed_file(null);
|
|
1069
|
-
}, [active_front_step, pending_clarification_responses, active_instance, handle_sourced_respond]);
|
|
1087
|
+
}, [active_front_step, pending_clarification_responses, active_instance, handle_sourced_respond, update_clarification_response]);
|
|
1070
1088
|
const handle_step_click = useCallback((step) => {
|
|
1071
1089
|
// Mark all steps before the target as completed
|
|
1072
1090
|
set_completed_steps(prev => {
|
|
@@ -1193,7 +1211,7 @@ export function FrontOfficeView() {
|
|
|
1193
1211
|
const step_0_content = (_jsxs("div", { className: "space-y-6", children: [!is_multi_instance && pending_clarifications.length > 0 && (_jsx(ClarificationSection, { items: pending_clarifications, counts: pending_counts, callbacks: { on_respond: is_front_read_only ? undefined : (id, response) => {
|
|
1194
1212
|
set_pending_clarification_responses(prev => { const next = new Map(prev); next.set(id, response); return next; });
|
|
1195
1213
|
handle_response_confirm(id, response);
|
|
1196
|
-
} }, hide_submit:
|
|
1214
|
+
} }, hide_submit: true, compact: true, collapsible: true, card_label: "Action Required", preserve_order: true, on_response_change: handle_response_change, on_doc_click: file_manager ? handle_clarification_doc_click : undefined, on_doc_view: file_manager ? handle_clarification_doc_view : undefined, file_validation: file_validation_badges, response_validations: response_validations, on_validation_click: set_validation_detail_file_id, file_validation_details: per_file_validation_details, file_pipeline_status: per_file_pipeline_status })), sourced_clarifications.length > 0 && (_jsx(ClarificationSection, { items: sourced_clarifications.map(item => {
|
|
1197
1215
|
// For responded items, strip the last client response from the thread
|
|
1198
1216
|
// since it's already shown in the RESPONSE SUBMITTED section below
|
|
1199
1217
|
if (item.status === 'responded' && item.thread?.length) {
|
|
@@ -1209,7 +1227,7 @@ export function FrontOfficeView() {
|
|
|
1209
1227
|
resolved: sourced_clarifications.filter(c => c.status === 'resolved').length,
|
|
1210
1228
|
dismissed: sourced_clarifications.filter(c => c.status === 'dismissed').length,
|
|
1211
1229
|
total: sourced_clarifications.length,
|
|
1212
|
-
}, callbacks: { on_respond: handle_sourced_respond }, hide_submit:
|
|
1230
|
+
}, callbacks: { on_respond: handle_sourced_respond }, hide_submit: true, compact: true, collapsible: true, card_label: "Action Required", preserve_order: true, on_response_change: handle_response_change, on_doc_click: file_manager ? handle_clarification_doc_click : undefined, on_doc_view: file_manager ? handle_clarification_doc_view : undefined, file_manager: file_manager?.callbacks, file_validation: file_validation_badges, response_validations: response_validations, on_validation_click: set_validation_detail_file_id, file_validation_details: per_file_validation_details, file_pipeline_status: per_file_pipeline_status })), is_multi_instance && active_instance && is_fb_terminal_status(active_instance.status) &&
|
|
1213
1231
|
(active_instance.sent_clarifications?.length ?? 0) > 0 &&
|
|
1214
1232
|
sourced_clarifications.length === 0 && (_jsx(ClarificationSection, { items: active_instance.sent_clarifications, counts: {
|
|
1215
1233
|
pending: 0,
|
|
@@ -1225,28 +1243,27 @@ export function FrontOfficeView() {
|
|
|
1225
1243
|
}), can_add_fields && fields.length > 0 && (_jsx(CollabFormAddFieldIcon, { field_id: fields[fields.length - 1].id, on_click: () => handle_open_add_field(fields[fields.length - 1].id), variant: "field" })), can_add_fields && fields.length === 0 && (_jsx(CollabFormAddFieldIcon, { field_id: group.id, on_click: () => handle_open_add_field(group.id), variant: "field" }))] }), gi < (section.groups?.length ?? 0) - 1 && !can_add_groups && (_jsx("div", { className: "border-t border-border/40" }))] }, group.id));
|
|
1226
1244
|
}), can_add_groups && (section.groups?.length ?? 0) > 0 && (_jsx(CollabFormAddFieldIcon, { field_id: section.groups[section.groups.length - 1].id, on_click: () => handle_open_add_group(section.groups[section.groups.length - 1].id), variant: "group" }))] })] }, si))), can_add_fields && add_field_open && (_jsx(React.Suspense, { fallback: null, children: _jsx(LazyAddFieldDialog, { open: add_field_open, on_open_change: set_add_field_open, on_confirm: handle_confirm_add_fields, enable_file_textbox_tab: true, default_tab: "file_textbox", enable_library: false, title: "Add Front Office Field", file_textbox_hide_classification: true, file_textbox_hide_tags: true }) })), can_add_groups && add_group_open && (_jsx(React.Suspense, { fallback: null, children: _jsx(LazyAddGroupDialog, { open: add_group_open, on_open_change: set_add_group_open, on_confirm: handle_confirm_add_group, enable_library: false, title: "Add Front Office Group" }) }))] }));
|
|
1227
1245
|
// Check if any file has failed rule_results without corresponding clarification items
|
|
1228
|
-
const has_unclarified_rule_failures = useMemo(() => Object.values(file_validation_results).some(vr => vr.rule_results?.some(r => r.
|
|
1246
|
+
const has_unclarified_rule_failures = useMemo(() => Object.values(file_validation_results).some(vr => vr.rule_results?.some(r => r.issues.length > 0)), [file_validation_results]);
|
|
1229
1247
|
// ── Step 1: Validation Issues content ──
|
|
1230
1248
|
const step_1_content = (_jsx("div", { className: "space-y-6", children: immediate_clarifications.length > 0 ? (_jsx(ClarificationSection, { items: immediate_clarifications, counts: immediate_clarification_counts, callbacks: { on_respond: is_front_read_only ? undefined : (id, response) => {
|
|
1231
1249
|
// Store the response in pending state, then confirm it
|
|
1232
1250
|
set_pending_clarification_responses(prev => { const next = new Map(prev); next.set(id, response); return next; });
|
|
1233
1251
|
handle_response_confirm(id, response);
|
|
1234
|
-
} }, hide_submit: false, submit_label: "
|
|
1252
|
+
} }, hide_submit: false, submit_label: "Submit Response", hide_header: true, on_response_change: is_front_read_only ? undefined : handle_response_change, on_doc_click: file_manager ? handle_clarification_doc_click : undefined, on_doc_view: file_manager ? handle_clarification_doc_view : undefined, file_manager: file_manager?.callbacks, read_only: is_front_read_only, file_validation: file_validation_badges, response_validations: response_validations, on_validation_click: set_validation_detail_file_id, file_validation_details: per_file_validation_details, file_pipeline_status: per_file_pipeline_status })) : (classifying_file_ids.size > 0 || queued_file_ids.size > 0 || validating_file_ids.size > 0 || autofilling_file_ids.size > 0) ? (_jsx("div", { className: "border rounded-lg bg-card shadow-sm overflow-hidden", children: _jsxs("div", { className: "flex items-center justify-center gap-3 px-5 py-12", children: [_jsx(LuLoader, { className: "h-8 w-8 text-amber-500 animate-spin flex-shrink-0" }), _jsxs("div", { children: [_jsx("h3", { className: "text-base font-semibold text-amber-700", children: "Files are being processed" }), _jsx("p", { className: "text-sm text-muted-foreground mt-0.5", children: "Please wait for processing to complete." })] })] }) })) : has_unclarified_rule_failures ? (_jsx("div", { className: "border rounded-lg bg-card shadow-sm overflow-hidden", children: _jsxs("div", { className: "flex items-center justify-center gap-3 px-5 py-12", children: [_jsx(HiExclamationCircle, { className: "h-8 w-8 text-amber-500 flex-shrink-0" }), _jsxs("div", { children: [_jsx("h3", { className: "text-base font-semibold text-amber-700", children: "Validation issues found" }), _jsx("p", { className: "text-sm text-muted-foreground mt-0.5", children: "Some checks failed. Click the validation icon on file(s) for details." })] })] }) })) : (_jsx("div", { className: "border rounded-lg bg-card shadow-sm overflow-hidden", children: _jsxs("div", { className: "flex items-center justify-center gap-3 px-5 py-12", children: [_jsx(HiCheckCircle, { className: "h-8 w-8 text-green-500 flex-shrink-0" }), _jsxs("div", { children: [_jsx("h3", { className: "text-base font-semibold text-green-700", children: "All checks passed" }), _jsx("p", { className: "text-sm text-muted-foreground mt-0.5", children: "No validation issues found." })] })] }) })) }));
|
|
1235
1253
|
// ── Step 2: Summary & Review content ──
|
|
1236
1254
|
const step_2_content = (_jsx(SummaryReviewView, { on_file_view: file_manager ? handle_file_view : undefined, on_submitted: () => set_front_submitted(true), on_go_to_clarifications: () => set_active_front_step(1) }));
|
|
1237
|
-
// ──
|
|
1238
|
-
const
|
|
1239
|
-
const
|
|
1240
|
-
const
|
|
1241
|
-
const next_button = (_jsx("div", { className: "flex justify-end pt-6 pb-2", children: _jsxs("button", { type: "button", onClick: go_next, className: "inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 transition-colors", children: [next_button_label, !is_clarifications_step && _jsx(HiChevronRight, { className: "h-4 w-4" })] }) }));
|
|
1255
|
+
// ── Bottom action button ──
|
|
1256
|
+
const has_pending_clarifications = sourced_clarifications.length > 0 || (!is_multi_instance && pending_clarifications.length > 0);
|
|
1257
|
+
const show_submit_response = active_front_step === 0 && has_pending_clarifications;
|
|
1258
|
+
const next_button = (_jsx("div", { className: "flex justify-end pt-6 pb-2", children: _jsxs("button", { type: "button", onClick: go_next, className: "inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 transition-colors", children: [show_submit_response ? 'Submit Response' : 'Next', !show_submit_response && _jsx(HiChevronRight, { className: "h-4 w-4" })] }) }));
|
|
1242
1259
|
// ── Build form_content based on stepper mode ──
|
|
1243
1260
|
const front_office_title = props.front_office_title;
|
|
1244
|
-
const form_content = use_stepper ? (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx(FrontOfficeStepper, { steps: stepper_steps, active_step: active_front_step, completed_steps: completed_steps, on_step_click: handle_step_click }), props.front_stepper_actions && (_jsx("div", { className: "flex items-center gap-2 flex-shrink-0", children: props.front_stepper_actions }))] }), active_front_step === 0 && (_jsxs(_Fragment, { children: [step_0_content, !is_front_read_only && next_button] })), active_front_step === 1 && (
|
|
1261
|
+
const form_content = use_stepper ? (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx(FrontOfficeStepper, { steps: stepper_steps, active_step: active_front_step, completed_steps: completed_steps, on_step_click: handle_step_click }), props.front_stepper_actions && (_jsx("div", { className: "flex items-center gap-2 flex-shrink-0", children: props.front_stepper_actions }))] }), active_front_step === 0 && (_jsxs(_Fragment, { children: [step_0_content, !is_front_read_only && next_button] })), active_front_step === 1 && (_jsx(_Fragment, { children: step_1_content })), active_front_step === 2 && step_2_content, validation_detail_file_id && (() => {
|
|
1245
1262
|
const vr = file_validation_results[validation_detail_file_id];
|
|
1246
1263
|
if (!vr)
|
|
1247
1264
|
return null;
|
|
1248
1265
|
const rule_results = vr.rule_results ?? [];
|
|
1249
|
-
const has_any_failures = rule_results.length > 0 && rule_results.some(rr => rr.
|
|
1266
|
+
const has_any_failures = rule_results.length > 0 && rule_results.some(rr => rr.issues.length > 0);
|
|
1250
1267
|
const file_clarifications = has_any_failures
|
|
1251
1268
|
? immediate_clarifications.filter(item => item.doc_references?.some(r => r.file_id === validation_detail_file_id))
|
|
1252
1269
|
: [];
|
|
@@ -1264,14 +1281,16 @@ export function FrontOfficeView() {
|
|
|
1264
1281
|
}
|
|
1265
1282
|
const status_label = vr.status === 'passed' ? 'Passed' : vr.status === 'skipped' ? 'Skipped' : vr.status === 'failed' ? 'Failed' : vr.status;
|
|
1266
1283
|
return (_jsx(HazoUiDialog, { open: true, onOpenChange: (open) => { if (!open)
|
|
1267
|
-
set_validation_detail_file_id(null); }, title: "Validation Details", description: vr.file_name, sizeWidth: "28rem", headerBar: true, showCancelButton: false, actionButtonText: "OK", onConfirm: () => set_validation_detail_file_id(null), headerClassName: "[&_*]:break-all", children: _jsx("div", { className: "space-y-3 text-sm", children: vr.status === 'validating' && rule_results.length === 0 ? (_jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [_jsx("span", { className: "h-4 w-4 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin flex-shrink-0" }), "Validation in progress..."] })) : rule_results.length > 0 ? (_jsxs("div", { className: "space-y-4", children: [rule_results.some(rr => rr.
|
|
1284
|
+
set_validation_detail_file_id(null); }, title: "Validation Details", description: vr.file_name, sizeWidth: "28rem", headerBar: true, showCancelButton: false, actionButtonText: "OK", onConfirm: () => set_validation_detail_file_id(null), headerClassName: "[&_*]:break-all", children: _jsx("div", { className: "space-y-3 text-sm", children: vr.status === 'validating' && rule_results.length === 0 ? (_jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [_jsx("span", { className: "h-4 w-4 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin flex-shrink-0" }), "Validation in progress..."] })) : rule_results.length > 0 ? (_jsxs("div", { className: "space-y-4", children: [rule_results.some(rr => rr.issues.length > 0) && (_jsxs("div", { children: [_jsxs("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-red-600", children: ["Checks Executed: Failed (", rule_results.filter(rr => rr.issues.length > 0).length, ")"] }), _jsx("div", { className: "mt-1.5 space-y-1.5", children: rule_results.filter(rr => rr.issues.length > 0).map((rr, i) => (_jsxs("div", { className: "flex items-start gap-2 rounded-md p-2 border border-destructive/30 bg-destructive/5", children: [rr.user_resolved ? (_jsx(HiCheckCircle, { className: "h-4 w-4 text-amber-500 flex-shrink-0 mt-0.5" })) : (_jsx(HiExclamationCircle, { className: "h-4 w-4 text-destructive flex-shrink-0 mt-0.5" })), _jsxs("div", { className: "min-w-0", children: [_jsx("span", { className: "font-medium", children: rr.rule_name ?? rr.rule_id }), rr.user_resolved && rr.user_resolution && (_jsxs("div", { className: "mt-1 text-xs", children: [_jsx("span", { className: "text-amber-600 font-medium", children: "Client resolved: " }), _jsx("span", { className: "text-muted-foreground", children: rr.user_resolution.response_choice }), rr.user_resolution.user_comment && (_jsxs("p", { className: "text-muted-foreground mt-0.5 italic", children: ["\u201C", rr.user_resolution.user_comment, "\u201D"] }))] })), !rr.user_resolved && (rr.summary || rr.issues[0]?.issue_description) && (_jsx("p", { className: "text-muted-foreground text-xs mt-0.5", children: rr.summary ?? rr.issues[0]?.issue_description }))] })] }, i))) })] })), rule_results.some(rr => rr.issues.length === 0) && (_jsxs("div", { children: [_jsxs("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-green-600", children: ["Checks Executed: Passed (", rule_results.filter(rr => rr.issues.length === 0).length, ")"] }), _jsx("div", { className: "mt-1.5 space-y-1.5", children: rule_results.filter(rr => rr.issues.length === 0).map((rr, i) => {
|
|
1268
1285
|
let explanation;
|
|
1269
|
-
if (rr.
|
|
1270
|
-
explanation = rr.
|
|
1286
|
+
if (rr.summary)
|
|
1287
|
+
explanation = rr.summary;
|
|
1288
|
+
else if (rr.issues[0]?.issue_description)
|
|
1289
|
+
explanation = rr.issues[0].issue_description;
|
|
1271
1290
|
else if (rr.raw_response) {
|
|
1272
1291
|
try {
|
|
1273
1292
|
const parsed = JSON.parse(rr.raw_response.replace(/```(?:json)?\s*\n?/g, '').replace(/```/g, '').trim());
|
|
1274
|
-
explanation = parsed.
|
|
1293
|
+
explanation = parsed.summary || parsed.description || parsed.reason;
|
|
1275
1294
|
}
|
|
1276
1295
|
catch { /* ignore */ }
|
|
1277
1296
|
}
|
|
@@ -1287,7 +1306,7 @@ export function FrontOfficeView() {
|
|
|
1287
1306
|
if (!vr)
|
|
1288
1307
|
return null;
|
|
1289
1308
|
const rule_results = vr.rule_results ?? [];
|
|
1290
|
-
const has_any_failures = rule_results.length > 0 && rule_results.some(rr => rr.
|
|
1309
|
+
const has_any_failures = rule_results.length > 0 && rule_results.some(rr => rr.issues.length > 0);
|
|
1291
1310
|
const file_clarifications = has_any_failures
|
|
1292
1311
|
? immediate_clarifications.filter(item => item.doc_references?.some(r => r.file_id === validation_detail_file_id))
|
|
1293
1312
|
: [];
|
|
@@ -1305,14 +1324,16 @@ export function FrontOfficeView() {
|
|
|
1305
1324
|
}
|
|
1306
1325
|
const status_label = vr.status === 'passed' ? 'Passed' : vr.status === 'skipped' ? 'Skipped' : vr.status === 'failed' ? 'Failed' : vr.status;
|
|
1307
1326
|
return (_jsx(HazoUiDialog, { open: true, onOpenChange: (open) => { if (!open)
|
|
1308
|
-
set_validation_detail_file_id(null); }, title: "Validation Details", description: vr.file_name, sizeWidth: "28rem", headerBar: true, showCancelButton: false, actionButtonText: "OK", onConfirm: () => set_validation_detail_file_id(null), headerClassName: "[&_*]:break-all", children: _jsx("div", { className: "space-y-3 text-sm", children: vr.status === 'validating' && rule_results.length === 0 ? (_jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [_jsx("span", { className: "h-4 w-4 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin flex-shrink-0" }), "Validation in progress..."] })) : rule_results.length > 0 ? (_jsxs("div", { className: "space-y-4", children: [rule_results.some(rr => rr.
|
|
1327
|
+
set_validation_detail_file_id(null); }, title: "Validation Details", description: vr.file_name, sizeWidth: "28rem", headerBar: true, showCancelButton: false, actionButtonText: "OK", onConfirm: () => set_validation_detail_file_id(null), headerClassName: "[&_*]:break-all", children: _jsx("div", { className: "space-y-3 text-sm", children: vr.status === 'validating' && rule_results.length === 0 ? (_jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [_jsx("span", { className: "h-4 w-4 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin flex-shrink-0" }), "Validation in progress..."] })) : rule_results.length > 0 ? (_jsxs("div", { className: "space-y-4", children: [rule_results.some(rr => rr.issues.length > 0) && (_jsxs("div", { children: [_jsxs("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-red-600", children: ["Checks Executed: Failed (", rule_results.filter(rr => rr.issues.length > 0).length, ")"] }), _jsx("div", { className: "mt-1.5 space-y-1.5", children: rule_results.filter(rr => rr.issues.length > 0).map((rr, i) => (_jsxs("div", { className: "flex items-start gap-2 rounded-md p-2 border border-destructive/30 bg-destructive/5", children: [rr.user_resolved ? (_jsx(HiCheckCircle, { className: "h-4 w-4 text-amber-500 flex-shrink-0 mt-0.5" })) : (_jsx(HiExclamationCircle, { className: "h-4 w-4 text-destructive flex-shrink-0 mt-0.5" })), _jsxs("div", { className: "min-w-0", children: [_jsx("span", { className: "font-medium", children: rr.rule_name ?? rr.rule_id }), rr.user_resolved && rr.user_resolution && (_jsxs("div", { className: "mt-1 text-xs", children: [_jsx("span", { className: "text-amber-600 font-medium", children: "Client resolved: " }), _jsx("span", { className: "text-muted-foreground", children: rr.user_resolution.response_choice }), rr.user_resolution.user_comment && (_jsxs("p", { className: "text-muted-foreground mt-0.5 italic", children: ["\u201C", rr.user_resolution.user_comment, "\u201D"] }))] })), !rr.user_resolved && (rr.summary || rr.issues[0]?.issue_description) && (_jsx("p", { className: "text-muted-foreground text-xs mt-0.5", children: rr.summary ?? rr.issues[0]?.issue_description }))] })] }, i))) })] })), rule_results.some(rr => rr.issues.length === 0) && (_jsxs("div", { children: [_jsxs("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-green-600", children: ["Checks Executed: Passed (", rule_results.filter(rr => rr.issues.length === 0).length, ")"] }), _jsx("div", { className: "mt-1.5 space-y-1.5", children: rule_results.filter(rr => rr.issues.length === 0).map((rr, i) => {
|
|
1309
1328
|
let explanation;
|
|
1310
|
-
if (rr.
|
|
1311
|
-
explanation = rr.
|
|
1329
|
+
if (rr.summary)
|
|
1330
|
+
explanation = rr.summary;
|
|
1331
|
+
else if (rr.issues[0]?.issue_description)
|
|
1332
|
+
explanation = rr.issues[0].issue_description;
|
|
1312
1333
|
else if (rr.raw_response) {
|
|
1313
1334
|
try {
|
|
1314
1335
|
const parsed = JSON.parse(rr.raw_response.replace(/```(?:json)?\s*\n?/g, '').replace(/```/g, '').trim());
|
|
1315
|
-
explanation = parsed.
|
|
1336
|
+
explanation = parsed.summary || parsed.description || parsed.reason;
|
|
1316
1337
|
}
|
|
1317
1338
|
catch { /* ignore */ }
|
|
1318
1339
|
}
|