[PLT-2407] Improve ordering of uploaded attachments (#7022)
* improve ordering of uploaded attachments * use LocalizationStore.getLocale() when comparing file names
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
c973608ccb
Коммит
2c8a5ffd97
@@ -475,6 +475,11 @@ export function splitFileLocation(fileLocation) {
|
||||
return {ext, name: filename, path: filePath};
|
||||
}
|
||||
|
||||
export function sortFilesByName(files) {
|
||||
const locale = LocalizationStore.getLocale();
|
||||
return Array.from(files).sort((a, b) => a.name.localeCompare(b.name, locale, {numeric: true}));
|
||||
}
|
||||
|
||||
export function toTitleCase(str) {
|
||||
function doTitleCase(txt) {
|
||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
||||
|
||||
Ссылка в новой задаче
Block a user