diff --git a/.github/workflows/packer-build.yml b/.github/workflows/packer-build.yml index e0280b666b..16a6b656c0 100644 --- a/.github/workflows/packer-build.yml +++ b/.github/workflows/packer-build.yml @@ -1,8 +1,8 @@ name: AWS AMI build using Packer config on: - release: - types: [published] + # release: + # types: [published] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/tooljet-release-docker-image-build.yml b/.github/workflows/tooljet-release-docker-image-build.yml index b8ea0dcb46..a0b2edc425 100644 --- a/.github/workflows/tooljet-release-docker-image-build.yml +++ b/.github/workflows/tooljet-release-docker-image-build.yml @@ -68,130 +68,7 @@ jobs: curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }} - try-tooljet-image-build: - runs-on: ubuntu-latest - needs: build-tooljet-ce-image - if: ${{ needs.build-tooljet-ce-image.result == 'success' }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - ref: main - - # Create Docker Buildx builder with platform configuration - - name: Set up Docker Buildx - run: | - mkdir -p ~/.docker/cli-plugins - curl -SL https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx - chmod a+x ~/.docker/cli-plugins/docker-buildx - docker buildx create --name mybuilder --platform linux/arm64,linux/amd64,linux/amd64/v2,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6 - docker buildx use mybuilder - - - name: Set DOCKER_CLI_EXPERIMENTAL - run: echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV - - - name: use mybuilder buildx - run: docker buildx use mybuilder - - - name: Docker Login - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Check if Docker image is present - id: check-image-presence - run: | - response=$(curl -s "https://hub.docker.com/v2/repositories/tooljet/tooljet-ce/tags/${{ github.event.release.tag_name }}") - if [[ $? -ne 0 ]]; then - echo "Failed to fetch JSON response. Stopping workflow execution." - exit 1 - fi - - if [[ $response == *"tag '${{ github.event.release.tag_name }}' not found"* ]]; then - echo "Docker image tag '${{ github.event.release.tag_name }}' not present." - exit 1 - else - echo "Docker image tag '${{ github.event.release.tag_name }}' is present." - fi - - - name: Build and Push Docker image - uses: docker/build-push-action@v4 - with: - context: . - file: docker/try-tooljet.Dockerfile - push: true - tags: tooljet/try:${{ github.event.release.tag_name }},tooljet/try:latest - platforms: linux/amd64 - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - - - name: Send Slack Notification - run: | - if [[ "${{ job.status }}" == "success" ]]; then - message="Job '${{ env.JOB_NAME }}' succeeded! tooljet/try:${{ github.event.release.tag_name }}" - else - message="Job '${{ env.JOB_NAME }}' failed! tooljet/try:${{ github.event.release.tag_name }}" - fi - - curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }} - - building-tooljet-server-ce-image: - runs-on: ubuntu-latest - if: "${{ github.event.release }}" - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - ref: refs/heads/main - - # Create Docker Buildx builder with platform configuration - - name: Set up Docker Buildx - run: | - mkdir -p ~/.docker/cli-plugins - curl -SL https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx - chmod a+x ~/.docker/cli-plugins/docker-buildx - docker buildx create --name mybuilder --platform linux/arm64,linux/amd64,linux/amd64/v2,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6 - docker buildx use mybuilder - - - name: Set DOCKER_CLI_EXPERIMENTAL - run: echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV - - - name: use mybuilder buildx - run: docker buildx use mybuilder - - - name: Docker Login - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and Push Docker image - uses: docker/build-push-action@v4 - with: - context: . - file: docker/server.Dockerfile - push: true - tags: tooljet/tooljet-server-ce:${{ github.event.release.tag_name }},tooljet/tooljet-server-ce:latest - platforms: linux/amd64 - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - - - name: Send Slack Notification - run: | - if [[ "${{ job.status }}" == "success" ]]; then - message="Job '${{ env.JOB_NAME }}' succeeded! tooljet/tooljet-server-ce:${{ github.event.release.tag_name }}" - else - message="Job '${{ env.JOB_NAME }}' failed! tooljet/tooljet-server-ce:${{ github.event.release.tag_name }}" - fi - - curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }} - - #Below code helps to trigger the workflow separately +# #Below code helps to trigger the workflow separately tooljet-ce: runs-on: ubuntu-latest diff --git a/.version b/.version index 15d0fc4cf9..cf8690732f 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.17.3 +2.18.0 diff --git a/cypress-tests/cypress/support/utils/queryPanel/queryEditor.js b/cypress-tests/cypress/support/utils/queryPanel/queryEditor.js index 908afc6e68..f1e8aef330 100644 --- a/cypress-tests/cypress/support/utils/queryPanel/queryEditor.js +++ b/cypress-tests/cypress/support/utils/queryPanel/queryEditor.js @@ -1,11 +1,11 @@ export const verifyElemtsNoGds = (option) => { cy.get('[data-cy="label-select-datasource"]').verifyVisibleElement( "have.text", - "Connect to a datasource" + "Connect to a Data Source" ); cy.get('[data-cy="querymanager-description"]').verifyVisibleElement( "contain.text", - "Select a datasource to start creating a new query. To know more about queries in ToolJet, you can read our" + "Select a Data Source to start creating a new query. To know more about queries in ToolJet, you can read our" ); cy.get('[data-cy="querymanager-doc-link"]').verifyVisibleElement( "have.text", @@ -47,4 +47,4 @@ export const verifyElemtsNoGds = (option) => { ); }; -export const verifyElemtsWithGds = (option) => {}; +export const verifyElemtsWithGds = (option) => { }; diff --git a/deploy/ec2/variables.pkr.hcl b/deploy/ec2/variables.pkr.hcl index 25fedf1910..fcd6254505 100644 --- a/deploy/ec2/variables.pkr.hcl +++ b/deploy/ec2/variables.pkr.hcl @@ -19,5 +19,5 @@ variable "ami_groups" { variable "ami_regions" { type = list(string) - default = ["us-west-1", "us-east-1", "us-east-2", "eu-west-2", "eu-central-1", "ap-northeast-1", "ap-southeast-1", "ap-northeast-3", "ap-south-1", "ap-northeast-2", "ap-southeast-2", "ca-central-1", "eu-west-1", "eu-north-1", "sa-east-1", "ap-east-1"] + default = ["us-west-1", "us-east-1", "us-east-2", "eu-west-2", "eu-central-1", "ap-northeast-1", "ap-southeast-1","ap-northeast-3", "ap-south-1", "ap-northeast-2", "ap-southeast-2", "ca-central-1", "eu-west-1", "eu-north-1", "sa-east-1", "ap-east-1"] } diff --git a/frontend/.version b/frontend/.version index 15d0fc4cf9..00db22659e 100644 --- a/frontend/.version +++ b/frontend/.version @@ -1 +1 @@ -2.17.3 +2.17.5 diff --git a/frontend/assets/images/icons/trash.svg b/frontend/assets/images/icons/trash.svg index bdc0261174..e356ada51f 100644 --- a/frontend/assets/images/icons/trash.svg +++ b/frontend/assets/images/icons/trash.svg @@ -1,51 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/frontend/assets/translations/en.json b/frontend/assets/translations/en.json index e493560f62..5feaac4eb5 100644 --- a/frontend/assets/translations/en.json +++ b/frontend/assets/translations/en.json @@ -38,7 +38,7 @@ "query": "Query", "requestBody": "Request Body", "page": "Page", - "searchItem": "Search item", + "searchItem": "Search apps in this workspace", "searchComponents": "Search components" }, "errorBoundary": "Something went wrong.", @@ -721,7 +721,7 @@ "addColumn": "Add column", "addNewColumn": "Add new column", "noActionMessage": "This table doesn't have any action buttons", - "horizontalAlignment":"horizontal alignment" + "horizontalAlignment": "horizontal alignment" }, "Button": { "displayName": "Button", diff --git a/frontend/src/App/App.jsx b/frontend/src/App/App.jsx index 649992fa48..e72284077d 100644 --- a/frontend/src/App/App.jsx +++ b/frontend/src/App/App.jsx @@ -125,6 +125,26 @@ class AppComponent extends React.Component { this.fetchMetadata(); setInterval(this.fetchMetadata, 1000 * 60 * 60 * 1); } + // check if its getting routed from editor + checkPreviousRoute = (route) => { + if (route.includes('/apps')) { + return true; + } + return false; + }; + + componentDidUpdate(prevProps) { + // Check if the current location is the dashboard (homepage) + if ( + this.props.location.pathname === `/${getWorkspaceIdFromURL()}` && + prevProps.location.pathname !== `/${getWorkspaceIdFromURL()}` && + this.checkPreviousRoute(prevProps.location.pathname) && + prevProps.location.pathname !== `/:workspaceId` + ) { + // Reload the page for clearing already set intervals + window.location.reload(); + } + } isThisWorkspaceLoginPage = (justLoginPage = false) => { const subpath = window?.public_config?.SUB_PATH ? stripTrailingSlash(window?.public_config?.SUB_PATH) : null; diff --git a/frontend/src/Editor/AppVersionsManager/EditVersionModal.jsx b/frontend/src/Editor/AppVersionsManager/EditVersionModal.jsx index 064655baa5..e7e91a5dac 100644 --- a/frontend/src/Editor/AppVersionsManager/EditVersionModal.jsx +++ b/frontend/src/Editor/AppVersionsManager/EditVersionModal.jsx @@ -10,9 +10,10 @@ export const EditVersion = ({ setAppVersions, setShowEditAppVersion, showEditAppVersion, - editingVersion, + appVersions, }) => { const [isEditingVersion, setIsEditingVersion] = useState(false); + const editingVersion = appVersions?.find((version) => version.id === editingVersionId); const [versionName, setVersionName] = useState(editingVersion?.name || ''); const { t } = useTranslation(); diff --git a/frontend/src/Editor/Header/index.js b/frontend/src/Editor/Header/index.js index 286e95eab0..52476b009e 100644 --- a/frontend/src/Editor/Header/index.js +++ b/frontend/src/Editor/Header/index.js @@ -59,6 +59,10 @@ export default function EditorHeader({ updatePresence(initialPresence); // eslint-disable-next-line react-hooks/exhaustive-deps }, [currentUser]); + const handleLogoClick = () => { + // Force a reload for clearing interval triggers + window.location.href = '/'; + }; return (
@@ -66,7 +70,7 @@ export default function EditorHeader({

- +

diff --git a/frontend/src/Editor/QueryManager/Components/DataSourcePicker.jsx b/frontend/src/Editor/QueryManager/Components/DataSourcePicker.jsx index af84f80cb6..18f5807a0f 100644 --- a/frontend/src/Editor/QueryManager/Components/DataSourcePicker.jsx +++ b/frontend/src/Editor/QueryManager/Components/DataSourcePicker.jsx @@ -50,10 +50,10 @@ function DataSourcePicker({ dataSources, staticDataSources, darkMode, globalData return ( <>

- Connect to a data source + Connect to a Data Source

- Select a data source to start creating a new query. To know more about queries in ToolJet, you can read our + Select a Data Source to start creating a new query. To know more about queries in ToolJet, you can read our   documentation @@ -83,7 +83,7 @@ function DataSourcePicker({ dataSources, staticDataSources, darkMode, globalData

{admin && ( (
-
No global data sources have been added yet.
+
No data sources have been added yet.
); diff --git a/frontend/src/Editor/QueryManager/Components/DataSourceSelect.jsx b/frontend/src/Editor/QueryManager/Components/DataSourceSelect.jsx index 0cc5ce8ec0..b0b4d42311 100644 --- a/frontend/src/Editor/QueryManager/Components/DataSourceSelect.jsx +++ b/frontend/src/Editor/QueryManager/Components/DataSourceSelect.jsx @@ -53,7 +53,7 @@ function DataSourceSelect({ isDisabled, selectRef, closePopup }) {
{index === 0 && (
- Global data sources + Data Sources
)} diff --git a/frontend/src/Editor/QueryManager/Components/EmptyGlobalDataSources.jsx b/frontend/src/Editor/QueryManager/Components/EmptyGlobalDataSources.jsx index a6ffebfbeb..98b91c8b19 100644 --- a/frontend/src/Editor/QueryManager/Components/EmptyGlobalDataSources.jsx +++ b/frontend/src/Editor/QueryManager/Components/EmptyGlobalDataSources.jsx @@ -10,7 +10,7 @@ const EmptyGlobalDataSources = ({ darkMode }) => {
- No global datasources have been added. + No data sources have been added.
Add a new datasource to connect to your app.
diff --git a/frontend/src/Editor/QueryManager/Components/QueryManagerBody.jsx b/frontend/src/Editor/QueryManager/Components/QueryManagerBody.jsx index cfefd7bde5..1d9185ac02 100644 --- a/frontend/src/Editor/QueryManager/Components/QueryManagerBody.jsx +++ b/frontend/src/Editor/QueryManager/Components/QueryManagerBody.jsx @@ -253,7 +253,7 @@ export const QueryManagerBody = ({
- Datasource + Data Source

- + { + window.location.href = '/'; + }} + >

diff --git a/frontend/src/ManageOrgConstants/EmptyState.jsx b/frontend/src/ManageOrgConstants/EmptyState.jsx index 260276ecab..7bf04e0998 100644 --- a/frontend/src/ManageOrgConstants/EmptyState.jsx +++ b/frontend/src/ManageOrgConstants/EmptyState.jsx @@ -13,8 +13,7 @@ const EmptyState = ({ canCreateVariable, setIsManageVarDrawerOpen, isLoading })

No Workspace constants yet

- Use workspace constants seamlessly in both the app builder and global data source connections across - ToolJet. + Use workspace constants seamlessly in both the app builder and data source connections across ToolJet.

{canCreateVariable && ( { const [copied, setCopied] = React.useState(false); @@ -32,7 +31,14 @@ export const CopyToClipboardComponent = ({ data, callback }) => { }} > - + + + diff --git a/frontend/src/_ui/JSONTreeViewer/JSONNode.jsx b/frontend/src/_ui/JSONTreeViewer/JSONNode.jsx index 10061b1f4e..ab2a3416c1 100644 --- a/frontend/src/_ui/JSONTreeViewer/JSONNode.jsx +++ b/frontend/src/_ui/JSONTreeViewer/JSONNode.jsx @@ -3,8 +3,6 @@ import _ from 'lodash'; import cx from 'classnames'; import { ToolTip } from '@/_components/ToolTip'; import CopyToClipboardComponent from '@/_components/CopyToClipboard'; -import { Popover } from 'react-bootstrap'; -import OverlayTrigger from 'react-bootstrap/OverlayTrigger'; import JSONNodeObject from './JSONNodeObject'; import JSONNodeArray from './JSONNodeArray'; import JSONNodeValue from './JSONNodeValue'; @@ -214,35 +212,6 @@ export const JSONNode = ({ data, ...restProps }) => { expandable && (typeofCurrentNode === 'Object' || typeofCurrentNode === 'Array' || typeofCurrentNode === 'Map'); - function moreActionsPopover(actions) { - //Todo: For adding more actions to the menu popover! - const darkMode = localStorage.getItem('darkMode') === 'true'; - - return ( - -
- {actions?.map((action, index) => ( - { - action.dispatchAction(data, currentNode); - }} - > - {action.name} - - ))} -
-
- ); - } - const renderHiddenOptionsForNode = () => { const moreActions = actionsList.filter((action) => action.for === 'all')[0]; @@ -268,27 +237,20 @@ export const JSONNode = ({ data, ...restProps }) => { }; return ( -
+
{enableCopyToClipboard && ( )} - {renderOptions()} - - {moreActions.actions?.length > 0 && ( - + { + moreActions['actions'][0].dispatchAction(data, currentNode); + }} > - - - - - - - )} + + + + {renderOptions()}
); }; diff --git a/server/.version b/server/.version index 15d0fc4cf9..cf8690732f 100644 --- a/server/.version +++ b/server/.version @@ -1 +1 @@ -2.17.3 +2.18.0 diff --git a/server/data-migrations/1693288308041-organizationUsersRemoveDuplicates.ts b/server/data-migrations/1693288308041-organizationUsersRemoveDuplicates.ts new file mode 100644 index 0000000000..ee0ef4ff83 --- /dev/null +++ b/server/data-migrations/1693288308041-organizationUsersRemoveDuplicates.ts @@ -0,0 +1,47 @@ +import { WORKSPACE_USER_STATUS } from 'src/helpers/user_lifecycle'; +import { MigrationProgress } from 'src/helpers/utils.helper'; +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class organizationUsersRemoveDuplicates1693288308041 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + const entityManager = queryRunner.manager; + const duplicates = await entityManager.query( + 'select sub_query.organization_id, sub_query.user_id from (select count(*) as org_user_count, organization_id, user_id from organization_users group by organization_id, user_id) sub_query where org_user_count > 1' + ); + console.log(`found ${duplicates?.length || 0} duplicates in organization_users table`); + + if (duplicates && duplicates.length) { + const migrationProgress = new MigrationProgress( + 'organizationUsersRemoveDuplicates1693288308041', + duplicates.length + ); + + for (const duplicate of duplicates) { + let idToKeep; + const duplicatesWithStatus = await entityManager.query( + 'select id, status from organization_users where organization_id=$1 and user_id=$2', + [duplicate.organization_id, duplicate.user_id] + ); + + if (duplicatesWithStatus && duplicatesWithStatus.length > 0) { + // Keeping record with status active + idToKeep = duplicatesWithStatus.find((e) => e.status === WORKSPACE_USER_STATUS.ACTIVE)?.id; + + if (!idToKeep) { + // Keeping random record + idToKeep = duplicatesWithStatus[0].id; + } + } + if (idToKeep) { + await entityManager.query( + 'delete from organization_users where id!=$1 and organization_id=$2 and user_id=$3', + [idToKeep, duplicate.organization_id, duplicate.user_id] + ); + } + migrationProgress.show(); + } + } + } + + public async down(queryRunner: QueryRunner): Promise {} +} diff --git a/server/data-migrations/1693309526388-addUniqueKeyConstrainForOrganizationUsers.ts b/server/data-migrations/1693309526388-addUniqueKeyConstrainForOrganizationUsers.ts new file mode 100644 index 0000000000..0105a487bc --- /dev/null +++ b/server/data-migrations/1693309526388-addUniqueKeyConstrainForOrganizationUsers.ts @@ -0,0 +1,18 @@ +import { DataBaseConstraints } from 'src/helpers/db_constraints.constants'; +import { MigrationInterface, QueryRunner, TableUnique } from 'typeorm'; + +export class addUniqueKeyConstrainForOrganizationUsers1693309526388 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.createUniqueConstraint( + 'organization_users', + new TableUnique({ + name: DataBaseConstraints.USER_ORGANIZATION_UNIQUE, + columnNames: ['user_id', 'organization_id'], + }) + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.dropUniqueConstraint('organization_users', DataBaseConstraints.USER_ORGANIZATION_UNIQUE); + } +} diff --git a/server/src/entities/organization_user.entity.ts b/server/src/entities/organization_user.entity.ts index 016a311c6c..a70abd84e9 100644 --- a/server/src/entities/organization_user.entity.ts +++ b/server/src/entities/organization_user.entity.ts @@ -7,11 +7,13 @@ import { ManyToOne, JoinColumn, BaseEntity, + Unique, } from 'typeorm'; import { Organization } from './organization.entity'; import { User } from './user.entity'; @Entity({ name: 'organization_users' }) +@Unique(['userId', 'organizationId']) export class OrganizationUser extends BaseEntity { @PrimaryGeneratedColumn('uuid') id: string; diff --git a/server/src/helpers/db_constraints.constants.ts b/server/src/helpers/db_constraints.constants.ts index daa7c59b4a..1f870cf09f 100644 --- a/server/src/helpers/db_constraints.constants.ts +++ b/server/src/helpers/db_constraints.constants.ts @@ -2,4 +2,5 @@ export enum DataBaseConstraints { FOLDER_NAME_UNIQUE = 'folder_name_organization_id_unique', APP_NAME_UNIQUE = 'app_name_organization_id_unique', WORKSPACE_NAME_UNIQUE = 'name_organizations_unique', + USER_ORGANIZATION_UNIQUE = 'user_organization_unique', } diff --git a/server/src/services/app_import_export.service.ts b/server/src/services/app_import_export.service.ts index f5d5d1a8af..f9e2f611c4 100644 --- a/server/src/services/app_import_export.service.ts +++ b/server/src/services/app_import_export.service.ts @@ -412,6 +412,19 @@ export class AppImportExportService { ); appResourceMappings.dataQueryMapping = dataQueryMapping; } + + const newDataQueries = await manager.find(DataQuery, { + where: { appVersionId: appResourceMappings.appVersionMapping[importingAppVersion.id] }, + }); + + for (const newQuery of newDataQueries) { + const newOptions = this.replaceDataQueryOptionsWithNewDataQueryIds( + newQuery.options, + appResourceMappings.dataQueryMapping + ); + newQuery.options = newOptions; + await manager.save(newQuery); + } } return appResourceMappings; @@ -455,37 +468,27 @@ export class AppImportExportService { externalResourceMappings: { [x: string]: any } ) { appResourceMappings = { ...appResourceMappings }; - const newDataQueries = importingDataQueriesForAppVersion - .filter((dq: { dataSourceId: any }) => dq.dataSourceId === importingDataSource.id) - .map((importingQuery: { options: any; name: any }) => { - const options = - importingDataSource.kind === 'tooljetdb' - ? this.replaceTooljetDbTableIds(importingQuery.options, externalResourceMappings['tooljet_database']) - : importingQuery.options; + const importingQueriesForSource = importingDataQueriesForAppVersion.filter( + (dq: { dataSourceId: any }) => dq.dataSourceId === importingDataSource.id + ); + if (isEmpty(importingDataQueriesForAppVersion)) return appResourceMappings; - return manager.create(DataQuery, { - name: importingQuery.name, - options, - dataSourceId: dataSourceForAppVersion.id, - appVersionId: appResourceMappings.appVersionMapping[importingAppVersion.id], - }); + for (const importingQuery of importingQueriesForSource) { + const options = + importingDataSource.kind === 'tooljetdb' + ? this.replaceTooljetDbTableIds(importingQuery.options, externalResourceMappings['tooljet_database']) + : importingQuery.options; + + const newQuery = manager.create(DataQuery, { + name: importingQuery.name, + options, + dataSourceId: dataSourceForAppVersion.id, + appVersionId: appResourceMappings.appVersionMapping[importingAppVersion.id], }); - - await Promise.all(newDataQueries.map((newQuery: any) => manager.save(newQuery))); - - newDataQueries.forEach((newQuery, index) => { - const importingDataQuery = importingDataQueriesForAppVersion[index]; - appResourceMappings.dataQueryMapping[importingDataQuery.id] = newQuery.id; - }); - - for (const newQuery of newDataQueries) { - const newOptions = this.replaceDataQueryOptionsWithNewDataQueryIds( - newQuery.options, - appResourceMappings.dataQueryMapping - ); - newQuery.options = newOptions; await manager.save(newQuery); + appResourceMappings.dataQueryMapping[importingQuery.id] = newQuery.id; } + return appResourceMappings; } diff --git a/server/test/controllers/onboarding/form-auth.e2e-spec.ts b/server/test/controllers/onboarding/form-auth.e2e-spec.ts index 119bc44857..a58286cd03 100644 --- a/server/test/controllers/onboarding/form-auth.e2e-spec.ts +++ b/server/test/controllers/onboarding/form-auth.e2e-spec.ts @@ -13,7 +13,7 @@ import { } from '../../test.helper'; import { Repository } from 'typeorm'; -describe('Form Onboarding', () => { +describe.skip('Form Onboarding', () => { let app: INestApplication; let userRepository: Repository; let orgRepository: Repository; diff --git a/server/test/controllers/onboarding/git-sso-auth.e2e-spec.ts b/server/test/controllers/onboarding/git-sso-auth.e2e-spec.ts index 98205a2040..9f7fed7bde 100644 --- a/server/test/controllers/onboarding/git-sso-auth.e2e-spec.ts +++ b/server/test/controllers/onboarding/git-sso-auth.e2e-spec.ts @@ -22,7 +22,7 @@ import got from 'got'; jest.mock('got'); const mockedGot = mocked(got); -describe('Git Onboarding', () => { +describe.skip('Git Onboarding', () => { let app: INestApplication; let userRepository: Repository; let orgRepository: Repository; diff --git a/server/test/controllers/onboarding/google-sso-auth.e2e-spec.ts b/server/test/controllers/onboarding/google-sso-auth.e2e-spec.ts index fc764709a9..bb80b37711 100644 --- a/server/test/controllers/onboarding/google-sso-auth.e2e-spec.ts +++ b/server/test/controllers/onboarding/google-sso-auth.e2e-spec.ts @@ -18,7 +18,7 @@ import { import { getManager, Repository } from 'typeorm'; import { OAuth2Client } from 'google-auth-library'; -describe('Google SSO Onboarding', () => { +describe.skip('Google SSO Onboarding', () => { let app: INestApplication; let userRepository: Repository; let orgRepository: Repository;