diff --git a/.ci/kie-tools-ci-build.Dockerfile b/.ci/kie-tools-ci-build.Dockerfile index 2ea895e2939..882285505da 100644 --- a/.ci/kie-tools-ci-build.Dockerfile +++ b/.ci/kie-tools-ci-build.Dockerfile @@ -84,8 +84,8 @@ RUN wget https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-mav echo "source /etc/profile.d/maven.sh" >> $HOME/.bashrc # Golang setup -RUN wget https://go.dev/dl/go1.21.1.linux-amd64.tar.gz -P /tmp && \ - sudo tar xzf /tmp/go1.21.1.linux-amd64.tar.gz -C /opt && rm /tmp/go1.21.1.linux-amd64.tar.gz && \ +RUN wget https://go.dev/dl/go1.21.5.linux-amd64.tar.gz -P /tmp && \ + sudo tar xzf /tmp/go1.21.5.linux-amd64.tar.gz -C /opt && rm /tmp/go1.21.5.linux-amd64.tar.gz && \ echo 'export GOPATH=${HOME}/go' | sudo tee /etc/profile.d/go.sh && \ echo 'export PATH=${PATH}:/opt/go/bin:${GOPATH}/bin' | sudo tee -a /etc/profile.d/go.sh && \ echo "source /etc/profile.d/go.sh" >> $HOME/.bashrc diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index 9c0fabc18ac..c681d15be1d 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -57,10 +57,10 @@ runs: java-version: 11 distribution: "zulu" - - name: "Set up GOLANG 1.21.1" + - name: "Set up GOLANG 1.21.5" uses: actions/setup-go@v3 with: - go-version: "1.21.1" + go-version: "1.21.5" - name: "Set up Maven" uses: stCarolas/setup-maven@v4.5 diff --git a/README.md b/README.md index 79f4cf49a9b..e06412ca67e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To start building the Apache KIE Tools project, you're going to need: - pnpm `8.7.0` _(To install, follow these instructions: https://pnpm.io/installation)_ - Maven `3.8.6` - Java `11` -- Go `1.21.1` _(To install, follow these instructions: https://go.dev/doc/install)_ +- Go `1.21.5` _(To install, follow these instructions: https://go.dev/doc/install)_ - Helm `3.13.3` _(To install, follow these instructions: https://helm.sh/docs/intro/install/)_ > **ℹ️ NOTE:** Some packages will require that `make` is available as well. diff --git a/examples/commit-message-validation-service/go.mod b/examples/commit-message-validation-service/go.mod index 2912fb55703..26e6cab45cf 100644 --- a/examples/commit-message-validation-service/go.mod +++ b/examples/commit-message-validation-service/go.mod @@ -1,6 +1,6 @@ module github.com/apache/incubator-kie-tools/examples/commit-message-validation-service -go 1.20 +go 1.21 require ( github.com/gin-contrib/cors v1.4.0 diff --git a/examples/commit-message-validation-service/go.sum b/examples/commit-message-validation-service/go.sum index 972796ea3cb..c219a718a92 100644 --- a/examples/commit-message-validation-service/go.sum +++ b/examples/commit-message-validation-service/go.sum @@ -19,6 +19,7 @@ github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= diff --git a/examples/uniforms-patternfly/src/schemas/json-schema.ts b/examples/uniforms-patternfly/src/schemas/json-schema.ts index 7cf28115903..d74a2049f15 100644 --- a/examples/uniforms-patternfly/src/schemas/json-schema.ts +++ b/examples/uniforms-patternfly/src/schemas/json-schema.ts @@ -55,6 +55,7 @@ const schema = { type: "string", format: "date-time", max: "2000-04-04T10:30:00.000Z", + description: "this is date and time field", }, }, disabled: false, diff --git a/packages/chrome-extension/src/app/Dependencies.ts b/packages/chrome-extension/src/app/Dependencies.ts index a77357e9d7c..1b6faac1bed 100644 --- a/packages/chrome-extension/src/app/Dependencies.ts +++ b/packages/chrome-extension/src/app/Dependencies.ts @@ -61,6 +61,9 @@ export class Dependencies { }; public readonly openRepoInExternalEditor = { + buttonContainerOnRepoHome: () => { + return document.querySelector("#repository-details-container .pagehead-actions") as HTMLElement | null; + }, buttonContainerOnRepoFilesList: () => { return document.querySelector(".d-flex.gap-2")?.parentElement as HTMLElement | null; }, diff --git a/packages/chrome-extension/src/app/components/common/GitHubContext.tsx b/packages/chrome-extension/src/app/components/common/GitHubContext.tsx index 8d249abf3bc..1c14f1e6a5b 100644 --- a/packages/chrome-extension/src/app/components/common/GitHubContext.tsx +++ b/packages/chrome-extension/src/app/components/common/GitHubContext.tsx @@ -62,7 +62,7 @@ export const GitHubContextProvider: React.FC<{}> = (props) => { const userIsLoggedIn = useCallback(() => { return !!globals.dependencies.all.notificationIndicator(); - }, []); + }, [globals.dependencies.all]); const octokit = useCallback(() => { return octokitInstance; @@ -77,7 +77,7 @@ export const GitHubContextProvider: React.FC<{}> = (props) => { console.debug("Token not found."); } setReady(true); - }, []); + }, [token]); useLayoutEffect(() => { if (!token) { @@ -87,7 +87,7 @@ export const GitHubContextProvider: React.FC<{}> = (props) => { setCookie(globals.githubAuthTokenCookieName, token); octokitInstance = new Octokit({ auth: token }); } - }, [token]); + }, [globals.githubAuthTokenCookieName, token]); return ( diff --git a/packages/chrome-extension/src/app/components/common/KogitoEditorIframe.tsx b/packages/chrome-extension/src/app/components/common/KogitoEditorIframe.tsx index 99888ebbdb8..dbb4d54170a 100644 --- a/packages/chrome-extension/src/app/components/common/KogitoEditorIframe.tsx +++ b/packages/chrome-extension/src/app/components/common/KogitoEditorIframe.tsx @@ -53,12 +53,13 @@ const RefForwardingKogitoEditorIframe: React.ForwardRefRenderFunction globalStateControl || new StateControl(), [globalStateControl]); const resourceContentService = useMemo(() => { return resourceContentServiceFactory.createNew(githubApi.octokit(), repoInfo); - }, [repoInfo]); + }, [githubApi, repoInfo, resourceContentServiceFactory]); const onResourceContentRequest = useCallback( (request: ResourceContentRequest) => @@ -85,13 +86,13 @@ const RefForwardingKogitoEditorIframe: React.ForwardRefRenderFunction { if (!textMode && wasOnTextMode) { - props.getFileContents().then((content) => editor?.setContent(props.contentPath, content ?? "")); + getFileContents().then((content) => editor?.setContent(contentPath, content ?? "")); } - }, [textMode, wasOnTextMode, editor]); + }, [textMode, wasOnTextMode, editor, getFileContents, contentPath]); // When !textMode, we should listen for changes on the diagram to update GitHub's default text editor. useEffect(() => { - if (props.readonly || textMode || !editor) { + if (readonly || textMode || !editor) { return; } @@ -106,7 +107,7 @@ const RefForwardingKogitoEditorIframe: React.ForwardRefRenderFunction editor.getStateControl().unsubscribe(stateControlSubscription); - }, [textMode, editor]); + }, [textMode, editor, readonly]); // Forward reference methods to set content programmatically vs property useImperativeHandle( @@ -117,10 +118,10 @@ const RefForwardingKogitoEditorIframe: React.ForwardRefRenderFunction editor.setContent(props.contentPath, content), + setContent: (content: string) => editor.setContent(contentPath, content), }; }, - [editor] + [editor, contentPath] ); return ( @@ -133,7 +134,7 @@ const RefForwardingKogitoEditorIframe: React.ForwardRefRenderFunction { + const validToken = await tokenIsValid(token); + if (validToken) { + gitHubApi.setToken(token!); + setPotentialToken(""); + } else { + gitHubApi.setToken(""); + } + return validToken; + }, + [gitHubApi] + ); useEffect(() => { updateToken(gitHubApi.token).then(() => { console.debug("Checked GitHub token."); }); - }, []); - - const onPaste = useCallback((e) => { - const token = e.clipboardData.getData("text/plain").slice(0, GITHUB_OAUTH_TOKEN_SIZE); - setPotentialToken(token); - setTimeout(async () => { - const wasValid = await updateToken(token); - if (wasValid) { - setTimeout(() => setWholeMenuOpen(false), 2000); - } - inputRef.current!.setSelectionRange(0, 0); - }, 0); - }, []); + }, [gitHubApi.token, updateToken]); + + const onPaste = useCallback( + (e) => { + const token = e.clipboardData.getData("text/plain").slice(0, GITHUB_OAUTH_TOKEN_SIZE); + setPotentialToken(token); + setTimeout(async () => { + const wasValid = await updateToken(token); + if (wasValid) { + setTimeout(() => setWholeMenuOpen(false), 2000); + } + inputRef.current!.setSelectionRange(0, 0); + }, 0); + }, + [updateToken, setPotentialToken, setWholeMenuOpen] + ); const onReset = useCallback(() => { gitHubApi.setToken(""); @@ -74,7 +78,7 @@ export function KogitoMenu() { setTimeout(() => { inputRef.current!.focus(); }, 0); - }, []); + }, [gitHubApi]); const toggleInfoPopOver = useCallback(() => { setInfoPopOverOpen(!isInfoPopOverOpen); diff --git a/packages/chrome-extension/src/app/components/common/customEffects.ts b/packages/chrome-extension/src/app/components/common/customEffects.ts index bd29ea50ec6..5003662a48f 100644 --- a/packages/chrome-extension/src/app/components/common/customEffects.ts +++ b/packages/chrome-extension/src/app/components/common/customEffects.ts @@ -27,7 +27,9 @@ export function useEffectAfterFirstRender(func: () => ReturnType } else { firstRender.current = false; } - }, deps); + // Using deps as an extension mechanism to allow callers to define their own custom dependencies. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [func, ...deps]); } export function useIsolatedEditorTogglingEffect( @@ -43,7 +45,7 @@ export function useIsolatedEditorTogglingEffect( githubTextEditorToReplace.classList.add("hidden"); iframeContainer.classList.remove("hidden"); } - }, [textMode]); + }, [githubTextEditorToReplace.classList, iframeContainer.classList, textMode]); } export function useInitialAsyncCallEffect(promise: () => Promise, callback: (a: T) => void) { @@ -60,5 +62,5 @@ export function useInitialAsyncCallEffect(promise: () => Promise, callback return () => { canceled = true; }; - }, []); + }, [callback, promise]); } diff --git a/packages/chrome-extension/src/app/components/openRepoInExternalEditor/openRepoInExternalEditorApp.tsx b/packages/chrome-extension/src/app/components/openRepoInExternalEditor/openRepoInExternalEditorApp.tsx index 22f4d97cf5d..e3869e23508 100644 --- a/packages/chrome-extension/src/app/components/openRepoInExternalEditor/openRepoInExternalEditorApp.tsx +++ b/packages/chrome-extension/src/app/components/openRepoInExternalEditor/openRepoInExternalEditorApp.tsx @@ -20,15 +20,15 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; import { Globals, Main } from "../common/Main"; -import { createAndGetMainContainer, openRepoInExternalEditorContainer, removeAllChildren } from "../../utils"; +import { + createAndGetMainContainer, + openRepoInExternalEditorContainer, + openRepoInExternalEditorContainerFromRepositoryHome, + removeAllChildren, +} from "../../utils"; import { OpenInExternalEditorButton } from "./OpenInExternalEditorButton"; import { GitHubPageType } from "../../github/GitHubPageType"; -import { - KOGITO_IFRAME_CONTAINER_PR_CLASS, - KOGITO_OPEN_REPO_IN_EXTERNAL_EDITOR_CONTAINER_CLASS, - KOGITO_TOOLBAR_CONTAINER_PR_CLASS, - KOGITO_VIEW_ORIGINAL_LINK_CONTAINER_PR_CLASS, -} from "../../constants"; +import { KOGITO_OPEN_REPO_IN_EXTERNAL_EDITOR_CONTAINER_CLASS } from "../../constants"; export function renderOpenRepoInExternalEditorApp( args: Globals & { className: string; pageType: GitHubPageType; container: () => HTMLElement } @@ -50,7 +50,9 @@ export function renderOpenRepoInExternalEditorApp( > {ReactDOM.createPortal( , - openRepoInExternalEditorContainer(args.id, args.container()) + GitHubPageType.REPO_HOME === args.pageType + ? openRepoInExternalEditorContainerFromRepositoryHome(args.id, args.container()) + : openRepoInExternalEditorContainer(args.id, args.container()) )} , createAndGetMainContainer(args.id, args.dependencies.all.body()), diff --git a/packages/chrome-extension/src/app/components/pr/IsolatedPrEditor.tsx b/packages/chrome-extension/src/app/components/pr/IsolatedPrEditor.tsx index 8f0f3714832..4ca16836544 100644 --- a/packages/chrome-extension/src/app/components/pr/IsolatedPrEditor.tsx +++ b/packages/chrome-extension/src/app/components/pr/IsolatedPrEditor.tsx @@ -45,7 +45,6 @@ export interface PrInfo { targetGitRef: string; org: string; gitRef: string; - commitSHA: string; } export function IsolatedPrEditor(props: { @@ -65,8 +64,8 @@ export function IsolatedPrEditor(props: { const [fileStatusOnPr, setFileStatusOnPr] = useState(FileStatusOnPr.UNKNOWN); const { isolatedEditorRef } = useIsolatedEditorRef(); - const originalFilePath = useMemo(() => getOriginalFilePath(props.unprocessedFilePath), []); - const modifiedFilePath = useMemo(() => getModifiedFilePath(props.unprocessedFilePath), []); + const originalFilePath = useMemo(() => getOriginalFilePath(props.unprocessedFilePath), [props.unprocessedFilePath]); + const modifiedFilePath = useMemo(() => getModifiedFilePath(props.unprocessedFilePath), [props.unprocessedFilePath]); useIsolatedEditorTogglingEffect( textMode, @@ -74,9 +73,13 @@ export function IsolatedPrEditor(props: { props.githubTextEditorToReplace ); - useInitialAsyncCallEffect(() => { - return discoverFileStatusOnPr(githubApi.octokit(), props.prInfo, originalFilePath, modifiedFilePath); - }, setFileStatusOnPr); + useInitialAsyncCallEffect( + useCallback( + () => discoverFileStatusOnPr(githubApi.octokit(), props.prInfo, originalFilePath, modifiedFilePath), + [githubApi, props.prInfo, originalFilePath, modifiedFilePath] + ), + setFileStatusOnPr + ); const closeDiagram = useCallback(() => { setTextMode(true); @@ -92,7 +95,7 @@ export function IsolatedPrEditor(props: { return showOriginal || fileStatusOnPr === FileStatusOnPr.DELETED ? () => getOriginalFileContents(githubApi.octokit(), props.prInfo, originalFilePath) : () => getModifiedFileContents(githubApi.octokit(), props.prInfo, modifiedFilePath); - }, [showOriginal, fileStatusOnPr, originalFilePath, modifiedFilePath, githubApi.octokit]); + }, [showOriginal, fileStatusOnPr, githubApi, props.prInfo, originalFilePath, modifiedFilePath]); const shouldAddLinkToOriginalFile = useMemo(() => { return fileStatusOnPr === FileStatusOnPr.CHANGED || fileStatusOnPr === FileStatusOnPr.DELETED; @@ -114,7 +117,14 @@ export function IsolatedPrEditor(props: { gitref: props.prInfo.gitRef, repo: props.prInfo.repo, }; - }, [showOriginal]); + }, [ + props.prInfo.gitRef, + props.prInfo.org, + props.prInfo.repo, + props.prInfo.targetGitRef, + props.prInfo.targetOrg, + showOriginal, + ]); const onEditorReady = useCallback(() => { setEditorReady(true); @@ -284,19 +294,11 @@ function iframeContainer(id: string, container: HTMLElement) { } function getModifiedFileContents(octokit: Octokit, prInfo: PrInfo, modifiedFilePath: string) { - return fetchFile(octokit, prInfo.org, prInfo.repo, prInfo.gitRef, modifiedFilePath, undefined, prInfo.commitSHA); + return fetchFile(octokit, prInfo.org, prInfo.repo, prInfo.gitRef, modifiedFilePath, undefined); } function getOriginalFileContents(octokit: Octokit, prInfo: PrInfo, originalFilePath: string) { - return fetchFile( - octokit, - prInfo.targetOrg, - prInfo.repo, - prInfo.targetGitRef, - originalFilePath, - undefined, - prInfo.commitSHA - ); + return fetchFile(octokit, prInfo.targetOrg, prInfo.repo, prInfo.targetGitRef, originalFilePath, undefined); } function viewOriginalFileHref(prInfo: PrInfo, originalFilePath: string) { diff --git a/packages/chrome-extension/src/app/components/pr/PrEditorsApp.tsx b/packages/chrome-extension/src/app/components/pr/PrEditorsApp.tsx index 8573cfa92d8..33b0311bc83 100644 --- a/packages/chrome-extension/src/app/components/pr/PrEditorsApp.tsx +++ b/packages/chrome-extension/src/app/components/pr/PrEditorsApp.tsx @@ -32,7 +32,7 @@ export function PrEditorsApp(props: { prInfo: PrInfo }) { useEffect(() => { setPrFileContainers(supportedPrFileElements(globals.logger, globals.envelopeLocator, globals.dependencies)); - }, []); + }, [globals.dependencies, globals.envelopeLocator, globals.logger]); useEffect(() => { const observer = new MutationObserver((mutations) => { @@ -59,7 +59,7 @@ export function PrEditorsApp(props: { prInfo: PrInfo }) { return () => { observer.disconnect(); }; - }, [prFileContainers]); + }, [globals.dependencies, globals.envelopeLocator, globals.logger, prFileContainers]); return ( <> diff --git a/packages/chrome-extension/src/app/components/pr/prEditors.tsx b/packages/chrome-extension/src/app/components/pr/prEditors.tsx index d4d3b1df066..0d97140abd0 100644 --- a/packages/chrome-extension/src/app/components/pr/prEditors.tsx +++ b/packages/chrome-extension/src/app/components/pr/prEditors.tsx @@ -65,7 +65,6 @@ export function parsePrInfo(dependencies: Dependencies): PrInfo { const targetOrganization = window.location.pathname.split("/")[1]; const repository = window.location.pathname.split("/")[2]; - const commitSHA = dependencies.all.getViewFileButton()?.href.split("/")[6]; // PR is within the same organization if (prInfos.length < 6) { return { @@ -74,7 +73,6 @@ export function parsePrInfo(dependencies: Dependencies): PrInfo { targetGitRef: prInfos[1], org: targetOrganization, gitRef: prInfos[3], - commitSHA: commitSHA ?? "", }; } @@ -85,7 +83,6 @@ export function parsePrInfo(dependencies: Dependencies): PrInfo { targetGitRef: prInfos[2], org: prInfos[4], gitRef: prInfos[5], - commitSHA: commitSHA ?? "", }; } diff --git a/packages/chrome-extension/src/app/components/single/SingleEditorApp.tsx b/packages/chrome-extension/src/app/components/single/SingleEditorApp.tsx index 064ef4a483a..f06a4f7fea1 100644 --- a/packages/chrome-extension/src/app/components/single/SingleEditorApp.tsx +++ b/packages/chrome-extension/src/app/components/single/SingleEditorApp.tsx @@ -38,7 +38,7 @@ function useFullScreenEditorTogglingEffect(fullscreen: boolean) { } else { iframeFullscreenContainer(globals.id, globals.dependencies.all.body()).classList.remove("hidden"); } - }, [fullscreen]); + }, [fullscreen, globals.dependencies.all, globals.id]); } export function SingleEditorApp(props: { @@ -78,14 +78,22 @@ export function SingleEditorApp(props: { onSetContentError={onSetContentError} /> ), - [textMode, onSetContentError] + [ + isolatedEditorRef, + props.getFileContents, + props.fileInfo.path, + props.openFileExtension, + props.readonly, + textMode, + onSetContentError, + ] ); const exitFullScreen = useCallback(() => { setFullscreen(false); setTextModeAvailable(false); globals.dependencies.all.showDocumentBody(); - }, []); + }, [globals.dependencies.all]); const deactivateTextMode = useCallback(() => { setTextMode(false); @@ -99,7 +107,7 @@ export function SingleEditorApp(props: { const goFullScreen = useCallback(() => { setFullscreen(true); globals.dependencies.all.hideDocumentBody(); - }, []); + }, [globals.dependencies.all]); const { getFileContents, getFileName } = props; @@ -130,7 +138,7 @@ export function SingleEditorApp(props: { owner: props.fileInfo.org, repo: props.fileInfo.repo, }; - }, []); + }, [props.fileInfo.gitRef, props.fileInfo.org, props.fileInfo.repo]); return ( <> diff --git a/packages/chrome-extension/src/app/components/single/SingleEditorToolbar.tsx b/packages/chrome-extension/src/app/components/single/SingleEditorToolbar.tsx index 36d99753eec..8424468a568 100644 --- a/packages/chrome-extension/src/app/components/single/SingleEditorToolbar.tsx +++ b/packages/chrome-extension/src/app/components/single/SingleEditorToolbar.tsx @@ -40,26 +40,39 @@ export function SingleEditorToolbar(props: { const linkToExternalEditorTextAreaRef = useRef(null); const copyLinkSuccessAlertRef = useRef(null); const { i18n } = useChromeExtensionI18n(); + const { onFullScreen, onSeeAsSource, onSeeAsDiagram, onOpenInExternalEditor } = props; - const goFullScreen = useCallback((e: any) => { - e.preventDefault(); - props.onFullScreen(); - }, []); + const goFullScreen = useCallback( + (e: any) => { + e.preventDefault(); + onFullScreen(); + }, + [onFullScreen] + ); - const seeAsSource = useCallback((e: any) => { - e.preventDefault(); - props.onSeeAsSource(); - }, []); + const seeAsSource = useCallback( + (e: any) => { + e.preventDefault(); + onSeeAsSource(); + }, + [onSeeAsSource] + ); - const seeAsDiagram = useCallback((e: any) => { - e.preventDefault(); - props.onSeeAsDiagram(); - }, []); + const seeAsDiagram = useCallback( + (e: any) => { + e.preventDefault(); + onSeeAsDiagram(); + }, + [onSeeAsDiagram] + ); - const openInExternalEditor = useCallback((e: any) => { - e.preventDefault(); - props.onOpenInExternalEditor?.(); - }, []); + const openInExternalEditor = useCallback( + (e: any) => { + e.preventDefault(); + onOpenInExternalEditor?.(); + }, + [onOpenInExternalEditor] + ); const copyLinkToExternalEditor = useCallback((e: any) => { e.preventDefault(); @@ -83,7 +96,7 @@ export function SingleEditorToolbar(props: { return () => { /* Do nothing */ }; - }, [copyLinkSuccessAlertVisible]); + }, [closeCopyLinkSuccessAlert, copyLinkSuccessAlertVisible]); return ( <> diff --git a/packages/chrome-extension/src/app/components/single/singleEditorView.tsx b/packages/chrome-extension/src/app/components/single/singleEditorView.tsx index bb034b2ed6f..1bbcbc60697 100644 --- a/packages/chrome-extension/src/app/components/single/singleEditorView.tsx +++ b/packages/chrome-extension/src/app/components/single/singleEditorView.tsx @@ -23,6 +23,7 @@ import { extractOpenFileExtension, extractOpenFilePath, iframeFullscreenContainer, + openRepoInExternalEditorContainer, removeAllChildren, waitForElementToBeReady, } from "../../utils"; @@ -35,6 +36,8 @@ import { KOGITO_IFRAME_CONTAINER_CLASS, KOGITO_TOOLBAR_CONTAINER_CLASS } from ". import { fetchFile } from "../../github/api"; import { useGitHubApi } from "../common/GitHubContext"; import { useGlobals } from "../common/GlobalContext"; +import { OpenInExternalEditorButton } from "../openRepoInExternalEditor/OpenInExternalEditorButton"; +import { GitHubPageType } from "../../github/GitHubPageType"; export interface FileInfo { repo: string; @@ -43,7 +46,9 @@ export interface FileInfo { gitRef: string; } -export async function renderSingleEditorReadonlyApp(args: Globals & { fileInfo: FileInfo }) { +export async function renderSingleEditorReadonlyApp( + args: Globals & { className: string; pageType: GitHubPageType; container: () => HTMLElement; fileInfo: FileInfo } +) { // wait for the dom element to be ready before rendering await waitForElementToBeReady("textarea[id='read-only-cursor-text-area']"); // Checking whether this text editor exists is a good way to determine if the page is "ready", @@ -80,6 +85,10 @@ export async function renderSingleEditorReadonlyApp(args: Globals & { fileInfo: resourceContentServiceFactory={args.resourceContentServiceFactory} externalEditorManager={args.externalEditorManager} > + {ReactDOM.createPortal( + , + openRepoInExternalEditorContainer(args.id, args.container()) + )} , createAndGetMainContainer(args.id, args.dependencies.all.body()!), @@ -99,7 +108,7 @@ function SingleEditorViewApp(props: { fileInfo: FileInfo; openFileExtension: str props.fileInfo.gitRef, props.fileInfo.path ), - [] + [githubApi, props.fileInfo.gitRef, props.fileInfo.org, props.fileInfo.path, props.fileInfo.repo] ); const getFileName = useCallback(() => { return decodeURIComponent(props.fileInfo.path.split("/").pop()!); diff --git a/packages/chrome-extension/src/app/github/GitHubPageType.ts b/packages/chrome-extension/src/app/github/GitHubPageType.ts index e323bf23fe6..b1e7d78d1c0 100644 --- a/packages/chrome-extension/src/app/github/GitHubPageType.ts +++ b/packages/chrome-extension/src/app/github/GitHubPageType.ts @@ -21,7 +21,7 @@ export enum GitHubPageType { VIEW, EDIT, PR_FILES_OR_COMMITS, - CAN_OPEN_REPO_IN_EXTERNAL_EDITOR, ANY, PR_HOME, + REPO_HOME, } diff --git a/packages/chrome-extension/src/app/github/api.ts b/packages/chrome-extension/src/app/github/api.ts index 240f1dac279..0e86f6ed414 100644 --- a/packages/chrome-extension/src/app/github/api.ts +++ b/packages/chrome-extension/src/app/github/api.ts @@ -26,8 +26,7 @@ export function fetchFile( repo: string, ref: string, path: string, - contentType?: ContentType, - commitSHA?: string + contentType?: ContentType ) { return octokit.repos .getContent({ @@ -39,7 +38,7 @@ export function fetchFile( .then((res) => (contentType === ContentType.BINARY ? (res.data as any).content : atob((res.data as any).content))) .catch((e) => { console.debug(`Error fetching ${path} with Octokit. Fallback is 'raw.githubusercontent.com'.`); - return fetch(`https://raw.githubusercontent.com/${org}/${repo}/${commitSHA}/${path}`).then((res) => + return fetch(`https://raw.githubusercontent.com/${org}/${repo}/${ref}/${path}`).then((res) => res.ok ? res.text() : Promise.resolve(undefined) ); }); diff --git a/packages/chrome-extension/src/app/utils.ts b/packages/chrome-extension/src/app/utils.ts index b8c145c6900..9811e8b1c11 100644 --- a/packages/chrome-extension/src/app/utils.ts +++ b/packages/chrome-extension/src/app/utils.ts @@ -111,6 +111,19 @@ export function openRepoInExternalEditorContainer(id: string, container: HTMLEle return element(); } +export function openRepoInExternalEditorContainerFromRepositoryHome(id: string, container: HTMLElement) { + const element = () => document.querySelector(`.${KOGITO_OPEN_REPO_IN_EXTERNAL_EDITOR_CONTAINER_CLASS}.${id}`)!; + + if (!element()) { + container.insertAdjacentHTML( + "beforeend", + `
  • ` + ); + } + + return element(); +} + export function extractOpenFileExtension(url: string) { return url .split(".") diff --git a/packages/chrome-extension/src/index.ts b/packages/chrome-extension/src/index.ts index 68101799e1d..054185bd0a2 100644 --- a/packages/chrome-extension/src/index.ts +++ b/packages/chrome-extension/src/index.ts @@ -99,7 +99,13 @@ function init(globals: Globals) { if (pageType === GitHubPageType.EDIT) { renderSingleEditorApp({ ...globals, fileInfo }); } else if (pageType === GitHubPageType.VIEW) { - renderSingleEditorReadonlyApp({ ...globals, fileInfo }); + renderSingleEditorReadonlyApp({ + ...globals, + pageType, + className: "btn ml-2 d-none d-md-block", + container: () => globals.dependencies.openRepoInExternalEditor.buttonContainerOnRepoFilesList()!, + fileInfo, + }); } else if (pageType === GitHubPageType.PR_FILES_OR_COMMITS) { renderPrEditorsApp({ ...globals }); } else if (pageType === GitHubPageType.PR_HOME) { @@ -109,12 +115,12 @@ function init(globals: Globals) { className: "btn btn-sm", container: () => globals.dependencies.openRepoInExternalEditor.buttonContainerOnPrs()!, }); - } else if (pageType === GitHubPageType.CAN_OPEN_REPO_IN_EXTERNAL_EDITOR) { + } else if (pageType === GitHubPageType.REPO_HOME) { renderOpenRepoInExternalEditorApp({ ...globals, pageType, - className: "btn ml-2 d-none d-md-block", - container: () => globals.dependencies.openRepoInExternalEditor.buttonContainerOnRepoFilesList()!, + className: "btn btn-sm", + container: () => globals.dependencies.openRepoInExternalEditor.buttonContainerOnRepoHome()!, }); } else { throw new Error(`Unknown GitHubPageType ${pageType}`); @@ -172,9 +178,11 @@ export function discoverCurrentGitHubPageType() { } const isOrgSlashRepo = window.location.pathname.split("/").length === 3; + const isOrgSlashRepoSlashTreeSlashName = + window.location.pathname.split("/tree/").length === 2 && !window.location.pathname.split("/tree/")[1].includes("/"); - if (pathnameMatches(`/.*/.*/tree/.*`) || isOrgSlashRepo) { - return GitHubPageType.CAN_OPEN_REPO_IN_EXTERNAL_EDITOR; + if (isOrgSlashRepo || isOrgSlashRepoSlashTreeSlashName) { + return GitHubPageType.REPO_HOME; } if (pathnameMatches(`.*/.*/pull/[0-9]+/files.*`)) { diff --git a/packages/chrome-extension/tests/index.test.ts b/packages/chrome-extension/tests/index.test.ts index 5359ba66916..54b5563ee4c 100644 --- a/packages/chrome-extension/tests/index.test.ts +++ b/packages/chrome-extension/tests/index.test.ts @@ -53,6 +53,18 @@ describe("discoverCurrentGitHubPageType", () => { expect(type).toStrictEqual(GitHubPageType.EDIT); }); + test("repo home", async () => { + setWindowLocationPathname("github.com/organization/repositoryName"); + const type = index.discoverCurrentGitHubPageType(); + expect(type).toStrictEqual(GitHubPageType.REPO_HOME); + }); + + test("repo home with branch", async () => { + setWindowLocationPathname("github.com/organization/repositoryName/tree/main"); + const type = index.discoverCurrentGitHubPageType(); + expect(type).toStrictEqual(GitHubPageType.REPO_HOME); + }); + test("pr home", async () => { setWindowLocationPathname("/org/repo/pull/1"); const type = index.discoverCurrentGitHubPageType(); @@ -71,18 +83,6 @@ describe("discoverCurrentGitHubPageType", () => { expect(type).toStrictEqual(GitHubPageType.PR_FILES_OR_COMMITS); }); - test("tree repo", async () => { - setWindowLocationPathname("/user/repo/tree/some_ref"); - const type = index.discoverCurrentGitHubPageType(); - expect(type).toStrictEqual(GitHubPageType.CAN_OPEN_REPO_IN_EXTERNAL_EDITOR); - }); - - test("tree repo root", async () => { - setWindowLocationPathname("/user/repo"); - const type = index.discoverCurrentGitHubPageType(); - expect(type).toStrictEqual(GitHubPageType.CAN_OPEN_REPO_IN_EXTERNAL_EDITOR); - }); - test("any", async () => { setWindowLocationPathname("/"); const type = index.discoverCurrentGitHubPageType(); diff --git a/packages/dev-deployment-upload-service/go.mod b/packages/dev-deployment-upload-service/go.mod index 269a87f48da..f10bc8e82ab 100644 --- a/packages/dev-deployment-upload-service/go.mod +++ b/packages/dev-deployment-upload-service/go.mod @@ -1,5 +1,5 @@ module github.com/apache/incubator-kie-tools/packages/dev-deployment-upload-service -go 1.20 +go 1.21 require golang.org/x/sync v0.1.0 diff --git a/packages/extended-services/go.mod b/packages/extended-services/go.mod index 0c74f3040d5..adafc06b7eb 100644 --- a/packages/extended-services/go.mod +++ b/packages/extended-services/go.mod @@ -1,6 +1,6 @@ module github.com/apache/incubator-kie-tools/packages/extended-services -go 1.20 +go 1.21 require ( fyne.io/systray v1.10.1-0.20230710085509-436a931baccf diff --git a/packages/kn-plugin-workflow/README.md b/packages/kn-plugin-workflow/README.md index 7c415943fde..71ce9484dbd 100644 --- a/packages/kn-plugin-workflow/README.md +++ b/packages/kn-plugin-workflow/README.md @@ -12,7 +12,7 @@ All the commands in this section should be performed in the monorepo root. - Node `>= 18.14.0` _(To install, follow these instructions: https://nodejs.org/en/download/package-manager/)_ - pnpm `8.7.0` _(To install, follow these instructions: https://pnpm.io/installation)_ -- Go `1.21.1` _(To install, follow these instructions: https://go.dev/doc/install)_ +- Go `1.21.5` _(To install, follow these instructions: https://go.dev/doc/install)_ #### Prerequisites for running end-to-end tests diff --git a/packages/kn-plugin-workflow/go.mod b/packages/kn-plugin-workflow/go.mod index a871b248417..206ec7c7fab 100644 --- a/packages/kn-plugin-workflow/go.mod +++ b/packages/kn-plugin-workflow/go.mod @@ -1,6 +1,6 @@ module github.com/apache/incubator-kie-tools/packages/kn-plugin-workflow -go 1.20 +go 1.21 require ( github.com/beevik/etree v1.2.0 diff --git a/packages/kn-plugin-workflow/go.sum b/packages/kn-plugin-workflow/go.sum index 4299468a4ea..daffd8200ac 100644 --- a/packages/kn-plugin-workflow/go.sum +++ b/packages/kn-plugin-workflow/go.sum @@ -37,6 +37,7 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= @@ -91,9 +92,11 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= +github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.7.0 h1:nJqP7uwL84RJInrohHfW0Fx3awjbm8qZeFv0nW9SYGc= github.com/evanphx/json-patch/v5 v5.7.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -107,6 +110,7 @@ github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= +github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= @@ -116,6 +120,7 @@ github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+ github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= @@ -124,6 +129,7 @@ github.com/go-playground/validator/v10 v10.15.4 h1:zMXza4EpOdooxPel5xDqXEdXG5r+W github.com/go-playground/validator/v10 v10.15.4/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -194,6 +200,7 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= @@ -233,6 +240,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -270,14 +278,17 @@ github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= +github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= @@ -305,6 +316,7 @@ github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwa github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= @@ -312,6 +324,7 @@ github.com/senseyeio/duration v0.0.0-20180430131211-7c2a214ada46 h1:Dz0HrI1AtNSG github.com/senseyeio/duration v0.0.0-20180430131211-7c2a214ada46/go.mod h1:is8FVkzSi7PYLWEXT5MgWhglFsyyiW8ffxAoJqfuFZo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/serverlessworkflow/sdk-go/v2 v2.2.4 h1:uAYaezqiw6Q3RR3UBRQOd5YCZtmYtLZAYC74iW253dU= github.com/serverlessworkflow/sdk-go/v2 v2.2.4/go.mod h1:YmKuDaZ81zLyIfYZtgkcUpOzGN8xWMWeZGGaO5pW0Us= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -362,8 +375,11 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= +go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -724,6 +740,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= +gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/packages/kn-plugin-workflow/go.work b/packages/kn-plugin-workflow/go.work index c8e15b51e36..f818bf29602 100644 --- a/packages/kn-plugin-workflow/go.work +++ b/packages/kn-plugin-workflow/go.work @@ -1 +1,5 @@ +go 1.21 + +toolchain go1.21 + use . diff --git a/packages/serverless-logic-web-tools/e2e-tests/fixtures/expression/expression.sw.json b/packages/serverless-logic-web-tools/e2e-tests/fixtures/expression/expression.sw.json index 38a02bea3b9..8412ef1b9dc 100644 --- a/packages/serverless-logic-web-tools/e2e-tests/fixtures/expression/expression.sw.json +++ b/packages/serverless-logic-web-tools/e2e-tests/fixtures/expression/expression.sw.json @@ -19,11 +19,11 @@ "version": "0.1", "specVersion": "0.8", "start": "Expression state", - "dataInputSchema": "https://raw.githubusercontent.com/kiegroup/kogito-examples/1.36.0.Final/serverless-workflow-examples/serverless-workflow-expression-quarkus/src/main/resources/schema/expression.json", + "dataInputSchema": "https://raw.githubusercontent.com/apache/incubator-kie-kogito-examples/1.36.0.Final/serverless-workflow-examples/serverless-workflow-expression-quarkus/src/main/resources/schema/expression.json", "functions": [ { "name": "callBackFunc", - "operation": "https://raw.githubusercontent.com/kiegroup/kogito-examples/1.36.0.Final/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-workflow/src/main/resources/specs/callback.yaml", + "operation": "https://raw.githubusercontent.com/apache/incubator-kie-kogito-examples/1.36.0.Final/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-workflow/src/main/resources/specs/callback.yaml", "type": "rest" }, { diff --git a/packages/serverless-logic-web-tools/e2e-tests/fixtures/expression/expression.sw.yaml b/packages/serverless-logic-web-tools/e2e-tests/fixtures/expression/expression.sw.yaml index 38cbb7e1a2d..4b270e24e2c 100644 --- a/packages/serverless-logic-web-tools/e2e-tests/fixtures/expression/expression.sw.yaml +++ b/packages/serverless-logic-web-tools/e2e-tests/fixtures/expression/expression.sw.yaml @@ -12,10 +12,10 @@ id: Expression test version: "0.1" specVersion: "0.8" start: Expression state -dataInputSchema: "https://raw.githubusercontent.com/kiegroup/kogito-examples/1.36.0.Final/serverless-workflow-examples/serverless-workflow-expression-quarkus/src/main/resources/schema/expression.json" +dataInputSchema: "https://raw.githubusercontent.com/apache/incubator-kie-kogito-examples/1.36.0.Final/serverless-workflow-examples/serverless-workflow-expression-quarkus/src/main/resources/schema/expression.json" functions: - name: callBackFunc - operation: "https://raw.githubusercontent.com/kiegroup/kogito-examples/1.36.0.Final/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-workflow/src/main/resources/specs/callback.yaml" + operation: "https://raw.githubusercontent.com/apache/incubator-kie-kogito-examples/1.36.0.Final/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-workflow/src/main/resources/specs/callback.yaml" type: rest - name: testFunc operation: any diff --git a/packages/uniforms-patternfly/src/wrapField.tsx b/packages/uniforms-patternfly/src/wrapField.tsx index eaa32386c9a..ba646aa5731 100644 --- a/packages/uniforms-patternfly/src/wrapField.tsx +++ b/packages/uniforms-patternfly/src/wrapField.tsx @@ -19,6 +19,8 @@ import * as React from "react"; import { FormGroup, FormGroupProps } from "@patternfly/react-core/dist/js/components/Form"; +import { Popover } from "@patternfly/react-core/dist/js/components/Popover"; +import { HelpIcon } from "@patternfly/react-icons/dist/js/icons/help-icon"; import { filterDOMProps } from "uniforms"; declare module "uniforms" { @@ -50,10 +52,23 @@ type WrapperProps = { errorMessage?: string; help?: string; showInlineError?: boolean; + description?: React.ReactNode; } & Omit; export default function wrapField( - { id, label, type, disabled, error, errorMessage, showInlineError, help, required, ...props }: WrapperProps, + { + id, + label, + type, + disabled, + error, + errorMessage, + showInlineError, + help, + required, + description, + ...props + }: WrapperProps, children: React.ReactNode ) { return ( @@ -61,6 +76,20 @@ export default function wrapField( data-testid={"wrapper-field"} fieldId={id} label={label} + labelIcon={ + description ? ( + + + + ) : undefined + } isRequired={required} validated={error ? "error" : "default"} type={type} diff --git a/repo/build-dependencies-versions.json b/repo/build-dependencies-versions.json index 972e38316f8..e52fac5ed24 100644 --- a/repo/build-dependencies-versions.json +++ b/repo/build-dependencies-versions.json @@ -1,5 +1,5 @@ { - "go": "1.21.1", + "go": "1.21.5", "java": "11", "maven": "3.8.6", "node": "18.14.0",