Premium support for our pure JavaScript UI components


Post by chrisb »

Hey Guys,

We want to display task information in other places in our app (e.g. a task linked to another resource shown on another dashboard). Our projects have on average 2.5k tasks. We want to display the WBS number along with the task name in these circumstances. I've set the wbs to alwaysWrite, and that's been working ok. However we've found that changes to the wbs structure (e.g. adding a task) will only affect sibling tasks, I assume as a side effect of the parentIndex property changing, and no changes to the children of those siblings.

The effect in our DB is that we have a task that's been updated to e.g. 1.4, and all it's children remain as 1.3.*.

How can we remedy this?

Thanks

Chris


Post by alex.l »

Hi Chris,

WBS should be forced manually to be recalculated (mentioned here https://bryntum.com/docs/gantt/#Gantt/model/TaskModel#field-wbsValue ). I assume you use Gantt (you posted in general forum and didn't mention the product you are talking about), and it may be done using https://bryntum.com/docs/gantt/#Gantt/model/TaskModel#function-refreshWbs
or for all the project

gantt.project.refreshWbs();

All the best,
Alex


Post by chrisb »

Hey Alex,

Yes sorry, Gantt.
Sorry, I wasn't entirely clear on my issue - the issue is not that the wbs doesn't change in the Gantt (I currently call refreshWbs() on task updates), the issue is that those changes are not synced - therefore the data in our DB gets out of sync

I have a virtual wbs prop on my task model

get wbs() {
    return (this.wbsValue as Wbs)?.value;
  }

And then the fields are setup like so,

static get fields() {
    return [
      { name: 'selected', persist: false, defaultValue: false },
      'description',
      'teamUuid',
      { name: 'team', persist: false },
      'roleUuids',
      { name: 'roles', persist: false },
      'locked',
      'isCritical',
      'ownerUsernames',
      { name: 'owners', persist: false },
      'phase',
      { name: 'valueDrivers', persist: false },
      { name: 'opsNorms', persist: false },
      'isNonIntegratedRisk',
      { name: 'wbs', alwaysWrite: true },
      { name: 'depth', alwaysWrite: true },
      'link',
      { name: 'taskEditService', persist: false }
    ];
  }

Post by alex.l »

wbsValue field is not persist by default, so it won't be included into changes even if it changed.
Please check this thread viewtopic.php?f=52&t=19028&p=94172#p94172

All the best,
Alex


Post by chrisb »

Hey Alex,

I've just tried setting wbsValue to persist - but I'm still not seeing changes in the sync to update children of updated sibling tasks.

It sounds like this might be a bug.

Given the below tasks;
Image

If I add a subtask to Test Task Parent;
Image

You can see that all tasks below Test Task Parent get their WBS updated. However the sync data does not include an update for the Grandchild task to update it's WBS from 2.1.2.1 to 2.1.3.1
Image

Cheers,
Chris


Post by alex.l »

Could you please check if it is in added section?
I was not able to reproduce the problem, but I got the situation when wbs code has been changed in just added task and that task was placed to added section.

All the best,
Alex


Post by chrisb »

The only task in the added section is the one I added - i.e. 2.1.1 - New task 7, there are no changes to 2.1.3.1.


Post by alex.l »

Still don't see it in our app. Maybe you can provide some steps to reproduce it, check if you have custom setting in you Gantt? Could you share it, please, as well as your task model?
Would be great to have a test case if possible.

All the best,
Alex


Post by chrisb »

I've reproduced the issue in the advanced example.
The changes I made is to add a sync url to the transport, and set the project to autoSync, and persist the wbsValue.
Image
Image

I then added a task above the first task - thereby changing all subsequent wbs numbers

Before:
Image

After:
Image

The only changes were the task being added, and a parentIndex change on the first task, there are no changes for every other task that had it's WBS changed.
Image

Hope this helps.


Post by alex.l »

Thank you for steps to reproduce, I was using totally different scenario.
Reproduced, here is a ticket: https://github.com/bryntum/support/issues/3572

All the best,
Alex


Post Reply