Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic swimlanes not collapsing and throwing an error #7336

Closed
marciogurka opened this issue Aug 18, 2023 · 1 comment
Closed

Dynamic swimlanes not collapsing and throwing an error #7336

marciogurka opened this issue Aug 18, 2023 · 1 comment
Assignees
Labels
bug Something isn't working forum Issues from forum high-priority Urgent to have fixed resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@marciogurka
Copy link

marciogurka commented Aug 18, 2023

Forum post

Using the demo based on plain JS swimlane demo, and changing to the attached code, which tries to change the swimlane configuration on runtime, it throws an error when collapsing any of them.

import '../_shared/shared.js'; // not required, our example styling etc.
import TaskBoard from '../../lib/TaskBoard/view/TaskBoard.js';
import '../../lib/TaskBoard/feature/ColumnDrag.js';
import '../../lib/TaskBoard/feature/SwimlaneDrag.js';
import '../../lib/TaskBoard/feature/TaskTooltip.js';
import '../../lib/TaskBoard/widget/SwimlanePickerButton.js';
import '../../lib/TaskBoard/widget/SwimlaneFilterField.js';

let toggle = false;

const taskBoard = new TaskBoard({
    appendTo : 'container',

    // Experimental, transition moving cards using the editor
    useDomTransition : true,

    features : {
        columnDrag   : true,
        swimlaneDrag : true,
        taskTooltip  : true
    },

    columns : [
        'todo',
        'doing',
        'review',
        'done'
    ],

    columnField : 'status',

    // Cards expand to fill available space if there are fewer than tasksPerRow
    stretchCards : true,

    tbar : [
        {
            type    : 'button',
            text    : 'Toggle Swinlane',
            onClick : 'up.onToggleClick'
        }
    ],

    taskRenderer({ taskRecord, cardConfig }) {
        const headerContent = cardConfig.children.header.children;

        // Header items are hidden in really small cards, make sure it exists before trying to update its text
        if (headerContent.text) {
            headerContent.text.text = `${taskRecord.hasGeneratedId ? '✻' : `#${taskRecord.id}`} ${taskRecord.name}`;
        }

        if (taskRecord.prio === 'critical') {
            headerContent.icon = {
                tag   : 'i',
                class : 'b-fa b-fa-exclamation-triangle'
            };
        }
    },

    project : {
        loadUrl  : 'data/data.json',
        autoLoad : true
    },

    onToggleClick() {
        if (toggle) {
            taskBoard.swimlaneField = null;
            taskBoard.swimlanes.removeAll();
        }
        else {
            taskBoard.swimlaneField = 'prio';
            taskBoard.swimlanes.removeAll();
            taskBoard.swimlanes.add([
                { id : 'critical', text : 'Critical!!', color : 'red', collapsible : true },
                { id : 'high', text : 'High', color : 'deep-orange', collapsible : true },
                { id : 'medium', text : 'Medium', color : 'orange', collapsible : true },
                // Display more tasks per row in the Low lane
                { id : 'low', text : 'Low', color : 'light-green', tasksPerRow : 3, collapsible : true }
            ]);
        }
        toggle = !toggle;
    }
});
Screenshot 2023-08-18 at 13 32 38
@marciogurka marciogurka added bug Something isn't working forum Issues from forum labels Aug 18, 2023
@marciogurka
Copy link
Author

User added a behavior that could be related https://forum.bryntum.com/viewtopic.php?p=129311&sid=093647233df7081e1a8fcf8861b56def#p129311

So I do NOT want to confuse the bug I just reported, but there is a SECOND bug related to this one. Please note when you click the button to add the swimlanes, that the COUNT of cards within the swimlane does NOT appear. You can reproduce this in the sample I provided.

@matsbryntse matsbryntse added the high-priority Urgent to have fixed label Aug 20, 2023
@matsbryntse matsbryntse self-assigned this Aug 20, 2023
@matsbryntse matsbryntse added the ready for review Issue is fixed, the pull request is being reviewed label Aug 20, 2023
@isglass isglass added this to the 5.5.2 milestone Aug 21, 2023
@isglass isglass added resolved Fixed but not yet released (available in the nightly builds) and removed ready for review Issue is fixed, the pull request is being reviewed labels Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum high-priority Urgent to have fixed resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

3 participants