Skip to content

Instantly share code, notes, and snippets.

View ankitjangidx's full-sized avatar
🧠

Ankit Jangid ankitjangidx

🧠
View GitHub Profile
import React from "react";
import { useLocation } from "react-router";
function useQuery() {
const location = useLocation();
// Prefer the query string (e.g. /execution?testExecutionId=123)
const searchParams = new URLSearchParams(location.search || "");
let testExecutionId = searchParams.get("testExecutionId");
// Fallback: handle malformed pattern like "/execution&testExecutionId=123"
@ankitjangidx
ankitjangidx / MyComposableEditor.jsx
Created August 21, 2025 18:20
media insert functionality for atlasian editor-core
import { EditorPresetBuilder } from "@atlaskit/editor-common/preset";
import { ComposableEditor } from "@atlaskit/editor-core/composable-editor";
import { usePreset } from "@atlaskit/editor-core/use-preset";
import React, { useRef } from "react";
import { basePlugin } from "@atlaskit/editor-plugins/base";
import { blockTypePlugin } from "@atlaskit/editor-plugins/block-type";
import { textFormattingPlugin } from "@atlaskit/editor-plugins/text-formatting";
import { alignmentPlugin } from "@atlaskit/editor-plugin-alignment";
import { findReplacePlugin } from "@atlaskit/editor-plugin-find-replace";
import { historyPlugin } from "@atlaskit/editor-plugin-history";
import { EditorPresetBuilder } from "@atlaskit/editor-common/preset";
import { ComposableEditor } from "@atlaskit/editor-core/composable-editor";
import { usePreset } from "@atlaskit/editor-core/use-preset";
import React, { useRef, useCallback } from "react";
import { basePlugin } from "@atlaskit/editor-plugins/base";
import { blockTypePlugin } from "@atlaskit/editor-plugins/block-type";
import { textFormattingPlugin } from "@atlaskit/editor-plugins/text-formatting";
import { alignmentPlugin } from "@atlaskit/editor-plugin-alignment";
import { findReplacePlugin } from "@atlaskit/editor-plugin-find-replace";
import { historyPlugin } from "@atlaskit/editor-plugin-history";