@@ -372,6 +387,45 @@ function SendouFormInner
({
);
}
+function SubmitRow({
+ hideWhen,
+ children,
+}: {
+ hideWhen: ((values: unknown) => boolean) | undefined;
+ children: React.ReactNode;
+}) {
+ return hideWhen ? (
+ {children}
+ ) : (
+ {children}
+ );
+}
+
+/**
+ * Split out of {@link SubmitRow} so that only forms that opt in subscribe to the
+ * form's values (and re-render on every edit).
+ */
+function ConditionalSubmitRow({
+ hideWhen,
+ children,
+}: {
+ hideWhen: (values: unknown) => boolean;
+ children: React.ReactNode;
+}) {
+ const context = React.useContext(FormContext);
+ const store = context?.store ?? EMPTY_FORM_STORE;
+ const getValues = () => store.values;
+ const values = React.useSyncExternalStore(
+ store.subscribe,
+ getValues,
+ getValues,
+ );
+
+ if (hideWhen(values)) return null;
+
+ return {children}
;
+}
+
function createFormStore(
initialValues: Record,
initialClientErrors: Partial>,
diff --git a/e2e/pages/user/user-card.ts b/e2e/pages/user/user-card.ts
index 625824b38..5fb2f5fd3 100644
--- a/e2e/pages/user/user-card.ts
+++ b/e2e/pages/user/user-card.ts
@@ -66,6 +66,8 @@ class ReportUserDialog {
this.locators = {
matchIdInput: page.getByLabel("Match ID"),
sentToast: page.getByText("Report sent to the staff"),
+ submitButton: page.getByTestId("submit-button"),
+ nicknameInstructions: page.getByTestId("nickname-report-instructions"),
};
}
diff --git a/e2e/user-report.spec.ts b/e2e/user-report.spec.ts
index 11774939a..171775fdc 100644
--- a/e2e/user-report.spec.ts
+++ b/e2e/user-report.spec.ts
@@ -51,6 +51,28 @@ test.describe("User report", () => {
await expect(adminPage.text(description)).toBeVisible();
});
+ test("points elsewhere instead of reporting an inappropriate nickname", async ({
+ page,
+ factories,
+ }) => {
+ const reporter = await factories.UserFactory.create();
+ await factories.LFGPostFactory.create({ authorId: NZAP_TEST_ID });
+
+ await impersonate(page, reporter.id);
+
+ const lfg = new LFGPage(page);
+ await lfg.goto();
+ const card = await lfg.openUserCard("N-ZAP");
+ const reportDialog = await card.openReportDialog();
+
+ await expect(reportDialog.locators.submitButton).toBeVisible();
+
+ await reportDialog.form.select("category", "INAPPROPRIATE_NICKNAME");
+
+ await expect(reportDialog.locators.nicknameInstructions).toBeVisible();
+ await expect(reportDialog.locators.submitButton).not.toBeVisible();
+ });
+
test("prefills the match id when reporting from a match page", async ({
page,
factories,
diff --git a/locales/da/forms.json b/locales/da/forms.json
index e3e99cfb5..8cceae3ab 100644
--- a/locales/da/forms.json
+++ b/locales/da/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "",
"labels.reportMatchId": "",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "",
"options.userReportCategory.HARASSMENT": "",
"options.userReportCategory.CHEATING": "",
diff --git a/locales/da/user.json b/locales/da/user.json
index ad22d513e..22331d83b 100644
--- a/locales/da/user.json
+++ b/locales/da/user.json
@@ -251,6 +251,9 @@
"card.editPrivateNote": "",
"card.report.header": "",
"card.report.falseReportsWarning": "",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "",
"card.xp": "",
"card.freeAgent": "",
diff --git a/locales/de/forms.json b/locales/de/forms.json
index d11b8f761..03964118d 100644
--- a/locales/de/forms.json
+++ b/locales/de/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "",
"labels.reportMatchId": "",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "",
"options.userReportCategory.HARASSMENT": "",
"options.userReportCategory.CHEATING": "",
diff --git a/locales/de/user.json b/locales/de/user.json
index c7e75ac15..30bd55bce 100644
--- a/locales/de/user.json
+++ b/locales/de/user.json
@@ -251,6 +251,9 @@
"card.editPrivateNote": "",
"card.report.header": "",
"card.report.falseReportsWarning": "",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "",
"card.xp": "",
"card.freeAgent": "",
diff --git a/locales/en/forms.json b/locales/en/forms.json
index f0ac8d30c..f42433bf3 100644
--- a/locales/en/forms.json
+++ b/locales/en/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "Category",
"labels.reportMatchId": "Match ID",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "Inappropriate content",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "Inappropriate nickname (Splatoon/Discord)",
"options.userReportCategory.ALTING": "Alting",
"options.userReportCategory.HARASSMENT": "Harassment",
"options.userReportCategory.CHEATING": "Cheating",
diff --git a/locales/en/user.json b/locales/en/user.json
index 1d5f9ce56..631038708 100644
--- a/locales/en/user.json
+++ b/locales/en/user.json
@@ -251,6 +251,9 @@
"card.editPrivateNote": "Edit private note",
"card.report.header": "Report {{name}}",
"card.report.falseReportsWarning": "Abuse of the reporting system including making false reports can lead to the suspension of your account.",
+ "card.report.nickname.explanation": "Please report them on the corresponding platform:",
+ "card.report.nickname.inGame": "Splatoon 3 in-game name: report the player in-game using Splatoon 3's own reporting feature (Battle Logs).",
+ "card.report.nickname.discord": "Discord username/avatar: report the account to Discord.",
"card.privateNote": "Private note",
"card.xp": "XP",
"card.freeAgent": "FA",
diff --git a/locales/es-ES/forms.json b/locales/es-ES/forms.json
index aa8d45fa8..4bd06aa6a 100644
--- a/locales/es-ES/forms.json
+++ b/locales/es-ES/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "Categoría",
"labels.reportMatchId": "ID de la partida",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "Contenido inapropiado",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "Multicuentas",
"options.userReportCategory.HARASSMENT": "Acoso",
"options.userReportCategory.CHEATING": "Trampas",
diff --git a/locales/es-ES/user.json b/locales/es-ES/user.json
index 09d1a5b91..b24cb1d03 100644
--- a/locales/es-ES/user.json
+++ b/locales/es-ES/user.json
@@ -254,6 +254,9 @@
"card.editPrivateNote": "Editar nota privada",
"card.report.header": "Reportar a {{name}}",
"card.report.falseReportsWarning": "Abusar del sistema de reportes, incluyendo hacer reportes falsos, puede llevar a la suspensión de tu cuenta.",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "Nota privada",
"card.xp": "XP",
"card.freeAgent": "FA",
diff --git a/locales/es-US/forms.json b/locales/es-US/forms.json
index d0607512e..633c5fdc3 100644
--- a/locales/es-US/forms.json
+++ b/locales/es-US/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "Categoría",
"labels.reportMatchId": "ID de la partida",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "Contenido inapropiado",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "Multicuentas",
"options.userReportCategory.HARASSMENT": "Acoso",
"options.userReportCategory.CHEATING": "Trampas",
diff --git a/locales/es-US/user.json b/locales/es-US/user.json
index e6f2090b2..76e1c18e7 100644
--- a/locales/es-US/user.json
+++ b/locales/es-US/user.json
@@ -254,6 +254,9 @@
"card.editPrivateNote": "Editar nota privada",
"card.report.header": "Reportar a {{name}}",
"card.report.falseReportsWarning": "Abusar del sistema de reportes, incluyendo hacer reportes falsos, puede llevar a la suspensión de tu cuenta.",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "Nota privada",
"card.xp": "XP",
"card.freeAgent": "FA",
diff --git a/locales/fr-CA/forms.json b/locales/fr-CA/forms.json
index e7f4a3960..5905bfc18 100644
--- a/locales/fr-CA/forms.json
+++ b/locales/fr-CA/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "",
"labels.reportMatchId": "",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "",
"options.userReportCategory.HARASSMENT": "",
"options.userReportCategory.CHEATING": "",
diff --git a/locales/fr-CA/user.json b/locales/fr-CA/user.json
index 07f9ef0c0..b11b3839f 100644
--- a/locales/fr-CA/user.json
+++ b/locales/fr-CA/user.json
@@ -254,6 +254,9 @@
"card.editPrivateNote": "",
"card.report.header": "",
"card.report.falseReportsWarning": "",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "",
"card.xp": "",
"card.freeAgent": "",
diff --git a/locales/fr-EU/forms.json b/locales/fr-EU/forms.json
index 62d035ddf..13d9ea32e 100644
--- a/locales/fr-EU/forms.json
+++ b/locales/fr-EU/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "",
"labels.reportMatchId": "",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "",
"options.userReportCategory.HARASSMENT": "",
"options.userReportCategory.CHEATING": "",
diff --git a/locales/fr-EU/user.json b/locales/fr-EU/user.json
index 36c72b99e..e3d9ceee1 100644
--- a/locales/fr-EU/user.json
+++ b/locales/fr-EU/user.json
@@ -254,6 +254,9 @@
"card.editPrivateNote": "",
"card.report.header": "",
"card.report.falseReportsWarning": "",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "",
"card.xp": "",
"card.freeAgent": "",
diff --git a/locales/he/forms.json b/locales/he/forms.json
index 4e6a9dc0c..216bcd878 100644
--- a/locales/he/forms.json
+++ b/locales/he/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "",
"labels.reportMatchId": "",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "",
"options.userReportCategory.HARASSMENT": "",
"options.userReportCategory.CHEATING": "",
diff --git a/locales/he/user.json b/locales/he/user.json
index a37c9ec43..08fbfad76 100644
--- a/locales/he/user.json
+++ b/locales/he/user.json
@@ -254,6 +254,9 @@
"card.editPrivateNote": "",
"card.report.header": "",
"card.report.falseReportsWarning": "",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "",
"card.xp": "",
"card.freeAgent": "",
diff --git a/locales/it/forms.json b/locales/it/forms.json
index d744a94b2..9fd023eec 100644
--- a/locales/it/forms.json
+++ b/locales/it/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "",
"labels.reportMatchId": "",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "",
"options.userReportCategory.HARASSMENT": "",
"options.userReportCategory.CHEATING": "",
diff --git a/locales/it/user.json b/locales/it/user.json
index 81973904c..fa6389595 100644
--- a/locales/it/user.json
+++ b/locales/it/user.json
@@ -254,6 +254,9 @@
"card.editPrivateNote": "",
"card.report.header": "",
"card.report.falseReportsWarning": "",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "",
"card.xp": "",
"card.freeAgent": "",
diff --git a/locales/ja/forms.json b/locales/ja/forms.json
index ea55c0ffa..a8f3be794 100644
--- a/locales/ja/forms.json
+++ b/locales/ja/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "",
"labels.reportMatchId": "",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "",
"options.userReportCategory.HARASSMENT": "",
"options.userReportCategory.CHEATING": "",
diff --git a/locales/ja/user.json b/locales/ja/user.json
index 1eca6c4ef..a17c7cc26 100644
--- a/locales/ja/user.json
+++ b/locales/ja/user.json
@@ -245,6 +245,9 @@
"card.editPrivateNote": "",
"card.report.header": "",
"card.report.falseReportsWarning": "",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "",
"card.xp": "",
"card.freeAgent": "",
diff --git a/locales/ko/forms.json b/locales/ko/forms.json
index 8dc958597..2c5e6a620 100644
--- a/locales/ko/forms.json
+++ b/locales/ko/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "",
"labels.reportMatchId": "",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "",
"options.userReportCategory.HARASSMENT": "",
"options.userReportCategory.CHEATING": "",
diff --git a/locales/ko/user.json b/locales/ko/user.json
index 350b6310f..950571459 100644
--- a/locales/ko/user.json
+++ b/locales/ko/user.json
@@ -245,6 +245,9 @@
"card.editPrivateNote": "",
"card.report.header": "",
"card.report.falseReportsWarning": "",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "",
"card.xp": "",
"card.freeAgent": "",
diff --git a/locales/nl/forms.json b/locales/nl/forms.json
index f8228a79e..822ca81c0 100644
--- a/locales/nl/forms.json
+++ b/locales/nl/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "",
"labels.reportMatchId": "",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "",
"options.userReportCategory.HARASSMENT": "",
"options.userReportCategory.CHEATING": "",
diff --git a/locales/nl/user.json b/locales/nl/user.json
index 6de20999e..673a77f91 100644
--- a/locales/nl/user.json
+++ b/locales/nl/user.json
@@ -251,6 +251,9 @@
"card.editPrivateNote": "",
"card.report.header": "",
"card.report.falseReportsWarning": "",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "",
"card.xp": "",
"card.freeAgent": "",
diff --git a/locales/pl/forms.json b/locales/pl/forms.json
index c03eb5380..7ac276cb1 100644
--- a/locales/pl/forms.json
+++ b/locales/pl/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "",
"labels.reportMatchId": "",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "",
"options.userReportCategory.HARASSMENT": "",
"options.userReportCategory.CHEATING": "",
diff --git a/locales/pl/user.json b/locales/pl/user.json
index 4c08d66ad..f2e9b6825 100644
--- a/locales/pl/user.json
+++ b/locales/pl/user.json
@@ -257,6 +257,9 @@
"card.editPrivateNote": "",
"card.report.header": "",
"card.report.falseReportsWarning": "",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "",
"card.xp": "",
"card.freeAgent": "",
diff --git a/locales/pt-BR/forms.json b/locales/pt-BR/forms.json
index 8235d18ba..98d6edf90 100644
--- a/locales/pt-BR/forms.json
+++ b/locales/pt-BR/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "",
"labels.reportMatchId": "",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "",
"options.userReportCategory.HARASSMENT": "",
"options.userReportCategory.CHEATING": "",
diff --git a/locales/pt-BR/user.json b/locales/pt-BR/user.json
index 1eb04b5ed..a55509021 100644
--- a/locales/pt-BR/user.json
+++ b/locales/pt-BR/user.json
@@ -254,6 +254,9 @@
"card.editPrivateNote": "",
"card.report.header": "",
"card.report.falseReportsWarning": "",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "",
"card.xp": "",
"card.freeAgent": "",
diff --git a/locales/ru/forms.json b/locales/ru/forms.json
index 4db2c5b31..a059b5e5c 100644
--- a/locales/ru/forms.json
+++ b/locales/ru/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "",
"labels.reportMatchId": "",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "",
"options.userReportCategory.HARASSMENT": "",
"options.userReportCategory.CHEATING": "",
diff --git a/locales/ru/user.json b/locales/ru/user.json
index 6105c6527..b3ab9faac 100644
--- a/locales/ru/user.json
+++ b/locales/ru/user.json
@@ -257,6 +257,9 @@
"card.editPrivateNote": "",
"card.report.header": "",
"card.report.falseReportsWarning": "",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "",
"card.xp": "",
"card.freeAgent": "",
diff --git a/locales/zh/forms.json b/locales/zh/forms.json
index 16209937f..e2561dfd0 100644
--- a/locales/zh/forms.json
+++ b/locales/zh/forms.json
@@ -218,6 +218,7 @@
"labels.reportCategory": "",
"labels.reportMatchId": "",
"options.userReportCategory.INAPPROPRIATE_CONTENT": "",
+ "options.userReportCategory.INAPPROPRIATE_NICKNAME": "",
"options.userReportCategory.ALTING": "",
"options.userReportCategory.HARASSMENT": "",
"options.userReportCategory.CHEATING": "",
diff --git a/locales/zh/user.json b/locales/zh/user.json
index 7070ccc9e..e1655f52a 100644
--- a/locales/zh/user.json
+++ b/locales/zh/user.json
@@ -246,6 +246,9 @@
"card.editPrivateNote": "",
"card.report.header": "",
"card.report.falseReportsWarning": "",
+ "card.report.nickname.explanation": "",
+ "card.report.nickname.inGame": "",
+ "card.report.nickname.discord": "",
"card.privateNote": "",
"card.xp": "",
"card.freeAgent": "",