mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 05:37:20 +08:00
fix: use sentence case for 'Waiting for sandbox' text (#12958)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -11,7 +11,7 @@ import { I18nKey } from "#/i18n/declaration";
|
|||||||
// Mock translations
|
// Mock translations
|
||||||
const t = (key: string) => {
|
const t = (key: string) => {
|
||||||
const translations: { [key: string]: string } = {
|
const translations: { [key: string]: string } = {
|
||||||
COMMON$WAITING_FOR_SANDBOX: "Waiting For Sandbox",
|
COMMON$WAITING_FOR_SANDBOX: "Waiting for sandbox",
|
||||||
COMMON$STOPPING: "Stopping",
|
COMMON$STOPPING: "Stopping",
|
||||||
COMMON$STARTING: "Starting",
|
COMMON$STARTING: "Starting",
|
||||||
COMMON$SERVER_STOPPED: "Server stopped",
|
COMMON$SERVER_STOPPED: "Server stopped",
|
||||||
@@ -69,7 +69,7 @@ describe("getStatusText", () => {
|
|||||||
t,
|
t,
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(result).toBe(t(I18nKey.COMMON$WAITING_FOR_SANDBOX));
|
expect(result).toBe("Waiting for sandbox");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns task detail when task status is ERROR and detail exists", () => {
|
it("returns task detail when task status is ERROR and detail exists", () => {
|
||||||
|
|||||||
@@ -838,7 +838,7 @@ interface GetStatusTextArgs {
|
|||||||
* isStartingStatus: false,
|
* isStartingStatus: false,
|
||||||
* isStopStatus: false,
|
* isStopStatus: false,
|
||||||
* curAgentState: AgentState.RUNNING
|
* curAgentState: AgentState.RUNNING
|
||||||
* }) // Returns "Waiting For Sandbox"
|
* }) // Returns "Waiting for sandbox"
|
||||||
*/
|
*/
|
||||||
export function getStatusText({
|
export function getStatusText({
|
||||||
isPausing = false,
|
isPausing = false,
|
||||||
@@ -866,13 +866,13 @@ export function getStatusText({
|
|||||||
return t(I18nKey.CONVERSATION$READY);
|
return t(I18nKey.CONVERSATION$READY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format status text: "WAITING_FOR_SANDBOX" -> "Waiting for sandbox"
|
// Format status text with sentence case: "WAITING_FOR_SANDBOX" -> "Waiting for sandbox"
|
||||||
return (
|
return (
|
||||||
taskDetail ||
|
taskDetail ||
|
||||||
taskStatus
|
taskStatus
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.replace(/_/g, " ")
|
.replace(/_/g, " ")
|
||||||
.replace(/\b\w/g, (c) => c.toUpperCase())
|
.replace(/^\w/, (c) => c.toUpperCase())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user