Skip to content

Commit 35c04c0

Browse files
Merge pull request #9 from typecode/stephe_sf-fields
add optional salesforce config fields to all field blocks
2 parents 740915d + cb2ced9 commit 35c04c0

File tree

2 files changed

+73
-13
lines changed

2 files changed

+73
-13
lines changed

wagtail_advanced_form_builder/blocks/fields/base_field_block.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,20 @@
88

99

1010
class BaseFieldBlock(blocks.StructBlock):
11-
1211
label = blocks.CharBlock(
13-
max_length=255,
14-
required=True,
15-
help_text='The label of the form field.'
12+
max_length=255, required=True, help_text="The label of the form field."
1613
)
1714

1815
required = blocks.BooleanBlock(
1916
default=False,
2017
required=False,
21-
help_text='Tick this box to make this a required field.'
18+
help_text="Tick this box to make this a required field.",
2219
)
2320

2421
display_checkbox_label = blocks.BooleanBlock(
2522
default=False,
2623
required=False,
27-
help_text='Do you want the checkbox label to display? If not you should populate help_text.'
24+
help_text="Do you want the checkbox label to display? If not you should populate help_text.",
2825
)
2926

3027
choices = blocks.ListBlock(
@@ -39,14 +36,21 @@ class BaseFieldBlock(blocks.StructBlock):
3936
)
4037

4138
max_length = blocks.IntegerBlock(
42-
required=False,
43-
help_text='Set a maximum length for this field. e.g. 100'
39+
required=False, help_text="Set a maximum length for this field. e.g. 100"
4440
)
4541

4642
default_value = blocks.CharBlock(
43+
max_length=255, required=False, help_text="Set a default value for this field."
44+
)
45+
salesforce_object_name = blocks.CharBlock(
46+
max_length=255,
47+
required=False,
48+
help_text="The Salesforce object name that the form field value will be integrated to.",
49+
)
50+
salesforce_api_field_name = blocks.CharBlock(
4751
max_length=255,
4852
required=False,
49-
help_text='Set a default value for this field.'
53+
help_text="The Salesforce API field name that the form field value will be integrated to.",
5054
)
5155

5256
# placeholder = blocks.CharBlock(
@@ -58,23 +62,23 @@ class BaseFieldBlock(blocks.StructBlock):
5862
help_text = blocks.CharBlock(
5963
max_length=255,
6064
required=False,
61-
help_text='Text to assist the user in populating this field.'
65+
help_text="Text to assist the user in populating this field.",
6266
)
6367

6468
html = RichTextBlock(
6569
required=False,
6670
)
6771

6872
display_side_by_side = blocks.BooleanBlock(
69-
help_text='Display these items side by side?',
73+
help_text="Display these items side by side?",
7074
required=False,
7175
)
7276

7377
rules = ConditionalBlock(
7478
required=False,
75-
help_text='Add conditional rules to show or hide fields depending on the value of other fields in the form.'
79+
help_text="Add conditional rules to show or hide fields depending on the value of other fields in the form.",
7680
)
7781

7882
@property
7983
def media(self):
80-
return forms.Media(js=[static('wagtail_advanced_form_builder/js/admin.js')])
84+
return forms.Media(js=[static("wagtail_advanced_form_builder/js/admin.js")])

0 commit comments

Comments
 (0)