diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index f8b1e3d5a..7ec78818d 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -3,9 +3,18 @@ name: Bump NPM version and push git tag on: workflow_dispatch: inputs: - version: - description: "Version to set (e.g., 1.2.3)" + version_type: + description: "Type of version bump" required: true + type: choice + options: + - major + - minor + - patch + - premajor + - preminor + - prepatch + - prerelease jobs: bump: @@ -25,9 +34,14 @@ jobs: node-version-file: ".nvmrc" - run: | - npm version ${{ inputs.version }} --no-git-tag-version + if [[ "${{ inputs.version_type }}" == "prerelease" || "${{ inputs.version_type }}" == "premajor" || "${{ inputs.version_type }}" == "preminor" || "${{ inputs.version_type }}" == "prepatch" ]]; then + npm version ${{ inputs.version_type }} --preid alpha --no-git-tag-version + else + npm version ${{ inputs.version_type }} --no-git-tag-version + fi git add package.json package-lock.json - git commit -m "Bump version to ${{ inputs.version }} [skip ci]" - git tag "v${{ inputs.version }}" + VERSION=$(node -p "require('./package.json').version") + git commit -m "Bump version to $VERSION [skip ci]" + git tag "v$VERSION" git push - git push origin "v${{ inputs.version }}" + git push origin "v$VERSION" diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/index.tsx index 66f6c1279..15febd7bc 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/index.tsx @@ -140,7 +140,7 @@ export const InsightCardRenderer = ({ if (spanCodeObjectId) { url = url.concat(`?uiFind=${spanCodeObjectId}`); } - window.open(url, "_blank", "noopener noreferrer"); + openURLInDefaultBrowser(url); return; } diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/insightCards/common/InsightCard/InsightHeader/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/insightCards/common/InsightCard/InsightHeader/index.tsx index b27e51afe..226255c26 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/insightCards/common/InsightCard/InsightHeader/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/insightCards/common/InsightCard/InsightHeader/index.tsx @@ -1,6 +1,8 @@ +import { platform } from "../../../../../../../../../platform"; import { useConfigSelector } from "../../../../../../../../../store/config/useConfigSelector"; import { isString } from "../../../../../../../../../typeGuards/isString"; import { formatTimeDistance } from "../../../../../../../../../utils/formatTimeDistance"; +import { getIdeLauncherLinkForSpan } from "../../../../../../../../../utils/getIdeLauncherLinkForSpan"; import { getInsightTypeInfo } from "../../../../../../../../../utils/getInsightTypeInfo"; import { Link } from "../../../../../../../../common/v3/Link"; import { NewTag } from "../../../../../../../../common/v3/NewTag"; @@ -53,10 +55,15 @@ export const InsightHeader = ({ const handleSpanLinkClick = () => { if (spanInfo) { - onSpanLinkClick(spanInfo.spanCodeObjectId); + onSpanLinkClick(); } }; + const spanIdeLauncherLink = + platform === "Web" && spanInfo + ? getIdeLauncherLinkForSpan(spanInfo) + : undefined; + return ( @@ -95,7 +102,14 @@ export const InsightHeader = ({ {!scope?.span && spanInfo && ( - {spanInfo.displayName} + + {spanInfo.displayName} + diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/insightCards/common/InsightCard/InsightHeader/types.ts b/src/components/Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/insightCards/common/InsightCard/InsightHeader/types.ts index 81ffe58b1..6db504aed 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/insightCards/common/InsightCard/InsightHeader/types.ts +++ b/src/components/Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/insightCards/common/InsightCard/InsightHeader/types.ts @@ -3,6 +3,6 @@ import type { GenericCodeObjectInsight } from "../../../../../../../types"; export interface InsightHeaderProps { insight: GenericCodeObjectInsight; isAsync?: boolean; - onSpanLinkClick: (spanCodeObjectId: string) => void; + onSpanLinkClick: () => void; lastUpdateTimer?: string | null; } diff --git a/src/types.ts b/src/types.ts index c861118cd..c098e8c86 100644 --- a/src/types.ts +++ b/src/types.ts @@ -98,6 +98,7 @@ export interface SpanInfo { spanCodeObjectId: string; methodCodeObjectId: string | null; kind: string | null; + uid?: string; } export interface SpanInstanceInfo { diff --git a/src/utils/getIdeLauncherLinkForSpan.ts b/src/utils/getIdeLauncherLinkForSpan.ts new file mode 100644 index 000000000..4c89c0035 --- /dev/null +++ b/src/utils/getIdeLauncherLinkForSpan.ts @@ -0,0 +1,16 @@ +import type { SpanInfo } from "../types"; + +export const getIdeLauncherLinkForSpan = (spanInfo: SpanInfo) => { + if (!spanInfo.uid) { + return; + } + + const baseURL = `${window.location.origin}/ide-launcher`; + const url = new URL(baseURL); + + url.searchParams.append("plugin.action", "GoToSpan"); + url.searchParams.append("plugin.spanUid", spanInfo.uid); + url.searchParams.append("plugin.targetTab", "issues"); + + return url.toString(); +};