SenseNet / sn-client

Monorepo for sensenet client packages πŸ±β€πŸ’»
https://sensenet.com
GNU General Public License v2.0
25 stars 37 forks source link

[BUG][Pickers-React] Cannot navigate up #187

Closed gallayl closed 5 years ago

gallayl commented 5 years ago

🐜 Bug Report

Error navigating upwards if the parent doesn't have a Workspace reference expanded

πŸ“¦ Package / Application

pickers-react

πŸ“ƒ Version

@latest dev

🐜 Describe the bug

when you try to navigate upwards to a content with no Workspace ref expanded, it won't do anything. There's also some unhandled null checks.

πŸ‘‰ Steps To Reproduce

  1. Go to the Admin UI
  2. Navigate to a subfolder
  3. Select an item
  4. Select "Copy" from the context menu
  5. Try to navigate upwards. You won't be able to navigate to the parent, if it has no Workspace reference.

    😯 Current behavior

You will also get an error on the console:

Uncaught TypeError: Cannot read property 'Id' of null
    at setParentIdOnDoubleClick (webpack-internal:///../../packages/sn-pickers-react/dist/ListPicker/ListPicker.js:77)
    at Object.onItemDoubleClickHandler [as onDoubleClickHandler] (webpack-internal:///../../packages/sn-pickers-react/dist/ListPicker/ListPicker.js:63)
    at onDoubleClick (webpack-internal:///../../packages/sn-pickers-react/dist/ListPicker/Item.js:17)
    at HTMLUnknownElement.callCallback (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:149)
    at Object.invokeGuardedCallbackDev (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:199)
    at invokeGuardedCallback (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:256)
    at invokeGuardedCallbackAndCatchFirstError (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:270)
    at executeDispatch (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:561)
    at executeDispatchesInOrder (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:580)
    at executeDispatchesAndRelease (webpack-internal:///../../node_modules/react-dom/cjs/react-dom.development.js:680)

πŸ€” Expected behavior

πŸ–Ό Screenshots

πŸ’» Code sample (for developers)

https://github.com/SenseNet/sn-client/blob/01708dcb33000308f3e32007012395730c61e3cc/packages/sn-pickers-react/src/ListPicker/ListPicker.tsx#L81

🌍 Your Environment (for developers)

Software Version(s)
Language (js/ts) ts
Operating System win10
NPM/Node/Yarn yarn
Bundler webpack

🌍 Your environment (for apps / examples)

a frying pan

πŸ—¨ Additional context

kultsar commented 5 years ago

From context menu seems ok. If Copy is started from the Actions menu, however, the user still cannot access parent folder.

gallayl commented 5 years ago

Update: However closing the dialog has been fixed in https://github.com/SenseNet/sn-client/pull/305 , I'm still unable to navigate upwards at the moment :(