Select workspace fixes (#4701)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2024-02-20 21:18:11 +06:00 committed by GitHub
parent bdf6f3e80d
commit b9fd44ca62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 15 deletions

View File

@ -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],

View File

@ -48,21 +48,23 @@
}
async function clickHandler (e: MouseEvent, ws: string): Promise<void> {
if (ws !== getCurrentLocation().path[1]) {
const tokens: Record<string, string> = 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<string, string> = 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))

View File

@ -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)

View File

@ -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]