-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
chore: git mod - integration app #38315
Changes from 131 commits
1119f65
2900b65
0d1fa18
146238c
e72e02f
54b5d93
a1b608b
0bb662f
d7e6c79
02e128b
3218b3a
f9c4030
adafd14
488b346
942193d
e9167f2
d024160
ef34582
c3d9a31
fa8c461
9b1414e
2de337e
40f057e
826dbf8
3a47055
ca19474
3a2a045
59f91f4
e1eb35a
3c4a4c2
fbcf6ae
56cbaef
f8545b4
65e9ea6
2b7c3d2
f613ae1
adddd08
c6343d3
c5c9585
c5b8cf3
bcef9f5
0e84fb8
c88bc0b
885446c
e106d43
005a655
ba6ac37
54ac997
8c310af
523296b
8745497
9d57e5a
44167c0
f698d26
245cb9b
cc35140
1b1da07
8dc482f
e70f659
801b06b
b4f8925
ec461fd
7f54647
b997ada
a569b22
f715c2a
1273fc6
0be3210
2953823
2be8c89
e1588c9
008f857
fe620bd
d8dca7f
e23819b
a7f5832
7b48aa2
57aa219
612c35a
ee50685
e20e0a2
b16bf38
34f7a00
a71a664
5e40b10
3921112
9071d0e
6314fe2
8d077c8
56f05cf
24d5e1c
546fd66
bbbee85
52b5c4f
f789c5a
062e19a
a6529bc
bc6b90e
243f299
5d758ca
34d96b4
4831434
df628d7
c100cc2
64c8a84
41e8b6f
b407de1
e724bcb
469a675
7478804
bc06f26
2730e4a
022ac38
a38be13
35ff365
1d6177f
1498ddc
bda63a5
a0a3d29
1f55194
a9a65c3
ad48cd9
e7c116c
a6926c9
a2e48c9
741d1f0
10a4325
5c46d32
4b18bae
0b57fae
059417b
9eaa84c
e678dd9
5fd6853
358b659
83579a9
19f3ca0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ import { all, select, take } from "redux-saga/effects"; | |
import type { FocusPath, FocusStrategy } from "sagas/FocusRetentionSaga"; | ||
import type { AppsmithLocationState } from "utils/history"; | ||
import { NavigationMethod } from "utils/history"; | ||
import { getCurrentGitBranch } from "selectors/gitSyncSelectors"; | ||
import type { FocusEntityInfo } from "navigation/FocusEntity"; | ||
import { | ||
FocusEntity, | ||
|
@@ -18,6 +17,9 @@ import { | |
widgetListURL, | ||
} from "ee/RouteBuilder"; | ||
import AppIDEFocusElements from "../FocusElements/AppIDE"; | ||
import { getCurrentBaseApplicationId } from "selectors/editorSelectors"; | ||
import { selectGitCurrentBranch } from "selectors/gitModSelectors"; | ||
import { applicationArtifact } from "git/artifact-helpers/application"; | ||
|
||
function shouldSetState( | ||
prevPath: string, | ||
|
@@ -86,8 +88,14 @@ const isPageChange = (prevPath: string, currentPath: string) => { | |
); | ||
}; | ||
|
||
export const createEditorFocusInfoKey = (basePageId: string, branch?: string) => | ||
`EDITOR_STATE.${basePageId}#${branch}`; | ||
export const createEditorFocusInfoKey = ( | ||
basePageId: string, | ||
branch: string | null = null, | ||
) => | ||
branch | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we changing these? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Branch can either be undefined or null. With the old implementation - when branch is not present it would return either |
||
? `EDITOR_STATE.${basePageId}#${branch}` | ||
: `EDITOR_STATE.${basePageId}`; | ||
|
||
export const createEditorFocusInfo = (basePageId: string, branch?: string) => ({ | ||
key: createEditorFocusInfoKey(basePageId, branch), | ||
entityInfo: { | ||
|
@@ -109,7 +117,11 @@ export const AppIDEFocusStrategy: FocusStrategy = { | |
return []; | ||
} | ||
|
||
const branch: string | undefined = yield select(getCurrentGitBranch); | ||
const baseApplicationId: string = yield select(getCurrentBaseApplicationId); | ||
const branch: string | undefined = yield select( | ||
selectGitCurrentBranch, | ||
applicationArtifact(baseApplicationId), | ||
); | ||
const entities: Array<{ entityInfo: FocusEntityInfo; key: string }> = []; | ||
const prevEntityInfo = identifyEntityFromPath(previousPath); | ||
const currentEntityInfo = identifyEntityFromPath(currentPath); | ||
|
@@ -136,7 +148,11 @@ export const AppIDEFocusStrategy: FocusStrategy = { | |
return entities; | ||
}, | ||
*getEntitiesForStore(path: string, currentPath: string) { | ||
const branch: string | undefined = yield select(getCurrentGitBranch); | ||
const baseApplicationId: string = yield select(getCurrentBaseApplicationId); | ||
const branch: string | undefined = yield select( | ||
selectGitCurrentBranch, | ||
applicationArtifact(baseApplicationId), | ||
); | ||
const entities: Array<FocusPath> = []; | ||
const currentFocusEntityInfo = identifyEntityFromPath(currentPath); | ||
const prevFocusEntityInfo = identifyEntityFromPath(path); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,8 @@ import { | |
import produce from "immer"; | ||
import { isEmpty } from "lodash"; | ||
import type { ApplicationPayload } from "entities/Application"; | ||
import { gitConnectSuccess, type GitConnectSuccessPayload } from "git"; | ||
import type { PayloadAction } from "@reduxjs/toolkit"; | ||
|
||
export const initialState: ApplicationsReduxState = { | ||
isSavingAppName: false, | ||
|
@@ -744,6 +746,20 @@ export const handlers = { | |
isSavingNavigationSetting: false, | ||
}; | ||
}, | ||
// git | ||
[gitConnectSuccess.type]: ( | ||
state: ApplicationsReduxState, | ||
action: PayloadAction<GitConnectSuccessPayload>, | ||
) => { | ||
return { | ||
...state, | ||
currentApplication: { | ||
...state.currentApplication, | ||
gitApplicationMetadata: | ||
action.payload.responseData.gitApplicationMetadata, | ||
}, | ||
}; | ||
}, | ||
Comment on lines
+750
to
+762
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to do this in the applicationsReducer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we do the same thing with old implementation as well. Didn't want to change it too much. Will revisit later |
||
}; | ||
|
||
const applicationsReducer = createReducer(initialState, handlers); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your git folder where you have API requests; why not create an HOC for the
Api
class that injectsbranch
as header. IIRC the config property that.get
.post
accept has an option to pass additional headersThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would ideally want to remove this from the interceptor logic and pass it with the api explicitly. But not tampering this right now