diff --git a/web/constants/spreadsheet.ts b/web/constants/spreadsheet.ts index 50d6c15df..b498b4e7d 100644 --- a/web/constants/spreadsheet.ts +++ b/web/constants/spreadsheet.ts @@ -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, diff --git a/web/store/issue/helpers/base-issues.store.ts b/web/store/issue/helpers/base-issues.store.ts index 2b1812a23..f8b75a8f6 100644 --- a/web/store/issue/helpers/base-issues.store.ts +++ b/web/store/issue/helpers/base-issues.store.ts @@ -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