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

Don't show CTA to set up traces if already configured #8548

Closed
ccschmitz opened this issue May 13, 2024 — with Linear · 2 comments
Closed

Don't show CTA to set up traces if already configured #8548

ccschmitz opened this issue May 13, 2024 — with Linear · 2 comments
Assignees

Comments

Copy link
Contributor

Maybe we should look at setup events to determine if someone has traces configured, or maybe only show the CTA if there is no query.

@ccschmitz ccschmitz self-assigned this May 13, 2024
Copy link

linear bot commented May 13, 2024

Copy link

greptile-apps bot commented May 13, 2024

To resolve the issue of not showing the CTA for setting up traces if already configured, follow these steps:

  1. In /frontend/src/pages/Setup/SetupRouter/SetupRouter.tsx, locate the section where the CTA for traces setup is rendered.
  2. Utilize the useTracesIntegration hook from /frontend/src/util/integrated.tsx to check if traces integration is already configured. This hook checks for traces integration data and returns a boolean indicating whether traces are integrated.
  3. Before rendering the CTA, add a conditional check using the value returned by useTracesIntegration. If traces are already integrated (localStorageIntegrated is true for traces), do not render the CTA.

Example code snippet for the conditional rendering:

const { localStorageIntegrated: tracesIntegrated } = useTracesIntegration();

if (!tracesIntegrated) {
  // Render the CTA for setting up traces
}

This approach ensures the CTA is only shown to users who have not yet configured traces integration.

References

/frontend/src/pages/Setup/SetupRouter/SetupRouter.tsx
/frontend/src/util/integrated.tsx

Ask Greptile

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

No branches or pull requests

1 participant