bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
54 stars 6 forks source link

Parent task shown incorrect on load with loadDataAsync #2769

Open chuckn0rris opened 3 years ago

chuckn0rris commented 3 years ago

Forum post

Copy/paste the next code into Gantt advanced demo to reproduce the issue. Open the demo. See that parent task gone left and doesn't respect endDate value. Try to use the JSON from loadDataAsync as initial data - parent task shown correct!

const gantt = new Gantt({
    appendTo : 'container',

    project : {
        eventStore : {
            syncDataOnLoad : true
        },

        repopulateOnDataset : false,

        eventsData : [
            {
                "id": "79d9b2d5-82bc-4e82-9e9f-a030d0463e27",
                "name": "Email Notifications & Auto-updates",
                "startDate": "2021-02-26T00:00:00",
                "endDate": "2021-03-11T23:59:59",
                "taskDuration": 10,
                "expanded": true,
                "manuallyScheduled": true,
                "children": [{
                    "id": "9e09ccc8-f6c8-4fc6-a92d-c7d82587bae4",
                    "name": "Daily Task Update Reminder",
                    "startDate": "2021-02-26T00:00:00",
                    "endDate": "2021-02-26T23:59:59",
                    "taskDuration": 1,
                    "manuallyScheduled": true,
                },{
                        "id": "05b35d05-21b9-4a06-8898-d9b7f8efcca4",
                        "name": "New Task Assigned to You",
                        "startDate": "2021-03-01T00:00:00",
                        "endDate": "2021-03-01T23:59:59",
                        "taskDuration": 1,
                        "manuallyScheduled": true,
                    },
                    {
                        "id": "6f02b615-638d-4643-be59-78b0e7b787b9",
                        "name": "New Actionable Task",
                        "startDate": "2021-03-02T00:00:00",
                        "endDate": "2021-03-02T23:59:59",
                        "taskDuration": 1,
                        "manuallyScheduled": true,
                    },
                    {
                        "id": "ab96d5d2-04b8-42a1-b2eb-aa3d80c5bcfd",
                        "name": "Critical Task Duration has grown or been significantly delayed",
                        "startDate": "2021-03-03T00:00:00",
                        "endDate": "2021-03-03T23:59:59",
                        "taskDuration": 1,
                        "manuallyScheduled": true,
                    },
                    {
                        "id": "74207363-3804-4c07-964e-e309841972bd",
                        "name": "Multiple, queued, critical tasks",
                        "startDate": "2021-03-04T00:00:00",
                        "endDate": "2021-03-04T23:59:59",
                        "taskDuration": 1,
                        "manuallyScheduled": true,
                    },
                    {
                        "id": "a9ac09e5-57a5-41bf-92bb-54ef6b738c48",
                        "name": "Update Project Start/End Dates",
                        "startDate": "2021-02-26T00:00:00",
                        "endDate": "2021-02-26T23:59:59",
                        "taskDuration": 1,
                        "manuallyScheduled": true,
                    },
                    {
                        "id": "d535ed23-1692-171e-4f39-305d3b2aa6ca",
                        "name": "Fill Segment Gaps",
                        "startDate": "2021-03-08T00:00:00",
                        "endDate": "2021-03-08T23:59:59",
                        "taskDuration": 1,
                        "manuallyScheduled": true,
                    }
                ]
            }
        ]
    }
});

gantt.project.commitAsync().then(async() => {

gantt.eventStore.loadDataAsync([
    {
        "id": "79d9b2d5-82bc-4e82-9e9f-a030d0463e27",
        "name": "Email Notifications & Auto-updates",
        "startDate": "2021-02-17T00:00:00",
        "endDate": "2021-03-11T23:59:59",
        // "duration": 17,
        "expanded": true,
        "manuallyScheduled": true,
        "children": [
          {
            "id": "9e09ccc8-f6c8-4fc6-a92d-c7d82587bae4",
            "name": "Daily Task Update Reminder",
            "startDate": "2021-02-17T00:00:00",
            "endDate": "2021-02-17T23:59:59",
            "taskDuration": 1,
            "manuallyScheduled": true,
          },
          {
            "id": "05b35d05-21b9-4a06-8898-d9b7f8efcca4",
            "name": "New Task Assigned to You",
            "startDate": "2021-03-01T00:00:00",
            "endDate": "2021-03-01T23:59:59",
            "taskDuration": 1,
            "manuallyScheduled": true,
          },
          {
            "id": "6f02b615-638d-4643-be59-78b0e7b787b9",
            "name": "New Actionable Task",
            "startDate": "2021-03-02T00:00:00",
            "endDate": "2021-03-02T23:59:59",
            "taskDuration": 1,
            "manuallyScheduled": true,
          },
          {
            "id": "ab96d5d2-04b8-42a1-b2eb-aa3d80c5bcfd",
            "name": "Critical Task Duration has grown or been significantly delayed",
            "startDate": "2021-03-03T00:00:00",
            "endDate": "2021-03-03T23:59:59",
            "taskDuration": 1,
            "manuallyScheduled": true,
          },
          {
            "id": "74207363-3804-4c07-964e-e309841972bd",
            "name": "Multiple, queued, critical tasks",
            "startDate": "2021-03-04T00:00:00",
            "endDate": "2021-03-04T23:59:59",
            "taskDuration": 1,
            "manuallyScheduled": true,
          },
          {
            "id": "a9ac09e5-57a5-41bf-92bb-54ef6b738c48",
            "name": "Update Project Start/End Dates",
            "startDate": "2021-02-26T00:00:00",
            "endDate": "2021-02-26T23:59:59",
            "taskDuration": 1,
            "manuallyScheduled": true,
          },
          {
            "id": "d535ed23-1692-171e-4f39-305d3b2aa6ca",
            "name": "Fill Segment Gaps",
            "startDate": "2021-03-08T00:00:00",
            "endDate": "2021-03-08T23:59:59",
            "taskDuration": 1,
            "manuallyScheduled": true,
          }
        ]
      },
]);
});
jsakalos commented 3 years ago

There is another problem related to this issue reported here: https://www.bryntum.com/forum/viewtopic.php?f=52&t=18000&p=89095#p89095

With the data user provided it behaves as he explains. However, if I change the endDate of the task in question from: 2021-03-22T23:59:59 to 2021-03-23T00:00:00 then it works as expected.

We should probably sense 23:59:59 and round it to the midnight so that it behaves as expected.