Skip to content

Commit

Permalink
Merge pull request #17 from netlify-templates/form-update
Browse files Browse the repository at this point in the history
updated form models and content
  • Loading branch information
TomasBankauskas authored Jun 10, 2024
2 parents 23addea + 809718a commit 074c83e
Show file tree
Hide file tree
Showing 16 changed files with 1 addition and 49 deletions.
2 changes: 0 additions & 2 deletions .stackbit/models/ContactSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ export const ContactSectionModel: Model = {
default: {
type: 'FormBlock',
elementId: 'contact-form',
action: '/.netlify/functions/submission_created',
destination: '',
fields: [
{
type: 'TextFormControl',
Expand Down
14 changes: 0 additions & 14 deletions .stackbit/models/FormBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,6 @@ export const FormBlockModel: Model = {
default: 'contact-form',
required: true
},
{
type: 'string',
name: 'action',
group: 'settings',
label: 'Action (form submission URL)',
default: '/.netlify/functions/submission_created'
},
{
type: 'string',
name: 'destination',
label: 'Destination (email to redirect responses)',
default: '',
group: 'settings'
},
{
type: 'style',
name: 'styles',
Expand Down
6 changes: 0 additions & 6 deletions .stackbit/presets/contact-section.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"form": {
"type": "FormBlock",
"elementId": "contact-form",
"action": "/.netlify/functions/submission_created",
"destination": "",
"fields": [
{
"type": "TextFormControl",
Expand Down Expand Up @@ -78,8 +76,6 @@
"form": {
"type": "FormBlock",
"elementId": "contact-form",
"action": "/.netlify/functions/submission_created",
"destination": "",
"fields": [
{
"type": "TextFormControl",
Expand Down Expand Up @@ -147,8 +143,6 @@
"form": {
"type": "FormBlock",
"elementId": "contact-form",
"action": "/.netlify/functions/submission_created",
"destination": "",
"fields": [
{
"type": "EmailFormControl",
Expand Down
4 changes: 0 additions & 4 deletions .stackbit/presets/page-layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@
"form": {
"type": "FormBlock",
"elementId": "sign-up-form",
"action": "/.netlify/functions/submission_created",
"destination": "",
"fields": [
{
"type": "TextFormControl",
Expand Down Expand Up @@ -573,8 +571,6 @@
"form": {
"type": "FormBlock",
"elementId": "sign-up-form",
"action": "/.netlify/functions/submission_created",
"destination": "",
"fields": [
{
"type": "TextFormControl",
Expand Down
2 changes: 0 additions & 2 deletions content/pages/blog/post-five.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ bottomSections:
form:
type: FormBlock
elementId: sign-up-form
destination: ''
action: /.netlify/functions/submission_created
fields:
- name: firstName
label: First Name
Expand Down
2 changes: 0 additions & 2 deletions content/pages/blog/post-four.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ bottomSections:
form:
type: FormBlock
elementId: sign-up-form
destination: ''
action: /.netlify/functions/submission_created
fields:
- name: firstName
label: First Name
Expand Down
2 changes: 0 additions & 2 deletions content/pages/blog/post-one.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ bottomSections:
form:
type: FormBlock
elementId: sign-up-form
destination: ''
action: /.netlify/functions/submission_created
fields:
- name: firstName
label: First Name
Expand Down
2 changes: 0 additions & 2 deletions content/pages/blog/post-seven.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ bottomSections:
form:
type: FormBlock
elementId: sign-up-form
destination: ''
action: /.netlify/functions/submission_created
fields:
- name: firstName
label: First Name
Expand Down
2 changes: 0 additions & 2 deletions content/pages/blog/post-six.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ bottomSections:
form:
type: FormBlock
elementId: sign-up-form
destination: ''
action: /.netlify/functions/submission_created
fields:
- name: firstName
label: First Name
Expand Down
2 changes: 0 additions & 2 deletions content/pages/blog/post-three.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ bottomSections:
form:
type: FormBlock
elementId: sign-up-form
destination: ''
action: /.netlify/functions/submission_created
fields:
- name: firstName
label: First Name
Expand Down
2 changes: 0 additions & 2 deletions content/pages/blog/post-two.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ bottomSections:
form:
type: FormBlock
elementId: sign-up-form
destination: ''
action: /.netlify/functions/submission_created
fields:
- name: firstName
label: First Name
Expand Down
2 changes: 0 additions & 2 deletions content/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ sections:
form:
type: FormBlock
elementId: sign-up-form
destination: ''
action: /.netlify/functions/submission_created
fields:
- name: firstName
label: First Name
Expand Down
2 changes: 0 additions & 2 deletions content/pages/info.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,6 @@ sections:
form:
type: FormBlock
elementId: sign-up-form
destination: ''
action: /.netlify/functions/submission_created
fields:
- name: firstName
label: First Name
Expand Down
2 changes: 0 additions & 2 deletions content/pages/projects/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ bottomSections:
form:
type: FormBlock
elementId: sign-up-form
destination: ''
action: /.netlify/functions/submission_created
fields:
- name: firstName
label: First Name
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/FormBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { mapStylesToClassNames as mapStyles } from '../../../utils/map-styles-to

export default function FormBlock(props) {
const formRef = React.createRef<HTMLFormElement>();
const { elementId, className, action, destination, fields = [], submitLabel, styles = {} } = props;
const { elementId, className, fields = [], submitLabel, styles = {} } = props;

if (fields.length === 0) {
return null;
Expand Down
2 changes: 0 additions & 2 deletions src/types/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ export type FormBlock = BaseContentObject & {
fields?: (TextFormControl | EmailFormControl | TextareaFormControl | CheckboxFormControl | SelectFormControl)[];
submitLabel?: string;
elementId: string;
action?: string;
destination?: string;
styles?: any;
};

Expand Down

0 comments on commit 074c83e

Please sign in to comment.