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

Task segment is rendered incorrectly when out of the view #6118

Open
bmblb opened this issue Feb 7, 2023 · 1 comment
Open

Task segment is rendered incorrectly when out of the view #6118

bmblb opened this issue Feb 7, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@bmblb
Copy link

bmblb commented Feb 7, 2023

Reported here: https://forum.bryntum.com/viewtopic.php?p=117809#p117809

test case

t.it('Should render task correctly when segments are outside of the view', async t => {
        gantt = await t.getGanttAsync({
            startDate : '2020-02-01',
            endDate   : '2023-01-01',

            viewPreset : 'monthAndYear',

            project : {
                tasksData : [
                    {
                        id                : 1,
                        manuallyScheduled : true,
                        startDate         : new Date(2020, 0, 1),
                        endDate           : new Date(2023, 1, 1),
                        segments          : [
                            { startDate : '2020-01-01', endDate : '2020-01-02' },
                            { startDate : '2020-03-03', endDate : '2020-07-07' },
                            { startDate : '2021-05-01', endDate : '2021-05-02' },
                            { startDate : '2022-01-01', endDate : '2022-05-01' }
                        ]
                    }
                ]
            }
        });

        const task = gantt.taskStore.getById(1);

        document.querySelectorAll('.b-sch-event-segments .b-sch-event-segment')
            .forEach((el, index) => {
                const
                    segment = task.segments[index],
                    start = DateHelper.max(gantt.startDate, segment.startDate),
                    end   = DateHelper.min(segment.endDate, gantt.endDate),
                    width = gantt.timeAxisViewModel.getDistanceBetweenDates(start, end);

                t.isApproxPx(t.rect(el).width, width, 2, 'Segment width is correct');
            });
    });
@bmblb bmblb added the bug Something isn't working label Feb 7, 2023
@bmblb
Copy link
Author

bmblb commented Feb 7, 2023

this test also throws exception from engine and I am not sure why:

Uncaught (in promise) Error: Invalid cache fill interval
    at CalendarCacheSingle.fillCache (VM1205 CalendarCacheSingle.js:32:19)
    at VM1287 CalendarCacheMultiple.js:21:27
    at Array.forEach (<anonymous>)
    at CalendarCacheMultiple.fillCache (VM1287 CalendarCacheMultiple.js:20:29)
    at CalendarCacheMultiple.ensureCacheFilledForInterval (VM1202 CalendarCache.js:81:14)
    at CalendarCacheMultiple.forEachAvailabilityInterval (VM1202 CalendarCache.js:130:22)
    at ClassDefEx.forEachAvailabilityInterval (VM1213 SplitEventMixin.js:466:50)
    at forEachAvailabilityInterval.next (<anonymous>)
    at ClassDefEx.calculateProjectedDuration (VM1211 SchedulerProHasAssignmentsMixin.js:139:29)
    at calculateProjectedDuration.next (<anonymous>)

@arcady-zherdev arcady-zherdev self-assigned this Feb 8, 2023
@arcady-zherdev arcady-zherdev removed their assignment Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants