From a927cf8929b0379df2567fa953a3975d5354cc21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Miguel=20D=C3=ADaz=20Abril?= Date: Wed, 25 Dec 2024 21:02:21 +0100 Subject: [PATCH] Update jira extension - Added ability to open issues in other application - Initial commit --- extensions/jira/CHANGELOG.md | 3 +++ extensions/jira/package.json | 10 +++++++++- .../jira/src/components/IssueActions.tsx | 19 +++++++++++++++++-- extensions/jira/src/open-from-clipboard.tsx | 3 ++- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/extensions/jira/CHANGELOG.md b/extensions/jira/CHANGELOG.md index a4bb71fc3b9..798b81985f5 100644 --- a/extensions/jira/CHANGELOG.md +++ b/extensions/jira/CHANGELOG.md @@ -1,5 +1,8 @@ # Jira Changelog +## [Add ability to open issues in other application defined in extension preferences] - 2024-12-25 +- Implemented the ability to open by default in any other application (e.g. other browser) any issue. + ## [Add ability to copy newly created issue url to clipboard as an optional config] - 2024-12-12 - If you want to copy the newly created issue URL to the clipboard, you can now enable this feature in the extension settings. diff --git a/extensions/jira/package.json b/extensions/jira/package.json index a94cbfd8074..c3c49eaedae 100644 --- a/extensions/jira/package.json +++ b/extensions/jira/package.json @@ -17,7 +17,8 @@ "luarmr", "horumy", "santiago_perez", - "silv" + "silv", + "EyLuismi" ], "pastContributors": [ "igor9silva" @@ -145,6 +146,13 @@ "description": "API Token", "type": "password", "required": false + }, + { + "name": "open_in", + "type": "appPicker", + "title": "Open Issues in", + "required": false, + "description": "Select the browser or application to open Issues with." } ], "dependencies": { diff --git a/extensions/jira/src/components/IssueActions.tsx b/extensions/jira/src/components/IssueActions.tsx index e0a34d0a39f..e59b43ac6f6 100644 --- a/extensions/jira/src/components/IssueActions.tsx +++ b/extensions/jira/src/components/IssueActions.tsx @@ -1,4 +1,4 @@ -import { Action, ActionPanel, Icon, showToast, Toast } from "@raycast/api"; +import { Action, ActionPanel, closeMainWindow, getPreferenceValues, Icon, showToast, Toast, open } from "@raycast/api"; import { MutatePromise, useCachedPromise } from "@raycast/utils"; import { useState } from "react"; @@ -146,6 +146,9 @@ export default function IssueActions({ } } + + const { open_in } = getPreferenceValues(); + return ( @@ -156,8 +159,20 @@ export default function IssueActions({ target={} /> ) : null} + + {open_in ? ( + { + open(issueUrl, open_in); + closeMainWindow(); + }} + /> + ) : ( + + )} - {showAttachmentsAction && "attachment" in issue.fields ? ( { async function getClipboardText() { + const { open_in } = getPreferenceValues(); const clipboardText = (await Clipboard.readText())?.trim(); if (!clipboardText || clipboardText.length == 0) { await showHUD("Clipboard empty", { clearRootSearch: true, popToRootType: PopToRootType.Immediate }); @@ -42,7 +43,7 @@ export default function OpenFromClipboard() { // If we got a base URL configured, open the issue in the browser and close raycast const baseUrl = getBaseURL(); if (baseUrl) { - await open(getBaseURL() + "/browse/" + clipboardText); + await open(getBaseURL() + "/browse/" + clipboardText, open_in ?? undefined); await closeMainWindow({ clearRootSearch: true, popToRootType: PopToRootType.Immediate }); return; }