diff --git a/assay/package-lock.json b/assay/package-lock.json index 500eab4e713..255cd924ce9 100644 --- a/assay/package-lock.json +++ b/assay/package-lock.json @@ -8,7 +8,7 @@ "name": "assay", "version": "0.0.0", "dependencies": { - "@labkey/components": "7.42.1" + "@labkey/components": "7.45.2-fb-redirectGH1023.1" }, "devDependencies": { "@labkey/build": "9.1.5", @@ -3742,9 +3742,9 @@ } }, "node_modules/@labkey/api": { - "version": "1.51.4", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/api/-/@labkey/api-1.51.4.tgz", - "integrity": "sha512-D8Rs1yd8dKnmLxGzMaTtOg3S7EpQRSGMCGPRNTPqICTukYwlHhi39UViiF9b7s3knlK4gtp9D64CHbQcehgw+w==", + "version": "1.51.5", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/api/-/@labkey/api-1.51.5.tgz", + "integrity": "sha512-F7qo6roSBTqeh68Z4yWwel/AAWvt620SSVdCQauKBYjHRJao/Z29gOKWEQ7lWy0E66avDwBOVzpBZq8syhvP0g==", "license": "Apache-2.0" }, "node_modules/@labkey/build": { @@ -3786,13 +3786,13 @@ } }, "node_modules/@labkey/components": { - "version": "7.42.1", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-7.42.1.tgz", - "integrity": "sha512-y9sVFxdqCQDBnWCSW4BqtpauFMbjuTmywXDT1O6Zh31PopyyWhGiEA99K+zPxGzn7QRKh6BLcm0QrlTFPh0+jA==", + "version": "7.45.2-fb-redirectGH1023.1", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-7.45.2-fb-redirectGH1023.1.tgz", + "integrity": "sha512-XGqquRH5Sn0CURgR2Tp8hubkQC+nB4YyyhETEhSD7ylybUCaX9/RTNeX9Yzs7fKhxCrxeUJ6EfWkICIcwcvutw==", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "@hello-pangea/dnd": "18.0.1", - "@labkey/api": "1.51.4", + "@labkey/api": "1.51.5", "@testing-library/dom": "~10.4.1", "@testing-library/jest-dom": "~6.9.1", "@testing-library/react": "~16.3.2", diff --git a/assay/package.json b/assay/package.json index 4966ca533cc..7132d07b5fe 100644 --- a/assay/package.json +++ b/assay/package.json @@ -15,7 +15,7 @@ "lint-fix": "eslint --fix" }, "dependencies": { - "@labkey/components": "7.42.1" + "@labkey/components": "7.45.2-fb-redirectGH1023.1" }, "devDependencies": { "@labkey/build": "9.1.5", diff --git a/assay/src/client/AssayTypeSelect/AssayTypeSelect.tsx b/assay/src/client/AssayTypeSelect/AssayTypeSelect.tsx index d1d20327916..682b6cdfead 100644 --- a/assay/src/client/AssayTypeSelect/AssayTypeSelect.tsx +++ b/assay/src/client/AssayTypeSelect/AssayTypeSelect.tsx @@ -12,6 +12,7 @@ import { AssayPickerTabs, GENERAL_ASSAY_PROVIDER_NAME, App as LabKeyApp, + redirect, useServerContext, } from '@labkey/components'; @@ -58,7 +59,7 @@ const AssayTypeSelect = memo(() => { const tab = useMemo(() => ActionURL.getParameter('tab'), []); const onCancel = useCallback(() => { - window.location.href = returnUrl || ActionURL.buildURL('project', 'begin'); + redirect(returnUrl || ActionURL.buildURL('project', 'begin')); }, [returnUrl]); const onChange = useCallback((model: AssayPickerSelectionModel) => { @@ -69,13 +70,15 @@ const AssayTypeSelect = memo(() => { const { container, file, provider, tab } = assayPickerSelection; if (tab === AssayPickerTabs.XAR_IMPORT_TAB && file) { uploadXarFile(file, container).then(() => { - window.location.href = ActionURL.buildURL('pipeline', 'status-showList', container); + redirect(ActionURL.buildURL('pipeline', 'status-showList', container)); }); } else { - window.location.href = ActionURL.buildURL('assay', 'designer', container, { - providerName: provider ? provider.name : GENERAL_ASSAY_PROVIDER_NAME, - returnUrl, - }); + redirect( + ActionURL.buildURL('assay', 'designer', container, { + providerName: provider ? provider.name : GENERAL_ASSAY_PROVIDER_NAME, + returnUrl, + }) + ); } }, [assayPickerSelection, returnUrl]); diff --git a/assay/src/client/PlateTemplateDesigner/PlateTemplateDesigner.test.tsx b/assay/src/client/PlateTemplateDesigner/PlateTemplateDesigner.test.tsx index 94d52b93dc8..3be58d1f081 100644 --- a/assay/src/client/PlateTemplateDesigner/PlateTemplateDesigner.test.tsx +++ b/assay/src/client/PlateTemplateDesigner/PlateTemplateDesigner.test.tsx @@ -25,6 +25,10 @@ jest.mock('@labkey/api', () => ({ }, })); +jest.mock('@labkey/components', () => ({ + redirect: jest.fn(), +})); + const mockPlate: PlateTemplate = { rowId: 1, name: 'Test Plate', diff --git a/assay/src/client/PlateTemplateDesigner/PlateTemplateDesigner.tsx b/assay/src/client/PlateTemplateDesigner/PlateTemplateDesigner.tsx index 4d846c60955..8996e7c8961 100644 --- a/assay/src/client/PlateTemplateDesigner/PlateTemplateDesigner.tsx +++ b/assay/src/client/PlateTemplateDesigner/PlateTemplateDesigner.tsx @@ -5,6 +5,7 @@ */ import React, { FC, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'; import { ActionURL, Ajax, Utils } from '@labkey/api'; +import { redirect } from '@labkey/components'; import { computeWarnings, PlateTemplate, Position, WellGroup } from './models'; import { StatusBar } from './components/StatusBar'; @@ -72,14 +73,6 @@ export function toggleCell(groups: WellGroup[], activeGroupRowId: number, row: n }); } -export function isSameOrigin(url: string): boolean { - try { - return new URL(url, window.location.origin).origin === window.location.origin; - } catch { - return false; - } -} - export const PlateTemplateDesigner: FC = () => { const [plate, setPlate] = useState(null); const [activeGroup, setActiveGroup] = useState(null); @@ -334,8 +327,7 @@ export const PlateTemplateDesigner: FC = () => { const navigateAway = useCallback(() => { isIntentionalExitRef.current = true; const returnURL = returnURLRef.current; - window.location.href = - returnURL && isSameOrigin(returnURL) ? returnURL : ActionURL.buildURL('plate', 'plateList'); + redirect(returnURL || ActionURL.buildURL('plate', 'plateList')); }, []); /** diff --git a/assay/src/client/PlateTemplateDesigner/PlateTemplateDesigner.utils.test.ts b/assay/src/client/PlateTemplateDesigner/PlateTemplateDesigner.utils.test.ts index ff1a1974f56..05895187f75 100644 --- a/assay/src/client/PlateTemplateDesigner/PlateTemplateDesigner.utils.test.ts +++ b/assay/src/client/PlateTemplateDesigner/PlateTemplateDesigner.utils.test.ts @@ -4,7 +4,7 @@ * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 */ import { WellGroup } from './models'; -import { assignColors, isSameOrigin, toggleCell } from './PlateTemplateDesigner'; +import { assignColors, toggleCell } from './PlateTemplateDesigner'; function makeGroup(rowId: number): WellGroup { return { rowId, type: 'SPECIMEN', name: `Group ${rowId}`, positions: [], properties: {}, allowNewGroups: false }; @@ -131,37 +131,3 @@ describe('toggleCell', () => { expect(toggleCell(groups, 99, 0, 0)).toEqual(groups); }); }); - -describe('isSameOrigin', () => { - // jsdom sets window.location.origin to 'http://localhost' - - test('returns true for a URL on the same origin', () => { - expect(isSameOrigin('http://localhost/some/path')).toBe(true); - }); - - test('returns true for a root-relative URL (same origin by construction)', () => { - expect(isSameOrigin('/labkey/plate/plateList.view')).toBe(true); - }); - - test('returns false for a different hostname', () => { - expect(isSameOrigin('http://evil.com/path')).toBe(false); - }); - - test('returns false for a different scheme', () => { - expect(isSameOrigin('https://localhost/path')).toBe(false); - }); - - test('returns false for a different port', () => { - expect(isSameOrigin('http://localhost:8080/path')).toBe(false); - }); - - test('returns false for a javascript: URL (XSS guard)', () => { - expect(isSameOrigin('javascript:alert(1)')).toBe(false); - }); - - test('returns false for an absolute URL with an invalid host (throws during construction)', () => { - // 'http://a b' has a space in the hostname which is invalid; the URL constructor throws, - // and the catch block returns false. - expect(isSameOrigin('http://a b/path')).toBe(false); - }); -}); diff --git a/core/package-lock.json b/core/package-lock.json index c87eb45ebef..88623bb2dc5 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -8,7 +8,7 @@ "name": "labkey-core", "version": "0.0.0", "dependencies": { - "@labkey/components": "7.42.1", + "@labkey/components": "7.45.2-fb-redirectGH1023.1", "@labkey/themes": "1.9.4" }, "devDependencies": { @@ -3745,9 +3745,9 @@ } }, "node_modules/@labkey/api": { - "version": "1.51.4", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/api/-/@labkey/api-1.51.4.tgz", - "integrity": "sha512-D8Rs1yd8dKnmLxGzMaTtOg3S7EpQRSGMCGPRNTPqICTukYwlHhi39UViiF9b7s3knlK4gtp9D64CHbQcehgw+w==", + "version": "1.51.5", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/api/-/@labkey/api-1.51.5.tgz", + "integrity": "sha512-F7qo6roSBTqeh68Z4yWwel/AAWvt620SSVdCQauKBYjHRJao/Z29gOKWEQ7lWy0E66avDwBOVzpBZq8syhvP0g==", "license": "Apache-2.0" }, "node_modules/@labkey/build": { @@ -3789,13 +3789,13 @@ } }, "node_modules/@labkey/components": { - "version": "7.42.1", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-7.42.1.tgz", - "integrity": "sha512-y9sVFxdqCQDBnWCSW4BqtpauFMbjuTmywXDT1O6Zh31PopyyWhGiEA99K+zPxGzn7QRKh6BLcm0QrlTFPh0+jA==", + "version": "7.45.2-fb-redirectGH1023.1", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-7.45.2-fb-redirectGH1023.1.tgz", + "integrity": "sha512-XGqquRH5Sn0CURgR2Tp8hubkQC+nB4YyyhETEhSD7ylybUCaX9/RTNeX9Yzs7fKhxCrxeUJ6EfWkICIcwcvutw==", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "@hello-pangea/dnd": "18.0.1", - "@labkey/api": "1.51.4", + "@labkey/api": "1.51.5", "@testing-library/dom": "~10.4.1", "@testing-library/jest-dom": "~6.9.1", "@testing-library/react": "~16.3.2", diff --git a/core/package.json b/core/package.json index dc5e7450330..e086b93a2bd 100644 --- a/core/package.json +++ b/core/package.json @@ -20,7 +20,7 @@ "lint-branch-fix": "node lint.diff.mjs --currentBranch --fix" }, "dependencies": { - "@labkey/components": "7.42.1", + "@labkey/components": "7.45.2-fb-redirectGH1023.1", "@labkey/themes": "1.9.4" }, "devDependencies": { diff --git a/core/src/client/AssayDesigner/AssayDesigner.tsx b/core/src/client/AssayDesigner/AssayDesigner.tsx index 9f866319365..7b8a7d59eec 100644 --- a/core/src/client/AssayDesigner/AssayDesigner.tsx +++ b/core/src/client/AssayDesigner/AssayDesigner.tsx @@ -27,6 +27,7 @@ import { getWebDavUrl, inferDomainFromFile, LoadingSpinner, + redirect, setDomainFields, } from '@labkey/components'; @@ -136,9 +137,7 @@ class AssayDesigner extends React.Component { navigate(defaultUrl: string) { this._dirty = false; - const redirectUrl = this.state.returnUrl || defaultUrl; - // TODO refactor this and other usages in platform/core/src/client to a helper safeRedirect() function from @labkey/components - window.location.href = ActionURL.buildURL('core', 'safeRedirect', undefined, { returnUrl: redirectUrl }); + redirect(this.state.returnUrl || defaultUrl); } onCancel = (): void => { diff --git a/core/src/client/DataClassDesigner/DataClassDesigner.tsx b/core/src/client/DataClassDesigner/DataClassDesigner.tsx index 9c83f7ae853..a2a3f538f09 100644 --- a/core/src/client/DataClassDesigner/DataClassDesigner.tsx +++ b/core/src/client/DataClassDesigner/DataClassDesigner.tsx @@ -23,6 +23,7 @@ import { DataClassModel, fetchDataClass, LoadingSpinner, + redirect, } from '@labkey/components'; import '../DomainDesigner.scss'; @@ -66,8 +67,7 @@ class DataClassDesignerWrapper extends React.Component { navigate(defaultUrl: string) { this._dirty = false; - const redirectUrl = ActionURL.getReturnUrl() || defaultUrl; - window.location.href = ActionURL.buildURL('core', 'safeRedirect', undefined, { returnUrl: redirectUrl }); + redirect(ActionURL.getReturnUrl() || defaultUrl); } onCancel = () => { diff --git a/core/src/client/DatasetDesigner/DatasetDesigner.tsx b/core/src/client/DatasetDesigner/DatasetDesigner.tsx index f7504d327c2..4c24160f2b1 100644 --- a/core/src/client/DatasetDesigner/DatasetDesigner.tsx +++ b/core/src/client/DatasetDesigner/DatasetDesigner.tsx @@ -23,6 +23,7 @@ import { DatasetModel, fetchDatasetDesign, LoadingSpinner, + redirect, } from '@labkey/components'; import { ActionURL, Domain, getServerContext } from '@labkey/api'; @@ -66,8 +67,7 @@ class DatasetDesigner extends PureComponent { navigate(defaultUrl: string): void { this._dirty = false; - const redirectUrl = ActionURL.getReturnUrl() || defaultUrl; - window.location.href = ActionURL.buildURL('core', 'safeRedirect', undefined, { returnUrl: redirectUrl }); + redirect(ActionURL.getReturnUrl() || defaultUrl); } navigateOnComplete(model: DatasetModel): void { diff --git a/core/src/client/DomainDesigner/DomainDesigner.tsx b/core/src/client/DomainDesigner/DomainDesigner.tsx index 0ff8aed6b54..72cc388132a 100644 --- a/core/src/client/DomainDesigner/DomainDesigner.tsx +++ b/core/src/client/DomainDesigner/DomainDesigner.tsx @@ -27,6 +27,7 @@ import { FormButtons, LoadingSpinner, Modal, + redirect, resolveErrorMessage, saveDomain, } from '@labkey/components'; @@ -161,8 +162,7 @@ class DomainDesigner extends React.PureComponent> { navigate = (): void => { this._dirty = false; - const redirectUrl = ActionURL.getReturnUrl() || ActionURL.buildURL('project', 'begin', getServerContext().container.path); - window.location.href = ActionURL.buildURL('core', 'safeRedirect', undefined, { returnUrl: redirectUrl }); + redirect(ActionURL.getReturnUrl() || ActionURL.buildURL('project', 'begin', getServerContext().container.path)); }; renderWarningConfirm() { diff --git a/core/src/client/ErrorHandler/ErrorHandler.tsx b/core/src/client/ErrorHandler/ErrorHandler.tsx index 794314c8ab1..9a891e33f67 100644 --- a/core/src/client/ErrorHandler/ErrorHandler.tsx +++ b/core/src/client/ErrorHandler/ErrorHandler.tsx @@ -8,7 +8,7 @@ import { ActionURL } from '@labkey/api'; import { getErrorHeading, getImage, getInstruction, getShowDetailsBtn, getSubHeading, getViewDetails } from './ErrorType'; import { ErrorDetails } from './model'; -import { withServerContext } from '@labkey/components'; +import { redirect, withServerContext } from '@labkey/components'; export interface AppContext { errorDetails: ErrorDetails; @@ -32,7 +32,7 @@ export class ErrorHandlerImpl extends PureComponent { - window.location.href = ActionURL.getBaseURL(false); + redirect(ActionURL.getBaseURL(false)); } render() { diff --git a/core/src/client/ErrorHandler/ErrorType.tsx b/core/src/client/ErrorHandler/ErrorType.tsx index 578010eaab1..a8a297ea682 100644 --- a/core/src/client/ErrorHandler/ErrorType.tsx +++ b/core/src/client/ErrorHandler/ErrorType.tsx @@ -4,7 +4,7 @@ * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 */ import React, { ReactNode } from 'react'; -import { imageURL, HelpLink, HELP_LINK_REFERRER } from '@labkey/components'; +import { HELP_LINK_REFERRER, HelpLink, imageURL, redirect } from '@labkey/components'; import { ActionURL, Ajax, getServerContext } from '@labkey/api'; import { ErrorDetails, ErrorType } from './model'; @@ -161,7 +161,7 @@ const PERMISSION_DETAILS = (errorDetails: ErrorDetails) => ( returnUrl, }, callback: () => { - window.location.href = returnUrl; + redirect(returnUrl); }, }); }} diff --git a/core/src/client/IssuesListDesigner/IssuesListDesigner.tsx b/core/src/client/IssuesListDesigner/IssuesListDesigner.tsx index 4896391279a..1084a2ab498 100644 --- a/core/src/client/IssuesListDesigner/IssuesListDesigner.tsx +++ b/core/src/client/IssuesListDesigner/IssuesListDesigner.tsx @@ -23,6 +23,7 @@ import { IssuesListDefDesignerPanels, IssuesListDefModel, LoadingSpinner, + redirect, } from '@labkey/components'; import '../DomainDesigner.scss'; @@ -82,8 +83,7 @@ class IssuesListDesigner extends React.Component<{}, State> { navigate = (defaultUrl: string) => { this._dirty = false; - const redirectUrl = ActionURL.getReturnUrl() || defaultUrl; - window.location.href = ActionURL.buildURL('core', 'safeRedirect', undefined, { returnUrl: redirectUrl }); + redirect(ActionURL.getReturnUrl() || defaultUrl); }; onComplete = (model: IssuesListDefModel) => { diff --git a/core/src/client/ListDesigner/ListDesigner.tsx b/core/src/client/ListDesigner/ListDesigner.tsx index 96ac31d955d..c57ba143d35 100644 --- a/core/src/client/ListDesigner/ListDesigner.tsx +++ b/core/src/client/ListDesigner/ListDesigner.tsx @@ -24,6 +24,7 @@ import { ListDesignerPanels, ListModel, LoadingSpinner, + redirect, } from '@labkey/components'; import '../DomainDesigner.scss'; @@ -104,7 +105,7 @@ export class ListDesigner extends React.Component { navigate = async (returnUrlProvider: () => Promise, model?: ListModel): Promise => { this._dirty = false; const redirectUrl = this.getReturnUrl(model) ?? (await returnUrlProvider()); - window.location.href = ActionURL.buildURL('core', 'safeRedirect', undefined, { returnUrl: redirectUrl }); + redirect(redirectUrl); }; getReturnUrl = (model?: ListModel): string => { diff --git a/core/src/client/QueryMetadataEditor/QueryMetadataEditor.tsx b/core/src/client/QueryMetadataEditor/QueryMetadataEditor.tsx index 7d22faef546..bde31a73a11 100644 --- a/core/src/client/QueryMetadataEditor/QueryMetadataEditor.tsx +++ b/core/src/client/QueryMetadataEditor/QueryMetadataEditor.tsx @@ -26,6 +26,7 @@ import { IBannerMessage, LoadingSpinner, Modal, + redirect, IFieldChange, } from '@labkey/components'; import { ActionURL, getServerContext } from '@labkey/api'; @@ -188,10 +189,12 @@ class QueryMetadataEditor extends PureComponent> { this._dirty = false; const { schemaName, queryName } = this.state; - window.location.href = ActionURL.buildURL('query', 'executeQuery', getServerContext().container.path, { - schemaName, - 'query.queryName': queryName, - }); + redirect( + ActionURL.buildURL('query', 'executeQuery', getServerContext().container.path, { + schemaName, + 'query.queryName': queryName, + }) + ); }; onConfirmViewData = () => { @@ -231,11 +234,12 @@ class QueryMetadataEditor extends PureComponent> { this._dirty = false; const { schemaName, queryName } = this.state; - window.location.href = + redirect( ActionURL.buildURL('query', 'sourceQuery', getServerContext().container.path, { schemaName, 'query.queryName': queryName, - }) + '#metadata'; + }) + '#metadata' + ); }; editSourceBtnHandler = () => { diff --git a/core/src/client/SampleTypeDesigner/SampleTypeDesigner.tsx b/core/src/client/SampleTypeDesigner/SampleTypeDesigner.tsx index 9f70eb8376b..497937e7c43 100644 --- a/core/src/client/SampleTypeDesigner/SampleTypeDesigner.tsx +++ b/core/src/client/SampleTypeDesigner/SampleTypeDesigner.tsx @@ -26,6 +26,7 @@ import { getSampleSet, getSampleTypeDetails, LoadingSpinner, + redirect, SampleTypeDesigner, SampleTypeModel, } from '@labkey/components'; @@ -144,8 +145,7 @@ class SampleTypeDesignerWrapper extends React.PureComponent { navigate(defaultUrl: string) { this._dirty = false; - const redirectUrl = ActionURL.getReturnUrl() || defaultUrl; - window.location.href = ActionURL.buildURL('core', 'safeRedirect', undefined, { returnUrl: redirectUrl }); + redirect(ActionURL.getReturnUrl() || defaultUrl); } render() { diff --git a/experiment/package-lock.json b/experiment/package-lock.json index e1fde491bd6..a08d63f7fe7 100644 --- a/experiment/package-lock.json +++ b/experiment/package-lock.json @@ -8,7 +8,7 @@ "name": "experiment", "version": "0.0.0", "dependencies": { - "@labkey/components": "7.42.1" + "@labkey/components": "7.45.2-fb-redirectGH1023.1" }, "devDependencies": { "@labkey/build": "9.1.5", @@ -3754,9 +3754,9 @@ } }, "node_modules/@labkey/api": { - "version": "1.51.4", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/api/-/@labkey/api-1.51.4.tgz", - "integrity": "sha512-D8Rs1yd8dKnmLxGzMaTtOg3S7EpQRSGMCGPRNTPqICTukYwlHhi39UViiF9b7s3knlK4gtp9D64CHbQcehgw+w==", + "version": "1.51.5", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/api/-/@labkey/api-1.51.5.tgz", + "integrity": "sha512-F7qo6roSBTqeh68Z4yWwel/AAWvt620SSVdCQauKBYjHRJao/Z29gOKWEQ7lWy0E66avDwBOVzpBZq8syhvP0g==", "license": "Apache-2.0" }, "node_modules/@labkey/build": { @@ -3798,13 +3798,13 @@ } }, "node_modules/@labkey/components": { - "version": "7.42.1", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-7.42.1.tgz", - "integrity": "sha512-y9sVFxdqCQDBnWCSW4BqtpauFMbjuTmywXDT1O6Zh31PopyyWhGiEA99K+zPxGzn7QRKh6BLcm0QrlTFPh0+jA==", + "version": "7.45.2-fb-redirectGH1023.1", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-7.45.2-fb-redirectGH1023.1.tgz", + "integrity": "sha512-XGqquRH5Sn0CURgR2Tp8hubkQC+nB4YyyhETEhSD7ylybUCaX9/RTNeX9Yzs7fKhxCrxeUJ6EfWkICIcwcvutw==", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "@hello-pangea/dnd": "18.0.1", - "@labkey/api": "1.51.4", + "@labkey/api": "1.51.5", "@testing-library/dom": "~10.4.1", "@testing-library/jest-dom": "~6.9.1", "@testing-library/react": "~16.3.2", diff --git a/experiment/package.json b/experiment/package.json index d8741240456..f68f022e17f 100644 --- a/experiment/package.json +++ b/experiment/package.json @@ -13,7 +13,7 @@ "test-integration": "cross-env NODE_ENV=test jest --ci --runInBand -c test/js/jest.config.integration.js" }, "dependencies": { - "@labkey/components": "7.42.1" + "@labkey/components": "7.45.2-fb-redirectGH1023.1" }, "devDependencies": { "@labkey/build": "9.1.5", diff --git a/pipeline/package-lock.json b/pipeline/package-lock.json index 05a94bf5859..a9a61e66f00 100644 --- a/pipeline/package-lock.json +++ b/pipeline/package-lock.json @@ -8,7 +8,7 @@ "name": "pipeline", "version": "0.0.0", "dependencies": { - "@labkey/components": "7.42.1" + "@labkey/components": "7.45.2-fb-redirectGH1023.1" }, "devDependencies": { "@labkey/build": "9.1.5", @@ -2835,9 +2835,9 @@ } }, "node_modules/@labkey/api": { - "version": "1.51.4", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/api/-/@labkey/api-1.51.4.tgz", - "integrity": "sha512-D8Rs1yd8dKnmLxGzMaTtOg3S7EpQRSGMCGPRNTPqICTukYwlHhi39UViiF9b7s3knlK4gtp9D64CHbQcehgw+w==", + "version": "1.51.5", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/api/-/@labkey/api-1.51.5.tgz", + "integrity": "sha512-F7qo6roSBTqeh68Z4yWwel/AAWvt620SSVdCQauKBYjHRJao/Z29gOKWEQ7lWy0E66avDwBOVzpBZq8syhvP0g==", "license": "Apache-2.0" }, "node_modules/@labkey/build": { @@ -2879,13 +2879,13 @@ } }, "node_modules/@labkey/components": { - "version": "7.42.1", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-7.42.1.tgz", - "integrity": "sha512-y9sVFxdqCQDBnWCSW4BqtpauFMbjuTmywXDT1O6Zh31PopyyWhGiEA99K+zPxGzn7QRKh6BLcm0QrlTFPh0+jA==", + "version": "7.45.2-fb-redirectGH1023.1", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-7.45.2-fb-redirectGH1023.1.tgz", + "integrity": "sha512-XGqquRH5Sn0CURgR2Tp8hubkQC+nB4YyyhETEhSD7ylybUCaX9/RTNeX9Yzs7fKhxCrxeUJ6EfWkICIcwcvutw==", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "@hello-pangea/dnd": "18.0.1", - "@labkey/api": "1.51.4", + "@labkey/api": "1.51.5", "@testing-library/dom": "~10.4.1", "@testing-library/jest-dom": "~6.9.1", "@testing-library/react": "~16.3.2", diff --git a/pipeline/package.json b/pipeline/package.json index ddab3d84e85..92943c0bc56 100644 --- a/pipeline/package.json +++ b/pipeline/package.json @@ -14,7 +14,7 @@ "build-prod": "npm run clean && cross-env NODE_ENV=production PROD_SOURCE_MAP=source-map webpack --config node_modules/@labkey/build/webpack/prod.config.js --color --progress --profile" }, "dependencies": { - "@labkey/components": "7.42.1" + "@labkey/components": "7.45.2-fb-redirectGH1023.1" }, "devDependencies": { "@labkey/build": "9.1.5", diff --git a/pipeline/src/client/CreatePipelineTrigger/CreatePipelineTrigger.tsx b/pipeline/src/client/CreatePipelineTrigger/CreatePipelineTrigger.tsx index 4917d722453..818caa8cb85 100644 --- a/pipeline/src/client/CreatePipelineTrigger/CreatePipelineTrigger.tsx +++ b/pipeline/src/client/CreatePipelineTrigger/CreatePipelineTrigger.tsx @@ -3,9 +3,9 @@ * * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 */ -import React, { ChangeEvent, Dispatch, FC, Reducer, useCallback, useEffect, useState, useReducer } from 'react'; +import React, { ChangeEvent, Dispatch, FC, Reducer, useCallback, useEffect, useReducer, useState } from 'react'; import { ActionURL, Ajax, Utils } from '@labkey/api'; -import { naturalSort, FormSchema, AutoForm, Alert, cancelEvent } from '@labkey/components'; +import { Alert, AutoForm, cancelEvent, FormSchema, naturalSort, redirect } from '@labkey/components'; // eslint-disable-next-line import/no-unassigned-import import './CreatePipelineTrigger.scss'; @@ -738,7 +738,7 @@ export const CreatePipelineTrigger: FC = props => { useEffect(() => { if (saveSuccessful) { - window.setTimeout(() => (window.location.href = returnUrl), 1000); + window.setTimeout(() => redirect(returnUrl), 1000); } }, [returnUrl, saveSuccessful]);