Skip to content

FEATURE: Create node template definition yaml dump from node subtree#40

Merged
Sebobo merged 13 commits intomasterfrom
feature/37-nodeTemplateYamlDumpFromNodeSubtree
Jun 1, 2023
Merged

FEATURE: Create node template definition yaml dump from node subtree#40
Sebobo merged 13 commits intomasterfrom
feature/37-nodeTemplateYamlDumpFromNodeSubtree

Conversation

@mhsdesign
Copy link
Contributor

@mhsdesign mhsdesign commented May 22, 2023

flow nodeTemplate:createFromNodeSubtree <nodeIdentifier>

closes: #37

also adds a first near-e2e test ;) #33

when creating a more complex node template, to create multiple pages and content elements, it can be helpful to take the current node subtree as reference. For this case a command controller would be great.

flow nodeTemplate:createFromNodeSubtree 136a646c-b2d5-4475-8e24-b25727aa7913 --workspaceName=live
Your.NodeType:
  options:
    template:
      childNodes:
        page0:
          name: page-0
          type: Foo.Bar:Page
          properties:
            title: 'my page'
            uriPathSegment: my-page
            # someReference -> Reference of NodeTypes (Neos.Neos:Document) with value Node(13f5e86b-7b0e-4a7f-9a8a-af6bdf1c1913)
          childNodes:
            page0:
              name: page-0
              type: Foo.Bar:Pag
              properties: ...
              childNodes:
                 mainContentCollection:
                   name: main
                   childNodes: ...

@mhsdesign mhsdesign force-pushed the feature/37-nodeTemplateYamlDumpFromNodeSubtree branch from 4e61058 to 68f0025 Compare May 22, 2023 14:24
mhsdesign added 3 commits May 22, 2023 22:21
Also improve dumper
This is helpful in case you have many properties, and some properties have say names evolved historically
Copy link
Member

@Sebobo Sebobo left a comment

Choose a reason for hiding this comment

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

Great change, left some comments

Copy link
Member

@Sebobo Sebobo left a comment

Choose a reason for hiding this comment

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

Works great ❤️ but can you add instructions to the readme?

Copy link
Contributor

@lorenzulrich lorenzulrich left a comment

Choose a reason for hiding this comment

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

Thanks, great work!

* @param string $workspaceName
* @return void
*/
public function fromSubtreeCommand(string $startingNodeId, string $workspaceName = 'live'): void
Copy link
Contributor

Choose a reason for hiding this comment

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

For my taste, a command name should contain a verb, e.g. createConfigurationForSubtree. Furthermore, "Subtree" is a term that is not really known to integrators. In Docs and ReadTheDocs, there are three mentions of this term (one of the referring to Git subtree), so I suggest to use a more common term.
Idea: dumpConfigurationForNodeTree

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi thanks for your review. The naming subtree is taken from the new ESCR, where you can actually get with one sql query the whole subtree:

ContentSubgraphInterface::findSubtree

A subtree will look like this

so i like to keep the name subtree (maybe we can add the prefix node so people understand its node releated?: NodeSubtree)

but i agree that something like a verb could also be a nice addition to the command name:

# original
flow nodeTemplate:fromSubtree <nodeIdentifier>

# your proposal
flow nodeTemplate:createConfigurationForSubtree <nodeIdentifier>

# your other proposal
flow nodeTemplate:dumpConfigurationForNodeTree <nodeIdentifier>

# my idea:
flow nodeTemplate:createFromNodeSubtree <nodeIdentifier>

@Sebobo and me decided for now on nodeTemplate:createFromNodeSubtree

@Sebobo Sebobo merged commit 9042e5a into master Jun 1, 2023
@Sebobo Sebobo deleted the feature/37-nodeTemplateYamlDumpFromNodeSubtree branch June 1, 2023 11:53
mhsdesign added a commit that referenced this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEATURE: Create node template definition yaml dump from node subtree

3 participants