Skip to content

Commit

Permalink
🎉 feat: name search arrest warning (#1913)
Browse files Browse the repository at this point in the history
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
#1902 (comment)

### New Translation Values

- [x] Added `isArrested` translation value to all `.json` translation
files.
- [x] `.json` files are formatted: `pnpm format`
- [x] Translations are correct
  • Loading branch information
whitigol authored Feb 13, 2024
1 parent c0e35d3 commit b37bde7
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/client/locales/cn/leo.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"createWarrant": "创建逮捕令",
"citizenDead": "警告:该公民死于{data}",
"hasWarrants": "警告:这个公民有有效的逮捕令!",
"isArrested": "警告:这位公民目前被逮捕!",
"rank": "等级",
"position": "位置",
"officerLogs": "警员日志",
Expand Down
1 change: 1 addition & 0 deletions apps/client/locales/cs-CZ/leo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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ů",
Expand Down
1 change: 1 addition & 0 deletions apps/client/locales/de-DE/leo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/client/locales/en-gb/leo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/client/locales/en/leo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/client/locales/fr-FR/leo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/client/locales/nl-BE/leo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/client/locales/pt-BR/leo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/client/locales/ru/leo.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"createWarrant": "Создать ордер",
"citizenDead": "ВНИМАНИЕ: Этот гражданин погиб {date}",
"hasWarrants": "ВНИМАНИЕ: На этого гражданина есть ордера!",
"isArrested": "ВНИМАНИЕ: Этот гражданин в настоящее время задержан!",
"rank": "Звание",
"position": "Должность",
"officerLogs": "Журнал офицера",
Expand Down
1 change: 1 addition & 0 deletions apps/client/locales/sv/leo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/client/locales/tc/leo.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"createWarrant": "創建認股權證",
"citizenDead": "警告:該公民死於{data}",
"hasWarrants": "警告:這個公民有有效的逮捕令!",
"isArrested": "警告:這位公民目前被拘留!",
"rank": "等級",
"position": "位置",
"officerLogs": "警員日誌",
Expand Down
1 change: 1 addition & 0 deletions apps/client/locales/zh-CN/leo.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"createWarrant": "创建逮捕令",
"citizenDead": "警告:该市民于 {date} 去世",
"hasWarrants": "警告:该市民有有效的逮捕令!",
"isArrested": "警告:这位公民目前被拘留!",
"rank": "等级",
"position": "职位",
"officerLogs": "警员日志",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? "",
Expand Down Expand Up @@ -337,6 +340,14 @@ export function NameSearchModal() {
</SpeechAlert>
) : null}

{isArrested ? (
<SpeechAlert text={t("isArrested")}>
<div className="p-2 my-2 font-semibold bg-red-700 rounded-md">
{t("isArrested")}
</div>
</SpeechAlert>
) : null}

<div className="flex flex-col md:flex-row mt-3">
<div className="mr-2 min-w-[100px]">
{currentResult.imageId ? (
Expand Down

1 comment on commit b37bde7

@Legacy-TacticalGamingInteractive

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the warning does not disappear, even though the person is not arrested or in jail page.

Please sign in to comment.