Updated 500 page copy and added button to reveal error message. - #1
Conversation
…t contains an errors object. I hooked up the 500 page to state tree. 500 page displays a button if an error message exists and reveals that message.
…to the reducer test file from the persistent_flash tests. Now the errors500 tests are updated and correct.
…n Kolide500 mapStateToProps.
zwass
left a comment
There was a problem hiding this comment.
@noahtalerman please update the PR name and description to be more descriptive of what the changes are. Take a look at https://github.com/kolide/fleet/pulls?q=is%3Apr+is%3Aclosed for some examples of how folks typically do this in Fleet.
| <p>We have alerted the engineers and they are working on a solution.</p> | ||
| {renderError()} | ||
| <p>Please file an issue if you believe this is a bug.</p> | ||
| <a href="https://github.com/kolide/fleet/issues">File an issue</a> |
There was a problem hiding this comment.
| <a href="https://github.com/kolide/fleet/issues">File an issue</a> | |
| <a href="https://github.com/fleetdm/fleet/issues">File an issue</a> |
Change issue link to new fork :)
There was a problem hiding this comment.
Ah, great catch. I remember making a mental note to commit this change and totally forgot.
There was a problem hiding this comment.
PR name and description are updated as well.
|
This addresses kolide/fleet#1389. |
…chor tag properties so the link opens in a new tab.
zwass
left a comment
There was a problem hiding this comment.
Thanks for updating the link and description!
|
@groob you had expressed interest in this change. |
* quickstart (first draft) * test.fleetdm.com » fleet.example.com
QA Wolf: Deployment: Free 🐺0 workflows ran (more details) |
QA Wolf: Deployment: Premium 🐺0 workflows ran (more details) |
publish article: linux desktop inventory and viz
- Drop FOREIGN KEY hosts(id) from the new table per handbook/engineering/scaling-fleet.md (avoid InnoDB locking on the hosts table). Test CI explicitly fails on host_id FKs. - Add host_mdm_apple_enrollment_permissions to hostRefs in server/datastore/mysql/hosts.go so rows are cleaned up when a host is deleted (the manual cleanup that replaces FK cascade). - Update migration test: drop the FK-cascade assertion, add an upsert assertion covering the ON DUPLICATE KEY UPDATE path used by the datastore method. - Regenerated schema.sql via make test-schema (includes both the new table and the allow_byod_wipe/lock keys seeded in app_config_json from PR #1; PR #1 will land its app_config_json portion separately).
- Drop FOREIGN KEY hosts(id) from the new table per handbook/engineering/scaling-fleet.md (avoid InnoDB locking on the hosts table). Test CI explicitly fails on host_id FKs. - Add host_mdm_apple_enrollment_permissions to hostRefs in server/datastore/mysql/hosts.go so rows are cleaned up when a host is deleted (the manual cleanup that replaces FK cascade). - Update migration test: drop the FK-cascade assertion, add an upsert assertion covering the ON DUPLICATE KEY UPDATE path used by the datastore method. - Regenerated schema.sql via make test-schema (includes both the new table and the allow_byod_wipe/lock keys seeded in app_config_json from PR #1; PR #1 will land its app_config_json portion separately).
- (#1) Swap useEffect/[showSearch] focus for native autoFocus on the search input. react-select unmounts <Menu> on close, so the input is a fresh DOM node on each open — autoFocus fires reliably without depending on effect deps semantics. - (#2) Key CustomMenuList's useLayoutEffect on React.Children.count(...) so it only re-measures scroll dimensions when the option list actually changes (search filter shrink/expand). onScroll still covers user- driven position changes. - (#3) menu.zIndex 6 -> 99 (page-overlay tier), __scroll-fade z-index 1 -> 9 (in-flow overlay tier), matching the 9/99/999 convention. - (#4) Add optional onAddFleet callback prop. If provided, fires instead of the browserHistory.push fallback — lets consumers use their own router.push. Nine current callers unaffected. - (#8) TODOL -> TODO: typo in the tests file (inherited from the deleted TeamsDropdown.tests.tsx).
- (#1) Extract getHiddenInput() helper. The double-cast to reach react-select's undocumented `inputRef` field was duplicated at two sites (menu-open focus effect + forwardNavKey bridge). Both now read through the helper — if react-select ever renames the field, the escape hatch fails in one place, not two. - (#2) Stash onClose in onCloseRef so an inline callback from a parent doesn't retrigger the menuIsOpen-transition effect on every parent render. The effect deps are back to [menuIsOpen] alone and reads onCloseRef.current?.() at fire time. - (#5) Extract isPrimoModeEnabled / isGitOpsModeEnabled locals instead of inlining the three nested optional-chain checks. Matches the permissions.isPrimoMode / permissions.isSandboxMode naming used elsewhere in the codebase and reads at a glance.
- (#1) preventDefault on Enter in addFleetKeyDown. Fleet Button's own handleKeyDown synthesizes onClick from Enter, so without preventDefault the browser ALSO synthesizes a native click after keyup, firing onClickAddFleet a second time. jsdom didn't catch this (it doesn't synthesize click from keyDown); the double-fire only manifests in a real browser. Space is left with stopPropagation only — Fleet Button has no Space handler, and native click synthesis is Space's only activation path. - (#2) Dev-only console.warn in getHiddenInput() when SelectInstance.inputRef is unexpectedly missing. Surfaces a react-select upgrade breaking the keydown-forwarding bridge loudly in dev instead of silently regressing keyboard nav. - (#4) Consolidate searchQuery clearing into the menuIsOpen transition effect. The same setSearchQuery("") was duplicated at 5 close origins (click-outside, toggleMenu, handleChange, onClickAddFleet, onMenuClose). All 5 removed; the transition effect is now the single source of truth for close-side state cleanup. - (#6) Story decorator: height: 600 -> minHeight: 780. The old fixed height clipped scrollable-list stories when the open menu grew past 600px; minHeight 780 (menu maxHeight 715 + trigger + margin) lets the full menu render without clipping.
Tests each surface touched by this PR (tab-header row above the list with description + optional Add button): - Certificates.tests.tsx (new): 4 tests — description always renders; Add certificate hidden on Free, hidden without a custom SCEP CA, shown for premium + Android MDM + custom SCEP CA. - ConfigurationProfiles.tests.tsx (new): 3 tests — MDM enabled shows description + Add profile; MDM disabled keeps description but hides Add profile (EmptyState explains "MDM must be turned on"); technician sees the "View configuration profiles." copy with no Add profile button. - AssetsTab.tests.tsx: added a tab-header test above a populated list and adjusted the empty-state assertion to expect two "Add asset" buttons (empty-state CTA + persistent tab-header — matches the accepted double-CTA pattern from self-review item #1). - CustomHostVitalsTab.tests.tsx: added a tab-header describe block asserting the description + Add vital button render above the list. Also reverts the earlier suppress-when-MDM-off change on ConfigurationProfiles.tsx: the description now always renders (its "Learn more" link stays useful even when MDM is off) and the existing `showAddProfileButton = mdmEnabled && !isTechnician` gate is what hides the button. That matches the behavior the new tests assert.
Updated the 500 page component to render a "SHOW ERROR" button.
This button is only rendered if the errors slice of the state contains an error and the
baseproperty exists. Otherwise, the 500 page will not render this button because there is no error message to show the user.Created a errors500 reducer and actions to update the state tree when a 500 error occurs. When 500 error occurs, the errors slice of state is updated with the error object. When the 500 page component unmounts the error object is removed from state.
Demo: https://www.loom.com/share/b87c4aee42274e7bb553e703d3f950c6