Skip to content

Commit

Permalink
fix(graphql): Add SystemLabel search filter (#1767)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->

## Related Issue(s)

- #1765

## Verification

- [ ] **Your** code builds clean without any errors or warnings
- [ ] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and
we'll help out)

## Documentation

- [ ] Documentation is updated (either in `docs`-directory, Altinnpedia
or a separate linked PR in
[altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if
applicable)
  • Loading branch information
oskogstad authored Jan 30, 2025
1 parent 15484b5 commit 431c529
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
4 changes: 3 additions & 1 deletion docs/schema/V1/schema.verified.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ input SearchDialogInput {
externalReference: String
"Filter by status"
status: [DialogStatus!]
"Filter by system label"
systemLabel: [SystemLabel!]
"Only return dialogs created after this date"
createdAfter: DateTime
"Only return dialogs created before this date"
Expand Down Expand Up @@ -456,4 +458,4 @@ scalar DateTime @specifiedBy(url: "https:\/\/www.graphql-scalars.com\/date-time"

scalar URL @specifiedBy(url: "https:\/\/tools.ietf.org\/html\/rfc3986")

scalar UUID @specifiedBy(url: "https:\/\/tools.ietf.org\/html\/rfc4122")
scalar UUID @specifiedBy(url: "https:\/\/tools.ietf.org\/html\/rfc4122")
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,10 @@ public enum DialogStatus
[GraphQLDescription("The dialogue was completed. This typically means that the dialogue is moved to a GUI archive or similar.")]
Completed = 6
}

public enum SystemLabel
{
Default = 1,
Bin = 2,
Archive = 3
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Digdir.Domain.Dialogporten.GraphQL.EndUser.Common;
using Digdir.Domain.Dialogporten.GraphQL.EndUser.MutationTypes;

namespace Digdir.Domain.Dialogporten.GraphQL.EndUser.DialogById;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Digdir.Domain.Dialogporten.GraphQL.EndUser.Common;

namespace Digdir.Domain.Dialogporten.GraphQL.EndUser.MutationTypes;

public sealed class SetSystemLabelPayload
Expand All @@ -12,13 +14,6 @@ public sealed class SetSystemLabelInput
public SystemLabel Label { get; set; }
}

public enum SystemLabel
{
Default = 1,
Bin = 2,
Archive = 3
}

[InterfaceType("SetSystemLabelError")]
public interface ISetSystemLabelError
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public MappingProfile()
CreateMap<SearchDialogInput, SearchDialogQuery>()
.ForMember(dest => dest.OrderBy, opt => opt.Ignore())
.ForMember(dest => dest.ContinuationToken, opt => opt.Ignore())
.ForMember(dest => dest.SystemLabel, opt => opt.MapFrom(src => src.SystemLabel))
.ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.Status));

CreateMap<PaginatedList<DialogDto>, SearchDialogsPayload>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Digdir.Domain.Dialogporten.Application.Common.Pagination.Order;
using Digdir.Domain.Dialogporten.GraphQL.EndUser.Common;
using Digdir.Domain.Dialogporten.GraphQL.EndUser.MutationTypes;

namespace Digdir.Domain.Dialogporten.GraphQL.EndUser.SearchDialogs;

Expand Down Expand Up @@ -105,6 +104,9 @@ public sealed class SearchDialogInput
[GraphQLDescription("Filter by status")]
public List<DialogStatus>? Status { get; init; }

[GraphQLDescription("Filter by system label")]
public List<SystemLabel>? SystemLabel { get; init; }

[GraphQLDescription("Only return dialogs created after this date")]
public DateTimeOffset? CreatedAfter { get; init; }

Expand Down

0 comments on commit 431c529

Please sign in to comment.