-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat: git mod - updating redux slice and adding pending actions #37830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
app/client/packages/git/src/actions/checkoutBranchActions.ts
This file contains hidden or 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 hidden or 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 hidden or 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
26 changes: 26 additions & 0 deletions
26
app/client/packages/git/src/actions/createBranchActions.ts
This file contains hidden or 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; | ||
| }, | ||
| ); |
26 changes: 26 additions & 0 deletions
26
app/client/packages/git/src/actions/deleteBranchActions.ts
This file contains hidden or 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 hidden or 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 hidden or 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
app/client/packages/git/src/actions/fetchAutocommitProgressActions.ts
This file contains hidden or 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; | ||
| }, | ||
| ); |
20 changes: 12 additions & 8 deletions
20
app/client/packages/git/src/actions/fetchBranchesActions.ts
This file contains hidden or 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
38 changes: 38 additions & 0 deletions
38
app/client/packages/git/src/actions/fetchGlobalConfigActions.ts
This file contains hidden or 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; | ||
| }, | ||
| ); |
38 changes: 38 additions & 0 deletions
38
app/client/packages/git/src/actions/fetchLocalConfigActions.ts
This file contains hidden or 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; | ||
| }, | ||
| ); | ||
brayn003 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.