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: {
|
priority: {
|
||||||
title: "Priority",
|
title: "Priority",
|
||||||
ascendingOrderKey: "priority",
|
ascendingOrderKey: "-priority",
|
||||||
ascendingOrderTitle: "None",
|
ascendingOrderTitle: "None",
|
||||||
descendingOrderKey: "-priority",
|
descendingOrderKey: "priority",
|
||||||
descendingOrderTitle: "Urgent",
|
descendingOrderTitle: "Urgent",
|
||||||
icon: Signal,
|
icon: Signal,
|
||||||
Column: SpreadsheetPriorityColumn,
|
Column: SpreadsheetPriorityColumn,
|
||||||
|
@ -783,7 +783,7 @@ export class BaseIssuesStore implements IBaseIssuesStore {
|
|||||||
|
|
||||||
issuesSortWithOrderBy = (issueIds: string[], key: TIssueOrderByOptions | undefined): string[] => {
|
issuesSortWithOrderBy = (issueIds: string[], key: TIssueOrderByOptions | undefined): string[] => {
|
||||||
const issues = this.rootIssueStore.issues.getIssuesByIds(issueIds, this.isArchived ? "archived" : "un-archived");
|
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) {
|
switch (key) {
|
||||||
case "sort_order":
|
case "sort_order":
|
||||||
@ -834,13 +834,13 @@ export class BaseIssuesStore implements IBaseIssuesStore {
|
|||||||
// custom
|
// custom
|
||||||
case "priority": {
|
case "priority": {
|
||||||
const sortArray = ISSUE_PRIORITIES.map((i) => i.key);
|
const sortArray = ISSUE_PRIORITIES.map((i) => i.key);
|
||||||
return this.getIssueIds(
|
return this.getIssueIds(orderBy(array, (currentIssue: TIssue) => indexOf(sortArray, currentIssue.priority)));
|
||||||
orderBy(array, (currentIssue: TIssue) => indexOf(sortArray, currentIssue.priority), ["desc"])
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
case "-priority": {
|
case "-priority": {
|
||||||
const sortArray = ISSUE_PRIORITIES.map((i) => i.key);
|
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
|
// number
|
||||||
|
Loading…
Reference in New Issue
Block a user