mirror of
https://github.com/stablyai/orca.git
synced 2026-10-08 08:02:32 +00:00
fix(board): stop truncating workflows longer than 12 columns (#11605)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
co-authored by
OrcaWin
parent
94cf2f1422
commit
ef9e6ab9a8
@@ -10,6 +10,29 @@ import {
|
||||
} from './workspace-statuses'
|
||||
|
||||
describe('workspace status visuals', () => {
|
||||
it.each([13, 20, 21, 64])('keeps all %i authored columns in order', (count) => {
|
||||
const authored = Array.from({ length: count }, (_, index) => ({
|
||||
id: `state-${index + 1}`,
|
||||
label: `State ${index + 1}`
|
||||
}))
|
||||
|
||||
const statuses = normalizeWorkspaceStatuses(authored)
|
||||
|
||||
expect(statuses).toHaveLength(count)
|
||||
expect(statuses.map((status) => status.id)).toEqual(authored.map((status) => status.id))
|
||||
})
|
||||
|
||||
it('normalizes every valid status without truncating the workflow', () => {
|
||||
const authored = Array.from({ length: 500 }, (_, index) => ({
|
||||
id: `state-${index}`,
|
||||
label: `State ${index}`
|
||||
}))
|
||||
|
||||
expect(normalizeWorkspaceStatuses(authored).map((status) => status.id)).toEqual(
|
||||
authored.map((status) => status.id)
|
||||
)
|
||||
})
|
||||
|
||||
it('keeps the default workflow order', () => {
|
||||
expect(cloneDefaultWorkspaceStatuses().map((status) => status.id)).toEqual([
|
||||
'todo',
|
||||
|
||||
@@ -9,7 +9,6 @@ export { DEFAULT_WORKSPACE_STATUSES } from './workspace-status-defaults'
|
||||
|
||||
const WORKSPACE_STATUS_GROUP_PREFIX = 'workspace-status:'
|
||||
const MAX_STATUS_LABEL_LENGTH = 32
|
||||
const MAX_WORKSPACE_STATUSES = 12
|
||||
type WorkspaceStatusNormalizationOptions = {
|
||||
migrateDefaultWorkflowStatuses?: boolean
|
||||
migrateLegacyDefaultStatusVisuals?: boolean
|
||||
@@ -169,7 +168,7 @@ function normalizeWorkspaceStatusesInternal(
|
||||
|
||||
const statuses: WorkspaceStatusDefinition[] = []
|
||||
const usedIds = new Set<string>()
|
||||
for (const rawStatus of value.slice(0, MAX_WORKSPACE_STATUSES)) {
|
||||
for (const rawStatus of value) {
|
||||
if (!rawStatus || typeof rawStatus !== 'object' || Array.isArray(rawStatus)) {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user