Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions assay/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"lint-fix": "eslint --fix"
},
"dependencies": {
"@labkey/components": "7.42.1"
"@labkey/components": "7.42.3-fb-redirectGH1023.2"
},
"devDependencies": {
"@labkey/build": "9.1.5",
Expand Down
3 changes: 2 additions & 1 deletion assay/src/client/AssayTypeSelect/AssayTypeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
AssayPickerTabs,
GENERAL_ASSAY_PROVIDER_NAME,
App as LabKeyApp,
redirect,
useServerContext,
} from '@labkey/components';

Expand Down Expand Up @@ -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) => {
Expand Down
16 changes: 8 additions & 8 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"lint-branch-fix": "node lint.diff.mjs --currentBranch --fix"
},
"dependencies": {
"@labkey/components": "7.42.1",
"@labkey/components": "7.42.3-fb-redirectGH1023.2",
"@labkey/themes": "1.9.4"
},
"devDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions core/src/client/AssayDesigner/AssayDesigner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
getWebDavUrl,
inferDomainFromFile,
LoadingSpinner,
redirect,
setDomainFields,
} from '@labkey/components';

Expand Down Expand Up @@ -136,9 +137,7 @@ class AssayDesigner extends React.Component<any, State> {

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 => {
Expand Down
4 changes: 2 additions & 2 deletions core/src/client/DataClassDesigner/DataClassDesigner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
DataClassModel,
fetchDataClass,
LoadingSpinner,
redirect,
} from '@labkey/components';

import '../DomainDesigner.scss';
Expand Down Expand Up @@ -66,8 +67,7 @@ class DataClassDesignerWrapper extends React.Component<any, 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);
}

onCancel = () => {
Expand Down
4 changes: 2 additions & 2 deletions core/src/client/DatasetDesigner/DatasetDesigner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
DatasetModel,
fetchDatasetDesign,
LoadingSpinner,
redirect,
} from '@labkey/components';
import { ActionURL, Domain, getServerContext } from '@labkey/api';

Expand Down Expand Up @@ -66,8 +67,7 @@ class DatasetDesigner extends PureComponent<any, State> {

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 {
Expand Down
4 changes: 2 additions & 2 deletions core/src/client/DomainDesigner/DomainDesigner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
FormButtons,
LoadingSpinner,
Modal,
redirect,
resolveErrorMessage,
saveDomain,
} from '@labkey/components';
Expand Down Expand Up @@ -161,8 +162,7 @@ class DomainDesigner extends React.PureComponent<any, Partial<IAppState>> {

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() {
Expand Down
4 changes: 2 additions & 2 deletions core/src/client/ErrorHandler/ErrorType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -161,7 +161,7 @@ const PERMISSION_DETAILS = (errorDetails: ErrorDetails) => (
returnUrl,
},
callback: () => {
window.location.href = returnUrl;
redirect(returnUrl);
},
});
}}
Expand Down
4 changes: 2 additions & 2 deletions core/src/client/IssuesListDesigner/IssuesListDesigner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
IssuesListDefDesignerPanels,
IssuesListDefModel,
LoadingSpinner,
redirect,
} from '@labkey/components';

import '../DomainDesigner.scss';
Expand Down Expand Up @@ -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) => {
Expand Down
3 changes: 2 additions & 1 deletion core/src/client/ListDesigner/ListDesigner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
ListDesignerPanels,
ListModel,
LoadingSpinner,
redirect,
} from '@labkey/components';

import '../DomainDesigner.scss';
Expand Down Expand Up @@ -104,7 +105,7 @@ export class ListDesigner extends React.Component<Props, State> {
navigate = async (returnUrlProvider: () => Promise<string>, model?: ListModel): Promise<void> => {
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 => {
Expand Down
4 changes: 2 additions & 2 deletions core/src/client/SampleTypeDesigner/SampleTypeDesigner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
getSampleSet,
getSampleTypeDetails,
LoadingSpinner,
redirect,
SampleTypeDesigner,
SampleTypeModel,
} from '@labkey/components';
Expand Down Expand Up @@ -144,8 +145,7 @@ class SampleTypeDesignerWrapper extends React.PureComponent<any, 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);
}

render() {
Expand Down
16 changes: 8 additions & 8 deletions experiment/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion experiment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.42.3-fb-redirectGH1023.2"
},
"devDependencies": {
"@labkey/build": "9.1.5",
Expand Down
16 changes: 8 additions & 8 deletions pipeline/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pipeline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.42.3-fb-redirectGH1023.2"
},
"devDependencies": {
"@labkey/build": "9.1.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -738,7 +738,7 @@ export const CreatePipelineTrigger: FC<Props> = props => {

useEffect(() => {
if (saveSuccessful) {
window.setTimeout(() => (window.location.href = returnUrl), 1000);
window.setTimeout(() => redirect(returnUrl), 1000);
}
}, [returnUrl, saveSuccessful]);

Expand Down