Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Rename file system file #1391

Merged
merged 36 commits into from Apr 2, 2024
Merged

Conversation

madsrasmussen
Copy link
Contributor

@madsrasmussen madsrasmussen commented Mar 6, 2024

This PR fixes renaming a file system file: Script, Partial View, and Stylesheet:

How to test:

  • Rename a file through the entity action
  • Make sure the tree is updated correctly.

Caution

Breaking changes

Rename of kind
Entity Action rename kind is made specific for server files and renamed to renameServerFile

Move event class to another module
UmbRequestReloadStructureForEntityEvent moved from @umbraco-cms/backoffice/event module to @umbraco-cms/backoffice/entity-action module because of circular dependency.

@madsrasmussen madsrasmussen marked this pull request as ready for review March 6, 2024 10:48
Copy link
Collaborator

@iOvergaard iOvergaard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I rename a stylesheet, it updates fine in the tree, but the "name" field and URL remain unchanged immediately, so I get 404 after refreshing the browser:

image

@iOvergaard
Copy link
Collaborator

When I rename a script, it doesn't autopopulate the "new name" field like it does with stylesheets and I have the same problem here as stylesheets where the URL doesn't change:

image

@madsrasmussen
Copy link
Contributor Author

This is ready for a second review.

  • I have fixed the issue where the name input wasn't correctly populated.
  • The problem with reloading is a bit trickier to fix. I have made a temporary solution that we need to improve on moving forward. This is the same case as If you delete an item you already have open. I have added an observer on the detail data and if it's removed from the store the workspace button is disabled. It won't prevent you from reloading, but you can't try to save it anymore. Ideally, we will have a workspace state that tells the entity is gone, but I think we should look into a solution for all workspaces at once.

Copy link

github-actions bot commented Apr 2, 2024

Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-1391.westeurope.1.azurestaticapps.net

Copy link

github-actions bot commented Apr 2, 2024

Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-1391.westeurope.1.azurestaticapps.net

@iOvergaard iOvergaard merged commit fa6e846 into main Apr 2, 2024
7 checks passed
@iOvergaard iOvergaard deleted the bugfix/rename-file-system-file branch April 2, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants