feat(i18n, agents, players): enhance localization and improve agent and player management interfaces
Some checks failed
lotteryadmin CI / build (push) Has been cancelled
Some checks failed
lotteryadmin CI / build (push) Has been cancelled
Updated localization files for English and Nepali, adding new entries and refining existing translations for better clarity. Enhanced the agent management interface with improved delegation features and child agent creation prompts. Improved player management functionalities, including confirmation dialogs for player actions and better handling of player creation and editing processes.
This commit is contained in:
@@ -1,66 +0,0 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const files = [
|
||||
"risk/risk-pools-console.tsx",
|
||||
"risk/risk-index-console.tsx",
|
||||
"admin-roles/admin-roles-console.tsx",
|
||||
"admin-users/admin-users-console.tsx",
|
||||
"wallet/wallet-console.tsx",
|
||||
"integration/integration-sites-console.tsx",
|
||||
"players/players-console.tsx",
|
||||
"config/doc/risk-cap-doc-screen.tsx",
|
||||
"draws/draw-review-console.tsx",
|
||||
"draws/draws-index-console.tsx",
|
||||
"tickets/player-tickets-console.tsx",
|
||||
"settings/currency-settings-panel.tsx",
|
||||
"agents/agents-console.tsx",
|
||||
"settlement/settlement-batches-console.tsx"
|
||||
];
|
||||
|
||||
const STICKY_HEAD_CLASSES = "sticky right-0 z-20 bg-muted shadow-[-1px_0_0_rgba(203,213,225,0.7)] ";
|
||||
const STICKY_CELL_CLASSES = "sticky right-0 z-10 bg-card shadow-[-1px_0_0_rgba(203,213,225,0.7)] ";
|
||||
|
||||
files.forEach(file => {
|
||||
const fullPath = path.join("/Users/kang/Work/lotterySystem/lotteryadmin/src/modules", file);
|
||||
if (!fs.existsSync(fullPath)) {
|
||||
console.log("Not found:", file);
|
||||
return;
|
||||
}
|
||||
|
||||
let content = fs.readFileSync(fullPath, 'utf8');
|
||||
let changed = false;
|
||||
|
||||
// Replace TableHead
|
||||
const newContent1 = content.replace(
|
||||
/<TableHead className="([^"]*text-center[^"]*)"([^>]*)>(.*?t\([^)]*(?:action|操作)[^)]*\).*?)<\/TableHead>/g,
|
||||
(match, p1, p2, p3) => {
|
||||
if (p1.includes("sticky")) return match;
|
||||
changed = true;
|
||||
return `<TableHead className="${STICKY_HEAD_CLASSES}${p1}"${p2}>${p3}</TableHead>`;
|
||||
}
|
||||
);
|
||||
content = newContent1;
|
||||
|
||||
// Replace TableCell wrapping AdminRowActionsMenu
|
||||
const newContent2 = content.replace(
|
||||
/<TableCell([^>]*)>\s*<AdminRowActionsMenu/g,
|
||||
(match, p1) => {
|
||||
if (match.includes("sticky")) return match;
|
||||
changed = true;
|
||||
if (p1.includes('className="')) {
|
||||
return match.replace(/className="([^"]*)"/, `className="${STICKY_CELL_CLASSES}$1"`);
|
||||
} else {
|
||||
return `<TableCell className="${STICKY_CELL_CLASSES}"${p1}>\n<AdminRowActionsMenu`;
|
||||
}
|
||||
}
|
||||
);
|
||||
content = newContent2;
|
||||
|
||||
if (changed) {
|
||||
fs.writeFileSync(fullPath, content, 'utf8');
|
||||
console.log("Updated", file);
|
||||
} else {
|
||||
console.log("Skipped", file);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user