From b37bde7bcfa2eeb6742f723213b38045fe1d7fe6 Mon Sep 17 00:00:00 2001
From: Whitigol <36452182+WhitigolProd@users.noreply.github.com>
Date: Tue, 13 Feb 2024 00:01:46 -0500
Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20feat:=20name=20search=20arrest?=
=?UTF-8?q?=20warning=20(#1913)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This adds a warning banner to the citizen search modal if the citizen is
currently arrested. This can be useful for citizens who are not supposed
to be released, jail breaks, etc. This was suggested in
https://github.com/SnailyCAD/snaily-cadv4/issues/1902#issuecomment-1927887466
### New Translation Values
- [x] Added `isArrested` translation value to all `.json` translation
files.
- [x] `.json` files are formatted: `pnpm format`
- [x] Translations are correct
---
apps/client/locales/cn/leo.json | 1 +
apps/client/locales/cs-CZ/leo.json | 1 +
apps/client/locales/de-DE/leo.json | 1 +
apps/client/locales/en-gb/leo.json | 1 +
apps/client/locales/en/leo.json | 1 +
apps/client/locales/fr-FR/leo.json | 1 +
apps/client/locales/nl-BE/leo.json | 1 +
apps/client/locales/pt-BR/leo.json | 1 +
apps/client/locales/ru/leo.json | 1 +
apps/client/locales/sv/leo.json | 1 +
apps/client/locales/tc/leo.json | 1 +
apps/client/locales/zh-CN/leo.json | 1 +
.../leo/modals/NameSearchModal/NameSearchModal.tsx | 11 +++++++++++
13 files changed, 23 insertions(+)
diff --git a/apps/client/locales/cn/leo.json b/apps/client/locales/cn/leo.json
index bf358ea32..9a867d232 100644
--- a/apps/client/locales/cn/leo.json
+++ b/apps/client/locales/cn/leo.json
@@ -60,6 +60,7 @@
"createWarrant": "创建逮捕令",
"citizenDead": "警告:该公民死于{data}",
"hasWarrants": "警告:这个公民有有效的逮捕令!",
+ "isArrested": "警告:这位公民目前被逮捕!",
"rank": "等级",
"position": "位置",
"officerLogs": "警员日志",
diff --git a/apps/client/locales/cs-CZ/leo.json b/apps/client/locales/cs-CZ/leo.json
index 089583175..18577a123 100644
--- a/apps/client/locales/cs-CZ/leo.json
+++ b/apps/client/locales/cs-CZ/leo.json
@@ -60,6 +60,7 @@
"createWarrant": "Vytvořit zatykač",
"citizenDead": "UPOZORNĚNÍ: tato osoba zemřela {date}.",
"hasWarrants": "UPOZORNĚNÍ: na osobu je vypsaný zatykač!",
+ "isArrested": "VAROVÁNÍ: Tento občan je v současné době zatčený!",
"rank": "Hodnost",
"position": "Pozice",
"officerLogs": "Záznamy policistů",
diff --git a/apps/client/locales/de-DE/leo.json b/apps/client/locales/de-DE/leo.json
index 1d8004039..ab31c7908 100644
--- a/apps/client/locales/de-DE/leo.json
+++ b/apps/client/locales/de-DE/leo.json
@@ -60,6 +60,7 @@
"createWarrant": "Haftbefehl erstellen",
"citizenDead": "WARNUNG: Dieser Bürger starb am {date}",
"hasWarrants": "WARNUNG: Gegen diesen Bürger liegt ein Haftbefehl vor!",
+ "isArrested": "WARNUNG: Dieser Bürger ist derzeit verhaftet!",
"rank": "Rang",
"position": "Position",
"officerLogs": "Officer Logs",
diff --git a/apps/client/locales/en-gb/leo.json b/apps/client/locales/en-gb/leo.json
index 63bbd652d..88bc78ebe 100644
--- a/apps/client/locales/en-gb/leo.json
+++ b/apps/client/locales/en-gb/leo.json
@@ -60,6 +60,7 @@
"createWarrant": "Create Warrant",
"citizenDead": "WARNING: This civilian was marked deceased on {date}",
"hasWarrants": "WARNING: This civilian has active warrants!",
+ "isArrested": "WARNING: This citizen is currently arrested!",
"rank": "Rank",
"position": "Position",
"officerLogs": "Officer Logs",
diff --git a/apps/client/locales/en/leo.json b/apps/client/locales/en/leo.json
index b95e7fa09..217b53bb3 100644
--- a/apps/client/locales/en/leo.json
+++ b/apps/client/locales/en/leo.json
@@ -60,6 +60,7 @@
"createWarrant": "Create Warrant",
"citizenDead": "WARNING: This citizen died on {date}",
"hasWarrants": "WARNING: This citizen has active warrants!",
+ "isArrested": "WARNING: This citizen is currently arrested!",
"rank": "Rank",
"position": "Position",
"officerLogs": "Officer Logs",
diff --git a/apps/client/locales/fr-FR/leo.json b/apps/client/locales/fr-FR/leo.json
index 245ae9359..ac16a7017 100644
--- a/apps/client/locales/fr-FR/leo.json
+++ b/apps/client/locales/fr-FR/leo.json
@@ -60,6 +60,7 @@
"createWarrant": "Créer un mandat",
"citizenDead": "ATTENTION : Ce citoyen est décédé le {date}",
"hasWarrants": "ATTENTION : Ce citoyen a des mandats actifs !",
+ "isArrested": "ATTENTION : Ce citoyen est actuellement arrêté !",
"rank": "Rang",
"position": "Position",
"officerLogs": "Journaux des officiers",
diff --git a/apps/client/locales/nl-BE/leo.json b/apps/client/locales/nl-BE/leo.json
index b5295e9cc..cbc51e25a 100644
--- a/apps/client/locales/nl-BE/leo.json
+++ b/apps/client/locales/nl-BE/leo.json
@@ -60,6 +60,7 @@
"createWarrant": "Arrestatiebevel maken",
"citizenDead": "WAARSCHUWING: Deze persoon is {date} overleden",
"hasWarrants": "WAARSCHUWING: Deze persoon heeft een actief arrestatiebevel!",
+ "isArrested": "WAARSCHUWING: Deze burger is momenteel gearresteerd!",
"rank": "Rang",
"position": "Positie",
"officerLogs": "Agenten Logs",
diff --git a/apps/client/locales/pt-BR/leo.json b/apps/client/locales/pt-BR/leo.json
index 551fb609e..aed01bbcc 100644
--- a/apps/client/locales/pt-BR/leo.json
+++ b/apps/client/locales/pt-BR/leo.json
@@ -60,6 +60,7 @@
"createWarrant": "Criar Mandado",
"citizenDead": "AVISO: Este cidadão morreu em {date}",
"hasWarrants": "AVISO: Este cidadão tem mandados ativos!",
+ "isArrested": "AVISO: Este cidadão está atualmente detido!",
"rank": "classificação",
"position": "Posição",
"officerLogs": "Registros do Oficial",
diff --git a/apps/client/locales/ru/leo.json b/apps/client/locales/ru/leo.json
index 2ef0d7cfc..bc84d8049 100644
--- a/apps/client/locales/ru/leo.json
+++ b/apps/client/locales/ru/leo.json
@@ -60,6 +60,7 @@
"createWarrant": "Создать ордер",
"citizenDead": "ВНИМАНИЕ: Этот гражданин погиб {date}",
"hasWarrants": "ВНИМАНИЕ: На этого гражданина есть ордера!",
+ "isArrested": "ВНИМАНИЕ: Этот гражданин в настоящее время задержан!",
"rank": "Звание",
"position": "Должность",
"officerLogs": "Журнал офицера",
diff --git a/apps/client/locales/sv/leo.json b/apps/client/locales/sv/leo.json
index 21c539707..e458afcfa 100644
--- a/apps/client/locales/sv/leo.json
+++ b/apps/client/locales/sv/leo.json
@@ -60,6 +60,7 @@
"createWarrant": "Skapa Arresteringsorder",
"citizenDead": "VARNING: Denna medborgare dog den {date}",
"hasWarrants": "VARNING: Denna medborgare har aktiva arresteringsordrar!",
+ "isArrested": "VARNING: Denna medborgare är för närvarande gripen!",
"rank": "Grad",
"position": "Position",
"officerLogs": "Officer-Loggar",
diff --git a/apps/client/locales/tc/leo.json b/apps/client/locales/tc/leo.json
index 1d1743942..e27a19bda 100644
--- a/apps/client/locales/tc/leo.json
+++ b/apps/client/locales/tc/leo.json
@@ -60,6 +60,7 @@
"createWarrant": "創建認股權證",
"citizenDead": "警告:該公民死於{data}",
"hasWarrants": "警告:這個公民有有效的逮捕令!",
+ "isArrested": "警告:這位公民目前被拘留!",
"rank": "等級",
"position": "位置",
"officerLogs": "警員日誌",
diff --git a/apps/client/locales/zh-CN/leo.json b/apps/client/locales/zh-CN/leo.json
index 9c013db53..866aedebb 100644
--- a/apps/client/locales/zh-CN/leo.json
+++ b/apps/client/locales/zh-CN/leo.json
@@ -60,6 +60,7 @@
"createWarrant": "创建逮捕令",
"citizenDead": "警告:该市民于 {date} 去世",
"hasWarrants": "警告:该市民有有效的逮捕令!",
+ "isArrested": "警告:这位公民目前被拘留!",
"rank": "等级",
"position": "职位",
"officerLogs": "警员日志",
diff --git a/apps/client/src/components/leo/modals/NameSearchModal/NameSearchModal.tsx b/apps/client/src/components/leo/modals/NameSearchModal/NameSearchModal.tsx
index fb927ade4..d001995fb 100644
--- a/apps/client/src/components/leo/modals/NameSearchModal/NameSearchModal.tsx
+++ b/apps/client/src/components/leo/modals/NameSearchModal/NameSearchModal.tsx
@@ -154,7 +154,10 @@ export function NameSearchModal() {
const warrants =
!currentResult || currentResult.isConfidential ? [] : currentResult.warrants ?? [];
+
const hasActiveWarrants = warrants.filter((v) => v.status === "ACTIVE").length > 0;
+ const isArrested =
+ !currentResult || currentResult.isConfidential ? false : currentResult.arrested;
const INITIAL_VALUES = {
searchValue: payloadCitizen?.name ?? "",
@@ -337,6 +340,14 @@ export function NameSearchModal() {
) : null}
+ {isArrested ? (
+