Skip to content

Updated 500 page copy and added button to reveal error message. - #1

Merged
zwass merged 6 commits into
fleetdm:masterfrom
noahtalerman:500-fix
Nov 4, 2020
Merged

Updated 500 page copy and added button to reveal error message. #1
zwass merged 6 commits into
fleetdm:masterfrom
noahtalerman:500-fix

Conversation

@noahtalerman

@noahtalerman noahtalerman commented Nov 3, 2020

Copy link
Copy Markdown
Member

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 base property 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

…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.

@zwass zwass left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Comment thread frontend/pages/Kolide500/Kolide500.jsx Outdated
<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>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<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 :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, great catch. I remember making a mental note to commit this change and totally forgot.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR name and description are updated as well.

@zwass

zwass commented Nov 3, 2020

Copy link
Copy Markdown
Member

This addresses kolide/fleet#1389.

@noahtalerman noahtalerman changed the title 500 fix Updated 500 page copy and added button to reveal error message. Nov 3, 2020

@zwass zwass left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the link and description!

@zwass
zwass merged commit d604c6a into fleetdm:master Nov 4, 2020
@zwass

zwass commented Nov 14, 2020

Copy link
Copy Markdown
Member

@groob you had expressed interest in this change.

chiiph pushed a commit that referenced this pull request Aug 4, 2021
* quickstart (first draft)

* test.fleetdm.com » fleet.example.com
@qa-wolf

qa-wolf Bot commented May 25, 2023

Copy link
Copy Markdown

QA Wolf: Deployment: Premium ✅

120 workflows ran (more details)

✅ 120 passed

@qa-wolf

qa-wolf Bot commented May 25, 2023

Copy link
Copy Markdown

QA Wolf: Deployment: Free ✅

70 workflows ran (more details)

✅ 70 passed

@qa-wolf

qa-wolf Bot commented May 26, 2023

Copy link
Copy Markdown

QA Wolf: Deployment: Free 🐺

0 workflows ran (more details)

@qa-wolf

qa-wolf Bot commented May 26, 2023

Copy link
Copy Markdown

QA Wolf: Deployment: Premium 🐺

0 workflows ran (more details)

akuthiala pushed a commit that referenced this pull request May 18, 2026
publish article: linux desktop inventory and viz
georgekarrv added a commit that referenced this pull request May 23, 2026
- 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).
georgekarrv added a commit that referenced this pull request May 23, 2026
- 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).
RachelElysia added a commit that referenced this pull request Jul 21, 2026
- (#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).
RachelElysia added a commit that referenced this pull request Jul 21, 2026
- (#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.
RachelElysia added a commit that referenced this pull request Jul 22, 2026
- (#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.
@Brajim20 Brajim20 mentioned this pull request Jul 28, 2026
60 tasks
RachelElysia added a commit that referenced this pull request Jul 29, 2026


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.
@xpkoala xpkoala mentioned this pull request Jul 31, 2026
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants