-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix issue with newly created template under an existing one #19669
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
Fix issue with newly created template under an existing one #19669
Conversation
nielslyngsoe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declining this for now, seems like another solution should be found. :-)
...raco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where newly created templates under an existing template would lose their master template relationship and appear to have unsaved changes. The fix ensures that when creating a template with a parent, the master template relationship is properly established and maintained.
Key changes:
- Modified template creation to properly pass master template information during scaffolding
- Updated type annotations for better type safety
- Fixed the logic for setting master template relationships in newly created templates
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| template-workspace.context.ts | Updates template creation logic to properly handle master template relationships and improves type safety |
| template-detail.server.data-source.ts | Ensures master template preset is properly applied during template scaffolding |
...raco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts
Outdated
Show resolved
Hide resolved
…an existing editor
also refactor function a bit
nielslyngsoe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super duper, its work as expected now!
Did notice the Discard Changes dialog, but we agreed this is another case. so that will be handled elsewhere.
Prerequisites
Resolves: #19632
Description
The linked issue illustrates problems when creating a template under an existing one - the newly created template loses it's updates and appears to have changes when it doesn't.
The problem looks to occur when we attempt to load the newly created template and we don't get the data returned from the API, rather the originally scaffolded content.
This Pull Request makes it possible to:
Testing
Create a template under an existing one, and verify the master template is correctly identified for subsequent editing.
This item has been added to our backlog AB#55723