Premium support for our pure JavaScript UI components
Hey!
We are overriding the ResourceAllocationInfo class.
It's working good on a dev server but not on a production build.
On prod build we are able to get the resource histogram template but all the ticks are empty (no color).
Did someone face something similar?
Any ideas on what could be the issue?
I did some tests here and seems that generator function cannot be overridden.
Works:
export class ResourceAllocationInfoOverride {
static get target() {
return {
class: ResourceAllocationInfo,
};
}
calculateAllocation() {
alert('Test');
}
}
Does not work:
export class ResourceAllocationInfoOverride {
static get target() {
return {
class: ResourceAllocationInfo,
};
}
*calculateAllocation() {
alert('Test');
}
}
But we do need to keep it as a generator function...
Hey arcady,
That's weird, but this way you provided is not working for me when I use the * (generator function).
Working:
export class ResourceAllocationInfoOverride extends ResourceAllocationInfo {
// @ts-expect-error
calculateAllocation(): CalculationIterator<this['allocation']> {
alert('calculateAllocation test');
}
}
Not working:
export class ResourceAllocationInfoOverride extends ResourceAllocationInfo {
// @ts-expect-error
*calculateAllocation(): CalculationIterator<this['allocation']> {
alert('calculateAllocation test');
}
}
As project model:
projectRef.current = new ProjectModel({
...
// @ts-expect-error
resourceAllocationInfoClass: ResourceAllocationInfoOverride,
});
Please provide a test case demonstrating the problem and we'll investigate what happens.
Do you know if is it possible to apply overrides on any available demo/example?
Not sure. I haven't tried to override all of the demos. Why?