Giter Site home page Giter Site logo

psmb.flatnav's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

psmb.flatnav's Issues

Neos Backend crashes if newReferenceNodePath points to non-existing node

If a newReferenceNodePath is configured, but the referenced node is not available, the backend crashes without providing a meaningful message.

Message in developer console:

Error: Please provide either a string, an array or an object containing a contextPath to the FlowQuery API.

A speaking error would be nice to have.

Allow restricting access to FlatNav configuration by role

Sometimes, you want to use FlatNav for a node type but restrict access to certain roles. Imagine having a News system allowing to set Tags. You want News and Tags to be defined in a FlatNav tab, but Tags only edited by adminstrators, not by normal editors.

events:
  label: Events
  icon: ticket
  type: flat
  query: 'q(node).find("[instanceof My.Site:Page.EventItem]").sort("date", "DESC").slice((page - 1) * 100, page * 100).get()'
  newReferenceNodePath: '/sites/my/node-58dcfb662cb42'
  newNodeType: 'My.Site:Page.EventItem'
categories:
  label: Categories
  icon: tags
  type: flat
  query: 'q(node).find("[instanceof My.Site:Page.Category]").sort("title", "DESC").slice((page - 1) * 100, page * 100).get()'
  newReferenceNodePath: '/sites/my/node-89j0mu3a57lgn'
  newNodeType: 'My.Site:Page.Category'
  restrictToRoles: ['Neos.Neos:Administrator']

By default, a FlatNav would be visible for all authenticated users. Therefore a new setting restrictToRoles (or similar) would be backwards-compatible.

By the way: I'm aware that this will not provide security for the affected nodes. It only allows displaying or not the FlatNav based on a role. The user will still need to configure CreateNodePrivilege, EditNodePrivilege and RemoveNodePrivilege to prevent users from modifying such records through the API.

Conflict with package Flowpack.Neos.FrontendLogin

When using this package together with the neos frontendlogin-package you will run into this problem:

The ajax-route "flatnav/query?..." is not considered a backend-route by the frontendlogin-package and your login-token is not active for the ajax-route. Problem is the way how Flowpack\Neos\FrontendLogin\Security\NeosRequestPattern (see https://github.com/Flowpack/Flowpack.Neos.FrontendLogin/blob/master/Classes/Flowpack/Neos/FrontendLogin/Security/NeosRequestPattern.php#L53) identifies be-routes.

My solution was to disable the frontendlogin requestpattern for the Neos-Backend provider:

Neos:
  Flow:
    security:
      authentication:
        providers:
          'Neos.Neos:Backend':
            requestPatterns:
              'Flowpack.Neos.FrontendLogin:NeosBackend': ~

By doing this, you might not be able to login via frontendlogin-form as a backend-user. For me not a problem as I don't use this feature.

Maybe this should be mentioned somewhere in the readme. The frontendlogin-package has no issues enabled in github, otherwise I would informed there as well.

Any plans to extend cut / copy function or search / filtering in Flatnav?

Hey,
we're using flatnav in a few projects and it's a nice package.
What we're (or our customers) missing are the cut / copy and the search / filter options of the default tree.

Are there any plans to extend the module with these features? (I don't exactly know how complicated it would be / what it would mean in development time).
Can we so anything to support the possible development of this new feature, whether financial or with man-power?

Thanks in advance,
David

TODO

  • Filtering & search
  • Code quality and clean up
  • Reload on dimension or workspace change
  • Spinner shown in inspector (wrong node merge)

Please help and provide PRs if you use the package!

"Load more" causing error when there are no more items

When clicking "Load More" and the response contains an empty string
the spinner will stay visible and in the browser console it shows:

Uncaught (in promise) TypeError: r(...) is not a function

I'm not sure where exactly to fix that or I would do that myself.

Get 'Your login has expired. Please log in again.' when loading flat nav tab

Neos version: 5.0.5
Logged in as Admin

While the page tree loads fine, when I click on the flat nav tab i created, I immediately get the login screen overlay.

This is my settings.yaml of my package

Neos:
  Neos:
    Ui:
      frontendConfiguration:
        Psmb_FlatNav:
          presets:
            blogPosts:
              label: 'Blog posts'
              icon: newspaper
              type: flat
              query: 'q(node).find("[instanceof RobertLemke.Plugin.Blog:Post]").sort("datePublished", "DESC").slice((page - 1) * 20, page * 20).get()'
              newReferenceNodePath: 'q(node).find("[instanceof RobertLemke.Plugin.Blog:Post]").first().get(0).path'
              newNodeType: 'RobertLemke.Plugin.Blog:Post'
              disablePagination: true

Second node with same name is not reachable

Inside a flat navigation, if you have two nodes with the same name (case-insensitive), you can never change to the second node with the same name. It always jumps back to the first node:

ezgif-3-3265c86cd29a

PageTree toolbar not fixed when included in tab

I've just discovered a bug where the toolbar of the PageTree is not displayed correctly.

Steps to reproduce:

  1. Enable FlatNav
  2. Add a preset of type tree
  3. Scroll down the page tree

The toolbar (plus button etc.) scrolls along with the content instead of being fixed to the top of the tab.

screen shot 2018-04-24 at 13 55 26

The issue is easily resolved by setting the tab panel and it's first to div descendants to height: 100% and the page tree container to display: flex; flex-direction: column;.

Problem is, I'm not sure if this is an issue with FlatNav or the UI in general so I have no idea where I could fix this.

Load more button with elasticsearch throws an exception

Exception: Argument 2 passed to Neos\Eel\Utility_Original::evaluateEelExpression() must implement interface Neos\Eel\EelEvaluatorInterface, instance of Neos\Flow\ObjectManagement\DependencyInjection\DependencyProxy given, called in /var/www/app/Data/Temporary/Development/SubContextMain/Cache/Code/Flow_Object_Classes/Psmb_FlatNav_Controller_StandardController.php on line 78

Control the destination on click

I have a structure where I have several pages and inside the pages I have products.

image

NodeTypes are like that:


vendor.project:Document.Page
└── vendor.project:Content.Product

vendor.project:Document.Page
└── vendor.project:Content.Product

I would like to see in FlatNav all the Products and when I click on the item in the list I would like to see the Page with the product in it.

I thought with q(node).closest("[instanceof vendor.project:Document.Page]").get(0).path I could get it but maybe I missunderstand that. How can I control the destionation when clicking on the node?

Settings.yaml

tags:
  label: Tags
  icon: tag
  type: flat
  query: 'q(node).find("[instanceof vendor.project:Content.Product]").sort("title", "ASC").slice((page - 1) * 20, page * 20).get()'
  newReferenceNodePath: 'q(node).closest("[instanceof vendor.project:Document.Page]").get(0).path'
  newNodeType: 'vendor.project:Content.Product'

Users can create nodes in workspaces they can't publish

When newNodeType is configured, the "new node"-Button is active whether the current user is allowed to create nodes in the currently selected workspace or not.

Example:

When a user with the role Neos.Neos:RestrictedEditor (ie. without Neos.Neos:Backend.PublishToLiveWorkspace privilege) selects the live workspace as target (eg. accidentally) a padlock appears and all (inline & inspector) editors turn into read only mode. But the "new node"-Button in the FlatNav is still active:

image

The user can even create nodes (which IMO is a bug of Neos really)

Tab change resets search or filter

When you use the search (or filter) inside default tree tab panel and then change to another tab and go back to the tree panel, the tree is still filtered, but the search box is empty:

search-change-tab

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.