Premium support for our pure JavaScript UI components


Post by outputlogic »

Hi guys,

I work within a small team and we have been so bogged down under new feature requests and bug fixes over the past 6 months that we haven't had a chance to upgrade Bryntum Gantt or Scheduler (we use both) past v5.1.3.

Now I have finally been asked to complete an upgrade to v5.3.0, but am struggling to do so. I have replaced the v5.1.3 files that we were using with their v5.3.0 equivalents, but am getting many TypeScript errors across our entire application now.

I have fixed many of those simply by being explicit about the types we are using. For example, we had the following code:

const toolbar = new Toolbar({
    overflow: null,
    items: [
        {
            type: 'button',
            color: 'b-blue',
            id: 'addAbsence',
            icon: 'b-fa b-fa-plus',
            tooltip: {
                html: 'Add Absence<div style="font-size: 80%">Adds a new absence for the selected resource(s)</div>',
                newInstance: true    // This line causes an error
            },
            ...more configuration of the first item
        }
        ...more toolbar items, all with similar tooltips that don't work
    ]
});

This worked fine in v5.1.3, but it is now seemingly necessary to write the Toolbar like this:

const toolbar = new Toolbar({
    overflow: null,
    items: [
        {
            type: 'button',
            color: 'b-blue',
            id: 'addAbsence',
            icon: 'b-fa b-fa-plus',
            tooltip: {
                html: 'Add Absence<div style="font-size: 80%">Adds a new absence for the selected resource(s)</div>',
                newInstance: true
            } as Partial<TooltipConfig>,
            ...more configuration of the first item
        }
        ...more toolbar items
    ]
});

Otherwise I get the following in Visual Studio's error list: https://drive.google.com/file/d/1Or-88ZGOa9TSc4iF4ncu0gYsJ-1HTWXz/view?usp=share_link.

So my first question is this: why is it necessary to explicitly cast the object to a Partial<TooltipConfig>? Shouldn't your TypeScript definitions handle this for me?

This is just one example of about 20 similar errors that make it seem to me as though your TypeScript definitions file (gantt.d.ts) is missing some crucial stuff.

Secondly, if I simply ignore the vast majority of TS errors and try to load a page on which I'm importing the Scheduler component, I get this in the Chrome DevTools console: https://drive.google.com/file/d/1KH2bNgEuo8U7weTuNTg-JaTo6jGc8Ebi/view?usp=share_link.

So what is the proper procedure needed for localization to work?

Many thanks in advance for your prompt and informative reply :-)

P.S. If possible, could you please reply to kent.cooper@outputlogic.com.au, since I am using my boss' email address to access these forums and don't want to bother him with any replies that are irrelevant to him. Thank you :-)


Post by marcio »

Hello Kent,

I sent you an email asking for more details regarding the TS-type errors that you're having.

Best regards,
Márcio


Post Reply