Skip to content

Commit

Permalink
feat: bulk update fields select sorted by translated labels (#22318)
Browse files Browse the repository at this point in the history
* feat: bulk update fields sorted translated alpha sort

* chore: implement review from @barredterra

* chore: fix linter/prettier

* fix: convert to string

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 42ee7f9)
  • Loading branch information
FHenry authored and mergify[bot] committed Sep 20, 2023
1 parent 428ba84 commit 65122b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frappe/public/js/frappe/list/bulk_operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,11 @@ export default class BulkOperations {
}

edit(docnames, field_mappings, done) {
let field_options = Object.keys(field_mappings).sort();
let field_options = Object.keys(field_mappings).sort(function (a, b) {
return __(cstr(field_mappings[a].label)).localeCompare(
cstr(__(field_mappings[b].label))
);
});
const status_regex = /status/i;

const default_field = field_options.find((value) => status_regex.test(value));
Expand Down

0 comments on commit 65122b4

Please sign in to comment.