From 96aeb4b892d2713af08bd8f78ea29e50c24b1464 Mon Sep 17 00:00:00 2001 From: Adish M Date: Fri, 27 Oct 2023 11:26:20 +0530 Subject: [PATCH 1/3] Adding release label to Trigger all the cypress worflow to main branch --- .github/workflows/cypress-appbuilder.yml | 2 +- .github/workflows/cypress-marketplace.yml | 2 +- .github/workflows/cypress-platform.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cypress-appbuilder.yml b/.github/workflows/cypress-appbuilder.yml index 2cbff90ea9..f1a5bd6a00 100644 --- a/.github/workflows/cypress-appbuilder.yml +++ b/.github/workflows/cypress-appbuilder.yml @@ -14,7 +14,7 @@ jobs: Cypress-App-Builder: runs-on: ubuntu-22.04 - if: ${{ github.event.action == 'labeled' && github.event.label.name == 'run-cypress-app-builder' }} + if: ${{ github.event.action == 'labeled' && (github.event.label.name == 'run-cypress-app-builder' || github.event.label.name == 'run-cypress') }} steps: - name: Setup Node.js diff --git a/.github/workflows/cypress-marketplace.yml b/.github/workflows/cypress-marketplace.yml index b2c138ff6c..edf9c6e7bb 100644 --- a/.github/workflows/cypress-marketplace.yml +++ b/.github/workflows/cypress-marketplace.yml @@ -14,7 +14,7 @@ jobs: Cypress-Marketplace: runs-on: ubuntu-22.04 - if: ${{ github.event.action == 'labeled' && github.event.label.name == 'run-cypress-marketplace' }} + if: ${{ github.event.action == 'labeled' && (github.event.label.name == 'run-cypress-marketplace' || github.event.label.name == 'run-cypress') }} steps: - name: Checkout diff --git a/.github/workflows/cypress-platform.yml b/.github/workflows/cypress-platform.yml index 6eda6f4962..5b7551430c 100644 --- a/.github/workflows/cypress-platform.yml +++ b/.github/workflows/cypress-platform.yml @@ -14,7 +14,7 @@ jobs: Cypress-Platform: runs-on: ubuntu-22.04 - if: ${{ github.event.action == 'labeled' && github.event.label.name == 'run-cypress-workspace' }} + if: ${{ github.event.action == 'labeled' && (github.event.label.name == 'run-cypress-workspace' || github.event.label.name == 'run-cypress') }} steps: - name: Setup Node.js From a7d1454d30cb726ab5f0b1bf88ccfbc3d03fd446 Mon Sep 17 00:00:00 2001 From: Adish M Date: Mon, 30 Oct 2023 12:48:16 +0530 Subject: [PATCH 2/3] marketplace workflow fix --- .github/workflows/cypress-appbuilder.yml | 3 +++ .github/workflows/cypress-marketplace.yml | 6 ++++++ .github/workflows/cypress-platform.yml | 3 +++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/cypress-appbuilder.yml b/.github/workflows/cypress-appbuilder.yml index f1a5bd6a00..4adabab5ea 100644 --- a/.github/workflows/cypress-appbuilder.yml +++ b/.github/workflows/cypress-appbuilder.yml @@ -191,6 +191,9 @@ jobs: sleep 5 done' + - name: Seeding + run: docker exec Tooljet-app npm run db:seed:prod + - name: Create Cypress environment file id: create-json uses: jsdaniell/create-json@1.1.2 diff --git a/.github/workflows/cypress-marketplace.yml b/.github/workflows/cypress-marketplace.yml index edf9c6e7bb..56224b7279 100644 --- a/.github/workflows/cypress-marketplace.yml +++ b/.github/workflows/cypress-marketplace.yml @@ -82,6 +82,9 @@ jobs: sleep 5 done' + - name: Seeding + run: docker exec Tooljet-app npm run db:seed:prod + - name: Create Cypress environment file id: create-json uses: jsdaniell/create-json@1.1.2 @@ -178,6 +181,9 @@ jobs: sleep 5 done' + - name: Seeding + run: docker exec Tooljet-app npm run db:seed:prod + - name: Create Cypress environment file id: create-json uses: jsdaniell/create-json@1.1.2 diff --git a/.github/workflows/cypress-platform.yml b/.github/workflows/cypress-platform.yml index 5b7551430c..1d2fc06b4f 100644 --- a/.github/workflows/cypress-platform.yml +++ b/.github/workflows/cypress-platform.yml @@ -195,6 +195,9 @@ jobs: sleep 5 done' + - name: Seeding + run: docker exec Tooljet-app npm run db:seed:prod + - name: Create Cypress environment file id: create-json uses: jsdaniell/create-json@1.1.2 From 93cc29dd72a75f12c4f968dfa7d3b1f97150cd65 Mon Sep 17 00:00:00 2001 From: Muhsin Shah C P Date: Mon, 30 Oct 2023 19:41:31 +0530 Subject: [PATCH 3/3] [hot-fix] Pages `applications` handle issue (#8066) * resolved application page handle issue * fixed a typo * add: exporting the function * bumped the version --- .version | 2 +- frontend/.version | 2 +- frontend/src/_helpers/authorizeWorkspace.js | 2 +- frontend/src/_helpers/routes.js | 6 +++--- frontend/src/_helpers/utils.js | 9 +-------- server/.version | 2 +- 6 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.version b/.version index d93847fab5..acbef76955 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.22.1 +2.22.2 diff --git a/frontend/.version b/frontend/.version index d93847fab5..acbef76955 100644 --- a/frontend/.version +++ b/frontend/.version @@ -1 +1 @@ -2.22.1 +2.22.2 diff --git a/frontend/src/_helpers/authorizeWorkspace.js b/frontend/src/_helpers/authorizeWorkspace.js index c3a95564fe..14aeb22c2b 100644 --- a/frontend/src/_helpers/authorizeWorkspace.js +++ b/frontend/src/_helpers/authorizeWorkspace.js @@ -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 diff --git a/frontend/src/_helpers/routes.js b/frontend/src/_helpers/routes.js index 26377022cc..40b98d8057 100644 --- a/frontend/src/_helpers/routes.js +++ b/frontend/src/_helpers/routes.js @@ -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()}`; }; diff --git a/frontend/src/_helpers/utils.js b/frontend/src/_helpers/utils.js index 1b8a538d70..c37cfb423d 100644 --- a/frontend/src/_helpers/utils.js +++ b/frontend/src/_helpers/utils.js @@ -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 : ''}`; diff --git a/server/.version b/server/.version index d93847fab5..acbef76955 100644 --- a/server/.version +++ b/server/.version @@ -1 +1 @@ -2.22.1 +2.22.2