Skip to content

Commit

Permalink
chore: adding base for CD
Browse files Browse the repository at this point in the history
  • Loading branch information
brayn003 committed Dec 14, 2024
1 parent 57aa219 commit 612c35a
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as ContinuousDeliveryEE } from "git/components/DefaultBranch/DefaultBranchCE";
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 ContinuousDeliveryCE() {
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>
);
}

export default ContinuousDeliveryCE;
16 changes: 16 additions & 0 deletions app/client/src/git/components/ContinuousDelivery/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import useGitFeatureFlags from "git/hooks/useGitFeatureFlags";
import React from "react";
import ContinuousDeliveryCE from "./ContinuousDeliveryCE";
import { ContinuousDeliveryEE } from "ee/git/components/ContinuousDelivery";

function ContinuousDelivery() {
const { license_git_continuous_delivery_enabled } = useGitFeatureFlags();

if (license_git_continuous_delivery_enabled) {
return <ContinuousDeliveryEE />;
}

return <ContinuousDeliveryCE />;
}

export default ContinuousDelivery;
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const StyledButton = styled(Button)`
display: inline-block;
`;

function TabContinuousDelivery() {
function TabContDelivery() {
const enterprisePricingLink = useAppsmithEnterpriseLink(
"git_continuous_delivery",
);
Expand All @@ -55,4 +55,4 @@ function TabContinuousDelivery() {
);
}

export default TabContinuousDelivery;
export default TabContDelivery;
4 changes: 4 additions & 0 deletions app/client/src/git/hooks/useGitFeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ export default function useGitFeatureFlags() {
const license_git_branch_protection_enabled = useFeatureFlag(
FEATURE_FLAG.license_git_branch_protection_enabled,
);
const license_git_continuous_delivery_enabled = useFeatureFlag(
FEATURE_FLAG.license_git_continuous_delivery_enabled,
);

return {
license_git_branch_protection_enabled,
license_git_continuous_delivery_enabled,
};
}

0 comments on commit 612c35a

Please sign in to comment.