fix orderby priority for spreadsheet

This commit is contained in:
rahulramesha 2024-03-26 12:27:43 +05:30
parent 6cdc670bc3
commit a9ffd18a2f
2 changed files with 7 additions and 7 deletions

View File

@ -101,9 +101,9 @@ export const SPREADSHEET_PROPERTY_DETAILS: {
},
priority: {
title: "Priority",
ascendingOrderKey: "priority",
ascendingOrderKey: "-priority",
ascendingOrderTitle: "None",
descendingOrderKey: "-priority",
descendingOrderKey: "priority",
descendingOrderTitle: "Urgent",
icon: Signal,
Column: SpreadsheetPriorityColumn,

View File

@ -783,7 +783,7 @@ export class BaseIssuesStore implements IBaseIssuesStore {
issuesSortWithOrderBy = (issueIds: string[], key: TIssueOrderByOptions | undefined): string[] => {
const issues = this.rootIssueStore.issues.getIssuesByIds(issueIds, this.isArchived ? "archived" : "un-archived");
const array = orderBy(issues, "created_at", ["asc"]);
const array = orderBy(issues, "created_at", ["desc"]);
switch (key) {
case "sort_order":
@ -834,13 +834,13 @@ export class BaseIssuesStore implements IBaseIssuesStore {
// custom
case "priority": {
const sortArray = ISSUE_PRIORITIES.map((i) => i.key);
return this.getIssueIds(
orderBy(array, (currentIssue: TIssue) => indexOf(sortArray, currentIssue.priority), ["desc"])
);
return this.getIssueIds(orderBy(array, (currentIssue: TIssue) => indexOf(sortArray, currentIssue.priority)));
}
case "-priority": {
const sortArray = ISSUE_PRIORITIES.map((i) => i.key);
return this.getIssueIds(orderBy(array, (currentIssue: TIssue) => indexOf(sortArray, currentIssue.priority)));
return this.getIssueIds(
orderBy(array, (currentIssue: TIssue) => indexOf(sortArray, currentIssue.priority), ["desc"])
);
}
// number