Example #1
0
 private static void ApplyMilestone(IssueFilter filter, BoundKevValueQuery query)
 {
     if (query.IsNegated)
     {
         filter.ExcludedMilestones.Add(query.Value);
     }
     else
     {
         filter.Milestone = query.Value;
     }
 }
Example #2
0
 private static void ApplyArea(IssueFilter filter, BoundKevValueQuery query)
 {
     if (query.IsNegated)
     {
         filter.ExcludedLabels.Add($"area-{query.Value}");
     }
     else
     {
         filter.IncludedLabels.Add($"area-{query.Value}");
     }
 }
Example #3
0
 private static void ApplyAuthor(IssueFilter filter, BoundKevValueQuery query)
 {
     if (query.IsNegated)
     {
         filter.ExcludedAuthors.Add(query.Value);
     }
     else
     {
         filter.Author = query.Value;
     }
 }
Example #4
0
 private static void ApplyAreaOwner(IssueFilter filter, BoundKevValueQuery query)
 {
     if (query.IsNegated)
     {
         filter.ExcludedAreaOwners.Add(query.Value);
     }
     else
     {
         filter.IncludedAreaOwners.Add(query.Value);
     }
 }
Example #5
0
        private static void Apply(IssueFilter result, BoundKevValueQuery expression)
        {
            var key   = expression.Key.ToLowerInvariant();
            var value = expression.Value.ToLowerInvariant();

            if (_keyValueHandlers.TryGetValue((key, value), out var handler) ||
                _keyValueHandlers.TryGetValue((key, null), out handler))
            {
                handler(result, expression);
                return;
            }

            Apply(result, new BoundTextQuery(expression.IsNegated, $"{key}:{value}"));
        }
Example #6
0
        private static void Apply(IssueFilter result, BoundTextQuery expression)
        {
            var terms = TextTokenizer.Tokenize(expression.Text);

            foreach (var term in terms)
            {
                if (expression.IsNegated)
                {
                    result.ExcludedTerms.Add(term);
                }
                else
                {
                    result.IncludedTerms.Add(term);
                }
            }
        }
Example #7
0
        private static IssueFilter CreateFilter(BoundQuery node)
        {
            var result = new IssueFilter();

            foreach (var and in FlattenAnds(node))
            {
                switch (and)
                {
                case BoundKevValueQuery kevValueExpression:
                    Apply(result, kevValueExpression);
                    break;

                case BoundTextQuery textExpression:
                    Apply(result, textExpression);
                    break;

                default:
                    throw new Exception($"Unexpected node {and.GetType()}");
                }
            }

            return(result);
        }
Example #8
0
 private static void ApplySortReactionsHeartDesc(IssueFilter filter)
 {
     filter.Sort.Add(IssueSort.ReactionsHeartDescending);
 }
Example #9
0
 private static void ApplySortReactionsTada(IssueFilter filter)
 {
     filter.Sort.Add(IssueSort.ReactionsTadaAscending);
 }
Example #10
0
 private static void ApplyGroupSortKey(IssueFilter filter)
 {
     filter.GroupSort.Add(IssueGroupSort.KeyAscending);
 }
Example #11
0
 private static void ApplyNoLabel(IssueFilter filter, BoundKevValueQuery query)
 {
     filter.NoLabels = !query.IsNegated;
 }
Example #12
0
 private static void ApplyGroupLabel(IssueFilter filter)
 {
     filter.Groups.Add(IssueGroup.Label);
 }
Example #13
0
 private static void ApplyGroupAreaNode(IssueFilter filter)
 {
     filter.Groups.Add(IssueGroup.AreaNode);
 }
Example #14
0
 private static void ApplyGroupAuthor(IssueFilter filter)
 {
     filter.Groups.Add(IssueGroup.Author);
 }
Example #15
0
 private static void ApplyGroupOrg(IssueFilter filter)
 {
     filter.Groups.Add(IssueGroup.Org);
 }
Example #16
0
 private static void ApplySortReactionsThinkingFaceDesc(IssueFilter filter)
 {
     filter.Sort.Add(IssueSort.ReactionsThinkingFaceDescending);
 }
Example #17
0
 private static void ApplyNoAreaOwner(IssueFilter filter, BoundKevValueQuery query)
 {
     filter.NoAreaOwner = !query.IsNegated;
 }
Example #18
0
 private static void ApplyNoMilestone(IssueFilter filter, BoundKevValueQuery query)
 {
     filter.NoMilestone = !query.IsNegated;
 }
Example #19
0
 private static void ApplySortInteractionsDesc(IssueFilter filter)
 {
     filter.Sort.Add(IssueSort.InteractionsDescending);
 }
Example #20
0
 private static void ApplyClosed(IssueFilter filter, BoundKevValueQuery query, RangeSyntax <DateTimeOffset> range)
 {
     filter.Closed = range.Negate(query.IsNegated);
 }
Example #21
0
 private static void ApplyGroupRepo(IssueFilter filter)
 {
     filter.Groups.Add(IssueGroup.Repo);
 }
Example #22
0
 private static void ApplyComments(IssueFilter filter, BoundKevValueQuery query, RangeSyntax <int> range)
 {
     filter.Comments = range.Negate(query.IsNegated);
 }
Example #23
0
 private static void ApplyGroupAssignee(IssueFilter filter)
 {
     filter.Groups.Add(IssueGroup.Assignee);
 }
Example #24
0
 private static void ApplyInteractions(IssueFilter filter, BoundKevValueQuery query, RangeSyntax <int> range)
 {
     filter.Interactions = range.Negate(query.IsNegated);
 }
Example #25
0
 private static void ApplyGroupMilestone(IssueFilter filter)
 {
     filter.Groups.Add(IssueGroup.Milestone);
 }
Example #26
0
 private static void ApplySortCreated(IssueFilter filter)
 {
     filter.Sort.Add(IssueSort.CreatedAscending);
 }
Example #27
0
 private static void ApplyGroupAreaOwner(IssueFilter filter)
 {
     filter.Groups.Add(IssueGroup.AreaOwner);
 }
Example #28
0
 private static void ApplySortUpdatedDesc(IssueFilter filter)
 {
     filter.Sort.Add(IssueSort.UpdatedDescending);
 }
Example #29
0
 private static void ApplyGroupSortCountDesc(IssueFilter filter)
 {
     filter.GroupSort.Add(IssueGroupSort.CountDescending);
 }
Example #30
0
 private static void ApplySortCommentsDesc(IssueFilter filter)
 {
     filter.Sort.Add(IssueSort.CommentsDescending);
 }