Skip to content
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

Advanced options update #291

Merged
merged 3 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ GITHUB_OWNER=
GITLAB_OWNER=
CIVO_TOKEN=
CIVO_CLOUD_REGION=
DNS_PROVIDER=
DNS_PROVIDER= # Civo | Cloudflare
DOMAIN_NAME=
ALERTS_EMAIL=
CLOUDFLARE_TOKEN=
Expand Down
22 changes: 22 additions & 0 deletions components/learnMore/learnMore.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Meta, StoryObj } from '@storybook/react';

import { InstallationType } from '../../types/redux';

import LearnMore from '.';

const meta: Meta<typeof LearnMore> = {
title: 'Components/LearnMore',
component: LearnMore,
};

export default meta;

export const Default: StoryObj<typeof LearnMore> = {
args: {
description: 'Learn more about',
href: '',
linkTitle: 'configuring your cluster',
installType: InstallationType.AWS,
withoutDivider: true,
},
};
4 changes: 3 additions & 1 deletion containers/clusterForms/shared/advancedOptions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ const AdvancedOptions: FunctionComponent = () => {
<ControlledTextField
control={control}
name="gitopsTemplateUrl"
label="GitOps template override"
label="gitops-template repository override"
defaultValue={values?.gitopsTemplateUrl}
rules={{
required: false,
}}
helperText={`Example format: https://${gitProvider}.com/kubefirst/gitops-template`}
/>
<ControlledTextField
control={control}
Expand All @@ -55,6 +56,7 @@ const AdvancedOptions: FunctionComponent = () => {
rules={{
required: false,
}}
helperText="Example: main"
/>
<CheckboxContainer>
<Typography variant="labelLarge" color={EXCLUSIVE_PLUM}>
Expand Down
6 changes: 6 additions & 0 deletions containers/clusterForms/shared/setupForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import ControlledTextField from '../../../../components/controlledFields/TextFie
import ControlledAutocomplete from '../../../../components/controlledFields/AutoComplete';
import { EMAIL_REGEX, LOWER_KEBAB_CASE_REGEX } from '../../../../constants';
import { InstallValues, InstallationType } from '../../../../types/redux';
import Typography from '../../../../components/typography';
import { BISCAY } from '../../../../constants/colors';

const CLOUD_REGION_LABELS: Record<InstallationType, string | null> = {
[InstallationType.AWS]: 'Cloud region',
Expand Down Expand Up @@ -107,6 +109,9 @@ const SetupForm: FunctionComponent = () => {

return (
<>
<Typography variant="subtitle2" color={BISCAY}>
General Settings
</Typography>
<ControlledTextField
control={control}
name="alertsEmail"
Expand All @@ -118,6 +123,7 @@ const SetupForm: FunctionComponent = () => {
required: true,
pattern: EMAIL_REGEX,
}}
helperText="This email address will receive important system notifications such cert expiry notices."
/>
<ControlledAutocomplete
control={control}
Expand Down
7 changes: 5 additions & 2 deletions cypress/e2e/1-create-cluster/civo-github-provision.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ describe('create civo github management cluster', () => {
});

cy.get("[name='dnsProvider']").click(); // click dnsProvider multiselect to open menu

cy.get('.MuiAutocomplete-popper').then((popper) => {
cy.wrap(popper).contains(DNS_PROVIDER).click();
});

cy.get("[name='cloudflareToken']").type(CLOUDFLARE_TOKEN, { log: false });
cy.get("[name='cloudflareOriginCaIssuerKey']").type(CLOUDFLARE_ORIGIN_CA_KEY, { log: false });
if (DNS_PROVIDER === 'Cloudflare') {
cy.get("[name='cloudflareToken']").type(CLOUDFLARE_TOKEN, { log: false });
cy.get("[name='cloudflareOriginCaIssuerKey']").type(CLOUDFLARE_ORIGIN_CA_KEY, { log: false });
}

cy.get("[name='domainName']").click(); // click domainName multiselect to open menu
cy.get('.MuiAutocomplete-popper').then((popper) => {
Expand Down