Tags: Sitecore/ASP.NET-Core-SDK
Tags
Changed text based TagHelpers to rendering Chromes with internal span… … not div (#40) This fixes the bug where Text based TagHelpers can't render inside of a `p` tag, causing all of MetaData editing to break. This aligns with the JSS approach of using a `span` tag instead. I also introduced a new `Assert` to the appropriate UnitTests as that tag insertion wasn't being tested currently. ## Testing - [x] The Unit & Intergration tests are passing. - [x] I have added the necessary tests to cover my changes. ## Terms <!-- The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it. --> - [x] I agree to follow this project's [Code of Conduct](CODE_OF_CONDUCT.md). Closes #39
Pages MetaData Editing Mode Support (#29) This PR adds support for Pages MetaData Editing. ## Description / Motivation - Introduction of a new Library to be referenced in XMC projects - Changes required in LayoutService.Client project to introduce concept of Field Chromes, which weren't required previously. - Tests updated to reflect new and updated code ## Testing - [x] The Unit & Intergration tests are passing. - [x] I have added the necessary tests to cover my changes. ## Terms <!-- Place an X in the [] to check. --> <!-- The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it. --> - [x] I agree to follow this project's [Code of Conduct](CODE_OF_CONDUCT.md). Closes #17 --------- Co-authored-by: Ivan Lieckens <ivanlieckens@hotmail.com>
Change log level for missing field during model binding (#31) This fixes issue #30 ## Description / Motivation Changes level of log level during model binding when field is missing from warning to debug ## Testing - [x] The Unit & Intergration tests are passing. - [x] I have added the necessary tests to cover my changes. ## Terms - [X] I agree to follow this project's [Code of Conduct](CODE_OF_CONDUCT.md).
Update Official Documentation link in README.md (#24) <!-- Provide a general summary of your changes in the Title above --> <!-- Apply the label "bug" or "enhancement" as applicable. --> ## Description / Motivation <!-- Describe your changes in detail --> Simple update to README to update the link to the Official Documentation to the new docs for the new open source SDK <!-- Why is this change required? What problem does it solve? --> Helps users/developers navigate to appropriate documentation immmediately <!-- If it fixes an open issue, please link to the issue here. --> ## Testing - [x] The Unit & Intergration tests are passing. - [x] I have added the necessary tests to cover my changes. ## Terms <!-- Place an X in the [] to check. --> <!-- The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it. --> - [x] I agree to follow this project's [Code of Conduct](CODE_OF_CONDUCT.md).
Context Support (#18) <!-- Provide a general summary of your changes in the Title above --> <!-- Apply the label "bug" or "enhacement" as applicable. --> ## Description / Motivation <!-- Describe your changes in detail --> This allows creating connections to the Edge using the Edge Platform Context instead of an ApiKey. It introduces new extension methods on the `SitecoreLayoutClientBuilder` called `AddGraphQlWithContextHandler` for the LayoutService.Client and enhances the extensions on `GraphQlConfiguration` called `AddGraphQlClient` for the GraphQL. Introducing `ContextId` to the `SitecoreGraphQlClientOptions` as well as by default using the https://edge-platform.sitecorecloud.io/v1/content/api/graphql/v1 endpoint instead of throwing an exception when passing in a ContextId. <!-- Why is this change required? What problem does it solve? --> Moving forward Sitecore and XM Cloud in particular will greatly rely on the unified Edge Platform endpoint with [ContextId](https://doc.sitecore.com/xmc/en/developers/xm-cloud/the-context-id-environment-variable.html) making this an important addition to the SDK. <!-- If it fixes an open issue, please link to the issue here. --> This resolves #10 ## Testing - [X] The Unit & Intergration tests are passing. - [X] I have added the necessary tests to cover my changes. ## Terms <!-- Place an X in the [] to check. --> <!-- The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it. --> - [X] I agree to follow this project's [Code of Conduct](CODE_OF_CONDUCT.md). --------- Co-authored-by: Ivan Lieckens <ivanlieckens@hotmail.com>
Handle empty string fields in FieldConverter. (#12) <!-- Provide a general summary of your changes in the Title above --> <!-- Apply the label "bug" or "enhacement" as applicable. --> ## Description This update addresses a specific issue encountered when dealing with JSON data for fields, such as the following example: ``` "fields": { "title": "", "leftLink": { "key": "40dfd6adb1334ff48c3e4c68ab9b9b35", "text": "The Energy Transition", "href": "/connections/energy-transition-and-sustainability/what-is-the-energy-transition" }, "rightLink": { "key": "de61e12028784b4da96a9676b73fc764", "text": "There are currently 54 known outages.", "href": "/outages-and-maintenance" } } ``` Previously, an empty string in the `title` field would trigger a `JsonException` in the `FieldConverter` because it was not recognized as a valid `JsonValueKind` type. This update introduces support for `JsonValueKind.String`, ensuring that empty strings are handled correctly alongside objects and arrays, thereby resolving the error. ## Motivation Custom Content Resolvers in both XM Cloud and Sitecore XP may return empty strings for certain fields, leading to errors in the `FieldConverter`. This enhancement ensures that such cases are handled properly, allowing for smooth operation regardless of whether an empty string is encountered. **Update:** Following the discussion below, this PR has been revised to focus on adding an integration test for fields with empty strings instead of altering the `FieldConverter`.
Custom Content Resolver Support (#14) <!-- Provide a general summary of your changes in the Title above --> <!-- Apply the label "bug" or "enhacement" as applicable. --> ## Description / Motivation <!-- Describe your changes in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If it fixes an open issue, please link to the issue here. --> This modifies the FieldParser to support Custom Content Resolvers returning modified JSON. This fixes #8 Added missing CONTRIBUTING file. Removed `AddSystemTextJson` which should not be used or needed as it pollutes the DI. ## Testing Added integration tests both for layout client and rendering engine binding leveraging the "Navigation" component from Headless SXA. - [X] The Unit & Intergration tests are passing. - [X] I have added the necesary tests to cover my changes. ## Terms <!-- Place an X in the [] to check. --> <!-- The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it. --> - [X] I agree to follow this project's [Code of Conduct](CODE_OF_CONDUCT.md). --------- Co-authored-by: Ivan Lieckens <ivanlieckens@hotmail.com>
Add GetRawValue() to return raw JSON in JsonSerializedField. (#9) <!-- Provide a general summary of your changes in the Title above --> <!-- Apply the label "bug" or "enhacement" as applicable. --> ## Description This pull request introduces an `GetRawValue()` method in the `JsonSerializedField` class to directly return the raw JSON string. This enhancement provides a more straightforward and efficient way to access the underlying JSON without the need for additional deserialization. ## Motivation The primary motivation for this change is to simplify the process of working with JSON data, particularly in scenarios where the JSON is deserialized, modified, and then re-serialized. In my case, I needed to deserialize JSON into a `SitecoreLayoutResponseContent` object, apply modifications, and then serialize it back to JSON. Previously, this required a custom `JsonConverter` that accessed the `_json` field via reflection. With this improvement, such workarounds are no longer necessary, making the code cleaner and more maintainable.
Improved Build Summary (#7) <!-- Provide a general summary of your changes in the Title above --> <!-- Apply the label "bug" or "enhacement" as applicable. --> ## Description / Motivation <!-- Describe your changes in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If it fixes an open issue, please link to the issue here. --> This adds a nice build summary to inspect results of testing, code coverage and benchmark runs. To clean up the results certain test code has been filtered and excluded. ## Testing - [X] The Unit & Intergration tests are passing. - [X] I have added the necesary tests to cover my changes. ## Terms <!-- Place an X in the [] to check. --> <!-- The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it. --> - [X] I agree to follow this project's [Code of Conduct](CODE_OF_CONDUCT.md). Co-authored-by: Ivan Lieckens <ivanlieckens@hotmail.com>
Fixed issue rendering nested empty placeholders (#6) Currently, empty Placeholders are not rendering the same HTML that JSS does. This PR updates the SDK's TagHelper to generate HTML that matches the same output from JSS. ## Description / Motivation When a Placeholder is rendered without any components loaded inside of it, it needs to be wrapped in a div to be correctly rendered in Pages and Experience Editor. The div being created by for this SDK is `<div className=\"sc-empty-placeholder\"></div>` ## Testing - [x] The Unit & Intergration tests are passing. - [x] I have added the necesary tests to cover my changes. ## Terms - [x] I agree to follow this project's [Code of Conduct](CODE_OF_CONDUCT.md). --------- Co-authored-by: Ivan Lieckens <ivanlieckens@hotmail.com>
PreviousNext