Skip to content

Commit

Permalink
Merge pull request #416 from Lemoncode/feature/#410-Alphabetical-sort…
Browse files Browse the repository at this point in the history
…ing-of-collections-in-edit-relation

feature/#410 Alphabetical sorting of collections in edit-relation
  • Loading branch information
brauliodiez authored Mar 20, 2024
2 parents afc6105 + 0feb5b1 commit 9d36b01
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/pods/edit-relation/edit-relation.business.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,16 @@ const mapTableToDropdownVm = (table: TableVm): DropdownOptionVm => ({

export const mapTableListToDropdownVm = (
canvasSchema: DatabaseSchemaVm
): DropdownOptionVm[] =>
canvasSchema.tables.map(
): DropdownOptionVm[] => {
const orderedList = orderTableListToDropDownVm(canvasSchema);
return orderedList.map(
(table): DropdownOptionVm => mapTableToDropdownVm(table)
);
)};

const orderTableListToDropDownVm = (canvasSchema: DatabaseSchemaVm) => {
const copyArray = [...canvasSchema.tables];
return copyArray.sort((a, b) => a.tableName.localeCompare(b.tableName));
}

const returnTableFromCanvasSchema = (
id: GUID,
Expand Down

0 comments on commit 9d36b01

Please sign in to comment.