mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
commit
ebdda1598b
6 changed files with 8 additions and 15 deletions
2
.version
2
.version
|
|
@ -1 +1 @@
|
|||
2.22.1
|
||||
2.22.2
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
2.22.1
|
||||
2.22.2
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import toast from 'react-hot-toast';
|
|||
export const authorizeWorkspace = () => {
|
||||
if (!isThisExistedRoute()) {
|
||||
const workspaceIdOrSlug = getWorkspaceIdOrSlugFromURL();
|
||||
const isApplicationsPath = getPathname(null, true).includes('/applications/');
|
||||
const isApplicationsPath = getPathname(null, true).startsWith('/applications/');
|
||||
const appId = isApplicationsPath ? getPathname().split('/')[2] : null;
|
||||
/* CASE-1 */
|
||||
authenticationService
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ export const getWorkspaceIdOrSlugFromURL = () => {
|
|||
};
|
||||
|
||||
export const excludeWorkspaceIdFromURL = (pathname) => {
|
||||
if (!['integrations', 'applications', 'switch-workspace'].find((path) => pathname.includes(path))) {
|
||||
if (!['/integrations', '/applications/', '/switch-workspace'].find((path) => pathname.startsWith(path))) {
|
||||
pathname = getSubpath() ? pathname.replace(getSubpath(), '') : pathname;
|
||||
const paths = pathname?.split('/').filter((path) => path !== '');
|
||||
paths.shift();
|
||||
|
|
@ -132,9 +132,9 @@ export const excludeWorkspaceIdFromURL = (pathname) => {
|
|||
export const getSubpath = () =>
|
||||
window?.public_config?.SUB_PATH ? stripTrailingSlash(window?.public_config?.SUB_PATH) : null;
|
||||
|
||||
const returnWorkspaceIdIfNeed = (path) => {
|
||||
export const returnWorkspaceIdIfNeed = (path) => {
|
||||
if (path) {
|
||||
return !path.includes('applications') && !path.includes('integrations') ? `/${getWorkspaceId()}` : '';
|
||||
return !path.startsWith('/applications/') && !path.startsWith('/integrations') ? `/${getWorkspaceId()}` : '';
|
||||
}
|
||||
return `/${getWorkspaceId()}`;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { authenticationService } from '@/_services/authentication.service';
|
|||
|
||||
import { useDataQueriesStore } from '@/_stores/dataQueriesStore';
|
||||
import { getCurrentState } from '@/_stores/currentStateStore';
|
||||
import { getWorkspaceIdOrSlugFromURL, getSubpath } from './routes';
|
||||
import { getWorkspaceIdOrSlugFromURL, getSubpath, returnWorkspaceIdIfNeed } from './routes';
|
||||
import { getCookie, eraseCookie } from '@/_helpers/cookie';
|
||||
import { staticDataSources } from '@/Editor/QueryManager/constants';
|
||||
|
||||
|
|
@ -1027,13 +1027,6 @@ export function eraseRedirectUrl() {
|
|||
return redirectPath;
|
||||
}
|
||||
|
||||
export const returnWorkspaceIdIfNeed = (path) => {
|
||||
if (path) {
|
||||
return !path.includes('applications') && !path.includes('integrations') ? `/${getWorkspaceId()}` : '';
|
||||
}
|
||||
return `/${getWorkspaceId()}`;
|
||||
};
|
||||
|
||||
export const redirectToWorkspace = () => {
|
||||
const path = eraseRedirectUrl();
|
||||
const redirectPath = `${returnWorkspaceIdIfNeed(path)}${path && path !== '/' ? path : ''}`;
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
2.22.1
|
||||
2.22.2
|
||||
|
|
|
|||
Loading…
Reference in a new issue