mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 16:56:36 +00:00
## Description: Some flags are offensive, so don't allow them to be selected by users. I think it's fine for nations continue to use the flags. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: evan
This commit is contained in:
@@ -29,9 +29,7 @@ export class FlagInputModal extends LitElement {
|
||||
class="flex flex-wrap justify-evenly gap-[1rem] overflow-y-auto overflow-x-hidden h-[90%]"
|
||||
>
|
||||
${Countries.filter(
|
||||
(country) =>
|
||||
country.name.toLowerCase().includes(this.search.toLowerCase()) ||
|
||||
country.code.toLowerCase().includes(this.search.toLowerCase()),
|
||||
(country) => !country.restricted && this.includedInSearch(country),
|
||||
).map(
|
||||
(country) => html`
|
||||
<button
|
||||
@@ -64,6 +62,13 @@ export class FlagInputModal extends LitElement {
|
||||
`;
|
||||
}
|
||||
|
||||
private includedInSearch(country: { name: string; code: string }): boolean {
|
||||
return (
|
||||
country.name.toLowerCase().includes(this.search.toLowerCase()) ||
|
||||
country.code.toLowerCase().includes(this.search.toLowerCase())
|
||||
);
|
||||
}
|
||||
|
||||
private handleSearch(event: Event) {
|
||||
this.search = (event.target as HTMLInputElement).value;
|
||||
}
|
||||
|
||||
@@ -484,7 +484,8 @@
|
||||
{
|
||||
"code": "Confederate States",
|
||||
"continent": "North America",
|
||||
"name": "Confederate States"
|
||||
"name": "Confederate States",
|
||||
"restricted": true
|
||||
},
|
||||
{
|
||||
"code": "1_Connacht",
|
||||
@@ -702,7 +703,8 @@
|
||||
{
|
||||
"code": "Fascist Spain",
|
||||
"continent": "Europe",
|
||||
"name": "Fascist Spain"
|
||||
"name": "Fascist Spain",
|
||||
"restricted": true
|
||||
},
|
||||
{
|
||||
"code": "fm",
|
||||
@@ -805,7 +807,8 @@
|
||||
{
|
||||
"code": "German Empire",
|
||||
"continent": "Europe",
|
||||
"name": "German Empire"
|
||||
"name": "German Empire",
|
||||
"restricted": true
|
||||
},
|
||||
{
|
||||
"code": "de",
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ export const ID = z
|
||||
export const AllPlayersStatsSchema = z.record(ID, PlayerStatsSchema);
|
||||
|
||||
export const UsernameSchema = SafeString;
|
||||
const countryCodes = countries.map((c) => c.code);
|
||||
const countryCodes = countries.filter((c) => !c.restricted).map((c) => c.code);
|
||||
export const FlagSchema = z
|
||||
.string()
|
||||
.max(128)
|
||||
|
||||
Reference in New Issue
Block a user