From f77cb5f5b166c2dc55661e76917b05def07c3810 Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Thu, 27 Jun 2024 15:00:15 +0200 Subject: [PATCH] FEATURE: Refactor edit template to AFX --- .../Controller/WorkspaceController.php | 4 +- Neos.Workspace.Ui/Configuration/Views.yaml | 2 +- .../Components/WorkspaceTableRow.fusion | 15 +- .../Private/Fusion/Views/Edit.fusion | 147 ++++++++++++++++++ .../Resources/Private/Fusion/Views/New.fusion | 4 +- .../Private/Templates/Workspace/Edit.html | 65 -------- .../Private/Translations/en/Main.xlf | 3 + 7 files changed, 166 insertions(+), 74 deletions(-) create mode 100644 Neos.Workspace.Ui/Resources/Private/Fusion/Views/Edit.fusion delete mode 100644 Neos.Workspace.Ui/Resources/Private/Templates/Workspace/Edit.html diff --git a/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php b/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php index 188158e0251..d221fa3ebfd 100644 --- a/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php +++ b/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php @@ -288,14 +288,14 @@ public function editAction(WorkspaceName $workspaceName): void * @param WorkspaceName $workspaceName * @param WorkspaceTitle $title Human friendly title of the workspace, for example "Christmas Campaign" * @param WorkspaceDescription $description A description explaining the purpose of the new workspace - * @param string $workspaceOwner Id of the owner of the workspace + * @param string|null $workspaceOwner Id of the owner of the workspace * @return void */ public function updateAction( WorkspaceName $workspaceName, WorkspaceTitle $title, WorkspaceDescription $description, - ?string $workspaceOwner + ?string $workspaceOwner = null ): void { $contentRepositoryId = SiteDetectionResult::fromRequest($this->request->getHttpRequest()) ->contentRepositoryId; diff --git a/Neos.Workspace.Ui/Configuration/Views.yaml b/Neos.Workspace.Ui/Configuration/Views.yaml index 2371306a213..dccdf779490 100644 --- a/Neos.Workspace.Ui/Configuration/Views.yaml +++ b/Neos.Workspace.Ui/Configuration/Views.yaml @@ -5,7 +5,7 @@ - 'resource://Neos.Workspace.Ui/Private/Partials' - 'resource://Neos.Neos/Private/Partials' -- requestFilter: 'isPackage("Neos.Workspace.Ui") && isController("Workspace") && isFormat("html") && (isAction("index") || isAction("new"))' +- requestFilter: 'isPackage("Neos.Workspace.Ui") && isController("Workspace") && isFormat("html") && (isAction("index") || isAction("new") || isAction("edit"))' viewObjectName: 'Neos\Fusion\View\FusionView' options: fusionPathPatterns: diff --git a/Neos.Workspace.Ui/Resources/Private/Fusion/Components/WorkspaceTableRow.fusion b/Neos.Workspace.Ui/Resources/Private/Fusion/Components/WorkspaceTableRow.fusion index 9726e28edf8..ca221982d63 100644 --- a/Neos.Workspace.Ui/Resources/Private/Fusion/Components/WorkspaceTableRow.fusion +++ b/Neos.Workspace.Ui/Resources/Private/Fusion/Components/WorkspaceTableRow.fusion @@ -50,6 +50,12 @@ prototype(Neos.Workspace.Ui:Component.WorkspaceTableRow) < prototype(Neos.Fusion workspace = ${props.workspaceName} } } + editWorkspaceUri = Neos.Fusion:UriBuilder { + action = 'edit' + arguments { + workspaceName = ${props.workspaceName} + } + } } renderer = afx` @@ -81,15 +87,14 @@ prototype(Neos.Workspace.Ui:Component.WorkspaceTableRow) < prototype(Neos.Fusion {I18n.translate('table.column.action.show', 'Show', [], 'Main', 'Neos.Workspace.Ui')} - +