Our state of the art Gantt chart


Post by methode »

Hello all,

ok, I managed to reproduce a small example starting from my project.
You should see the error now.

I'm working on Mac, you can open the project with Visual Studio for Mac.
Once unzipped, the project is under WebofficeTest.

To run the project, under ClientApp folder run:

  • npm install
  • npm start
  • run the vs project from IDE

The main files to check are:

  • ClientApp/src/app/main/progetti/project-edit/tab-gantt
  • Controllers/GanttController.cs

For steps to reproduce, please check the opening post.

Code works fine if you add resource from the grid.

If you need to, feel free to ask for further infos about the project.

PS. in the lib code, at the error line, the console.log is mine.

Thanks a lot.

Attachments
web-office-test.zip
(19.04 MiB) Downloaded 154 times

Post by saki »

I have followed your instructions above (and from the first post). Also, not having VS and the api server that it probably runs, I have changed the project config to:

const project = new ProjectModel({
    transport: {
        sync: {
            url: 'assets/data/success.json',
            method: 'GET',
            requestConfig: {
                headers: {
                    'Content-Type': 'application/json; charset=utf-8'
                }
            }
        },

With that I cannot reproduce the issue:

gantt-sync.gif
gantt-sync.gif (2.4 MiB) Viewed 1857 times

Can you reproduce the issue also outside of VS with the above setup? Or, is there anything I'm doing different than you?


Post by methode »

Hello Saki,

yes, there is one more step. After insert - it works as expected - double click the task and check js console.

Thanks


Post by saki »

Hmm, I still don't get any error. So I'm thinking if it is not related to what the server returns. I only return {"success":true} (which is also reason why the resource is actually not assigned). You could look in this direction and if not successful then post here the json returned by your server.

Also, did you check with web-office-test.zip you posted above with my modifications? If your side manifests the error even then we need to look elsewhere.

add-resource.gif
add-resource.gif (2.32 MiB) Viewed 1840 times

Post by methode »

Hello Saki,

ok I see. Well it was fine if you could test the solution I posted.
It is the real scenario, where I need the requestId and in sync data.

Here it is the JSON response:


{
	"success": true,
	"requestId": 15924879107772,
	"assignments": {
		"rows": [{
			"id": 3000,
			"event": 1000,
			"resource": 1,
			"units": 100,
			"sysPhantomId": "_generatedClassDefEx1"
		}]
	}
}

I also recorded a video, please see attachment.

Let's hope to find a solution, on the contrary I had the only way to change source code.
The issue is blocking my development.

Thanks a lot

Attachments
ezgif.com-gif-maker.mov.zip
(1.29 MiB) Downloaded 144 times

Post by methode »

Hello,

any update?

Thank you


Post by saki »

Is it possible that you might have forgotten to uncomment taskModelClass? It works for me:

add-resource.gif
add-resource.gif (3.97 MiB) Viewed 1826 times

Post by methode »

Hello Saki,

the taskModelClass is commented because not use in test case.

I decommented it and defined WebofficeTaskModel this way:


class WebofficeTaskModel extends TaskModel {
}

so code becomes:


class WebofficeTaskModel extends TaskModel {
}

const project = new ProjectModel({
    transport: {
        load: {
            url: '/assets/data/launch-saas.json',
            paramName: 'q',
            requestConfig: {
                headers: {
                    'Content-Type': 'application/json; charset=utf-8'
                }
            }
        },
        sync: {
            url: '/api/gantt/sync',
            requestConfig: {
                headers: {
                    'Content-Type': 'application/json; charset=utf-8'
                }
            }
        }
    },
    taskModelClass: WebofficeTaskModel,
    phantomIdField: 'sysPhantomId',
    autoLoad: false,
    autoSync: true,
    tasksData: []
});

no luck, this way I continue to get error.

The only way is to - remove - sysPhantomId field from response as you posted.
In this case code works - but - in contrast with documentation here:

https://www.bryntum.com/docs/gantt/#guides/crud_manager.md

Sync request structure paragraph, json code.

Sorry, can't see in video how you defined WebofficeTaskModel.

Am I wrong or missing anything?

Is it possible to test your code project?

Thanks for support


Post by pmiklashevich »

Hello,

Thanks for your patience! I was able to reproduce the issue! The key element was the video you attached few posts above. Ticket here: https://github.com/bryntum/support/issues/968

I reproduced the issue just by repeating your steps in our PHP demo without any demo modifications. Please see how I described steps in the ticket. Basically that's what we expect to have as a report from our users. Link to one of our examples, steps to reproduce, error stacktrace. If example has to be modified, need to list all files and modifications to be applied. If lots of them, just attach a zip with modified example.

Best regards,
Pavel

Pavlo Miklashevych
Sr. Frontend Developer


Post by methode »

Thank you all, we're moving forward!


Post Reply