mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix orderby priority for spreadsheet
This commit is contained in:
parent
6cdc670bc3
commit
a9ffd18a2f
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user