Giter Site home page Giter Site logo

punktde / editconflictprevention Goto Github PK

View Code? Open in Web Editor NEW
14.0 8.0 3.0 637 KB

Prevents edit conflicts when multiple editors are working on the site by either warn the user or deny editing.

License: MIT License

PHP 74.75% JavaScript 21.98% CSS 3.26%
neoscms editors workspaces

editconflictprevention's Introduction

PunktDe.EditConflictPrevention

Build Status Latest Stable Version Total Downloads License

This package helps preventing edit conflicts when several editors are working on content simultaneously.

Information about changes of the current document in other workspaces

When changes in other workspaces exist on the same document, a warning is displayed in the upper toolbar.

Edit conflict warning Clicking that warning opens a modal, showing a list of changed nodes and where they have been changed. Contact information from Neos Party is displayed to make it easier to communicate.

Edit conflict details

Prevent the editor to do conflicting changes

There are also privilege targets available which prevents editing a document and all containing content nodes when changes in other workspaces are detected. To prevent an editor from editing such pages, add the following privilege configuration to your Policy.yaml

roles:
  'Neos.Neos:AbstractEditor':
    privileges:
      -
        privilegeTarget: 'PunktDe.EditConflictPrevention.EditNodeWithChangesInOtherWorkspaces'
        permission: DENY
      -
        privilegeTarget: 'PunktDe.EditConflictPrevention.EditNodePropertiesWithChangesInOtherWorkspaces'
        permission: DENY

Installation

composer require punktde/editconflictprevention  

Configuration

excludedDocumentTypes: List the document types here, that you like to exclude from detecting conflicts.

editconflictprevention's People

Contributors

andrehoffmann30 avatar c4ll-m3-j4ck avatar crydotsnake avatar daniellienert avatar gjwnc avatar paxuclus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

editconflictprevention's Issues

Nested Changes causes Neos\Flow\Security\Exception\AccessDeniedException

Trying to fetch changes when a new Node is added, which automatically adds ChildNodes (e.g. through NodeTemplates) throws an Exception when trying to get the NodeLabel of the ChildNode.

Verify this by adding a new Node in a Workspace, which adds a ChildNode through options.template.childNodes.

This does not occur, when the ChildNode is manually added into the newly created Node

Unhandled exception caused by invalid workspaces (null)

Our Neos 7.0 instance produces invalid workspaces sometimes (no clue why that happens yet).
Running node:repair from time to time will find these and kindly ask to remove them.

However, while these invalid workspaces exist, EditConflictPrevention seems to have a problem with it:

21-04-29 08:24:57 263 CRITICAL Exception in line 99 of /app/Packages/Framework/Neos.Flow/Classes/ObjectManagement/DependencyInjection/DependencyProxy.php: Argument 2 passed to PunktDe\EditConflictPrevention\Domain\Repository\NodeDataRepository_Original::findChangedSubNodesInOtherWorkspaces() must be an instance of Neos\ContentRepository\Domain\Model\Workspace, null given, called in /app/Packages/Framework/Neos.Flow/Classes/ObjectManagement/DependencyInjection/DependencyProxy.php on line 99 - See also: 20210429082456d08ee1.txt

Allow further edits in private/internal workspaces

The feature this package provides works great with no additional private or internal workspaces in place.

Editing workflows:

  • User workspace => Internal workspace => Live workspace
  • User workspace => Private workspace => Live workspace

Editors publish changes to additional workspaces frequently to share them with the team before publishing to Live. Such workflow is pretty common, I guess. Editing a page in private/internal workspaces twice before publishing to Live is currently not possible (without granting the privileges EditNodeWithChangesInOtherWorkspaces and EditNodePropertiesWithChangesInOtherWorkspaces).

I'd suggest the following defaults:

  • Deny further edits when a change in a User workspace exists
  • Allow edits on pages that already have changes in private/internal workspaces (only if the target workspace matches!) - maybe show an info or warning that there are changes "in progress" for that specific page

Changes are not reliably fetched from the backend

Steps to reproduce:

  1. Change exists for a node in another workspace
  2. Navigate to that node with another user
    -> The red bar is shown denoting that there are changed
  3. Klick on the red bar
    -> nodeHasChangesAction is called and returns true
    -> getChangedNodesAction is not called
    -> List is empty (or shows the changes when the modal was last opened)
  4. reload the host frame
  5. klick on the bar
    -> Correct data is shown

FEATURE: Render notice when Policy blocks editing

I like the way the package work currently but wonder if the editors are not confused, when they can not edit content because the devs configured policies for the blocking case.

WDYT would it is not better to give visual feedback for that case?

Authentication Error that leads to relogin screen

Hello,

Got the hint today as I did not know the package, and so I was happy and installed it on a Neos 8.2.
Sadly only saw the relogin screen.

Screenshot 2023-02-17 at 14 40 03

Tried to debug that, updated the UI plugin and when I comment out the request getchangednodes everything of neos works.
The Policies and so on is well configured, and I don't see where the error comes from at the moment.

Also tried now Neos 7.3 as it was mentioned as compatible.

Screenshot 2023-02-17 at 14 40 22

Hope that I can find the issue. If you know something, let me know ;)

Compatibility with Neos 7.3

I tried using PunktDe\EditConflictPrevention with Neos 7.3 but it throws an Error when opening the backend.

Exception in line 633 of .../Packages/Libraries/doctrine/orm/lib/Doctrine/ORM/Query/Expr.php: str_replace(): Argument #3 ($subject) must be of type array|string, Neos\ContentRepository\Domain\Model\NodeType given

86 str_replace("'", "''", Neos\ContentRepository\Domain\Model\NodeType)
85 Doctrine\ORM\Query\Expr::quoteLiteral(Neos\ContentRepository\Domain\Model\NodeType)
84 Doctrine\ORM\Query\Expr::in("n.nodeType", array|19|)
83 PunktDe\EditConflictPrevention\Domain\Repository\NodeDataRepository_Original::findChangedSubNodesInOtherWorkspaces(Neos\ContentRepository\Domain\Model\Node, Neos\ContentRepository\Domain\Model\Workspace)
82 Neos\Flow\ObjectManagement\DependencyInjection\DependencyProxy::__call("findChangedSubNodesInOtherWorkspaces", array|2|)
81 PunktDe\EditConflictPrevention\Domain\ChangedNodesCalculator_Original::findChangedNodeDataForDocument(Neos\ContentRepository\Domain\Model\Node)
80 PunktDe\EditConflictPrevention\Domain\ChangedNodesCalculator_Original::documentHasChangesInOtherWorkspace(Neos\ContentRepository\Domain\Model\Node)
79 PunktDe\EditConflictPrevention\Security\Authorization\Privilege\Node\NodePrivilegeContext_Original::hasChangesInOtherWorkspaceInternal()
78 PunktDe\EditConflictPrevention\Security\Authorization\Privilege\Node\NodePrivilegeContext_Original::hasChangesInOtherWorkspaces()
77 call_user_func_array(array|2|, array|0|)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.