Our pure JavaScript Scheduler component


Post by andrew.perera »

We have upgraded Bryntum from 4.0.8 to 5.0.1 and ever since eventResizeEnd returns the same Original data & data inside the event Record. Because of that now our events are not updating once the event is resized.

eventResizeEnd.png
eventResizeEnd.png (45.01 KiB) Viewed 281 times

As you might already be aware we use the two scheduler view and React as the front-end development library. According to the code snippet we try to capture the difference between the original event and the current event.

Unfortunately, the event record returns the same object. But in 4.0.8 the durations were different as expected.

STEPS

  1. Normal Event

    normalEvent.png
    normalEvent.png (24.52 KiB) Viewed 281 times
  2. Resizing the event from 4hrs to 3.5 hours

    resizedEvent.png
    resizedEvent.png (37.29 KiB) Viewed 281 times
  3. Observe the event object and what's inside

data > duration

{
    "key1": "17753",
    "description1": "Testing Suggested Resources",
    "customerName": "Chamila",
    "startTime": "15:00",
    "duration": 4,
    "address": "",
    "locationStatus": "Unknown",
    "phone": "02-88753033",
    "email": "",
    "customerRef": "MRI-11111111",
    "priority": "Urgent",
    "eventType": "Do & Charge",
    "timeRemaining": "",
    "customAlpha5": "",
    "callDateTimeResponseReqd": "Date(2022-10-19) 14:23",
    "callDateTimeOnsiteReqd": "Date(2022-10-19) 15:23",
    "callDateTimeRepairReqd": "Date(2022-10-19) 16:23",
    "customAlpha2": "",
    "holdReason": "",
    "holdUntilDateTime": "Date()",
    "durationTextHHMM": "4 Hours",
    "generic4": "Date(2022-10-19) 13:23",
    "startDate": "2022-10-19T04:00:00.000Z",
    "type": 22,
    "key2": "",
    "description2": "",
    "dateTimeStart": "Date(2022-10-19) 15:00",
    "durationScale": "Hours",
    "durationText": "4 Hours",
    "eventTypeCode": "DC",
    "owner": "Adelaide",
    "ownerCode": "ADE",
    "priorityCode": 2,
    "customerCode": "ABCDD",
    "customerDrillDown": "deb/m10mast -e ABCDD",
    "parentKey1": "   1862-01",
    "eventRepCode": "789",
    "eventRep": "Brice Montychop",
    "parentKeyDesc1": "Equipment Contract, PM=2  Not Serialized",
    "contactName": "Michael",
    "addressName": "",
    "postcode": "",
    "latitude": 0,
    "longitude": 0,
    "generic1": "andrewp",
    "genericDesc1": "Andrew Perera",
    "generic2": "TBA",
    "genericDesc2": "To Be Advised",
    "generic3": "",
    "genericDesc3": "",
    "genericDesc4": "",
    "generic5": "13:23",
    "genericDesc5": "",
    "callDateTimeResponded": "Date()",
    "callDateTimeOnsite": "Date()",
    "callDateTimeRepaired": "Date()",
    "notes": "<h2>Fault Notes</h2><p>Testing Suggested Resources&nbsp;</p>",
    "holdReasonCode": "",
    "callActivity": "Clean - 2.5 hours",
    "callActivityCode": "CL",
    "callCriticalCode": "A",
    "callCriticalDesc": "A Grade Service 1/2/3 - No A/H",
    "callTenantCode": "",
    "callTenant": "",
    "zoneCode": "TAS",
    "zone": "tassie",
    "zoneTravelTime": 1,
    "zoneTravelTimeText": "1 Hour",
    "status": "Entered",
    "customAlpha1": "",
    "customAlpha3": "",
    "customAlpha4": "",
    "drillDown": "service/s10maint -singlemaint 17753",
    "resizable": true,
    "draggable": "true",
    "maskedEvent": 0,
    "eventColor": "#0b779a",
    "eventStyle": "border: none;",
    "icon": "",
    "overdueFlag": "1",
    "declineFlag": "0",
    "onHoldFlag": "0",
    "notifiedFlag": "0",
    "resourceId": "type:22-key1:17753-key2:0-rc:-rn:0-dt:",
    "name": "Testing Suggested Resources",
    "durationUnit": "Hours",
    "rmsContext": 0,
    "id": "type:22-key1:17753-key2:0-rc:-rn:0-dt:",
    "dateFormat": "au"
}

OriginalData>duration

{
    "key1": "17753",
    "description1": "Testing Suggested Resources",
    "customerName": "Chamila",
    "startTime": "15:00",
    "duration": 4,
    "address": "",
    "locationStatus": "Unknown",
    "phone": "02-88753033",
    "email": "",
    "customerRef": "MRI-11111111",
    "priority": "Urgent",
    "eventType": "Do & Charge",
    "timeRemaining": "",
    "customAlpha5": "",
    "callDateTimeResponseReqd": "Date(2022-10-19) 14:23",
    "callDateTimeOnsiteReqd": "Date(2022-10-19) 15:23",
    "callDateTimeRepairReqd": "Date(2022-10-19) 16:23",
    "customAlpha2": "",
    "holdReason": "",
    "holdUntilDateTime": "Date()",
    "durationTextHHMM": "4 Hours",
    "generic4": "Date(2022-10-19) 13:23",
    "startDate": "2022-10-19T04:00:00.000Z",
    "type": 22,
    "key2": "",
    "description2": "",
    "dateTimeStart": "Date(2022-10-19) 15:00",
    "durationScale": "Hours",
    "durationText": "4 Hours",
    "eventTypeCode": "DC",
    "owner": "Adelaide",
    "ownerCode": "ADE",
    "priorityCode": 2,
    "customerCode": "ABCDD",
    "customerDrillDown": "deb/m10mast -e ABCDD",
    "parentKey1": "   1862-01",
    "eventRepCode": "789",
    "eventRep": "Brice Montychop",
    "parentKeyDesc1": "Equipment Contract, PM=2  Not Serialized",
    "contactName": "Michael",
    "addressName": "",
    "postcode": "",
    "latitude": 0,
    "longitude": 0,
    "generic1": "andrewp",
    "genericDesc1": "Andrew Perera",
    "generic2": "TBA",
    "genericDesc2": "To Be Advised",
    "generic3": "",
    "genericDesc3": "",
    "genericDesc4": "",
    "generic5": "13:23",
    "genericDesc5": "",
    "callDateTimeResponded": "Date()",
    "callDateTimeOnsite": "Date()",
    "callDateTimeRepaired": "Date()",
    "notes": "<h2>Fault Notes</h2><p>Testing Suggested Resources&nbsp;</p>",
    "holdReasonCode": "",
    "callActivity": "Clean - 2.5 hours",
    "callActivityCode": "CL",
    "callCriticalCode": "A",
    "callCriticalDesc": "A Grade Service 1/2/3 - No A/H",
    "callTenantCode": "",
    "callTenant": "",
    "zoneCode": "TAS",
    "zone": "tassie",
    "zoneTravelTime": 1,
    "zoneTravelTimeText": "1 Hour",
    "status": "Entered",
    "customAlpha1": "",
    "customAlpha3": "",
    "customAlpha4": "",
    "drillDown": "service/s10maint -singlemaint 17753",
    "resizable": true,
    "draggable": true,
    "maskedEvent": 0,
    "eventColor": "#0b779a",
    "eventStyle": "border: none;",
    "icon": "",
    "overdueFlag": "1",
    "declineFlag": "0",
    "onHoldFlag": "0",
    "notifiedFlag": "0",
    "resourceId": "type:22-key1:17753-key2:0-rc:-rn:0-dt:",
    "name": "Testing Suggested Resources",
    "durationUnit": "Hours",
    "rmsContext": 0,
    "id": "type:22-key1:17753-key2:0-rc:-rn:0-dt:",
    "dateFormat": "au",
    "cls": "",
    "allDay": false,
    "exceptionDates": {},
    "endDate": "2022-10-19T08:00:00.000Z",
    "parentIndex": 19
}
  1. However, if you resize the event again let's say for 6 hours the returned object will have the values from the previous move. Which was step 2.
    Very misleading!

Appreciate it if you can help us to troubleshoot as this is a very critical business case that is broken after upgrading to 5.0.1.


Post by Animal »

You can add a temporary override until we get this fixed:

Override the Scheduler/feature/EventResize class:

    async cleanup(context, changed) {
        const
            me               = this,
            { client }       = me,
            {
                element,
                eventRecord
            }                = context,
            name             = client.scheduledEventName;

        // The record must know that it is being resized.
        eventRecord.meta.isResizing = false;

        client.endListeningForBatchedUpdates();
        me.tip?.hide();
        me.unHighlightHandle(element);
        client.element.classList.remove(...me.dragActiveCls.split(' '));

        // wait for project data update
        await client.project.commitAsync();

        // Triggers eventResizeEnd or taskResizeEnd depending on product
        me.triggerEventResizeEnd(`${name}ResizeEnd`, {
            changed,
            [`${name}Record`] : eventRecord,
            ...me.getResizeEndParams(context)
        });
    }

The change is it has become async and has an await before it fires the event.


Post by tasnim »

Thanks for reporting, Reproduced! We'll fix it. Here is ticket for that https://github.com/bryntum/support/issues/5500

Good Luck :),
Tasnim


Post by andrew.perera »

Thanks Team


Post Reply