forked from appsmithorg/appsmith
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: git mod - updating redux slice and adding pending actions (apps…
…mithorg#37830) ## Description - Updates the keys for redux store according to https://miro.com/app/board/uXjVL-Nij1k=/?share_link_id=2678396780 - Adds pending actions Fixes appsmithorg#36808 Fixes appsmithorg#36809 Fixes appsmithorg#36810 ## 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/12080417362> > Commit: 3d9de62 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12080417362&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Git` > Spec: > <hr>Fri, 29 Nov 2024 08:00:47 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 ## Release Notes - **New Features** - Introduced new actions for managing branch operations (checkout, create, delete) and configurations (global, local). - Added actions for fetching and updating various Git-related data, including autocommit progress, merge status, and SSH keys. - New enumerations for Git artifact types and connection steps to enhance clarity and organization. - **Bug Fixes** - Improved error handling and loading state management across various actions. - **Documentation** - Enhanced type definitions and state structure for clearer understanding and usage. - **Refactor** - Updated state management structure to utilize a nested approach under `apiResponses`, improving consistency across actions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
29 changed files
with
875 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { createSingleArtifactAction } from "./helpers/createSingleArtifactAction"; | ||
import type { GitArtifactErrorPayloadAction } from "../types"; | ||
|
||
export const checkoutBranchInitAction = createSingleArtifactAction((state) => { | ||
state.apiResponses.checkoutBranch.loading = true; | ||
state.apiResponses.checkoutBranch.error = null; | ||
|
||
return state; | ||
}); | ||
|
||
export const checkoutBranchSuccessAction = createSingleArtifactAction( | ||
(state) => { | ||
state.apiResponses.checkoutBranch.loading = false; | ||
|
||
return state; | ||
}, | ||
); | ||
|
||
export const checkoutBranchErrorAction = createSingleArtifactAction( | ||
(state, action: GitArtifactErrorPayloadAction) => { | ||
const { error } = action.payload; | ||
|
||
state.apiResponses.checkoutBranch.loading = false; | ||
state.apiResponses.checkoutBranch.error = error; | ||
|
||
return state; | ||
}, | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { createSingleArtifactAction } from "./helpers/createSingleArtifactAction"; | ||
import type { GitArtifactErrorPayloadAction } from "../types"; | ||
|
||
export const createBranchInitAction = createSingleArtifactAction((state) => { | ||
state.apiResponses.createBranch.loading = true; | ||
state.apiResponses.createBranch.error = null; | ||
|
||
return state; | ||
}); | ||
|
||
export const createBranchSuccessAction = createSingleArtifactAction((state) => { | ||
state.apiResponses.createBranch.loading = false; | ||
|
||
return state; | ||
}); | ||
|
||
export const createBranchErrorAction = createSingleArtifactAction( | ||
(state, action: GitArtifactErrorPayloadAction) => { | ||
const { error } = action.payload; | ||
|
||
state.apiResponses.createBranch.loading = false; | ||
state.apiResponses.createBranch.error = error; | ||
|
||
return state; | ||
}, | ||
); |
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,26 @@ | ||
import { createSingleArtifactAction } from "./helpers/createSingleArtifactAction"; | ||
import type { GitArtifactErrorPayloadAction } from "../types"; | ||
|
||
export const deleteBranchInitAction = createSingleArtifactAction((state) => { | ||
state.apiResponses.deleteBranch.loading = true; | ||
state.apiResponses.deleteBranch.error = null; | ||
|
||
return state; | ||
}); | ||
|
||
export const deleteBranchSuccessAction = createSingleArtifactAction((state) => { | ||
state.apiResponses.deleteBranch.loading = false; | ||
|
||
return state; | ||
}); | ||
|
||
export const deleteBranchErrorAction = createSingleArtifactAction( | ||
(state, action: GitArtifactErrorPayloadAction) => { | ||
const { error } = action.payload; | ||
|
||
state.apiResponses.deleteBranch.loading = false; | ||
state.apiResponses.deleteBranch.error = error; | ||
|
||
return state; | ||
}, | ||
); |
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,26 @@ | ||
import { createSingleArtifactAction } from "./helpers/createSingleArtifactAction"; | ||
import type { GitArtifactErrorPayloadAction } from "../types"; | ||
|
||
export const discardInitAction = createSingleArtifactAction((state) => { | ||
state.apiResponses.discard.loading = true; | ||
state.apiResponses.discard.error = null; | ||
|
||
return state; | ||
}); | ||
|
||
export const discardSuccessAction = createSingleArtifactAction((state) => { | ||
state.apiResponses.discard.loading = false; | ||
|
||
return state; | ||
}); | ||
|
||
export const discardErrorAction = createSingleArtifactAction( | ||
(state, action: GitArtifactErrorPayloadAction) => { | ||
const { error } = action.payload; | ||
|
||
state.apiResponses.discard.loading = false; | ||
state.apiResponses.discard.error = error; | ||
|
||
return state; | ||
}, | ||
); |
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,26 @@ | ||
import { createSingleArtifactAction } from "./helpers/createSingleArtifactAction"; | ||
import type { GitArtifactErrorPayloadAction } from "../types"; | ||
|
||
export const disconnectInitAction = createSingleArtifactAction((state) => { | ||
state.apiResponses.disconnect.loading = true; | ||
state.apiResponses.disconnect.error = null; | ||
|
||
return state; | ||
}); | ||
|
||
export const disconnectSuccessAction = createSingleArtifactAction((state) => { | ||
state.apiResponses.disconnect.loading = false; | ||
|
||
return state; | ||
}); | ||
|
||
export const disconnectErrorAction = createSingleArtifactAction( | ||
(state, action: GitArtifactErrorPayloadAction) => { | ||
const { error } = action.payload; | ||
|
||
state.apiResponses.disconnect.loading = false; | ||
state.apiResponses.disconnect.error = error; | ||
|
||
return state; | ||
}, | ||
); |
41 changes: 41 additions & 0 deletions
41
packages/git/src/actions/fetchAutocommitProgressActions.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,41 @@ | ||
import type { | ||
GitArtifactPayloadAction, | ||
GitArtifactErrorPayloadAction, | ||
GitAutocommitProgress, | ||
} from "../types"; | ||
import { createSingleArtifactAction } from "./helpers/createSingleArtifactAction"; | ||
|
||
export const fetchAutocommitProgressInitAction = createSingleArtifactAction( | ||
(state) => { | ||
state.apiResponses.autocommitProgress.loading = true; | ||
state.apiResponses.autocommitProgress.error = null; | ||
|
||
return state; | ||
}, | ||
); | ||
|
||
export const fetchAutocommitProgressSuccessAction = createSingleArtifactAction( | ||
( | ||
state, | ||
action: GitArtifactPayloadAction<{ | ||
autocommitProgress: GitAutocommitProgress; | ||
}>, | ||
) => { | ||
state.apiResponses.autocommitProgress.loading = false; | ||
state.apiResponses.autocommitProgress.value = | ||
action.payload.autocommitProgress; | ||
|
||
return state; | ||
}, | ||
); | ||
|
||
export const fetchAutocommitProgressErrorAction = createSingleArtifactAction( | ||
(state, action: GitArtifactErrorPayloadAction) => { | ||
const { error } = action.payload; | ||
|
||
state.apiResponses.autocommitProgress.loading = false; | ||
state.apiResponses.autocommitProgress.error = error; | ||
|
||
return state; | ||
}, | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { | ||
GitArtifactPayloadAction, | ||
GitArtifactErrorPayloadAction, | ||
GitGlobalConfig, | ||
} from "../types"; | ||
import { createSingleArtifactAction } from "./helpers/createSingleArtifactAction"; | ||
|
||
export const fetchGlobalConfigInitAction = createSingleArtifactAction( | ||
(state) => { | ||
state.apiResponses.globalConfig.loading = true; | ||
state.apiResponses.globalConfig.error = null; | ||
|
||
return state; | ||
}, | ||
); | ||
|
||
export const fetchGlobalConfigSuccessAction = createSingleArtifactAction( | ||
( | ||
state, | ||
action: GitArtifactPayloadAction<{ globalConfig: GitGlobalConfig }>, | ||
) => { | ||
state.apiResponses.globalConfig.loading = false; | ||
state.apiResponses.globalConfig.value = action.payload.globalConfig; | ||
|
||
return state; | ||
}, | ||
); | ||
|
||
export const fetchGlobalConfigErrorAction = createSingleArtifactAction( | ||
(state, action: GitArtifactErrorPayloadAction) => { | ||
const { error } = action.payload; | ||
|
||
state.apiResponses.globalConfig.loading = false; | ||
state.apiResponses.globalConfig.error = error; | ||
|
||
return state; | ||
}, | ||
); |
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,38 @@ | ||
import type { | ||
GitArtifactPayloadAction, | ||
GitArtifactErrorPayloadAction, | ||
GitLocalConfig, | ||
} from "../types"; | ||
import { createSingleArtifactAction } from "./helpers/createSingleArtifactAction"; | ||
|
||
export const fetchLocalConfigInitAction = createSingleArtifactAction( | ||
(state) => { | ||
state.apiResponses.localConfig.loading = true; | ||
state.apiResponses.localConfig.error = null; | ||
|
||
return state; | ||
}, | ||
); | ||
|
||
export const fetchLocalConfigSuccessAction = createSingleArtifactAction( | ||
( | ||
state, | ||
action: GitArtifactPayloadAction<{ localConfig: GitLocalConfig }>, | ||
) => { | ||
state.apiResponses.localConfig.loading = false; | ||
state.apiResponses.localConfig.value = action.payload.localConfig; | ||
|
||
return state; | ||
}, | ||
); | ||
|
||
export const fetchLocalConfigErrorAction = createSingleArtifactAction( | ||
(state, action: GitArtifactErrorPayloadAction) => { | ||
const { error } = action.payload; | ||
|
||
state.apiResponses.localConfig.loading = false; | ||
state.apiResponses.localConfig.error = error; | ||
|
||
return state; | ||
}, | ||
); |
Oops, something went wrong.