MCPcopy Create free account
hub / github.com/bytebase/bytebase / formatIssueTitle

Function formatIssueTitle

frontend/src/utils/v1/issue/issue.ts:68–91  ·  view source on GitHub ↗
(
  title: string,
  databaseNameList?: string[]
)

Source from the content-addressed store, hash-verified

66 * This is the base formatting function used by both plans and other issue types.
67 */
68export const formatIssueTitle = (
69 title: string,
70 databaseNameList?: string[]
71): string => {
72 const parts: string[] = [];
73
74 if (databaseNameList !== undefined) {
75 if (databaseNameList.length === 0) {
76 parts.push(`[All databases]`);
77 } else if (databaseNameList.length === 1) {
78 parts.push(`[${databaseNameList[0]}]`);
79 } else {
80 parts.push(`[${databaseNameList.length} databases]`);
81 }
82 }
83
84 parts.push(title);
85
86 const datetime = dayjs().format("@MM-DD HH:mm");
87 const tz = "UTC" + dayjs().format("ZZ");
88 parts.push(`${datetime} ${tz}`);
89
90 return parts.join(" ");
91};
92
93/** Generates a title for database change plan issues. */
94export const generatePlanTitle = (

Callers 2

handleSubmitFunction · 0.90
generatePlanTitleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected