Skip to content

Commit

Permalink
Merge pull request #307 from oneblink/ON-39753
Browse files Browse the repository at this point in the history
ON-39753 # Added new types and config for Location Lookup
  • Loading branch information
Zaxist authored Apr 24, 2024
2 parents e9a905b + b7e040e commit df8cfd8
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 45 deletions.
15 changes: 1 addition & 14 deletions OneBlink.SDK.Tests/FormsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,6 @@ public async void can_crud_form()
null
);

FormElement geoscapeElement = FormElement.CreateGeoscapeAddressElement(
"geoscapeElement",
"Geoscape Element",
Guid.NewGuid(),
false,
false,
null,
true,
false,
"default",
"placeholder value",
"hint value"
);
FormElementOption option = new FormElementOption();
option.id = Guid.NewGuid().ToString();
option.value = "A";
Expand All @@ -270,7 +257,7 @@ public async void can_crud_form()
new List<FormElementOption>() { option }
);

newForm.elements = new List<FormElement>() { textElement, summaryElement, geoscapeElement, complianceElement };
newForm.elements = new List<FormElement>() { textElement, summaryElement, complianceElement };

FormsClient formsClient = new FormsClient(ACCESS_KEY, SECRET_KEY, TenantName.ONEBLINK_TEST);
Form savedForm = await formsClient.Create(newForm);
Expand Down
5 changes: 5 additions & 0 deletions OneBlink.SDK/models/Form.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,5 +280,10 @@ public List<string> customCssClasses
{
get; set;
}

public string googleMapsIntegrationEnvironmentId
{
get; set;
}
}
}
9 changes: 9 additions & 0 deletions OneBlink.SDK/models/FormElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,15 @@ public bool? decorativeImage
{
get; set;
}
public bool? showStreetAddress
{
get; set;
}

public string formattedAddressElementId
{
get; set;
}
private static Guid initialiseId(Guid? id)
{
if (!id.HasValue)
Expand Down
4 changes: 4 additions & 0 deletions OneBlink.SDK/models/FormMigrationOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,9 @@ public long? versionId
{
get; set;
}
public bool googleMapsIntegrationEnvironmentId
{
get; set;
}
}
}
4 changes: 4 additions & 0 deletions OneBlink.SDK/models/FormsAppEnvironmentCloneOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,9 @@ public bool isCloningFormApprovalSteps
{
get; set;
}
public bool isCloningFormGoogleMapsIntegrationEnvironmentId
{
get; set;
}
}
}
63 changes: 32 additions & 31 deletions docs/models/Form.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,38 @@

### Constructor

| Parameter | Required | Type | Description | Default Value |
| ------------------------------ | -------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| `name` | Yes | `string` | | |
| `description` | Yes | `string` | | |
| `organisationId` | Yes | `string` | Id of the organisation this form is associated too | |
| `formsAppEnvironmentId` | Yes | `long` | Id of the environment this form is part of | |
| `formsAppIds` | No | `List<long>` | List of Form Apps id's | `new List<long>()` |
| `elements` | No | `List<FormElement>` | List of FormElement's | `new List<FormElement>()` |
| `id` | No | `long?` | Will be assigned by OneBlink when form is creating | `null` |
| `postSubmissionAction` | No | `string` | Allowed values of "BACK", "URL", "CLOSE", "FORMS_LIBRARY" | `"FORMS_LIBRARY"` |
| `isAuthenticated` | No | `bool` | Determines if only authenticated users can access the form | `true` |
| `submissionEvents` | No | `List<FormSubmissionEvent>` | List of Form submission events | `new List<FormSubmissionEvent>()` |
| `draftEvents` | No | `List<FormSubmissionEvent>` | List of Form draft events | `new List<FormSubmissionEvent>()` |
| `schedulingEvents` | No | `List<FormSubmissionEvent>` | List of Form scheduling events | `new List<FormSubmissionEvent>()` |
| `approvalSteps` | No | `List<FormSubmissionEvent>` | List of Form approval steps | `new List<FormApprovalStep>()` |
| `approvalEvents` | No | `List<FormSubmissionEvent>` | List of Form approval events | `new List<FormSubmissionEvent>()` |
| `isMultiPage` | No | `bool` | Determines if this form a single page form or multi page form | `false` |
| `redirectUrl` | No | `string` | URL to be redirected too, only applies if `postSubmissionAction` is "URL" | `null` |
| `tags` | No | `List<string>` | List of tags to be associated with the form | `new List<string>()` |
| `publishStartDate` | No | `DateTime?` | DateTime the form should become available | `null` |
| `publishEndDate` | No | `DateTime?` | DateTime the form should become unavailable | `null` |
| `unpublishedUserMessage` | No | `string` | The message to be shown to forms users when the form is not in the published time window | `null` |
| `cancelAction` | No | `string` | Allowed values of "BACK", "URL", "CLOSE", "FORMS_LIBRARY" | `"BACK"` |
| `cancelRedirectUrl` | No | `string` | URL to be redirected too, only applies if `cancelAction` is "URL" | `null` |
| `serverValidation` | No | `FormServerValidation` | Optional configuration for form submission validation | `null` |
| `externalIdGenerationOnSubmit` | No | `FormExternalIdGeneration` | Optional configuration for generating externalId after serverValidation but before submission | `null` |
| `personalisation` | No | `FormPersonalisation` | Optional configuration for prefilling elements or generating new elements on form load | `null` |
| `approvalConfiguration` | No | `FormApprovalConfiguration` | Optional configuration for approvals | `null` |
| `submissionTitle` | No | `string` | Optional configuration for the default submission title | `null` |
| `continueWithAutosave` | No | `boolean` | Whether or not viewing the form should auto-continue with autosave data when available rather than prompting the user title | `false` |
| `customCssClasses` | No | `List<string>` | Custom CSS classes that will be added to the form during rendering | `new List<string>()` |
| Parameter | Required | Type | Description | Default Value |
| ------------------------------------ | -------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| `name` | Yes | `string` | | |
| `description` | Yes | `string` | | |
| `organisationId` | Yes | `string` | Id of the organisation this form is associated too | |
| `formsAppEnvironmentId` | Yes | `long` | Id of the environment this form is part of | |
| `formsAppIds` | No | `List<long>` | List of Form Apps id's | `new List<long>()` |
| `elements` | No | `List<FormElement>` | List of FormElement's | `new List<FormElement>()` |
| `id` | No | `long?` | Will be assigned by OneBlink when form is creating | `null` |
| `postSubmissionAction` | No | `string` | Allowed values of "BACK", "URL", "CLOSE", "FORMS_LIBRARY" | `"FORMS_LIBRARY"` |
| `isAuthenticated` | No | `bool` | Determines if only authenticated users can access the form | `true` |
| `submissionEvents` | No | `List<FormSubmissionEvent>` | List of Form submission events | `new List<FormSubmissionEvent>()` |
| `draftEvents` | No | `List<FormSubmissionEvent>` | List of Form draft events | `new List<FormSubmissionEvent>()` |
| `schedulingEvents` | No | `List<FormSubmissionEvent>` | List of Form scheduling events | `new List<FormSubmissionEvent>()` |
| `approvalSteps` | No | `List<FormSubmissionEvent>` | List of Form approval steps | `new List<FormApprovalStep>()` |
| `approvalEvents` | No | `List<FormSubmissionEvent>` | List of Form approval events | `new List<FormSubmissionEvent>()` |
| `isMultiPage` | No | `bool` | Determines if this form a single page form or multi page form | `false` |
| `redirectUrl` | No | `string` | URL to be redirected too, only applies if `postSubmissionAction` is "URL" | `null` |
| `tags` | No | `List<string>` | List of tags to be associated with the form | `new List<string>()` |
| `publishStartDate` | No | `DateTime?` | DateTime the form should become available | `null` |
| `publishEndDate` | No | `DateTime?` | DateTime the form should become unavailable | `null` |
| `unpublishedUserMessage` | No | `string` | The message to be shown to forms users when the form is not in the published time window | `null` |
| `cancelAction` | No | `string` | Allowed values of "BACK", "URL", "CLOSE", "FORMS_LIBRARY" | `"BACK"` |
| `cancelRedirectUrl` | No | `string` | URL to be redirected too, only applies if `cancelAction` is "URL" | `null` |
| `serverValidation` | No | `FormServerValidation` | Optional configuration for form submission validation | `null` |
| `externalIdGenerationOnSubmit` | No | `FormExternalIdGeneration` | Optional configuration for generating externalId after serverValidation but before submission | `null` |
| `personalisation` | No | `FormPersonalisation` | Optional configuration for prefilling elements or generating new elements on form load | `null` |
| `approvalConfiguration` | No | `FormApprovalConfiguration` | Optional configuration for approvals | `null` |
| `submissionTitle` | No | `string` | Optional configuration for the default submission title | `null` |
| `continueWithAutosave` | No | `boolean` | Whether or not viewing the form should auto-continue with autosave data when available rather than prompting the user title | `false` |
| `customCssClasses` | No | `List<string>` | Custom CSS classes that will be added to the form during rendering | `new List<string>()` |
| `googleMapsIntegrationEnvironmentId` | No | `string` | Optional configuration to allow "Show Street Address" on "Location" Elements to work with "Text" elements. You must have a Google Maps Integration setup to use this. | `null` |

### Other properties

Expand Down
Loading

0 comments on commit df8cfd8

Please sign in to comment.