Сортировка досок list-issues-by-users
This commit is contained in:
parent
4509a729cb
commit
eacbad3a02
1 changed files with 7 additions and 2 deletions
|
|
@ -13,6 +13,7 @@ export namespace ListIssuesByUsersWidgetNs {
|
||||||
fromRootIssueId?: number;
|
fromRootIssueId?: number;
|
||||||
fromQuery?: nano.MangoQuery;
|
fromQuery?: nano.MangoQuery;
|
||||||
userKey: string;
|
userKey: string;
|
||||||
|
userSort?: boolean;
|
||||||
statuses: string[];
|
statuses: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -46,7 +47,6 @@ export class ListIssuesByUsersWidgetService
|
||||||
}
|
}
|
||||||
|
|
||||||
async render(widgetParams: Params): Promise<any> {
|
async render(widgetParams: Params): Promise<any> {
|
||||||
// if (widgetParams)
|
|
||||||
let store: FlatIssuesStore;
|
let store: FlatIssuesStore;
|
||||||
if (widgetParams.fromRootIssueId) {
|
if (widgetParams.fromRootIssueId) {
|
||||||
store = await this.getListFromRoot(widgetParams.fromRootIssueId);
|
store = await this.getListFromRoot(widgetParams.fromRootIssueId);
|
||||||
|
|
@ -61,7 +61,7 @@ export class ListIssuesByUsersWidgetService
|
||||||
const res = this.getUserValueByKey(issue, widgetParams.userKey);
|
const res = this.getUserValueByKey(issue, widgetParams.userKey);
|
||||||
return res.result || 'Unknown';
|
return res.result || 'Unknown';
|
||||||
}, widgetParams.statuses);
|
}, widgetParams.statuses);
|
||||||
const res = [] as any[];
|
let res = [] as any[];
|
||||||
for (const user in grouped) {
|
for (const user in grouped) {
|
||||||
if (Object.prototype.hasOwnProperty.call(grouped, user)) {
|
if (Object.prototype.hasOwnProperty.call(grouped, user)) {
|
||||||
const data = grouped[user];
|
const data = grouped[user];
|
||||||
|
|
@ -71,6 +71,11 @@ export class ListIssuesByUsersWidgetService
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (widgetParams.userSort) {
|
||||||
|
res = res.sort((a, b) => {
|
||||||
|
return a.metainfo.title.localeCompare(b.metainfo.title);
|
||||||
|
});
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue