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

ON-42773 # Added slug to Form #332

Merged
merged 2 commits into from
Aug 16, 2024
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Added

- `slug` to `Form`

## [7.0.0] - 2024-08-07

### Added
Expand Down
2 changes: 2 additions & 0 deletions OneBlink.SDK.Tests/FormsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public async void can_crud_form()
DateTime endDate = DateTime.Today.AddDays(10);
Form newForm = new Form();
newForm.name = "Unit test";
newForm.slug = "unit-test";
newForm.description = "Created via unit test";
newForm.organisationId = organisationId;
newForm.isAuthenticated = false;
Expand Down Expand Up @@ -282,6 +283,7 @@ public async void can_crud_form()
Assert.NotNull(savedForm);
Form retrievedForm = await formsClient.Get(savedForm.id, true);
Assert.NotNull(retrievedForm);
Assert.Equal(newForm.slug, retrievedForm.slug);
Assert.Equal(tags, retrievedForm.tags);
Assert.Equal(newForm.postSubmissionReceipt.html, retrievedForm.postSubmissionReceipt.html);
// Need to convert these to UTC time as that is what comes from api, and these dates are in local time
Expand Down
4 changes: 4 additions & 0 deletions OneBlink.SDK/models/Form.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ public string name
{
get; set;
}
public string slug
{
get; set;
}
public string description
{
get; set;
Expand Down
1 change: 1 addition & 0 deletions docs/models/Form.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
| `customCssClasses` | No | `List<string>` | Custom CSS classes that will be added to the form during rendering | `new List<string>()` |
| `pointAddressEnvironmentId` | No | `Guid?` | Optional except when `elements` contains a Point Address element | `null` |
| `allowGeoscapeAddresses` | No | `bool?` | Optional configuration to allow use of Geoscape elements on the form | `null` |
| `slug` | No | `string` | Unique domain safe text to identify the form | `null` |

### Other properties

Expand Down
Loading