Project

General

Profile

Bug #27970

Toast notifications not working when permissions are missing

Added by Jeremy Lenz about 1 year ago. Updated 7 months ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Notifications
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Steps to reproduce:

1. Log in as / impersonate a user with only Viewer permissions
2. Navigate to /subscriptions

Expected behavior: Toast alert appears on screen with permission error.
Actual behavior: No toast is shown.

See screenshot attached; looks like the data shape added to Redux is a bit odd with multiple "message" keys.

Open the browser dev tools (Ctrl+Shift+I) and you'll see the following:

Warning: Failed prop type: Invalid prop `message` supplied to `AlertBody`, expected a ReactNode.
in AlertBody (created by ToastsList)
in ToastsList (created by Connect(ToastsList))
in Connect(ToastsList) (created by I18nProviderWrapper(Connect(ToastsList)))
in IntlProvider (created by I18nProviderWrapper(Connect(ToastsList)))
in I18nProviderWrapper(Connect(ToastsList)) (created by StoreProvider(I18nProviderWrapper(Connect(ToastsList))))
in Provider (created by StoreProvider(I18nProviderWrapper(Connect(ToastsList))))
in StoreProvider(I18nProviderWrapper(Connect(ToastsList)))
r chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:6
printWarning
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:252655
checkPropTypes foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:252717
validatePropTypes
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:326884
createElementWithValidation foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:327057
(anonymous)
bundle.js:10857
ToastsList bundle.js:10839
renderWithHooks
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:290436
updateFunctionComponent foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:292253
beginWork$1
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:293826
beginWork$$1 foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:298521
performUnitOfWork
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:297536
workLoopSync foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:297513
renderRoot
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:297206
runRootCallback foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:296882
(anonymous)
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:286681
unstable_runWithPriority foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:340474
runWithPriority$2
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:286633
flushSyncCallbackQueueImpl foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:286677
flushSyncCallbackQueue
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:286666
scheduleUpdateOnFiber foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:296759
enqueueSetState
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:288428
../vendor-core/node_modules/react/cjs/react.development.js.Component.setState foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:325413
onStateChange
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:310666
dispatch foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:338969
e
(anonymous)
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:338406
(anonymous) foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:338458
dispatch
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:338516
(anonymous) katello.js:8368
(anonymous)
katello.js:8367
(anonymous) katello.js:8387
(anonymous)
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:338455
dispatch foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:338516
_callee$
katello.js:33931
tryCatch foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:375985
invoke
foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:376211
prototype.<computed> foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:376037
step
katello.js:33893
(anonymous) @ katello.js:33893
Show 10 more frames

foreman-vendor.bundle-v1.4.0-development-70f7bba7929e06fae0ca.js:289141 Uncaught Invariant Violation: Objects are not valid as a React child (found: object with keys {message, details, missing_permissions}). If you meant to render a collection of children, use an array instead.
in span (created by AlertBody)
in AlertBody (created by ToastsList)
in div (created by Alert)
in Alert (created by ToastNotification)
in ToastNotification (created by ToastsList)
in div (created by ToastNotificationList)
in ToastNotificationList (created by ToastsList)
in ToastsList (created by Connect(ToastsList))
in Connect(ToastsList) (created by I18nProviderWrapper(Connect(ToastsList)))
in IntlProvider (created by I18nProviderWrapper(Connect(ToastsList)))
in I18nProviderWrapper(Connect(ToastsList)) (created by StoreProvider(I18nProviderWrapper(Connect(ToastsList))))
in Provider (created by StoreProvider(I18nProviderWrapper(Connect(ToastsList))))
in StoreProvider(I18nProviderWrapper(Connect(ToastsList)))

toasts_redux.png View toasts_redux.png 34.9 KB Jeremy Lenz, 09/30/2019 07:42 PM
Toasts redux

Associated revisions

Revision 01635361 (diff)
Added by Jeremy Lenz 7 months ago

Fixes #27970 - handle objects in toast actions

History

#1 Updated by Chris Roberts about 1 year ago

  • Triaged changed from No to Yes
  • Target version set to Katello 3.14.0

#2 Updated by Jonathon Turel 9 months ago

  • Target version changed from Katello 3.14.0 to Katello 3.16.0

#3 Updated by The Foreman Bot 7 months ago

  • Assignee set to Jeremy Lenz
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/8643 added

#4 Updated by The Foreman Bot 7 months ago

  • Fixed in Releases Katello 3.16.0 added

#5 Updated by Jeremy Lenz 7 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF