From 6c4876285d9d6f0f4ea0b932a5bdf93d7631f108 Mon Sep 17 00:00:00 2001 From: Matt Carroll Date: Fri, 16 Aug 2024 13:44:25 +1000 Subject: [PATCH 1/2] ON-42773 # Added slug to Form --- CHANGELOG.md | 4 ++++ OneBlink.SDK.Tests/FormsClientTests.cs | 2 ++ OneBlink.SDK/models/Form.cs | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8611c8f..8434d7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Added + +- `slug` to `Form` + ## [7.0.0] - 2024-08-07 ### Added diff --git a/OneBlink.SDK.Tests/FormsClientTests.cs b/OneBlink.SDK.Tests/FormsClientTests.cs index 2ccc2c9..115ba0d 100644 --- a/OneBlink.SDK.Tests/FormsClientTests.cs +++ b/OneBlink.SDK.Tests/FormsClientTests.cs @@ -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; @@ -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 diff --git a/OneBlink.SDK/models/Form.cs b/OneBlink.SDK/models/Form.cs index 37ae3d2..dae79d8 100644 --- a/OneBlink.SDK/models/Form.cs +++ b/OneBlink.SDK/models/Form.cs @@ -160,6 +160,10 @@ public string name { get; set; } + public string slug + { + get; set; + } public string description { get; set; From 259a9408344abd47feb16db78aeeb792d6a95d1e Mon Sep 17 00:00:00 2001 From: Matt Carroll Date: Fri, 16 Aug 2024 15:21:40 +1000 Subject: [PATCH 2/2] ON-42773 # Added slug to form docs --- docs/models/Form.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/models/Form.md b/docs/models/Form.md index 2bba9d2..61b4caa 100644 --- a/docs/models/Form.md +++ b/docs/models/Form.md @@ -37,6 +37,7 @@ | `customCssClasses` | No | `List` | Custom CSS classes that will be added to the form during rendering | `new List()` | | `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