( title: string, databaseNameList?: string[] )
| 66 | * This is the base formatting function used by both plans and other issue types. |
| 67 | */ |
| 68 | export 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. */ |
| 94 | export const generatePlanTitle = ( |
no outgoing calls
no test coverage detected