Skip to content

feat: Initial Project Create Form ('/projects/create') #60

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 16 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Clean up lint issues
  • Loading branch information
bryphe-coder committed Jan 25, 2022
commit e872b9eabf429c323ad5c91544ceccb51a08b8b6
6 changes: 3 additions & 3 deletions site/components/Form/FormDropdownField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface FormDropdownFieldProps<T> extends FormTextFieldProps<T> {
export const formDropdownFieldFactory = <T,>(): React.FC<FormDropdownFieldProps<T>> => {
const FormTextField = formTextFieldFactory<T>()

const component: React.FC<FormDropdownFieldProps<T>> = ({ items, ...props }) => {
const Component: React.FC<FormDropdownFieldProps<T>> = ({ items, ...props }) => {
const styles = useStyles()
return (
<FormTextField select {...props}>
Expand All @@ -44,8 +44,8 @@ export const formDropdownFieldFactory = <T,>(): React.FC<FormDropdownFieldProps<
}

// Required when using an anonymous factory function
component.displayName = "FormDropdownField"
return component
Component.displayName = "FormDropdownField"
return Component
}

const useStyles = makeStyles({
Expand Down
16 changes: 0 additions & 16 deletions site/components/Form/types.ts

This file was deleted.

11 changes: 4 additions & 7 deletions site/forms/CreateProjectForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ export const CreateProjectForm: React.FC<CreateProjectFormProps> = ({
fullWidth
helperText="A unique name describing your project."
label="Project Name"
placeholder={"my-project"}
placeholder="my-project"
required
/>
</FormSection>

<FormSection title="Organization">
<FormDropdownField
form={form}
formFieldName={"organizationId"}
formFieldName="organizationId"
helperText="The organization owning this project."
items={organizationDropDownItems}
fullWidth
Expand All @@ -96,7 +96,7 @@ export const CreateProjectForm: React.FC<CreateProjectFormProps> = ({
<FormSection title="Provider">
<FormDropdownField
form={form}
formFieldName={"provisioner"}
formFieldName="provisioner"
helperText="The backing provisioner for this project."
items={provisionerDropDownItems}
fullWidth
Expand All @@ -112,10 +112,7 @@ export const CreateProjectForm: React.FC<CreateProjectFormProps> = ({
<LoadingButton
loading={form.isSubmitting}
className={styles.button}
onClick={() => {
console.log("submit clicked: " + JSON.stringify(form.values))
form.submitForm()
}}
onClick={form.submitForm}
variant="contained"
color="primary"
type="submit"
Expand Down