fix(frontend): select default join token in installation media wizard

Select the default join token in the installation media wizard. Also bump tsconfig to ES2023 (which is baseline widely available) to get access to .toSorted().

Signed-off-by: Edward Sammut Alessi <edward.sammutalessi@siderolabs.com>
This commit is contained in:
Edward Sammut Alessi 2026-04-20 09:36:55 +02:00
parent 0987fa9e8f
commit cc0adefcad
No known key found for this signature in database
GPG Key ID: 65558E016966977A
5 changed files with 18 additions and 10 deletions

View File

@ -33,8 +33,7 @@ export const sortMachineSetIds = (clusterId: string | undefined, ids: string[]):
return ids
}
const idsCopy = ids.concat()
return idsCopy.sort((a, b) => {
return ids.toSorted((a, b) => {
const nameA = machineSetName(clusterId, a)
const nameB = machineSetName(clusterId, b)

View File

@ -56,10 +56,17 @@ const talosVersions = computed(() =>
)
const joinTokens = computed(() =>
joinTokenList.value.map((t) => ({
label: t.spec.name || t.metadata.id || '',
value: t.metadata.id || '',
})),
joinTokenList.value
.toSorted((a, b) => {
if (a.spec.is_default) return -1
if (b.spec.is_default) return 1
return 0
})
.map((t) => ({
label: t.spec.name || t.metadata.id || '',
value: t.metadata.id || '',
})),
)
// Form defaults

View File

@ -143,9 +143,9 @@ const groupedK8sVersions = computed(() => {
})
const allTalosVersions = computed(() =>
allTalosVersionsUnsorted.value
.slice()
.sort((a, b) => semver.compare(a.spec.version!, b.spec.version!)),
allTalosVersionsUnsorted.value.toSorted((a, b) =>
semver.compare(a.spec.version!, b.spec.version!),
),
)
function isVersionUpgradeable(version: string) {

View File

@ -3,6 +3,8 @@
"include": ["env.d.ts", "src/**/*", "src/**/*.vue", "typed-router.d.ts"],
"exclude": ["src/**/*.spec.*", "src/**/*.stories.*"],
"compilerOptions": {
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"moduleResolution": "Bundler",
"rootDir": ".",

View File

@ -12,7 +12,7 @@
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",
"lib": ["ES2022"],
"lib": ["ES2023"],
"types": ["node", "jsdom", "@testing-library/jest-dom"],
"paths": {