Skip to content

Commit 6313380

Browse files
authored
Merge pull request #5 from davidfrp/feature/SAGA-12-implement-issue-view-command
fix: invalid issue url
2 parents 1fd58c9 + c2461ae commit 6313380

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

src/commands/ready.ts

+14-15
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,18 @@ export default class Ready extends AuthCommand {
3939
this.initGitService(),
4040
]);
4141

42+
const shouldUndo = flags.undo;
43+
44+
if (!shouldUndo) {
45+
this.log(chalk.dim("(Use --undo flag to undo this action)"));
46+
}
47+
4248
const projectKey = await this.resolveProjectKey(jira);
4349

4450
await this.handlePullRequestExistance(git);
4551

4652
const issue = await this.resolveIssue(jira, git, projectKey);
4753

48-
const shouldUndo = flags.undo;
49-
5054
const transition = issue
5155
? await this.resolveIssueTransition(jira, shouldUndo, issue)
5256
: undefined;
@@ -61,15 +65,6 @@ export default class Ready extends AuthCommand {
6165

6266
await this.handleWhatsNext(jira, git, issue);
6367

64-
if (!shouldUndo) {
65-
this.log();
66-
this.log(
67-
chalk.dim(
68-
"Hint: You can use the --undo flag with the ready command to undo this action."
69-
)
70-
);
71-
}
72-
7368
this.log();
7469
}
7570

@@ -110,8 +105,6 @@ export default class Ready extends AuthCommand {
110105
this.open(issueUrl);
111106
break;
112107
}
113-
114-
this.log();
115108
}
116109

117110
private getSequencer(
@@ -284,15 +277,21 @@ export default class Ready extends AuthCommand {
284277
) ?? null;
285278
}
286279

287-
if (!transition) {
280+
if (!transitionStatus) {
281+
this.log(chalk.yellow("!"), "No issue status found.");
282+
}
283+
284+
if (transitionStatus && !transition) {
288285
this.log(
289286
chalk.yellow("!"),
290287
format(
291-
"The issue status %s is no longer available for this issue.",
288+
"The issue status %s is no longer available.",
292289
chalk.cyan(transitionStatus)
293290
)
294291
);
292+
}
295293

294+
if (!transition) {
296295
transition = await chooseTransition(filteredTransitions);
297296

298297
if (!transition.name) {

src/services/jira/JiraService.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export class JiraService {
121121
}
122122

123123
public constructIssueUrl(issue: Issue) {
124-
return `https://${this.host}/browse/${issue.key}`;
124+
return `${this.host}/browse/${issue.key}`;
125125
}
126126

127127
public extractIssueKey(projectKey: string, value: string) {

0 commit comments

Comments
 (0)