feat(kanban): add setting to always show bucket task count (#1966)

Added "Always show task count on Kanban buckets" setting in user preferences to control the visibility of task counts on Kanban bucket headers
This commit is contained in:
kolaente
2025-12-12 00:27:13 +01:00
committed by GitHub
parent 49c43e87f0
commit 8b6082e8c7
9 changed files with 114 additions and 16 deletions

View File

@@ -1,4 +1,5 @@
import type {APIRequestContext} from '@playwright/test'
import {objectToSnakeCase} from '../../src/helpers/case'
export async function updateUserSettings(apiContext: APIRequestContext, token: string, settings: any) {
const apiUrl = process.env.API_URL || 'http://localhost:3456/api/v1'
@@ -9,15 +10,30 @@ export async function updateUserSettings(apiContext: APIRequestContext, token: s
},
})
const oldSettings = await userResponse.json()
const userData = await userResponse.json()
// GET /user returns { settings: { frontend_settings: ... }, ... }
// POST /user/settings/general expects { frontend_settings: ... } at the top level
const oldSettings = userData.settings || {}
const snakeSettings = objectToSnakeCase(settings)
// Deep merge frontend_settings if provided
const mergedSettings = {
...oldSettings,
...snakeSettings,
}
if (snakeSettings.frontend_settings) {
mergedSettings.frontend_settings = {
...(oldSettings.frontend_settings || {}),
...snakeSettings.frontend_settings,
}
}
await apiContext.post(`${apiUrl}/user/settings/general`, {
headers: {
'Authorization': `Bearer ${token}`,
},
data: {
...oldSettings,
...settings,
},
data: mergedSettings,
})
}