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

Feat/content type drop down #38

Merged
merged 5 commits into from
Apr 9, 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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ insert_final_newline = true
dotnet_diagnostic.IDE0055.severity = error

dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
dotnet_separate_import_directive_groups = true

## C# Formatting Rules https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/formatting-rules

Expand Down
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Library Version**
The full version of the library or integration you experienced the issue with [e.g. 3.2.2]

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<PackageVersion Include="Kentico.Xperience.WebApp" Version="28.1.2" />
<PackageVersion Include="Kentico.Xperience.Core.Tests" Version="28.1.2" />
<PackageVersion Include="Algolia.Search" Version="6.16.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
<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" />
Expand Down
2 changes: 1 addition & 1 deletion docs/Managing-Indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ or clicking an existing path in the table at the top of the index configuration
- Included Path - can be an exact relative path of a web page item, (ex: `/path/to/my/page`), or a wildcard path (ex: `/parent-path/%`)
- To determine a web page path, select the web page in the website channel page tree, then view the "Current URL" in the Content tab of the web page. The path will be the relative path excluding the domain
- Available content types - these are the web page content types that can be selected for the path.
- Included ContentType items - each content type in the list enables modification to web pages of that type to trigger an event that your custom indexing strategy can process. If the list is empty, no web pages will trigger these events. The items should be separated by new lines.
- Included ContentType items - these are the web page content types that can be selected for the path. Each content type in the multi-select enables modification to web pages of that type to trigger an event that your custom indexing strategy can process. If no option is selected, no web pages will trigger these events.

## Indexing reusable content items

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"version": "8.0.101",
"rollForward": "latestMajor",
"allowPrerelease": false
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public AlgoliaConfigurationModel(
AlgoliaIndexItemInfo index,
IEnumerable<AlgoliaIndexLanguageItemInfo> indexLanguages,
IEnumerable<AlgoliaIncludedPathItemInfo> indexPaths,
IEnumerable<AlgoliaContentTypeItemInfo> contentTypes
IEnumerable<AlgoliaIndexContentType> contentTypes
)
{
Id = index.AlgoliaIndexItemId;
Expand Down
23 changes: 23 additions & 0 deletions src/Kentico.Xperience.Algolia/Admin/AlgoliaIndexContentType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace Kentico.Xperience.Algolia.Admin;

public class AlgoliaIndexContentType
{
/// <summary>
/// Name of the indexed content type for an indexed path
/// </summary>
public string ContentTypeName { get; set; } = "";

/// <summary>
/// Displayed name of the indexed content type for an indexed path which will be shown in admin UI
/// </summary>
public string ContentTypeDisplayName { get; set; } = "";

public AlgoliaIndexContentType()
{ }

public AlgoliaIndexContentType(string className, string classDisplayName)
{
ContentTypeName = className;
ContentTypeDisplayName = classDisplayName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class AlgoliaIndexIncludedPath
/// <summary>
/// A list of content types under the specified <see cref="AliasPath"/> that will be indexed.
/// </summary>
public List<string> ContentTypes { get; set; } = new();
public List<AlgoliaIndexContentType> ContentTypes { get; set; } = [];

/// <summary>
/// The internal identifier of the included path.
Expand All @@ -28,10 +28,10 @@ public class AlgoliaIndexIncludedPath
/// </summary>
/// <param name="indexPath"></param>
/// <param name="contentTypes"></param>
public AlgoliaIndexIncludedPath(AlgoliaIncludedPathItemInfo indexPath, IEnumerable<AlgoliaContentTypeItemInfo> contentTypes)
public AlgoliaIndexIncludedPath(AlgoliaIncludedPathItemInfo indexPath, IEnumerable<AlgoliaIndexContentType> contentTypes)
{
AliasPath = indexPath.AlgoliaIncludedPathItemAliasPath;
ContentTypes = contentTypes.Where(y => indexPath.AlgoliaIncludedPathItemId == y.AlgoliaContentTypeItemIncludedPathItemId).Select(y => y.AlgoliaContentTypeItemContentTypeName).ToList();
ContentTypes = contentTypes.ToList();
Identifier = indexPath.AlgoliaIncludedPathItemId.ToString();
}
}
5 changes: 4 additions & 1 deletion src/Kentico.Xperience.Algolia/Admin/Client/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "after-used"
"args": "after-used",
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"import/first": "warn",
Expand Down
Loading
Loading