Skip to content
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
1119f65
chore: adding apis for git
Dec 5, 2024
2900b65
fix: review changes
Dec 5, 2024
0d1fa18
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 5, 2024
146238c
fix: fixing enum imports
Dec 5, 2024
e72e02f
chore: changing named export to default export
Dec 6, 2024
54b5d93
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 6, 2024
a1b608b
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 6, 2024
0bb662f
fix: adding saga for commit and connect
Dec 7, 2024
d7e6c79
chore: adding global profile and config redux slice
Dec 7, 2024
02e128b
chore: adding saga for git profile update
Dec 7, 2024
3218b3a
chore: adding fetch branches saga
Dec 7, 2024
f9c4030
chore: adding fetch and update local profile
Dec 7, 2024
adafd14
fix: fixing connectsaga
Dec 7, 2024
488b346
fix: review changes
Dec 8, 2024
942193d
chore: adding branch based sagas
Dec 9, 2024
e9167f2
fix: moving things around
Dec 9, 2024
d024160
chore: adding ctx
Dec 9, 2024
ef34582
chore: expanding context provider and making contextaware comps
Dec 9, 2024
c3d9a31
fix: remove gittest
Dec 9, 2024
fa8c461
chore: adding init sagas
Dec 10, 2024
9b1414e
fix: test fixes
Dec 10, 2024
2de337e
fix: review changes
Dec 10, 2024
40f057e
Merge branch 'chore/git-mod-5' of github.com:appsmithorg/appsmith int…
Dec 10, 2024
826dbf8
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 10, 2024
3a47055
chore: adding autocommit to saga
Dec 10, 2024
ca19474
fix: adding relevant selectors for quick git actions
Dec 10, 2024
3a2a045
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 11, 2024
59f91f4
fix: resolving conflict errors
Dec 11, 2024
e1eb35a
fix: review changes
Dec 11, 2024
3c4a4c2
Merge branch 'chore/git-mod-5' of github.com:appsmithorg/appsmith int…
Dec 11, 2024
fbcf6ae
fix: fixing test cases
Dec 11, 2024
56cbaef
fix: fixing more test cases
Dec 11, 2024
f8545b4
fix: changing AxiosResponse to AxiosPromise
Dec 11, 2024
65e9ea6
fix: fixing build and naming issues
Dec 11, 2024
2b7c3d2
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 11, 2024
f613ae1
fix: remove expect error
Dec 11, 2024
adddd08
chore: adding git ops modal
Dec 11, 2024
c6343d3
fix: arranging dumb components in a better fashion
Dec 11, 2024
c5c9585
fix: adding conflicterror and conflicterrormodal
Dec 11, 2024
c5b8cf3
fix: adding pull sagas
Dec 11, 2024
bcef9f5
chore: adding deploy tab
Dec 11, 2024
0e84fb8
chore: adding merge tab
Dec 11, 2024
c88bc0b
fix: review changes
Dec 12, 2024
885446c
Merge branch 'chore/git-mod-6' of github.com:appsmithorg/appsmith int…
Dec 12, 2024
e106d43
fix: better handling of ctx values
Dec 12, 2024
005a655
fix: minor fixes to merge comp
Dec 12, 2024
ba6ac37
chore: adding skeleton for status
Dec 12, 2024
54ac997
chore: adding status component and transformer
Dec 12, 2024
8c310af
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 12, 2024
523296b
fix: adding autocommit statusbar
Dec 12, 2024
8745497
Merge branch 'chore/git-mod-7' of github.com:appsmithorg/appsmith int…
Dec 12, 2024
9d57e5a
chore: adding git settings modal
Dec 12, 2024
44167c0
chore: wip - git settings modal
Dec 13, 2024
f698d26
fix: fixing error handling
Dec 13, 2024
245cb9b
chore: minor changes in error handling
Dec 13, 2024
cc35140
chore: review fixes
Dec 13, 2024
1b1da07
Merge branch 'chore/git-mod-7' of github.com:appsmithorg/appsmith int…
Dec 13, 2024
8dc482f
fix: review comments
Dec 13, 2024
e70f659
Merge branch 'chore/git-mod-7' of github.com:appsmithorg/appsmith int…
Dec 13, 2024
801b06b
chore: minor fixes for build failures
Dec 13, 2024
b4f8925
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 13, 2024
ec461fd
chore: review fixes
Dec 13, 2024
7f54647
Merge branch 'chore/git-mod-7' of github.com:appsmithorg/appsmith int…
Dec 13, 2024
b997ada
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 13, 2024
a569b22
chore: shifting fixes from ee to ee
Dec 13, 2024
f715c2a
fix: minor fixes
Dec 13, 2024
1273fc6
chore: adding initial state
Dec 13, 2024
0be3210
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 13, 2024
2953823
chore: renaming files
Dec 13, 2024
2be8c89
fix: minor
Dec 13, 2024
e1588c9
chore: fixes build issue
Dec 13, 2024
008f857
chore: adding branch protection
Dec 13, 2024
fe620bd
chore: adding local profile
Dec 13, 2024
d8dca7f
fix: issue with localprofile
Dec 13, 2024
e23819b
chore: adding general tab
Dec 14, 2024
a7f5832
chore: added disconnect modal
Dec 14, 2024
7b48aa2
chore: adding disable autocommit modal
Dec 14, 2024
57aa219
chore: adding disconnect and toggle autocommit saga
Dec 14, 2024
612c35a
chore: adding base for CD
Dec 14, 2024
ee50685
chore: moving things around
Dec 14, 2024
e20e0a2
chore: adding minor fixes
Dec 14, 2024
9071d0e
chore: wip ce-ee split
Dec 16, 2024
6314fe2
chore: additional ee files
Dec 16, 2024
8d077c8
chore: wip more ce-ee split
Dec 16, 2024
56f05cf
chore: removing old ee folder
Dec 16, 2024
52b5c4f
chore: adding ff
Dec 16, 2024
f789c5a
chore: unlicensed cd
Dec 16, 2024
49c1077
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 16, 2024
047af23
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions app/client/src/git/ce/components/ContinuousDelivery/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import {
CONFIGURE_CD_DESC,
CONFIGURE_CD_TITLE,
TRY_APPSMITH_ENTERPRISE,
createMessage,
} from "ee/constants/messages";
import { Button, Text } from "@appsmith/ads";
import { useAppsmithEnterpriseLink } from "pages/Editor/gitSync/GitSettingsModal/TabBranch/hooks";
import React from "react";
import styled from "styled-components";

export const Container = styled.div`
padding-top: 8px;
padding-bottom: 16px;
overflow: auto;
min-height: calc(360px + 52px);
`;

export const SectionTitle = styled(Text)`
font-weight: 600;
margin-bottom: 4px;
`;

export const SectionDesc = styled(Text)`
margin-bottom: 12px;
`;

export const StyledButton = styled(Button)`
display: inline-block;
`;

function ContinuousDelivery() {
const enterprisePricingLink = useAppsmithEnterpriseLink(
"git_continuous_delivery",
);

return (
<Container>
<SectionTitle kind="heading-s" renderAs="h3">
{createMessage(CONFIGURE_CD_TITLE)}
</SectionTitle>
<SectionDesc kind="body-m" renderAs="p">
{createMessage(CONFIGURE_CD_DESC)}
</SectionDesc>
<StyledButton
href={enterprisePricingLink}
kind="primary"
renderAs="a"
size="md"
target="_blank"
>
{createMessage(TRY_APPSMITH_ENTERPRISE)}
</StyledButton>
</Container>
);
}
Comment thread
brayn003 marked this conversation as resolved.

export default ContinuousDelivery;
153 changes: 153 additions & 0 deletions app/client/src/git/ce/components/DefaultBranch/DefaultBranchView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
import {
APPSMITH_ENTERPRISE,
DEFAULT_BRANCH,
DEFAULT_BRANCH_DESC,
UPDATE,
createMessage,
} from "ee/constants/messages";
import { Button, Link, Option, Select, Text } from "@appsmith/ads";
import React, { useCallback, useEffect, useMemo, useState } from "react";
import styled from "styled-components";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import type { FetchBranchesResponseData } from "git/requests/fetchBranchesRequest.types";
import noop from "lodash/noop";
import { useAppsmithEnterpriseUrl } from "git/hooks/useAppsmithEnterpriseUrl";

const Container = styled.div`
padding-top: 8px;
padding-bottom: 16px;
`;

const HeadContainer = styled.div`
margin-bottom: 16px;
`;

const BodyContainer = styled.div`
display: flex;
`;

const SectionTitle = styled(Text)`
font-weight: 600;
margin-bottom: 4px;
`;

const SectionDesc = styled(Text)`
margin-bottom: 4px;
`;

const StyledSelect = styled(Select)`
width: 240px;
margin-right: 12px;
`;

const StyledLink = styled(Link)`
display: inline-flex;
`;

interface DefaultBranchViewProps {
branches: FetchBranchesResponseData | null;
isGitProtectedFeatureLicensed: boolean;
updateDefaultBranch?: (branchName: string) => void;
}

function DefaultBranchView({
branches = null,
isGitProtectedFeatureLicensed = false,
updateDefaultBranch = noop,
}: DefaultBranchViewProps) {
const [selectedValue, setSelectedValue] = useState<string | undefined>();

const currentDefaultBranch = useMemo(() => {
const defaultBranch = branches?.find((b) => b.default);

return defaultBranch?.branchName;
}, [branches]);

const enterprisePricingUrl = useAppsmithEnterpriseUrl(
"git_branch_protection",
);

const filteredBranches = useMemo(
() => branches?.filter((branch) => !branch.branchName.includes("origin/")),
[branches],
);

const isUpdateDisabled =
!selectedValue || selectedValue === currentDefaultBranch;

useEffect(
function selectedValueOnInitEffect() {
const defaultBranch = branches?.find((b) => b.default);

setSelectedValue(defaultBranch?.branchName);
},
[branches],
);

const handleGetPopupContainer = useCallback(
(triggerNode) => triggerNode.parentNode,
[],
);

const handleUpdate = useCallback(() => {
if (selectedValue) {
AnalyticsUtil.logEvent("GS_DEFAULT_BRANCH_UPDATE", {
old_branch: currentDefaultBranch,
new_branch: selectedValue,
});
updateDefaultBranch(selectedValue);
}
}, [currentDefaultBranch, selectedValue, updateDefaultBranch]);

return (
<Container>
<HeadContainer>
<SectionTitle kind="heading-s" renderAs="h3">
{createMessage(DEFAULT_BRANCH)}
</SectionTitle>
<SectionDesc kind="body-m" renderAs="p">
{createMessage(DEFAULT_BRANCH_DESC)}
</SectionDesc>
{!isGitProtectedFeatureLicensed && (
<SectionDesc kind="body-m" renderAs="p">
To change your default branch, try{" "}
<StyledLink
kind="primary"
target="_blank"
to={enterprisePricingUrl}
>
{createMessage(APPSMITH_ENTERPRISE)}
</StyledLink>
</SectionDesc>
)}
</HeadContainer>
<BodyContainer>
<StyledSelect
data-testid="t--git-default-branch-select"
dropdownMatchSelectWidth
getPopupContainer={handleGetPopupContainer}
isDisabled={!isGitProtectedFeatureLicensed}
onChange={setSelectedValue}
value={selectedValue}
>
{filteredBranches?.map((b) => (
<Option key={b.branchName} value={b.branchName}>
{b.branchName}
</Option>
))}
</StyledSelect>
<Button
data-testid="t--git-default-branch-update-btn"
isDisabled={isUpdateDisabled}
kind="secondary"
onClick={handleUpdate}
size="md"
>
{createMessage(UPDATE)}
</Button>
</BodyContainer>
</Container>
);
}

export default DefaultBranchView;
14 changes: 14 additions & 0 deletions app/client/src/git/ce/components/DefaultBranch/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import { useGitContext } from "git/components/GitContextProvider";
import DefaultBranchView from "./DefaultBranchView";

export default function DefaultBranch() {
const { branches } = useGitContext();

return (
<DefaultBranchView
branches={branches}
isGitProtectedFeatureLicensed={false}
/>
);
}
20 changes: 20 additions & 0 deletions app/client/src/git/ce/components/GitModals/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import ConflictErrorModal from "git/components/ConflictErrorModal";
import DisableAutocommitModal from "git/components/DisableAutocommitModal";
import DisconnectModal from "git/components/DisconnectModal";
import OpsModal from "git/components/OpsModal";
import SettingsModal from "git/components/SettingsModal";
import React from "react";

function GitModals() {
return (
<>
<OpsModal />
<SettingsModal />
<DisconnectModal />
<DisableAutocommitModal />
<ConflictErrorModal />
</>
);
}

export default GitModals;
18 changes: 18 additions & 0 deletions app/client/src/git/ce/hooks/useDefaultBranch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { useGitContext } from "git/components/GitContextProvider";
import { selectDefaultBranch } from "git/store/selectors/gitSingleArtifactSelectors";
import type { GitRootState } from "git/store/types";
import { useSelector } from "react-redux";

function useDefaultBranch() {
const { artifactDef } = useGitContext();

const defaultBranch = useSelector((state: GitRootState) =>
selectDefaultBranch(state, artifactDef),
);

return {
defaultBranch,
};
}

export default useDefaultBranch;
13 changes: 13 additions & 0 deletions app/client/src/git/ce/sagas/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { PayloadAction } from "@reduxjs/toolkit";

export const blockingActionSagas: Record<
string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(action: PayloadAction<any>) => Generator<any>
> = {};

export const nonBlockingActionSagas: Record<
string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(action: PayloadAction<any>) => Generator<any>
> = {};
3 changes: 3 additions & 0 deletions app/client/src/git/ce/store/actions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const gitArtifactCaseReducers = {};

export const gitConfigCaseReducers = {};
9 changes: 9 additions & 0 deletions app/client/src/git/ce/store/helpers/initialState.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {
GitArtifactAPIResponsesReduxState,
GitArtifactUIReduxState,
} from "../types";

export const gitArtifactUIInitialState: GitArtifactUIReduxState = {};

export const gitArtifactAPIResponsesInitialState: GitArtifactAPIResponsesReduxState =
{};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default {};
3 changes: 3 additions & 0 deletions app/client/src/git/ce/store/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface GitArtifactAPIResponsesReduxState {}

export interface GitArtifactUIReduxState {}
6 changes: 3 additions & 3 deletions app/client/src/git/components/ConflictError/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from "react";

import { useGitContext } from "../GitContextProvider";
import GitConflictErrorView from "./ConflictErrorView";
import useMetadata from "git/hooks/useMetadata";

export default function ConflictError() {
const { gitMetadata } = useGitContext();
const { metadata } = useMetadata();

// ! case: learnMoreUrl comes from pullError
const learnMoreUrl =
"https://docs.appsmith.com/advanced-concepts/version-control-with-git";
const repoUrl = gitMetadata?.browserSupportedRemoteUrl || "";
const repoUrl = metadata?.browserSupportedRemoteUrl || "";

return <GitConflictErrorView learnMoreUrl={learnMoreUrl} repoUrl={repoUrl} />;
}
Loading