Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nav): Move stats to settings #84804

Merged
merged 4 commits into from
Feb 10, 2025

Conversation

malwilley
Copy link
Member

Ref #84018

As part of the new nav project, we want to locate the /stats/ page inside /settings/stats/.

The stats page will remain unchanged if you do not have the new nav feature flag on.

CleanShot 2025-02-07 at 12 04 48

@malwilley malwilley requested a review from a team February 7, 2025 20:08
@malwilley malwilley requested a review from a team as a code owner February 7, 2025 20:08
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 7, 2025
@@ -226,16 +225,7 @@ export function PrimaryNavigationItems() {
</SidebarMenu>

<SidebarLink
to={`/${prefix}/stats/`}
Copy link
Member Author

Choose a reason for hiding this comment

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

Removes stats in new nav component

@@ -695,6 +696,39 @@ function buildRoutes() {
</Route>
);

const statsChildRoutes = (
Copy link
Member Author

Choose a reason for hiding this comment

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

Refactor so that we can use the statsChildRoutes in two places

Copy link
Member Author

Choose a reason for hiding this comment

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

New wrapper for stats routes to provide redirect from /stats/ -> /settings/stats/ (redirect only happens when feature flag is on)

@@ -126,6 +126,14 @@ const organizationNavigation: NavigationSection[] = [
show: ({organization}) =>
!!organization && organization.features.includes('feature-flag-ui'),
},
{
Copy link
Member Author

Choose a reason for hiding this comment

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

Adds stats item in settings menu (feature flagged)

Copy link

codecov bot commented Feb 7, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
8578 2 8576 3
View the top 2 failed test(s) by shortest run time
Nav primary navigation displays primary navigation items
Stack Traces | 0.07s run time
Error: expect(received).toHaveLength(expected)

Expected length: 6
Received length: 5
Received array:  [<a aria-current="page" aria-selected="true" class="css-5xvr8y-Link-linkStyles-NavLink enr7cyg1" href=".../organizations/org-slug/issues/"><span class="css-1cv7pa9-InteractionStateLayer-InteractionStateLayer-InteractionStateLayer-InteractionStateLayer e18pngx40" role="presentation" /><svg fill="currentColor" height="14px" viewBox="0 0 16 16" width="14px"><path d="M13.24,16H2.74A2.75,2.75,0,0,1,0,13.26V2.76A2.75,2.75,0,0,1,2.74,0h10.5A2.75,2.75,0,0,1,16,2.76v10.5A2.75,2.75,0,0,1,13.24,16ZM2.74,1.51A1.25,1.25,0,0,0,1.49,2.76v10.5a1.25,1.25,0,0,0,1.25,1.25h10.5a1.25,1.25,0,0,0,1.25-1.25V2.76a1.25,1.25,0,0,0-1.25-1.25Z" /><rect height="1.5" width="14.5" x="0.74" y="2.61" /><rect height="1.5" width="14.5" x="0.74" y="5.26" /><path d="M10.79,12.08H5.19a1.25,1.25,0,0,1-1.25-1.25V9.42H.74V7.92h4.7v2.66h5.1V7.92h4.7v1.5H12v1.41A1.25,1.25,0,0,1,10.79,12.08Z" /></svg><span>Issues</span></a>, <a aria-selected="false" class="css-5xvr8y-Link-linkStyles-NavLink enr7cyg1" href=".../org-slug/explore/traces/"><span class="css-hrlyle-InteractionStateLayer-InteractionStateLayer-InteractionStateLayer e18pngx40" role="presentation" /><svg fill="currentColor" height="14px" viewBox="0 0 16 16" width="14px"><path d="M6,12A6,6,0,1,1,12,6,6,6,0,0,1,6,12ZM6,1.54A4.46,4.46,0,1,0,10.45,6,4.46,4.46,0,0,0,6,1.54Z" /><path d="M15.2,16a.74.74,0,0,1-.53-.22L9.14,10.2A.75.75,0,0,1,10.2,9.14l5.53,5.53a.75.75,0,0,1,0,1.06A.74.74,0,0,1,15.2,16Z" /></svg><span>Explore</span></a>, <a aria-selected="false" class="css-5xvr8y-Link-linkStyles-NavLink enr7cyg1" href=".../organizations/org-slug/dashboards/"><span class="css-hrlyle-InteractionStateLayer-InteractionStateLayer-InteractionStateLayer e18pngx40" role="presentation" /><svg fill="currentColor" height="14px" viewBox="0 0 16 16" width="14px"><path d="M5.66,16H1.5A1.5,1.5,0,0,1,0,14.5v-13A1.5,1.5,0,0,1,1.5,0H5.66a1.5,1.5,0,0,1,1.5,1.5v13A1.5,1.5,0,0,1,5.66,16ZM1.5,1.52v13H5.66v-13Z" /><path d="M14.5,16H10.34a1.5,1.5,0,0,1-1.5-1.5V11.79a1.5,1.5,0,0,1,1.5-1.5H14.5a1.5,1.5,0,0,1,1.5,1.5V14.5A1.5,1.5,0,0,1,14.5,16Zm0-4.21H10.34V14.5H14.5Z" /><path d="M14.5,8.62H10.34a1.5,1.5,0,0,1-1.5-1.5V1.5A1.5,1.5,0,0,1,10.34,0H14.5A1.5,1.5,0,0,1,16,1.5V7.12A1.5,1.5,0,0,1,14.5,8.62ZM10.34,1.5V7.12H14.5V1.5Z" /></svg><span>Boards</span></a>, <a aria-selected="false" class="css-5xvr8y-Link-linkStyles-NavLink enr7cyg1" href=".../org-slug/insights/frontend/"><span class="css-hrlyle-InteractionStateLayer-InteractionStateLayer-InteractionStateLayer e18pngx40" role="presentation" /><svg fill="currentColor" height="14px" viewBox="0 0 16 16" width="14px"><path d="M4.38,15.99c-.28,0-.54-.16-.67-.41L.09,8.34c-.19-.37-.04-.82.34-1.01.37-.18.82-.03,1.01.34l2.95,5.9L10.95.42c.13-.25.39-.41.67-.41h0c.28,0,.54.16.67.42l3.62,7.26c.19.37.03.82-.34,1.01-.37.18-.82.03-1.01-.34l-2.95-5.91-6.57,13.14c-.13.25-.39.41-.67.41Z" /></svg><span>Insights</span></a>, <a aria-label="Settings" aria-selected="false" class="css-5xvr8y-Link-linkStyles-NavLink enr7cyg1" href=".../org-slug/settings/org-slug/"><span class="css-hrlyle-InteractionStateLayer-InteractionStateLayer-InteractionStateLayer e18pngx40" role="presentation" /><svg fill="currentColor" height="14px" viewBox="0 0 16 16" width="14px"><path d="M8,10.73A2.73,2.73,0,1,1,10.73,8,2.74,2.74,0,0,1,8,10.73Zm0-4A1.23,1.23,0,1,0,9.23,8,1.23,1.23,0,0,0,8,6.77Z" /><path d="M8.05,16A2.07,2.07,0,0,1,6,13.93a.35.35,0,0,0-.22-.35.37.37,0,0,0-.41.05,2.07,2.07,0,0,1-1.5.64h0a2,2,0,0,1-1.43-.58l0,0a2.07,2.07,0,0,1,0-2.93.37.37,0,0,0,.1-.41.35.35,0,0,0-.31-.21H2.07A2.07,2.07,0,0,1,2.07,6a.35.35,0,0,0,.35-.22.37.37,0,0,0,0-.41,2.07,2.07,0,0,1-.64-1.5,2,2,0,0,1,.58-1.43l0,0a2.07,2.07,0,0,1,2.93,0,.37.37,0,0,0,.41.1l.13,0a.37.37,0,0,0,.13-.27V2.07a2.07,2.07,0,0,1,4.14,0,.36.36,0,0,0,.2.36.35.35,0,0,0,.38-.06,2.07,2.07,0,0,1,1.5-.64h0a2,2,0,0,1,1.43.58l0,0a2.07,2.07,0,0,1,0,2.93.37.37,0,0,0-.1.41.5.5,0,0,1,0,.13.37.37,0,0,0,.27.13h.11a2.07,2.07,0,0,1,0,4.14.36.36,0,0,0-.36.2h0a.36.36,0,0,0,.07.37,2.07,2.07,0,0,1,.64,1.5,2,2,0,0,1-.58,1.43l0,0a2.07,2.07,0,0,1-2.93,0,.37.37,0,0,0-.41-.1.35.35,0,0,0-.21.31v.11A2.07,2.07,0,0,1,8.05,16ZM5.59,12a1.83,1.83,0,0,1,.73.15,1.81,1.81,0,0,1,1.16,1.66.59.59,0,0,0,.57.65.56.56,0,0,0,.57-.57v-.11a1.84,1.84,0,0,1,3.13-1.31.6.6,0,0,0,.84.06l0,0a.56.56,0,0,0,0-.8,1.86,1.86,0,0,1-.41-2.07,1.84,1.84,0,0,1,1.68-1.11A.59.59,0,0,0,14.5,8a.57.57,0,0,0-.57-.57h-.11a1.84,1.84,0,0,1-1.69-1.11,1.33,1.33,0,0,1-.05-.19,1.82,1.82,0,0,1,.43-1.88.6.6,0,0,0,.06-.84l0,0a.56.56,0,0,0-.8,0,1.87,1.87,0,0,1-2.07.41A1.84,1.84,0,0,1,8.57,2.13.59.59,0,0,0,8,1.5a.57.57,0,0,0-.57.57v.11A1.84,1.84,0,0,1,6.32,3.87l-.19,0a1.8,1.8,0,0,1-1.88-.43.6.6,0,0,0-.84-.06l0,0a.56.56,0,0,0,0,.8,1.86,1.86,0,0,1,.41,2.07A1.81,1.81,0,0,1,2.15,7.48a.59.59,0,0,0-.65.57.56.56,0,0,0,.57.57h.11a1.84,1.84,0,0,1,1.31,3.13.6.6,0,0,0-.06.84l0,0a.56.56,0,0,0,.8,0A2,2,0,0,1,5.59,12ZM12.88,10h0Z" /></svg></a>]
    at Object.<anonymous> (.../components/nav/index.spec.tsx:64:21)
    at Promise.then.completed (.../jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9)
    at run (.../jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../jest-runner/build/runTest.js:367:16)
    at runTest (.../jest-runner/build/runTest.js:444:34)
    at Object.worker (.../jest-runner/build/testWorker.js:106:12)
Nav mobile navigation renders mobile navigation on small screen sizes
Stack Traces | 0.145s run time
TestingLibraryElementError: Unable to find an accessible element with the role "link" and name "Stats"

Here are the accessible roles:

  banner:

  Name "":
  ...

  --------------------------------------------------
  link:

  Name "Sentry Home":
  ...

  --------------------------------------------------
  button:

  Name "Close main menu":
  ...

  --------------------------------------------------
  presentation:

  Name "":
  ...

  --------------------------------------------------navigation:

  Name "Primary Navigation":
  ...

  --------------------------------------------------
  list:

  Name "":
  ...

  Name "":
  ...

  --------------------------------------------------
  listitem:

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  --------------------------------------------------
  link:

  Name "Issues":
  ...

  Name "Explore":
  ...

  Name "Boards":
  ...

  Name "Insights":
  ...

  Name "Settings":
  ...

  --------------------------------------------------
  presentation:

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  --------------------------------------------------
  button:

  Name "Help":
  ...

  --------------------------------------------------

Ignored nodes: comments, script, style
...
    at Object.getElementError (.../sentry/sentry/node_modules/@.../dom/dist/config.js:37:19)
    at .../sentry/sentry/node_modules/@.../dom/dist/query-helpers.js:76:38
    at .../sentry/sentry/node_modules/@.../dom/dist/query-helpers.js:52:17
    at .../sentry/sentry/node_modules/@.../dom/dist/query-helpers.js:95:19
    at Object.<anonymous> (.../components/nav/index.spec.tsx:204:42)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@malwilley malwilley merged commit e1e1fcf into master Feb 10, 2025
42 checks passed
@malwilley malwilley deleted the malwilley/feat/nav-stats-in-settings branch February 10, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants