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: add Title property to MultiUrlPicker for link title retrieval #347

Merged
merged 3 commits into from
Feb 13, 2025
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
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,8 @@ type MultiUrlPickerItem {
target: String
"Gets the type of the link."
type: LinkType!
"Gets the title of the link."
title: String
"Gets the name of a content item."
name: String
"Gets the id of a content item."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,8 @@ type MultiUrlPickerItem {
target: String
"Gets the type of the link."
type: LinkType!
"Gets the title of the link."
title: String
"Gets the name of a content item."
name: String
"Gets the id of a content item."
Expand Down
6 changes: 6 additions & 0 deletions src/Nikcio.UHeadless/Defaults/Properties/MultiUrlPicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
{
return PublishedContentItemsLinks.Select(link =>
{
if (link.Udi == null || link.Udi is not GuidUdi linkUdiGuid)

Check warning on line 57 in src/Nikcio.UHeadless/Defaults/Properties/MultiUrlPicker.cs

View workflow job for this annotation

GitHub Actions / Build and analyze

Remove this unnecessary null check; 'is' returns false for nulls. (https://rules.sonarsource.com/csharp/RSPEC-4201)
{
return CreateMultiUrlPickerItem(null, link, resolverContext);
}
Expand Down Expand Up @@ -165,6 +165,12 @@
[GraphQLDescription("Gets the type of the link.")]
public LinkType Type => Link.Type;

/// <summary>
/// Gets the title of the link
/// </summary>
[GraphQLDescription("Gets the title of the link.")]
public string? Title => Link.Name;

/// <summary>
/// Gets the name of a content item
/// </summary>
Expand Down
Loading