diff --git a/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php b/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php index 52a3f1c32b..f61c98ad7e 100644 --- a/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php +++ b/Neos.Workspace.Ui/Classes/Controller/WorkspaceController.php @@ -156,15 +156,13 @@ public function indexAction(string $sortBy = 'title', bool $sortAscending = true $this->view->assign('displayContentRepositorySelector', $numberOfContentRepositories > 1); $contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId); - $workspaceListItems = $this->getWorkspaceListItems($contentRepository, $currentUser); + $workspaceListItems = $this->getWorkspaceListItems($contentRepository); if ($sortBy === 'title') { $workspaceListItems = $workspaceListItems->sortByTitle($sortAscending); } $this->view->assignMultiple([ - // todo remove userWorkspaceName field and add distinction to $workspaceListItems as $workspaceListItems->userWorkspace and $workspaceListItems->otherWorkspaces or something. - 'userWorkspaceName' => $this->workspaceService->getPersonalWorkspaceForUser($contentRepositoryId, $currentUser->getId())->workspaceName->value, 'workspaceListItems' => $workspaceListItems, 'flashMessages' => $this->controllerContext->getFlashMessageContainer()->getMessagesAndFlush(), 'sortAscending' => $sortAscending, @@ -422,10 +420,9 @@ public function updateAction( ) ); - $workspaceListItems = $this->getWorkspaceListItems($contentRepository, $currentUser); + $workspaceListItems = $this->getWorkspaceListItems($contentRepository); $this->view->assignMultiple([ - 'userWorkspaceName' => $this->workspaceService->getPersonalWorkspaceForUser($contentRepositoryId, $currentUser->getId())->workspaceName->value, 'workspaceListItems' => $workspaceListItems, ]); } @@ -433,9 +430,6 @@ public function updateAction( /** * Delete a workspace * - * TODO: Add force delete option to ignore unpublished nodes or dependent workspaces, the later should be rebased instead - * - * @param WorkspaceName $workspaceName A workspace to delete * @throws StopActionException */ public function deleteAction(WorkspaceName $workspaceName): void @@ -499,7 +493,7 @@ public function deleteAction(WorkspaceName $workspaceName): void ); $this->addFlashMessage($message, '', Message::SEVERITY_WARNING); $this->throwStatus(403, 'Workspace has unpublished nodes'); - // delete workspace on POST -> todo make this more FLOW-ig by possibly having a DeleteController with post() and get() _or_ by having deleteAction_post and deleteAction_get?? Or a separate action? + // delete workspace on POST -> TODO: Split this into 2 actions like the create or edit workflows } elseif ($this->request->getHttpRequest()->getMethod() === 'POST') { $this->workspaceService->deleteWorkspace($contentRepositoryId, $workspaceName); @@ -967,15 +961,11 @@ protected function renderContentChanges( $originalPropertyValue = ($originalNode?->getProperty($propertyName)); if ($changedPropertyValue === $originalPropertyValue) { - // TODO && !$changedNode->isRemoved() continue; } if (!is_object($originalPropertyValue) && !is_object($changedPropertyValue)) { $originalSlimmedDownContent = $this->renderSlimmedDownContent($originalPropertyValue); - // TODO $changedSlimmedDownContent = $changedNode->isRemoved() - // ? '' - // : $this->renderSlimmedDownContent($changedPropertyValue); $changedSlimmedDownContent = $this->renderSlimmedDownContent($changedPropertyValue); $diff = new Diff( @@ -1223,38 +1213,9 @@ public function getModuleLabel(string $id, array $arguments = [], mixed $quantit protected function getWorkspaceListItems( ContentRepository $contentRepository, - User $userWorkspaceOwner, ): WorkspaceListItems { $workspaceListItems = []; $allWorkspaces = $contentRepository->findWorkspaces(); - // todo this throws "No workspace is assigned to the user with id" for the case user logs first into workspace module before workspace exists!!! - $userWorkspace = $this->workspaceService->getPersonalWorkspaceForUser($contentRepository->id, $userWorkspaceOwner->getId()); - $userWorkspaceMetadata = $this->workspaceService->getWorkspaceMetadata($contentRepository->id, $userWorkspace->workspaceName); - $workspaceRoleAssignments = $this->workspaceService->getWorkspaceRoleAssignments( - $contentRepository->id, - $userWorkspace->workspaceName - ); - $userWorkspacesPermissions = $this->authorizationService->getWorkspacePermissions( - $contentRepository->id, - $userWorkspace->workspaceName, - $this->securityContext->getRoles(), - $userWorkspaceOwner->getId() - ); - - // add user workspace first - $workspaceListItems[$userWorkspace->workspaceName->value] = new WorkspaceListItem( - $userWorkspace->workspaceName->value, - $userWorkspaceMetadata->classification->value, - $userWorkspace->status->value, - $userWorkspaceMetadata->title->value, - $userWorkspaceMetadata->description->value, - $userWorkspace->baseWorkspaceName?->value, - $this->computePendingChanges($userWorkspace, $contentRepository), - !$allWorkspaces->getDependantWorkspaces($userWorkspace->workspaceName)->isEmpty(), - $userWorkspaceOwner->getLabel(), - $userWorkspacesPermissions, - $workspaceRoleAssignments, - ); // add other, accessible workspaces foreach ($allWorkspaces as $workspace) { @@ -1272,7 +1233,6 @@ protected function getWorkspaceListItems( continue; } - // TODO use owner/WorkspaceRoleAssignment? // TODO: If user is allowed to edit child workspace, we need to at least show the parent workspaces in the list if ($workspacesPermissions->read === false) { continue; 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 8b40bf735f..0f5a3e25a9 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 @@ -1,6 +1,4 @@ Neos.Workspace.Ui.WorkspaceController.index = Neos.Fusion:Component { - /// string - userWorkspaceName = ${userWorkspaceName} /// Neos\Workspace\Ui\ViewModel\WorkspaceListItems workspaceListItems = ${workspaceListItems} /// array @@ -26,7 +24,6 @@ Neos.Workspace.Ui.WorkspaceController.index = Neos.Fusion:Component {
` diff --git a/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Components/WorkspaceTable.fusion b/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Components/WorkspaceTable.fusion index 6fce74c637..0b94bcfa8b 100644 --- a/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Components/WorkspaceTable.fusion +++ b/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Components/WorkspaceTable.fusion @@ -2,8 +2,6 @@ # Renders a list of workspaces # prototype(Neos.Workspace.Ui:Component.WorkspaceTable) < prototype(Neos.Fusion:Component) { - /// string - userWorkspaceName = null /// \Neos\Workspace\Ui\ViewModel\WorkspaceListItems workspaceListItems = ${{}} /// string @@ -48,7 +46,6 @@ prototype(Neos.Workspace.Ui:Component.WorkspaceTable) < prototype(Neos.Fusion:Co 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 338f6883e2..287e3402f2 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 @@ -2,8 +2,6 @@ # Renders a single workspace list item # prototype(Neos.Workspace.Ui:Component.WorkspaceTableRow) < prototype(Neos.Fusion:Component) { - /// string - userWorkspaceName = null /// Neos\Workspace\Ui\ViewModel\WorkspaceListItem workspaceListItem = ${[]} /// integer @@ -76,7 +74,7 @@ prototype(Neos.Workspace.Ui:Component.WorkspaceTableRow) < prototype(Neos.Fusion 1}/> {props.workspaceListItem.title} - + ({private.i18n.id('workspaces.workspace.userWorkspace')}) diff --git a/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Components/WorkspaceTreeNode.fusion b/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Components/WorkspaceTreeNode.fusion index 5a2e8f169b..da573e4013 100644 --- a/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Components/WorkspaceTreeNode.fusion +++ b/Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Components/WorkspaceTreeNode.fusion @@ -2,8 +2,6 @@ # Renders a single workspace list item and its subworkspaces # prototype(Neos.Workspace.Ui:Component.WorkspaceTreeNode) < prototype(Neos.Fusion:Component) { - /// string - userWorkspaceName = null /// Neos\Workspace\Ui\ViewModel\WorkspaceListItem workspaceListItem = null /// Neos\Workspace\Ui\ViewModel\WorkspaceListItems @@ -18,14 +16,12 @@ prototype(Neos.Workspace.Ui:Component.WorkspaceTreeNode) < prototype(Neos.Fusion renderer = afx`