Skip to content

Conversation

@AndyButland
Copy link
Contributor

@AndyButland AndyButland commented Jul 4, 2025

Prerequisites

  • I have added steps to test this contribution in the description below

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:

  • Create a new template at the root (the UI will show "Master Template: None")
  • Create a new template under another template (the UI will show "Master Template: ")
  • Change the existing master template from/to NULL (root) or an existing one

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

Copilot AI review requested due to automatic review settings July 4, 2025 08:27

This comment was marked as outdated.

Copy link
Member

@nielslyngsoe nielslyngsoe left a 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. :-)

@nielslyngsoe nielslyngsoe added the state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks label Aug 14, 2025
Copy link
Contributor

Copilot AI left a 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

@nielslyngsoe nielslyngsoe enabled auto-merge (squash) September 3, 2025 13:16
Copy link
Member

@nielslyngsoe nielslyngsoe left a 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.

@nielslyngsoe nielslyngsoe merged commit f5322b5 into main Sep 3, 2025
27 checks passed
@nielslyngsoe nielslyngsoe deleted the v16/bugfix/fix-post-create-template-with-master-issues branch September 3, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creating a template under a template does not save properly

4 participants