mui / mui-toolpad

Toolpad Studio: Low-code admin builder. Open-source and powered by MUI.
https://mui.com/toolpad/
MIT License
815 stars 206 forks source link

it will delete old page while adding new page #2171

Closed JerryWu1234 closed 10 months ago

JerryWu1234 commented 11 months ago

fix #1984 it will delete old page while adding new page

JerryWu1234 commented 11 months ago

image

Janpot commented 11 months ago
JerryWu1234 commented 11 months ago
  • Would it be possible to do this similarly to deletePage and just rename the page folder on the file system?

I totally agree, and I will follow your idea. and I think it relates to the saveDom api

JerryWu1234 commented 11 months ago
  • Would it be possible to do this similarly to deletePage and just rename the page folder on the file system?
  • This needs a test

@Janpot we can't only rename it because the user maybe renames the page and changes the content.

JerryWu1234 commented 11 months ago

image image

@Janpot sorry I'm not good at playwright but I tried a lot of methods. unfortunately, I can't run the unit test in my local. I don't know why, please help if you are available.

image

Janpot commented 11 months ago

I've added a guide on how to run integration tests locally. Please take a look and let me know whether this helps you further: https://github.com/mui/mui-toolpad/pull/2192

JerryWu1234 commented 11 months ago

I've added a guide on how to run integration tests locally. Please take a look and let me know whether this helps you further: #2192

I'm sorry for replying late because I recently went on vacation.

JerryWu1234 commented 11 months ago

I've added a guide on how to run integration tests locally. Please take a look and let me know whether this helps you further: #2192

image

Some parts of the unit test will not succeed but some part not. I used both methods the dev mode and production mode. Still, I got the same result, although I followed your steps.

JerryWu1234 commented 11 months ago

@Janpot

image

maybe I miss some part of the stuff?

Janpot commented 11 months ago

parts of the unit test will not succeed but some part not. I used both methods the dev mode and production mode. Still, I got the same result, although I followed your steps.

You are right, I messed up the environment variable. The correct command is:

TOOLPAD_NEXT_DEV=1 yarn test:integration --project chromium

https://github.com/mui/mui-toolpad/pull/2199

JerryWu1234 commented 11 months ago

parts of the unit test will not succeed but some part not. I used both methods the dev mode and production mode. Still, I got the same result, although I followed your steps.

You are right, I messed up the environment variable. The correct command is:

TOOLPAD_NEXT_DEV=1 yarn test:integration --project chromium

2199

image

Better now. But it has also some errors in it.

JerryWu1234 commented 11 months ago

parts of the unit test will not succeed but some part not. I used both methods the dev mode and production mode. Still, I got the same result, although I followed your steps.

You are right, I messed up the environment variable. The correct command is:

TOOLPAD_NEXT_DEV=1 yarn test:integration --project chromium

2199

@Janpot

Janpot commented 11 months ago

I works for me this way.

You might have to go dig deeper into debugging this a bit more yourself

JerryWu1234 commented 11 months ago

@Janpot

image

this is the log. No matter which branch you choose, the result is the same. it seems that I can't access the website

Janpot commented 11 months ago

I've seen this happen some time on the first run. Try to verify whether it works by running the integration tests in production mode. I'll increase the timeout for this use case in https://github.com/mui/mui-toolpad/pull/2222

JerryWu1234 commented 11 months ago

thanks. I'll try it when it is merged

JerryWu1234 commented 11 months ago

I've seen this happen some time on the first run. Try to verify whether it works by running the integration tests in production mode. I'll increase the timeout for this use case in #2222

@Janpot it's fine for Pro, image

But it is still wrong in dev image

JerryWu1234 commented 11 months ago

@Janpot I added the unit test.

JerryWu1234 commented 11 months ago

I've seen this happen some time on the first run. Try to verify whether it works by running the integration tests in production mode. I'll increase the timeout for this use case in #2222

@Janpot it's fine for Pro, image

But it is still wrong in dev image

@Janpot Waiting for a while, everything will be better if you run yarn run dev But tests can pass sometimes, sometimes not. However, at least it can’t take effect for writing test.

JerryWu1234 commented 11 months ago

thanks again

JerryWu1234 commented 11 months ago

image

@Janpot are There only four people? LOL

prakhargupta1 commented 11 months ago

@JerryWu1234 We started the Discord server last week and haven't shared it with anyone yet.

JerryWu1234 commented 11 months ago

@JerryWu1234 We started the Discord server last week and haven't shared it with anyone yet.

I'm just curious about whether you will discuss all their contributed problems on the Discord server in the future?

JerryWu1234 commented 10 months ago

@Janpot I done。help check

JerryWu1234 commented 10 months ago

@Janpot I added a test for what you said. help check thanks

JerryWu1234 commented 10 months ago

I added a test that compares the previous node with the new node created, to test NodeNameEditor.tsx。 hopefully, I get it right

JerryWu1234 commented 10 months ago

image

Janpot commented 10 months ago

Ok, we have integration tests, we can always improve the implementation later. I've added the following updates:

Thanks for this fix, we can merge soon