From 877315fe6b1b2be13db156761007b5fb184d3bda Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Tue, 3 Dec 2024 17:03:41 +0100 Subject: [PATCH] TASK: Introduce module wrapper for workspace module views --- .../Fusion/Common/ModuleWrapper.fusion | 4 ++ .../Features/Review/Actions/Review.fusion | 68 +++++++++---------- .../Review/Components/ReviewActions.fusion | 2 +- .../Features/Workspace/Actions/Index.fusion | 16 ++--- .../Components/WorkspaceTableRow.fusion | 11 +-- 5 files changed, 43 insertions(+), 58 deletions(-) diff --git a/Neos.Workspace.Ui/Resources/Private/Fusion/Common/ModuleWrapper.fusion b/Neos.Workspace.Ui/Resources/Private/Fusion/Common/ModuleWrapper.fusion index bec875ad9b..ff99d993d3 100644 --- a/Neos.Workspace.Ui/Resources/Private/Fusion/Common/ModuleWrapper.fusion +++ b/Neos.Workspace.Ui/Resources/Private/Fusion/Common/ModuleWrapper.fusion @@ -2,6 +2,9 @@ # Wrapper to be used for each "full" view like "index" or "review" # prototype(Neos.Workspace.Ui:Component.ModuleWrapper) < prototype(Neos.Fusion:Component) { + /// array + flashMessages = ${[]} + /// string content = '' @@ -16,5 +19,6 @@ prototype(Neos.Workspace.Ui:Component.ModuleWrapper) < prototype(Neos.Fusion:Com > {props.content} +
` } diff --git a/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Review/Actions/Review.fusion b/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Review/Actions/Review.fusion index 1a5beef3b9..964ab2a0b2 100644 --- a/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Review/Actions/Review.fusion +++ b/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Review/Actions/Review.fusion @@ -1,11 +1,11 @@ Neos.Workspace.Ui.WorkspaceController.review = Neos.Fusion:Component { - ///todo Neos\ContentRepository\Core\Projection\Workspace\Workspace + /// string selectedWorkspaceName = ${selectedWorkspaceName} /// string selectedWorkspaceLabel = ${selectedWorkspaceLabel} - + /// \Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName baseWorkspaceName = ${baseWorkspaceName} - + /// string baseWorkspaceLabel = ${baseWorkspaceLabel} /// bool canPublishToBaseWorkspace = ${canPublishToBaseWorkspace} @@ -21,28 +21,23 @@ Neos.Workspace.Ui.WorkspaceController.review = Neos.Fusion:Component { i18n = ${I18n.id('').source('Main').package('Neos.Workspace.Ui')} renderer = afx` -
- - - -
-
- - {props.i18n.id('workspaces.unpublishedChanges').arguments([selectedWorkspaceLabel]).translate()} - + +
+
+ + {props.i18n.id('workspaces.unpublishedChanges').arguments([selectedWorkspaceLabel]).translate()} + - + {props.i18n.id('workspaces.reviewWorkspace.disabled').arguments([selectedWorkspaceLabel]).translate()}
- - -
-
-
-
- ` + + + + + + ` } diff --git a/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Review/Components/ReviewActions.fusion b/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Review/Components/ReviewActions.fusion index b466eaaf74..dd3625572a 100644 --- a/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Review/Components/ReviewActions.fusion +++ b/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Review/Components/ReviewActions.fusion @@ -58,7 +58,7 @@ prototype(Neos.Workspace.Ui:Component.ReviewActions) < prototype(Neos.Fusion:Com attributes.hx-get={private.indexWorkspaceUri} attributes.hx-replace-url={private.indexWorkspaceUri} attributes.hx-select="#workspace-module-content" - attributes.hx-target="#workspaceReview" + attributes.hx-target="#workspace-module-content" attributes.hx-swap="outerHTML" /> diff --git a/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Actions/Index.fusion b/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Actions/Index.fusion index 69b56210ef..7dce63756b 100644 --- a/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Actions/Index.fusion +++ b/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Actions/Index.fusion @@ -3,8 +3,6 @@ Neos.Workspace.Ui.WorkspaceController.index = Neos.Fusion:Component { userWorkspaceName = ${userWorkspaceName} /// Neos\Workspace\Ui\ViewModel\WorkspaceListItems workspaceListItems = ${workspaceListItems} - /// array - flashMessages = ${flashMessages} newAction = Neos.Fusion:UriBuilder { action = 'new' @@ -18,15 +16,10 @@ Neos.Workspace.Ui.WorkspaceController.index = Neos.Fusion:Component { renderer = Neos.Fusion:Match { @subject = ${request.format} @default = afx` -
- - - -
+
-
-
+ ` htmx = afx` diff --git a/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Components/WorkspaceTableRow.fusion b/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Components/WorkspaceTableRow.fusion index 93a6e525d5..994d7c6d05 100644 --- a/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Components/WorkspaceTableRow.fusion +++ b/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Components/WorkspaceTableRow.fusion @@ -55,13 +55,7 @@ prototype(Neos.Workspace.Ui:Component.WorkspaceTableRow) < prototype(Neos.Fusion } reviewWorkspaceUri = Neos.Fusion:ActionUri { action = 'review' - format = 'htmx' - arguments { - workspace = ${props.workspaceListItem.name} - } - } - reviewWorkspaceFullUri = Neos.Fusion:ActionUri { - action = 'review' + format = 'html' arguments { workspace = ${props.workspaceListItem.name} } @@ -137,8 +131,9 @@ prototype(Neos.Workspace.Ui:Component.WorkspaceTableRow) < prototype(Neos.Fusion title={private.i18n.id(props.workspaceListItem.pendingChanges.total ? 'workspaces.reviewWorkspace' : 'workspaces.reviewWorkspace.noChanges').arguments([props.workspaceListItem.title])} attributes.disabled={props.workspaceListItem.pendingChanges.total == 0} attributes.hx-get={private.reviewWorkspaceUri} - attributes.hx-replace-url={private.reviewWorkspaceFullUri} + attributes.hx-replace-url={private.reviewWorkspaceUri} attributes.hx-target="#workspace-module-content" + attributes.hx-select="#workspace-module-content" attributes.hx-swap="outerHTML" />