Servoy / fullcalendarcomponent2

Servoy Component around Fullcalendar
MIT License
0 stars 0 forks source link

Multiple Bugs in 2024.03.0 #12

Open r4inX opened 4 months ago

r4inX commented 4 months ago

Hey Guys,

we found multiple bugs in the newest release. Servoy 2024.3.1.3944 + fullcalendar2 2024.03.0 TING

1) custombuttons wont work. example:

customButtons: {
        reloadEvents:{
            icon: 'bi bi-arrow-clockwise',
            click: function(){
                application.output('RELOADING');
            },
            hint: i18n.getI18NMessage('rooms.calendar.timeline.refresh')
}

output:

ERROR org.sablo.BrowserConsole - sendMessageObject@http://localhost:8189/chunk-M7D4W3TY.js:31383:22
callService@http://localhost:8189/chunk-M7D4W3TY.js:31375:12
callService@http://localhost:8189/chunk-M7D4W3TY.js:33441:36
executeInlineScript@http://localhost:8189/chunk-M7D4W3TY.js:36822:39
func@http://localhost:8189/chunk-M7D4W3TY.js:36326:37
buttonClick@http://localhost:8189/chunk-M7D4W3TY.js:175890:35
m@http://localhost:8189/chunk-IZGWZGWH.js:584:35
invokeTask@http://localhost:8189/polyfills.js:10504:171
onInvokeTask@http://localhost:8189/chunk-DBU6XUYG.js:11205:22
invokeTask@http://localhost:8189/polyfills.js:10504:54
onInvokeTask@http://localhost:8189/chunk-DBU6XUYG.js:11374:25
invokeTask@http://localhost:8189/polyfills.js:10504:54
runTask@http://localhost:8189/polyfills.js:10321:37
invokeTask@http://localhost:8189/polyfills.js:10575:26
invokeTask@http://localhost:8189/polyfills.js:11548:12
globalCallback@http://localhost:8189/polyfills.js:11569:31
globalZoneAwareCallback@http://localhost:8189/polyfills.js:11594:12

2) html injection wont work. for a fontawesome icon in the resource-area we need to inject the html of the title, does not work. https://fullcalendar.io/docs/content-injection https://servoy-cloud.atlassian.net/browse/SVYX-872

3) reloading events wont work. we tried multiple different ways to reload events, none of those worked. the situation: a event gets added to the db-table in the background. v1: destroy() the whole fc and reload with newest events -> not working v2: just add the event from another form -> not working (fc is not initialized) v3: loop through .getCalendarEvents() and just addEvent() the missing one -> not working aswell... v4: clear the options.events[] array and fill it again -> not working

- Is there a update planned in the near future, this release is unusable in any way.

lvostinar commented 4 months ago

Hi, please see https://docs.servoy.com/guides/develop/application-design/ui-components/specialized-components/fullcalendar2#fullcalendar-functions-support , you need to use our special API for functions (then point 1 and 2 will work, i think). For point 3, I would expect you need to use updateFullCalendar.

r4inX commented 4 months ago

@Ivostinar ty for the reply, i tried it with application.generateBrowserFunction and with clientutils.generateBrowserFunction still wont work, i get the following error in servoy:

ERROR org.sablo.BrowserConsole - buttonClick@http://localhost:8189/chunk-M7D4W3TY.js:175890:35
m@http://localhost:8189/chunk-IZGWZGWH.js:584:35
invokeTask@http://localhost:8189/polyfills.js:10504:171
onInvokeTask@http://localhost:8189/chunk-DBU6XUYG.js:11205:22
invokeTask@http://localhost:8189/polyfills.js:10504:54
onInvokeTask@http://localhost:8189/chunk-DBU6XUYG.js:11374:25
invokeTask@http://localhost:8189/polyfills.js:10504:54
runTask@http://localhost:8189/polyfills.js:10321:37
invokeTask@http://localhost:8189/polyfills.js:10575:26
invokeTask@http://localhost:8189/polyfills.js:11548:12
globalCallback@http://localhost:8189/polyfills.js:11569:31
globalZoneAwareCallback@http://localhost:8189/polyfills.js:11594:12

and in the firefoxconsole:

ERROR TypeError: customButtonProps.click.call is not a function
    buttonClick index.js:762
    m Preact
    Angular 10
        invokeTask
        onInvokeTask
        invokeTask
        onInvokeTask
        invokeTask
        runTask
        invokeTask
        invokeTask
        globalCallback
        globalZoneAwareCallback
[sablo.service.ts:68:23](http://localhost:8189/src/sablo/sablo.service.ts)
    apply sablo.service.ts:68
    Angular 2
    RxJS 6
    Angular 12
lvostinar commented 4 months ago

Indeed this seems to be a bug, added a case: https://servoy-cloud.atlassian.net/browse/SVY-19262

r4inX commented 4 months ago

@lvostinar quick update. the content injection via clientUtils.generateBrowserFunction() is working for <i class> tags in the resource column... BUT and thats a bummer, it only works for the first column, the injection is not working for the second or third, etc columns if you have multiple resource-columns. i attached a screenshot:

grafik

    // --- Ressourse Felder einfügen ---
    resourceAreaColumns: [
        {
          field: 'room_nr',
          headerContent: 'Zimmer-Nr & Status'
        },
        {
          field: 'status',
          headerContent: i18n.getI18NMessage('rooms.calendar.fullcalendar_module.status')
        }
      ],

// DAS HIER FUNKTIONIERT (NUR IN ERSTER SPALTE) resourceLabelContent: clientutils.generateBrowserFunction("function(arg) { return {html : '<b>' + arg.resource.extendedProps.room_nr + '</b>'} }"),
    resourceLabelContent: clientutils.generateBrowserFunction("function(arg) { return {html : '<b>' + arg.resource.extendedProps.room_nr + '</b>&#09;' + arg.resource.extendedProps.status + ''} }"),
lvostinar commented 4 months ago

This seems to be a fullcalendar issue, see for example https://stackoverflow.com/questions/64387835/fullcalendar-sheduler-how-to-add-icon-html-on-second-resourceareacolumn