-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: git pkg - package integration with git (#39342)
## Description - integrating packages with git Fixes #38505 ## Automation /ok-to-test tags="@tag.Git" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/13409662643> > Commit: 820025a > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13409662643&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Git` > Spec: > <hr>Wed, 19 Feb 2025 10:39:11 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced the Git import process to better distinguish between complete and partial imports, triggering appropriate UI prompts and navigation. - Introduced a new action for handling successful Git imports. - **Refactor** - Streamlined the underlying logic for Git import handling to deliver clearer user feedback and a more efficient experience. - **Chores** - Updated type definitions and action payloads for improved type safety and maintainability. - Added `.lens` to the `.gitignore` file to exclude it from version control. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
7 changed files
with
84 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
app/client/src/git-artifact-helpers/application/sagas/applicationImportFromGitSaga.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { toast } from "@appsmith/ads"; | ||
import { createMessage, IMPORT_APP_SUCCESSFUL } from "ee/constants/messages"; | ||
import { builderURL } from "ee/RouteBuilder"; | ||
import { showReconnectDatasourceModal } from "ee/actions/applicationActions"; | ||
import type { ApplicationResponsePayload } from "ee/api/ApplicationApi"; | ||
import type { GitImportSuccessPayload } from "git/store/actions/gitImportActions"; | ||
import type { GitArtifactPayloadAction } from "git/store/types"; | ||
import { put } from "redux-saga/effects"; | ||
import history from "utils/history"; | ||
|
||
export default function* applicationImportFromGitSaga( | ||
action: GitArtifactPayloadAction<GitImportSuccessPayload>, | ||
) { | ||
const { responseData } = action.payload; | ||
const { isPartialImport, unConfiguredDatasourceList } = responseData; | ||
|
||
const application = | ||
(responseData.application as ApplicationResponsePayload) ?? null; | ||
|
||
if (!application) return; | ||
|
||
// there is configuration-missing datasources | ||
if (isPartialImport) { | ||
yield put( | ||
showReconnectDatasourceModal({ | ||
application: application as ApplicationResponsePayload, | ||
unConfiguredDatasourceList: unConfiguredDatasourceList ?? [], | ||
workspaceId: application?.workspaceId ?? "", | ||
}), | ||
); | ||
} else { | ||
let basePageId = ""; | ||
|
||
if (application.pages && application.pages.length > 0) { | ||
const defaultPage = application.pages.find( | ||
(eachPage) => !!eachPage.isDefault, | ||
); | ||
|
||
basePageId = defaultPage ? defaultPage.baseId : ""; | ||
} | ||
|
||
const branch = application?.gitApplicationMetadata?.branchName; | ||
|
||
const pageURL = builderURL({ | ||
basePageId, | ||
branch, | ||
}); | ||
|
||
history.push(pageURL); | ||
toast.show(createMessage(IMPORT_APP_SUCCESSFUL), { | ||
kind: "success", | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters