Skip to content

Commit d1418e9

Browse files
Merge pull request #6092 from Shopify/sort-extensions-on-partners-client-main
Sort template specifications on partners client
2 parents cedc213 + e3440f7 commit d1418e9

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

packages/app/src/cli/utilities/developer-platform-client/partners-client.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,22 @@ export class PartnersClient implements DeveloperPlatformClient {
365365
}
366366
})
367367

368+
let counter = 0
369+
const templatesWithPriority = templates.map((template) => ({
370+
...template,
371+
sortPriority: template.sortPriority ?? counter++,
372+
}))
373+
374+
const groupOrder: string[] = []
375+
for (const template of templatesWithPriority) {
376+
if (template.group && !groupOrder.includes(template.group)) {
377+
groupOrder.push(template.group)
378+
}
379+
}
380+
368381
return {
369-
templates,
370-
groupOrder: [],
382+
templates: templatesWithPriority,
383+
groupOrder,
371384
}
372385
}
373386

0 commit comments

Comments
 (0)