Skip to content

Commit

Permalink
Feature: Xperience v29.7.0 support, docs format, file cleanup (#34)
Browse files Browse the repository at this point in the history
* build(sln): update to xperience v29.7.0

* chore(Zapier): localization typos/grammar
  • Loading branch information
seangwright authored Dec 3, 2024
1 parent e856078 commit 4375616
Show file tree
Hide file tree
Showing 198 changed files with 3,893 additions and 1,634 deletions.
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"recommendations": [
"ms-dotnettools.csdevkit",
"k--kato.docomment",
"editorconfig.editorconfig",
"davidanson.vscode-markdownlint",
"tintoy.msbuild-project-tools",
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<HotChocolateImplicitUsings>disable</HotChocolateImplicitUsings>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
20 changes: 10 additions & 10 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Kentico.Xperience.Admin" Version="29.5.0" />
<PackageVersion Include="Kentico.Xperience.WebApp" Version="29.5.0" />
<PackageVersion Include="kentico.xperience.azurestorage" Version="29.5.0" />
<PackageVersion Include="kentico.xperience.imageprocessing" Version="29.5.0" />
<PackageVersion Include="Kentico.Xperience.Admin" Version="29.7.0" />
<PackageVersion Include="Kentico.Xperience.WebApp" Version="29.7.0" />
<PackageVersion Include="kentico.xperience.azurestorage" Version="29.7.0" />
<PackageVersion Include="kentico.xperience.imageprocessing" Version="29.7.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.6.0.74858" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="NUnit" Version="4.0.1" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="NUnit.Analyzers" Version="3.10.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="AspNetCore.Authentication.ApiKey" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="NUnit" Version="4.2.2" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="NUnit.Analyzers" Version="4.4.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="AspNetCore.Authentication.ApiKey" Version="8.0.1" />
</ItemGroup>
</Project>
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Zapier integration enables seamless connectivity between a wide range of web app

## Library Version Matrix

This version supports content workflows added in version 28.3.0. Please ensure that your versions are up to date.

| Xperience Version | Library Version |
| ----------------- | --------------- |
| >= 29.5.* | >= 2.1.0 |
| >= 29.3.* | >= 2.0.0 |
| >= 29.0.* | 1.0.0 |
| >= 29.7.\* | >= 2.2.0 |
| >= 29.5.\* | >= 2.1.0 |
| >= 29.3.\* | >= 2.0.0 |
| >= 29.0.\* | 1.0.0 |

## Zapier cli application

The Zapier cli app version 1.0.1 will initially be beta flagged, but this is the full version. The beta flag is just a zapier flag for new app integrations. This Flag will disappear after 90 days.

### Dependencies
Expand Down Expand Up @@ -90,7 +90,7 @@ dotnet add package Kentico.Xperience.Zapier
- In the third step you need to set configuration for your trigger
- Test your trigger
6. Now you can create your own workflow eg. connect with Gmail, Microsoft Teams, ...
- You can find more information on https://zapier.com/workflows
- You can find more information on <https://zapier.com/workflows>
7. Publication of your Zap will create an object in your Xperience by Kentico application.
- You can find the list of created triggers at Zapier application at page _List of Zapier triggers_

Expand Down
4 changes: 2 additions & 2 deletions docs/Usage-Guide.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Configure your application
# Configure your application

Prerequisites for using this integration are a public Xperience by Kentico application and a Zapier account.

Expand All @@ -25,7 +25,7 @@ In the appsettings configuration, you need to specify the list of the allowed ob

You can view a sample of such configuration [here](./docs/Configuration-example.md).

### Zapier administration application
## Zapier administration application

After configuring your application, a new application named **Zapier** should appear in your application's administration.
This application consists of two submodules: a listing page of created Zapier triggers from the Zapier UI and a submodule for managing the API Key.
Expand Down
Empty file removed examples/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion examples/DancingGoat/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"kentico.xperience.dbmanager": {
"version": "29.5.0",
"version": "29.7.0",
"commands": [
"kentico-xperience-dbmanager"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

using CMS.Base;
using CMS.Base;
using CMS.ContactManagement;
using CMS.Core;
using CMS.DataEngine;
Expand Down Expand Up @@ -131,12 +127,10 @@ private void EnableDataProtectionSamples()
}


private OverviewCard GetGdprCard()
private OverviewCard GetGdprCard() => new()
{
return new OverviewCard
{
Headline = "Set up data protection (GDPR) demo",
Actions = new[]
Headline = "Set up data protection (GDPR) demo",
Actions = new[]
{
new Kentico.Xperience.Admin.Base.Action(ActionType.Command)
{
Expand All @@ -145,16 +139,15 @@ private OverviewCard GetGdprCard()
ButtonColor = ButtonColor.Secondary
}
},
Components = new List<IOverviewCardComponent>()
{
Components =
[
new StringContentCardComponent
{
Content = @"Generates data and enables demonstration of giving consents, personal data portability, right to access, and right to be forgotten features.
Once enabled, the demo functionality cannot be disabled. Use on demo instances only."
}
}
};
}
]
};


private async Task SetChannelDefaultCookieLevelToEssential(int websiteChannelId)
Expand Down
2 changes: 1 addition & 1 deletion examples/DancingGoat/Components/ComponentIdentifiers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ public static class ComponentIdentifiers
public const string ARTICLE_TEMPLATE = "DancingGoat.Article";
public const string ARTICLE_WITH_SIDEBAR_TEMPLATE = "DancingGoat.ArticleWithSidebar";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

using Kentico.Forms.Web.Mvc;

[assembly: RegisterFormSection("DancingGoat.TitledSection", "Section with title", "~/Components/FormSections/TitledSection/_TitledSection.cshtml", Description = "Single-column section with one zone and an editable title", IconClass = "icon-rectangle-a", PropertiesType = typeof(TitledSectionProperties))]
[assembly: RegisterFormSection("DancingGoat.TitledSection", "Section with title", "~/Components/FormSections/TitledSection/_TitledSection.cshtml", Description = "Single-column section with one zone and an editable title", IconClass = "icon-rectangle-a", PropertiesType = typeof(TitledSectionProperties))]
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public sealed class ColorPickerEditorViewModel : InlineEditorViewModel
/// </summary>
public string ColorCssClass { get; set; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public abstract class InlineEditorViewModel
/// </summary>
public string PropertyName { get; set; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public sealed class TextEditorViewModel : InlineEditorViewModel
/// </summary>
public string PlaceholderText { get; set; } = "Type your text";
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DancingGoat;
using DancingGoat;
using DancingGoat.Models;
using DancingGoat.PageTemplates;
using DancingGoat.Sections;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System.Collections.Generic;
using System.Linq;

using CMS.ContactManagement;
using CMS.ContactManagement;
using CMS.DataEngine;

using DancingGoat.Personalization;
Expand Down Expand Up @@ -46,4 +43,4 @@ public override bool Evaluate()
return contact.IsInAnyContactGroup(SelectedContactGroups.Select(c => c.ObjectCodeName).ToArray());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ public class ThemeSectionProperties : ISectionProperties
[DropDownComponent(Label = "Color scheme", Order = 1, Options = ";None\nsection-white;Flat white\nsection-cappuccino;Cappuccino")]
public string Theme { get; set; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public class ThreeColumnSectionProperties : ThemeSectionProperties
[TextInputComponent(Label = "Title", Order = 1)]
public string Title { get; set; }
}
}
}
12 changes: 3 additions & 9 deletions examples/DancingGoat/Components/Sections/ZoneRestrictions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using DancingGoat.Widgets;

using Kentico.PageBuilder.Web.Mvc;

using DancingGoat.Widgets;

namespace DancingGoat.Sections
{
/// <summary>
Expand Down Expand Up @@ -51,11 +48,8 @@ public static IEnumerable<string> GetWideZoneRestrictions()
}


private static IEnumerable<string> GetWidgetsIdentifiers()
{
return new ComponentDefinitionProvider<WidgetDefinition>()
private static IEnumerable<string> GetWidgetsIdentifiers() => new ComponentDefinitionProvider<WidgetDefinition>()
.GetAll()
.Select(definition => definition.Identifier);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

using CMS.Websites;
using CMS.Websites;

using DancingGoat.Models;

Expand Down Expand Up @@ -41,12 +37,12 @@ public ArticlesViewComponent(

public async Task<ViewViewComponentResult> InvokeAsync(WebPageRelatedItem articlesSectionItem)
{
var languageName = currentLanguageRetriever.Get();
string languageName = currentLanguageRetriever.Get();

var articlesSection = await articlesSectionRepository.GetArticlesSection(articlesSectionItem.WebPageGuid, languageName);
var articlesSection = await articlesSectionRepository.GetArticlesSection(articlesSectionItem.WebPageGuid, languageName, HttpContext.RequestAborted);
if (articlesSection == null)
{
return View("~/Components/ViewComponents/Articles/Default.cshtml", ArticlesSectionViewModel.GetViewModel(Enumerable.Empty<ArticleViewModel>(), string.Empty));
return View("~/Components/ViewComponents/Articles/Default.cshtml", ArticlesSectionViewModel.GetViewModel(null, Enumerable.Empty<ArticleViewModel>(), string.Empty));
}

var articlePages = await articlePageRepository.GetArticles(articlesSection.SystemFields.WebPageItemTreePath,
Expand All @@ -55,15 +51,15 @@ public async Task<ViewViewComponentResult> InvokeAsync(WebPageRelatedItem articl
var models = new List<ArticleViewModel>();
foreach (var article in articlePages)
{
var model = await ArticleViewModel.GetViewModel(article, urlRetriever, languageName);
var model = await ArticleViewModel.GetViewModel(article, urlRetriever, languageName, HttpContext.RequestAborted);
models.Add(model);
}

var url = (await urlRetriever.Retrieve(articlesSection, languageName)).RelativePath;
string url = (await urlRetriever.Retrieve(articlesSection, languageName, HttpContext.RequestAborted)).RelativePath;

var viewModel = ArticlesSectionViewModel.GetViewModel(models, url);
var viewModel = ArticlesSectionViewModel.GetViewModel(articlesSection, models, url);

return View("~/Components/ViewComponents/Articles/Default.cshtml", viewModel);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ namespace DancingGoat.ViewComponents
/// </summary>
public class BannerViewComponent : ViewComponent
{
public ViewViewComponentResult Invoke(BannerViewModel banner)
{
return View("~/Components/ViewComponents/Banner/Default.cshtml", banner);
}
public ViewViewComponentResult Invoke(BannerViewModel banner) => View("~/Components/ViewComponents/Banner/Default.cshtml", banner);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ namespace DancingGoat.ViewComponents
/// </summary>
public class CafeViewComponent : ViewComponent
{
public ViewViewComponentResult Invoke(CafeViewModel cafe)
{
return View("~/Components/ViewComponents/Cafe/Default.cshtml", cafe);
}
public ViewViewComponentResult Invoke(CafeViewModel cafe) => View("~/Components/ViewComponents/Cafe/Default.cshtml", cafe);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
}
else
{
<a href="#" class="ourcoffee-tile-link">
<h2 class="ourcoffee-tile-text center-text">@Model.Name</h2>
<span class="cafe-overlay"> </span>
@if (!string.IsNullOrEmpty(Model.PhotoPath))
{
<img src="@Url.Content(Model.PhotoPath)" alt="@Model.PhotoShortDescription" title="@Model.Name" class="ourcoffee-tile-image" loading="lazy" />
}
</a>
<h2 class="ourcoffee-tile-text center-text">@Model.Name</h2>
<span class="cafe-overlay"> </span>
@if (!string.IsNullOrEmpty(Model.PhotoPath))
{
<img src="@Url.Content(Model.PhotoPath)" alt="@Model.PhotoShortDescription" title="@Model.Name" class="ourcoffee-tile-image" loading="lazy" />
}
}
</div>
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Linq;
using CMS.Websites;

using DancingGoat.Models;

using Kentico.Content.Web.Mvc.Routing;

using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ViewComponents;

Expand All @@ -11,11 +12,39 @@ namespace DancingGoat.ViewComponents
/// <summary>
/// Cafe card section view component.
/// </summary>
public class CafeCardSectionViewComponent: ViewComponent
public class CafeCardSectionViewComponent : ViewComponent
{
public ViewViewComponentResult Invoke(IEnumerable<CafeViewModel> cafes)
private readonly ContactsPageRepository contactsPageRepository;
private readonly IWebPageUrlRetriever webPageUrlRetriever;
private readonly IPreferredLanguageRetriever currentLanguageRetriever;


public CafeCardSectionViewComponent(IPreferredLanguageRetriever currentLanguageRetriever, ContactsPageRepository contactsPageRepository, IWebPageUrlRetriever webPageUrlRetriever)
{
this.currentLanguageRetriever = currentLanguageRetriever;
this.contactsPageRepository = contactsPageRepository;
this.webPageUrlRetriever = webPageUrlRetriever;
}


public async Task<ViewViewComponentResult> InvokeAsync(IEnumerable<CafeViewModel> cafes)
{
return View("~/Components/ViewComponents/CafeCardSection/Default.cshtml", cafes.Take(3));
string languageName = currentLanguageRetriever.Get();
string contactsPagePath = await GetContactsPagePath(languageName, HttpContext.RequestAborted);
var model = new CafeCardSectionViewModel(cafes, contactsPagePath);

return View("~/Components/ViewComponents/CafeCardSection/Default.cshtml", model);
}


private async Task<string> GetContactsPagePath(string languageName, CancellationToken cancellationToken)
{
const string CONTACTS_PAGE_TREE_PATH = "/Contacts";

var contactsPage = await contactsPageRepository.GetContactsPage(CONTACTS_PAGE_TREE_PATH, languageName, cancellationToken);
var url = await webPageUrlRetriever.Retrieve(contactsPage, languageName, cancellationToken);

return url.RelativePath;
}
}
}
Loading

0 comments on commit 4375616

Please sign in to comment.