From 2e49ea5cefcdbcb992aa547d73c09e333e38b8ad Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Tue, 14 Oct 2025 18:55:50 +0200 Subject: [PATCH] feat(boards): limit new sort setting to columns that include due tasks specifically --- .../board-panel/board-panel.component.ts | 5 ++- src/app/features/boards/boards-form.const.ts | 33 +++++++++++-------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/app/features/boards/board-panel/board-panel.component.ts b/src/app/features/boards/board-panel/board-panel.component.ts index e62d6efc70..df3017bc25 100644 --- a/src/app/features/boards/board-panel/board-panel.component.ts +++ b/src/app/features/boards/board-panel/board-panel.component.ts @@ -179,7 +179,10 @@ export class BoardPanelComponent { const merged = [...orderedTasks, ...nonOrderedTasks].filter((t) => !!t); // mode: 'off' | 'asc' (earliest first) | 'desc' (latest first) - const mode = panelCfg.sortByDue || 'off'; + const mode = + (panelCfg.scheduledState === BoardPanelCfgScheduledState.Scheduled && + panelCfg.sortByDue) || + 'off'; if (mode !== 'off') { const getDueTs = (task: TaskCopy): number | null => { // prefer dueWithTime (timestamp), then dueDay (ISO-like date string) diff --git a/src/app/features/boards/boards-form.const.ts b/src/app/features/boards/boards-form.const.ts index 5dc25960b5..6b68aee104 100644 --- a/src/app/features/boards/boards-form.const.ts +++ b/src/app/features/boards/boards-form.const.ts @@ -9,6 +9,7 @@ import { import { nanoid } from 'nanoid'; import { T } from '../../t.const'; import { DEFAULT_PANEL_CFG } from './boards.const'; +import { FormlyFieldConfig } from '@ngx-formly/core/lib/models/fieldconfig'; const getNewPanel = (): BoardPanelCfg => ({ ...DEFAULT_PANEL_CFG, @@ -126,6 +127,24 @@ export const BOARDS_FORM: LimitedFormlyFieldConfig[] = [ ], }, }, + { + key: 'sortByDue', + type: 'radio', + expressions: { + hide: (fCfg: FormlyFieldConfig) => + fCfg.model.scheduledState !== BoardPanelCfgScheduledState.Scheduled, + }, + props: { + label: 'Sort by due date', + required: true, + defaultValue: 'off', + options: [ + { value: 'off', label: 'Off' }, + { value: 'asc', label: 'Ascending (soonest first)' }, + { value: 'desc', label: 'Descending (furthest first)' }, + ], + }, + }, { key: 'backlogState', type: 'radio', @@ -169,20 +188,6 @@ export const BOARDS_FORM: LimitedFormlyFieldConfig[] = [ defaultValue: false, }, }, - { - key: 'sortByDue', - type: 'radio', - props: { - label: 'Sort by due date', - required: true, - defaultValue: 'off', - options: [ - { value: 'off', label: 'Off' }, - { value: 'asc', label: 'Ascending (soonest first)' }, - { value: 'desc', label: 'Descending (furthest first)' }, - ], - }, - }, ], }, },