mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-11 03:51:01 +00:00
Merge pull request #164 from Corfirean/feat/custom-races-report-target
Add Custom Races and Content Scaling report destinations
This commit is contained in:
13 files changed
+49
-8
No files matched your search
@@ -0,0 +1,7 @@
|
||||
---
|
||||
area: manager
|
||||
type: added
|
||||
audience: admins
|
||||
title: Report Content Scaling problems directly to its repository
|
||||
---
|
||||
The report form now includes a separate Content Scaling destination.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
area: manager
|
||||
type: added
|
||||
audience: admins
|
||||
title: Send custom race problem reports directly to their maintainer
|
||||
---
|
||||
The report form now includes Custom Races as a separate destination.
|
||||
@@ -1,5 +1,4 @@
|
||||
//! Where a problem report goes. A report about the bots goes to the repository of the bot system in question, anything
|
||||
//! else to the Manager's own. The repositories come from the module catalog, so there is one list to keep right.
|
||||
//! Problem-report destinations for the Manager, bot systems and upstream custom races.
|
||||
|
||||
use std::path::Path;
|
||||
|
||||
@@ -36,14 +35,14 @@ fn catalog_repo(id: &str) -> Option<String> {
|
||||
.and_then(|e| repo_of(&e.repo))
|
||||
}
|
||||
|
||||
/// The three places, in the order the page lists them. A bot system whose repository is unknown falls back to the Manager's.
|
||||
/// Report destinations in display order. Custom-race reports go to the upstream asset maintainer.
|
||||
pub fn targets() -> Vec<Target> {
|
||||
let mut v = vec![Target {
|
||||
id: "manager",
|
||||
repo: MANAGER_REPO.into(),
|
||||
ours: true,
|
||||
}];
|
||||
for (id, module) in [("companions", "companions"), ("squid", "playerbots")] {
|
||||
for (id, module) in [("companions", "companions"), ("squid", "playerbots"), ("content-scaling", "content-scaling")] {
|
||||
if let Some(repo) = catalog_repo(module) {
|
||||
v.push(Target {
|
||||
id,
|
||||
@@ -52,6 +51,11 @@ pub fn targets() -> Vec<Target> {
|
||||
});
|
||||
}
|
||||
}
|
||||
v.push(Target {
|
||||
id: "custom-races",
|
||||
repo: "ilusixn/azerothcore-wotlk-coa".into(),
|
||||
ours: false,
|
||||
});
|
||||
v
|
||||
}
|
||||
|
||||
@@ -103,7 +107,7 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn the_three_targets_come_from_the_catalog() {
|
||||
fn report_targets_route_to_their_maintainers() {
|
||||
let t = targets();
|
||||
let repo = |id: &str| t.iter().find(|x| x.id == id).map(|x| x.repo.clone());
|
||||
assert_eq!(
|
||||
@@ -116,6 +120,10 @@ mod tests {
|
||||
);
|
||||
assert_eq!(repo("squid").as_deref(), Some("Zyth45/mod-playerbots"));
|
||||
assert!(t.iter().find(|x| x.id == "squid").is_some_and(|x| !x.ours));
|
||||
assert_eq!(repo("custom-races").as_deref(), Some("ilusixn/azerothcore-wotlk-coa"));
|
||||
assert!(t.iter().find(|x| x.id == "custom-races").is_some_and(|x| !x.ours));
|
||||
assert_eq!(repo("content-scaling").as_deref(), Some("Corfirean/mod-coa-content-scaling"));
|
||||
assert!(t.iter().find(|x| x.id == "content-scaling").is_some_and(|x| x.ours));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -135,6 +143,9 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn only_the_new_issue_pages_of_the_targets_are_allowed() {
|
||||
assert!(is_new_issue_url("https://github.com/Corfirean/mod-coa-content-scaling/issues/new?title=a&body=b"));
|
||||
assert!(is_new_issue_url("https://github.com/ilusixn/azerothcore-wotlk-coa/issues/new?title=a&body=b"));
|
||||
assert!(!is_new_issue_url("https://github.com/ilusixn/azerothcore-wotlk-coa/issues/newer"));
|
||||
assert!(is_new_issue_url(
|
||||
"https://github.com/Zyth45/mod-playerbots/issues/new"
|
||||
));
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ export {};
|
||||
}
|
||||
if(cmd==="module_save_settings") { moduleEdits[args.module] = {...moduleEdits[args.module], ...args.changes}; return Object.keys(args.changes); }
|
||||
if(cmd==="report_context") return {manager_version:"0.3.1",windows:"Windows 11 (build 26200)",install_kind:"new",server_version:"0.261001.10",suggested_target:"companions",bots_version:"0.2.1 · 1a2b3c4d"};
|
||||
if(cmd==="report_targets") return [{id:"manager",repo:"Corfirean/coa-server-manager",ours:true},{id:"companions",repo:"Corfirean/mod-coa-playerbots",ours:true},{id:"squid",repo:"Zyth45/mod-playerbots",ours:false}];
|
||||
if(cmd==="report_targets") return [{id:"manager",repo:"Corfirean/coa-server-manager",ours:true},{id:"companions",repo:"Corfirean/mod-coa-playerbots",ours:true},{id:"squid",repo:"Zyth45/mod-playerbots",ours:false},{id:"custom-races",repo:"ilusixn/azerothcore-wotlk-coa",ours:false},{id:"content-scaling",repo:"Corfirean/mod-coa-content-scaling",ours:true}];
|
||||
if(cmd==="open_link"){(window as any).__lastLink=args.url;return null;}
|
||||
if(cmd==="export_diagnostics") return "C:\\Users\\you\\Desktop\\CoA-Diagnostics-20261001-140000.zip";
|
||||
if(cmd==="list_crashes") return [];
|
||||
|
||||
@@ -721,6 +721,8 @@ const de: Partial<Record<keyof typeof en, string>> = {
|
||||
"rep.target.manager": "CoA Server Manager, der Server oder andere Module",
|
||||
"rep.target.companions": "CoA Companions (Bots und das CoABotUI-Addon)",
|
||||
"rep.target.squid": "SQUID Playerbots",
|
||||
"rep.target.content-scaling": "Content Scaling (Schwierigkeits- und Stufenskalierung)",
|
||||
"rep.target.custom-races": "Custom Races (Völker und Client-Patches)",
|
||||
"rep.targetPublic": "Der Bericht wird öffentlich auf GitHub in {repo} veröffentlicht.",
|
||||
"rep.botsVersion": "Bot-Version",
|
||||
"rep.withDiag": "Diagnose für mich sammeln (empfohlen)",
|
||||
|
||||
@@ -777,6 +777,8 @@ const en = {
|
||||
"rep.target.manager": "CoA Server Manager, the server or other modules",
|
||||
"rep.target.companions": "CoA Companions (bots and the CoABotUI addon)",
|
||||
"rep.target.squid": "SQUID Playerbots",
|
||||
"rep.target.content-scaling": "Content Scaling (difficulty and level scaling)",
|
||||
"rep.target.custom-races": "Custom Races (races and client patches)",
|
||||
"rep.targetPublic": "The report will be public on GitHub in {repo}.",
|
||||
"rep.botsVersion": "Bot release",
|
||||
"rep.withDiag": "Collect the diagnostics for me (recommended)",
|
||||
|
||||
@@ -721,6 +721,8 @@ const es: Partial<Record<keyof typeof en, string>> = {
|
||||
"rep.target.manager": "CoA Server Manager, el servidor u otros módulos",
|
||||
"rep.target.companions": "CoA Companions (bots y el addon CoABotUI)",
|
||||
"rep.target.squid": "SQUID Playerbots",
|
||||
"rep.target.content-scaling": "Content Scaling (ajuste de dificultad y niveles)",
|
||||
"rep.target.custom-races": "Custom Races (razas y parches del cliente)",
|
||||
"rep.targetPublic": "El informe será público en GitHub, en {repo}.",
|
||||
"rep.botsVersion": "Versión de los bots",
|
||||
"rep.withDiag": "Reunir el diagnóstico por mí (recomendado)",
|
||||
|
||||
@@ -721,6 +721,8 @@ const fr: Partial<Record<keyof typeof en, string>> = {
|
||||
"rep.target.manager": "CoA Server Manager, le serveur ou d’autres modules",
|
||||
"rep.target.companions": "CoA Companions (bots et addon CoABotUI)",
|
||||
"rep.target.squid": "SQUID Playerbots",
|
||||
"rep.target.content-scaling": "Content Scaling (ajustement de la difficulté et des niveaux)",
|
||||
"rep.target.custom-races": "Custom Races (races et correctifs client)",
|
||||
"rep.targetPublic": "Le rapport sera public sur GitHub dans {repo}.",
|
||||
"rep.botsVersion": "Version des bots",
|
||||
"rep.withDiag": "Rassembler le diagnostic pour moi (recommandé)",
|
||||
|
||||
@@ -760,6 +760,8 @@ const ru: Partial<Record<keyof typeof en, string>> = {
|
||||
"rep.target.manager": "CoA Server Manager, сервер или другие модули",
|
||||
"rep.target.companions": "CoA Companions (боты и аддон CoABotUI)",
|
||||
"rep.target.squid": "SQUID Playerbots",
|
||||
"rep.target.content-scaling": "Content Scaling (масштабирование сложности и уровней)",
|
||||
"rep.target.custom-races": "Custom Races (расы и клиентские патчи)",
|
||||
"rep.targetPublic": "Репорт будет публичным на GitHub в {repo}.",
|
||||
"rep.botsVersion": "Версия ботов",
|
||||
"rep.withDiag": "Собрать диагностику за меня (рекомендуется)",
|
||||
|
||||
@@ -736,6 +736,8 @@ const zh = {
|
||||
"rep.target.manager": "CoA Server Manager、服务器或其他模块",
|
||||
"rep.target.companions": "CoA Companions(机器人与 CoABotUI 插件)",
|
||||
"rep.target.squid": "SQUID Playerbots",
|
||||
"rep.target.content-scaling": "Content Scaling(难度与等级缩放)",
|
||||
"rep.target.custom-races": "Custom Races(种族与客户端补丁)",
|
||||
"rep.targetPublic": "该报告将公开发布在 GitHub 的 {repo}。",
|
||||
"rep.botsVersion": "机器人版本",
|
||||
"rep.withDiag": "替我收集诊断信息(推荐)",
|
||||
|
||||
+1
-1
@@ -257,7 +257,7 @@ export interface ReportContext {
|
||||
bots_version: string | null;
|
||||
}
|
||||
|
||||
export type ReportTargetId = "manager" | "companions" | "squid";
|
||||
export type ReportTargetId = "manager" | "companions" | "squid" | "custom-races" | "content-scaling";
|
||||
|
||||
/** A place a problem report can go: its GitHub repository as `owner/name`. */
|
||||
export interface ReportTarget {
|
||||
|
||||
+3
-1
@@ -31,7 +31,9 @@ export function reportBody(r: ReportInput): string {
|
||||
`**Windows version:** ${r.windows || "unknown"} `,
|
||||
`**Fresh install or imported server:** ${r.installKind === "new" ? "Fresh install" : "Imported server"} `,
|
||||
...(r.serverVersion ? [`**Server version:** ${r.serverVersion} `] : []),
|
||||
...(r.target !== "manager" ? [`**Bot system:** ${r.target === "squid" ? "SQUID Playerbots" : "CoA Companions"}${r.botsVersion ? ` ${r.botsVersion}` : ""} `] : []),
|
||||
...(r.target === "squid" || r.target === "companions" ? [`**Bot system:** ${r.target === "squid" ? "SQUID Playerbots" : "CoA Companions"}${r.botsVersion ? ` ${r.botsVersion}` : ""} `] : []),
|
||||
...(r.target === "custom-races" ? ["**Component:** Custom Races "] : []),
|
||||
...(r.target === "content-scaling" ? ["**Component:** Content Scaling "] : []),
|
||||
"",
|
||||
"**What happened?** ",
|
||||
text(r.what, "Describe the problem."),
|
||||
|
||||
@@ -12,6 +12,8 @@ const TARGET_LABEL: Record<ReportTargetId, Key> = {
|
||||
manager: "rep.target.manager",
|
||||
companions: "rep.target.companions",
|
||||
squid: "rep.target.squid",
|
||||
"custom-races": "rep.target.custom-races",
|
||||
"content-scaling": "rep.target.content-scaling",
|
||||
};
|
||||
|
||||
const FALLBACK: ReportTarget = { id: "manager", repo: "Corfirean/coa-server-manager", ours: true };
|
||||
|
||||
Reference in new issue
Block a user