## Description - Add application apis for git package Fixes #37823 ## 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/12194637717> > Commit: e72e02f75e0c58ad1306776b3246c6de2431e9bf > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12194637717&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Git` > Spec: > <hr>Fri, 06 Dec 2024 08:23:16 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** - Introduced various asynchronous functions for Git operations, including: - `checkoutBranchRequest` - `commitRequest` - `connectRequest` - `createBranchRequest` - `deleteBranchRequest` - `fetchBranchesRequest` - `fetchGitMetadataRequest` - `fetchProtectedBranchesRequest` - `mergeRequest` - `pullRequest` - `toggleAutocommitRequest` - `triggerAutocommitRequest` - `updateGlobalConfigRequest` - `updateLocalConfigRequest` - `updateProtectedBranchesRequest` - Added new enumeration `AutocommitStatus` and interfaces to enhance type safety for Git operations. - **Bug Fixes** - Updated import paths for consistency and clarity across multiple files. - **Documentation** - Enhanced type definitions for various request and response structures. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
148 lines
2.6 KiB
TypeScript
148 lines
2.6 KiB
TypeScript
import {
|
|
GitConnectStep,
|
|
GitImportStep,
|
|
GitOpsTab,
|
|
GitSettingsTab,
|
|
} from "../../constants/enums";
|
|
import type {
|
|
GitSingleArtifactAPIResponsesReduxState,
|
|
GitSingleArtifactUIReduxState,
|
|
GitSingleArtifactReduxState,
|
|
} from "../../types";
|
|
|
|
const gitSingleArtifactInitialUIState: GitSingleArtifactUIReduxState = {
|
|
connectModal: {
|
|
open: false,
|
|
step: GitConnectStep.Provider,
|
|
},
|
|
importModal: {
|
|
open: false,
|
|
step: GitImportStep.Provider,
|
|
},
|
|
branchList: {
|
|
open: false,
|
|
},
|
|
opsModal: {
|
|
open: false,
|
|
tab: GitOpsTab.Deploy,
|
|
},
|
|
settingsModal: {
|
|
open: false,
|
|
tab: GitSettingsTab.General,
|
|
},
|
|
};
|
|
|
|
const gitSingleArtifactInitialAPIResponses: GitSingleArtifactAPIResponsesReduxState =
|
|
{
|
|
metadata: {
|
|
value: null,
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
connect: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
status: {
|
|
value: null,
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
commit: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
pull: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
discard: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
mergeStatus: {
|
|
value: null,
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
merge: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
branches: {
|
|
value: null,
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
checkoutBranch: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
createBranch: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
deleteBranch: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
globalConfig: {
|
|
value: null,
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
localConfig: {
|
|
value: null,
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
updateGlobalConfig: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
updateLocalConfig: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
disconnect: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
protectedBranches: {
|
|
value: null,
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
updateProtectedBranches: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
autocommitProgress: {
|
|
value: null,
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
toggleAutocommit: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
triggerAutocommit: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
generateSSHKey: {
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
sshKey: {
|
|
value: null,
|
|
loading: false,
|
|
error: null,
|
|
},
|
|
};
|
|
|
|
export const gitSingleArtifactInitialState: GitSingleArtifactReduxState = {
|
|
ui: gitSingleArtifactInitialUIState,
|
|
apiResponses: gitSingleArtifactInitialAPIResponses,
|
|
};
|