Our state of the art Gantt chart


Post by ahmad.siddique »

kronaemmanuel wrote: Fri Jan 19, 2024 12:02 pm

Hey Ahmad,

I've opened an issue on github to track this: https://github.com/bryntum/support/issues/8302. Please subscribe to the issue for more updates.

Regards,
Krona

Thank you.
I noticed the same behavior for task drag and task end date change.
I am also attaching the video
https://www.loom.com/share/0715da47f8624061820017aaef9095d7


Post by ghulam.ghous »

Hi Ahmad,

Created a ticket for this too, we will investigate and fix it https://github.com/bryntum/support/issues/8307.

Regards,
Ghous


Post by ahmad.siddique »

Hi everyone.

I am facing a new challenge in undo redo.

When I outdent a task in the Gantt chart one transaction is saved in STM. In that one transaction, it has queue Property which has 4 items in it.

I want to fetch the item that caused the transaction.

For example:
I Outdent a task. This will result in a transaction with 4 items in the queue

Screenshot 2024-03-20 at 2.36.32 PM.png
Screenshot 2024-03-20 at 2.36.32 PM.png (194.98 KiB) Viewed 86 times

From these 4 items, "I know" the item at index 1 (Insert Child Action) is the actual item, the other three are just a reaction of outdenting the task (updating the startDate / endDate of Parent etc).

now there is no way I could distinguish between these 4 items because I want to know what was the actual reason behind the transaction from these 4 items.

There should be a flag or a property (either true or false) from which I can know that this was the action that I performed resulting in this transaction.

STM Object :

Screenshot 2024-03-20 at 2.35.37 PM.png
Screenshot 2024-03-20 at 2.35.37 PM.png (135.62 KiB) Viewed 86 times

Post by ahmad.siddique »

I have one more issue.

When assigning a resource to a task and pressing undo/redo it only gives the resources being added or removed in the modelList prop.

there is no oldData prop to compare the changes in the queue.

I have to send the request to the backend with updated assigned resources and because there is no oldData to compare I cannot generate a new list with updated resources.

Screenshot 2024-03-20 at 3.39.54 PM.png
Screenshot 2024-03-20 at 3.39.54 PM.png (231.32 KiB) Viewed 78 times

Post by nickolay »

@ahmad.siddique Hi,

I want to fetch the item that caused the transaction.

I guess, in this particular case, you can check the 1st action that updates the parent of the event InsertChildAction - that might be the source of the outdent transaction.

However, what is your overall goal for this? Thing is, the stm queue, as you already noticed, reflects the changes in the dataset, but it does not reflects the source of changes (user input). This is by design and it serves the existing purposes well. If you need to implement something specific, perhaps that can be done in the different way, or we may be adding the markers to the stm actions as you suggested, but need to understand the bigger picture first.

I have one more issue.

Please start a separate thread for it - that will help to keep the conversation focused.


Post by ahmad.siddique »

Hi Nick,

The bigger picture here is that I only need to send requests to the backend for only the functionality I perform. I do not want to be sending requests for every change in the queue.

Sending a request for every change in the queue will create a lot of load on the backend server and I don't need that.

As you said

source of changes (user input)

should have some flag with it to distinguish it from other items in the queue.


Post by nickolay »

What about other cases when some change triggers changes in the dependent data? For example, when you change percent done of some task, the percent done of its parents will be changed, when you move some task - it successors will be moved as well, etc.

For this scenarios, do you also plan to only send the initial user input to the server? Do you perform the data changes propagation on the server?


Post by ahmad.siddique »

Yes, I am handling all the changes of dependent data on the backend. that is why I only need to send the cause of change, not the reactions.


Post by nickolay »

Ok, I see. We'll discuss internally what can be done here.

In the meantime, please try analyzing the first InsertChildAction in the transaction.


Post by nickolay »

We have this mechanism (marking user input as such, to distinguish it from dependent changes) in the development already. It should appear in the 6.0.0 release (tentatively scheduled for April). It will be experimental and private (undocumented) API initially, but we can tweak it, based on your feedback and may be make public. Created a ticket: https://github.com/bryntum/support/issues/8845 Stay tuned.

In the meantime, you can also do the following:

  • Override the finalizeCommitHook method of the ProjectModel
  • By the time it is called, the actions, recorded by the STM generally represents the user input and you can mark them as such:
        // new stm method from the development branch
        markCurrentTransactionContentUserInput() {
            if (this.isRecording) {
                const
                    transaction = this[TRANSACTION_PROP],
                    queue = transaction[ACTION_QUEUE_PROP];
    
                queue.forEach(action => action.isUserInput = true);
            }
        }
    Then, you can filter the actions based on the isUserInput flag. Hope that helps.

This, however, probably won't work specifically for indent/outdentTask case - as it performs a batch of parentEvent changes in one go, but should work for other cases, like percentDone change, task move etc. For indent/oudent you can also check the indent/outdent methods of the TaskStore, possibly overriding them.


Post Reply