Skip to content

Commit

Permalink
fix: priorities and status ai filters are failing
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithmullapudi committed Jun 30, 2024
1 parent f1827f0 commit 4856c76
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion frontend/src/hooks/use-filters-from-ai.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/** Copyright (c) 2024, Tegon, all rights reserved. **/

import { Priorities } from 'common/types/issue';

import { useContextStore } from 'store/global-context-provider';
import type { User } from 'store/user-context';

Expand Down Expand Up @@ -43,7 +45,13 @@ export function useFiltersFromAI() {
}

case 'priority': {
return labelsStore.getLabelWithValues(value);
return value
.map((priority: string) => {
const index = Priorities.indexOf(priority);

return index < 0 ? undefined : index;
})
.filter(Boolean);
}

case 'status': {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/store/workflows/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const WorkflowsStore: IAnyStateTreeNode = types
.map((name: string) => {
const workflow = self.workflows.find(
(workflow: WorkflowType) =>
workflow.name.toLocaleLowerCase() === name,
workflow.name.toLowerCase() === name.toLowerCase(),
);

return workflow?.id;
Expand Down

0 comments on commit 4856c76

Please sign in to comment.