jrrribeiro commited on
Commit
d170e95
·
1 Parent(s): 83fe12c

feat(ui): strengthen conflict indicators with explicit severity

Browse files
Files changed (1) hide show
  1. src/ui/app_factory.py +5 -2
src/ui/app_factory.py CHANGED
@@ -125,7 +125,8 @@ def _page_to_table(
125
  item.end_time,
126
  str(snapshot.get(item.detection_key, {}).get("status", "pending")),
127
  int(snapshot.get(item.detection_key, {}).get("version", 0)),
128
- "conflict" if conflict_detection_key and item.detection_key == conflict_detection_key else "",
 
129
  ]
130
  for item in page_obj.items
131
  ]
@@ -288,7 +289,8 @@ def _save_selected_validation(
288
  except OptimisticLockError as exc:
289
  return (
290
  "Conflito de concorrencia: esta deteccao foi atualizada por outro validador "
291
- f"(versao atual={exc.current_version}, esperada={exc.expected_version}). Recarregue a tabela.",
 
292
  cache_key,
293
  None,
294
  )
@@ -466,6 +468,7 @@ def create_app() -> gr.Blocks:
466
  "validation_status",
467
  "version",
468
  "conflict_flag",
 
469
  ],
470
  label="Deteccoes",
471
  interactive=False,
 
125
  item.end_time,
126
  str(snapshot.get(item.detection_key, {}).get("status", "pending")),
127
  int(snapshot.get(item.detection_key, {}).get("version", 0)),
128
+ "CONFLICT" if conflict_detection_key and item.detection_key == conflict_detection_key else "",
129
+ "HIGH" if conflict_detection_key and item.detection_key == conflict_detection_key else "",
130
  ]
131
  for item in page_obj.items
132
  ]
 
289
  except OptimisticLockError as exc:
290
  return (
291
  "Conflito de concorrencia: esta deteccao foi atualizada por outro validador "
292
+ f"(detection_key={exc.detection_key}, versao atual={exc.current_version}, esperada={exc.expected_version}). "
293
+ "Recarregue a tabela.",
294
  cache_key,
295
  None,
296
  )
 
468
  "validation_status",
469
  "version",
470
  "conflict_flag",
471
+ "conflict_severity",
472
  ],
473
  label="Deteccoes",
474
  interactive=False,