diff --git a/package.json b/package.json index d6f2cbc..8b1c4cd 100644 --- a/package.json +++ b/package.json @@ -45,4 +45,4 @@ "typescript": "^5.5.4", "vitest": "^2.0.5" } -} \ No newline at end of file +} diff --git a/src/main.ts b/src/main.ts index a28ecd1..94ed00a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,9 +17,9 @@ import { issueStatusSchema, issueTypeSchema, prioritySchema, - PriorityWithExit, + PriorityWithControls, Size, - SizeWithExit, + SizeWithControls, } from './schema/jira'; dotenv.config({ @@ -77,7 +77,7 @@ const cli = async () => { let storyPoints: Size = issue.fields[jira.fields.storyPoints]; if (!storyPoints) { - const answer: SizeWithExit = await select({ + const answer: SizeWithControls = await select({ message: 'Story Points', choices: [ { @@ -105,6 +105,10 @@ const cli = async () => { value: 13, }, new Separator('---'), + { + name: 'SKIP', + value: 0, + }, { name: 'EXIT', value: -1, @@ -114,6 +118,10 @@ const cli = async () => { loop: false, }); + if (answer === 0) { + continue; + } + if (answer === -1) { process.exit(0); } @@ -127,7 +135,7 @@ const cli = async () => { ); let priority = parsedPriority.success ? parsedPriority.data : undefined; if (!priority) { - const answer: PriorityWithExit = await select({ + const answer: PriorityWithControls = await select({ message: 'Priority', choices: [ { @@ -151,6 +159,10 @@ const cli = async () => { value: 'Blocker', }, new Separator(), + { + name: 'SKIP', + value: '0', + }, { name: 'EXIT', value: '-1', @@ -160,6 +172,10 @@ const cli = async () => { loop: false, }); + if (answer === '0') { + continue; + } + if (answer === '-1') { process.exit(0); } diff --git a/src/schema/jira.ts b/src/schema/jira.ts index c5b2c8a..ac15fde 100644 --- a/src/schema/jira.ts +++ b/src/schema/jira.ts @@ -30,7 +30,7 @@ export const colorSizeSchema = sizeSchema.transform(val => { }); export type Size = z.infer; -export type SizeWithExit = Size | -1; +export type SizeWithControls = Size | 0 | -1; export const prioritySchema = z.union([ z.literal('Blocker'), // red bold @@ -56,7 +56,7 @@ export const colorPrioritySchema = prioritySchema.transform(val => { }); export type Priority = z.infer; -export type PriorityWithExit = Priority | '-1'; +export type PriorityWithControls = Priority | '0' | '-1'; export const issueIdSchema = z.string().regex(/^RHEL-\d+$/);