sort folders by name first and then sequence (#5063)

* sort folders by name first and then sequence
---------

Co-authored-by: lohit <lohit@usebruno.com>
This commit is contained in:
lohit
2025-07-14 22:17:11 +05:30
committed by GitHub
parent 31e555812c
commit 4e4c94d73f
13 changed files with 537 additions and 94 deletions

View File

@@ -1,5 +1,6 @@
import {cloneDeep, isEqual, sortBy, filter, map, isString, findIndex, find, each, get } from 'lodash';
import { uuid } from 'utils/common';
import { sortByNameThenSequence } from 'utils/common/index';
import path from 'utils/common/path';
const replaceTabsWithSpaces = (str, numSpaces = 2) => {
@@ -1036,7 +1037,7 @@ export const getFormattedCollectionOauth2Credentials = ({ oauth2Credentials = []
export const resetSequencesInFolder = (folderItems) => {
const items = folderItems;
const sortedItems = items.sort((a, b) => a.seq - b.seq);
const sortedItems = sortByNameThenSequence(items);
return sortedItems.map((item, index) => {
item.seq = index + 1;
return item;