diff --git a/models/tracker/src/viewlets.ts b/models/tracker/src/viewlets.ts index 9ad3ec976a..f080199179 100644 --- a/models/tracker/src/viewlets.ts +++ b/models/tracker/src/viewlets.ts @@ -38,10 +38,10 @@ export const issuesOptions = (kanban: boolean): ViewOptionsModel => ({ 'reportedTime' ], orderBy: [ + ['modifiedOn', SortingOrder.Descending], ['status', SortingOrder.Ascending], ['kind', SortingOrder.Ascending], ['priority', SortingOrder.Ascending], - ['modifiedOn', SortingOrder.Descending], ['createdOn', SortingOrder.Descending], ['dueDate', SortingOrder.Ascending], ['rank', SortingOrder.Ascending], diff --git a/plugins/workbench-resources/src/components/SelectWorkspaceMenu.svelte b/plugins/workbench-resources/src/components/SelectWorkspaceMenu.svelte index 51ede1f4ee..e94326b40e 100644 --- a/plugins/workbench-resources/src/components/SelectWorkspaceMenu.svelte +++ b/plugins/workbench-resources/src/components/SelectWorkspaceMenu.svelte @@ -48,21 +48,23 @@ } async function clickHandler (e: MouseEvent, ws: string): Promise { + if (ws !== getCurrentLocation().path[1]) { + const tokens: Record = fetchMetadataLocalStorage(login.metadata.LoginTokens) ?? {} + const token = tokens[ws] + if (!token) { + const selectWorkspace = await getResource(login.function.SelectWorkspace) + const loginInfo = (await selectWorkspace(ws))[1] + if (loginInfo !== undefined) { + tokens[ws] = loginInfo?.token + } + setMetadataLocalStorage(login.metadata.LoginTokens, tokens) + } + } if (!e.metaKey && !e.ctrlKey) { e.preventDefault() closePopup() closePopup() if (ws !== getCurrentLocation().path[1]) { - const tokens: Record = fetchMetadataLocalStorage(login.metadata.LoginTokens) ?? {} - const token = tokens[ws] - if (!token) { - const selectWorkspace = await getResource(login.function.SelectWorkspace) - const loginInfo = (await selectWorkspace(ws))[1] - if (loginInfo !== undefined) { - tokens[ws] = loginInfo?.token - } - setMetadataLocalStorage(login.metadata.LoginTokens, tokens) - } const last = localStorage.getItem(`${locationStorageKeyId}_${ws}`) if (last !== null) { navigate(JSON.parse(last)) diff --git a/tests/sanity/tests/tracker/issues-duplicate.spec.ts b/tests/sanity/tests/tracker/issues-duplicate.spec.ts index 996bdbb975..8a42cb3b3a 100644 --- a/tests/sanity/tests/tracker/issues-duplicate.spec.ts +++ b/tests/sanity/tests/tracker/issues-duplicate.spec.ts @@ -48,7 +48,7 @@ test.describe('Tracker duplicate issue tests', () => { await trackerNavigationMenuPage.openTemplateForProject('Default') await trackerNavigationMenuPage.openIssuesForProject('Default') await issuesPage.searchIssueByName(secondIssue.title) - const secondIssueId = await issuesPage.getIssueId(secondIssue.title, 1) + const secondIssueId = await issuesPage.getIssueId(secondIssue.title, 0) expect(firstIssueId).not.toEqual(secondIssueId) await issuesPage.checkIssuesCount(firstIssue.title, 2) diff --git a/tests/sanity/tests/tracker/tracker.spec.ts b/tests/sanity/tests/tracker/tracker.spec.ts index de31c58129..2ebda1d331 100644 --- a/tests/sanity/tests/tracker/tracker.spec.ts +++ b/tests/sanity/tests/tracker/tracker.spec.ts @@ -189,9 +189,6 @@ test.describe('Tracker tests', () => { await navigate(page) await page.click('text="Issues"') - await page.click('button:has-text("View")') - await page.click('.ordering >> nth=0') - await page.click('text="Modified date"') await page.keyboard.press('Escape') const values = [2, 4, 6, 8]