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

dashboard should show default title based on metric being graphed #8579

Closed
Vadman97 opened this issue May 15, 2024 — with Linear · 14 comments · Fixed by #8602
Closed

dashboard should show default title based on metric being graphed #8579

Vadman97 opened this issue May 15, 2024 — with Linear · 14 comments · Fixed by #8602

Comments

Copy link
Member

Vadman97 commented May 15, 2024

The default title of the chart should be updated to the graphed value once one is picked.

Screenshot from 2024-05-15 16-02-04.png

ie. in this case, the metric view title should be set to CountDistinct(Identifier)

@Vadman97 Vadman97 added the waterloo label May 15, 2024 — with Linear
Copy link

linear bot commented May 15, 2024

@Vadman97 Vadman97 changed the title dashbaord should show default title based on metric being graphed dashboard should show default title based on metric being graphed May 15, 2024
Copy link

greptile-apps bot commented May 15, 2024

To implement default titles for metrics being graphed, follow these steps:

  1. Update getDefaultMetricConfig in /frontend/src/pages/Dashboards/Metrics.ts:

    • Modify the function to include a default title based on the metric name.
    export const getDefaultMetricConfig = (name: string): DashboardMetricConfig => ({
      name,
      title: `Default Title for ${name}`, // Add this line
      aggregator: MetricAggregator.AVG,
      ...
    });
  2. Modify CreateDashboardModal in /frontend/src/pages/Dashboards/components/CreateDashboardModal/CreateDashboardModal.tsx:

    • Ensure the modal uses the default title when creating a new dashboard.
    const handleCreate = () => {
      const defaultConfig = getDefaultMetricConfig(metricName);
      const newDashboard = {
        title: defaultConfig.title, // Use default title
        ...
      };
      ...
    };
  3. Update DashboardPage in /frontend/src/pages/Dashboards/pages/Dashboard/DashboardPage.tsx:

    • Ensure the dashboard page displays the default title if no custom title is provided.
    const DashboardPage = ({ dashboard }) => {
      const title = dashboard.title || `Default Title for ${dashboard.metricName}`;
      return (
        <h1>{title}</h1>
        ...
      );
    };
  4. Modify GraphingEditor in /frontend/src/pages/Graphing/GraphingEditor.tsx:

    • Ensure the graph editor uses the default title when creating a new graph.
    const handleCreateMetricView = () => {
      const defaultConfig = getDefaultMetricConfig(selectedMetric);
      const newMetricView = {
        title: defaultConfig.title, // Use default title
        ...
      };
      ...
    };

References

/backend/model/model.go
/frontend/src/pages/Graphing/Dashboard.tsx
/frontend/src/pages/Dashboards/Metrics.ts
/frontend/src/pages/Dashboards/components/CreateDashboardModal/CreateDashboardModal.tsx
/frontend/src/pages/Dashboards/pages/Dashboard/DashboardPage.tsx
/frontend/src/pages/Graphing/GraphingEditor.tsx

Ask Greptile

Copy link
Member Author

/bounty $50

Copy link

algora-pbc bot commented May 15, 2024

💎 $50 bounty • Highlight (YC W23)

Payment will be awarded to the first person to successfully merge a PR meeting all requirements. In the event that multiple PRs are submitted for the issue, we will award payment to the highest quality PR (the one that has cleanest code, best test coverage, most thorough, etc.).

Steps to solve:

  1. Start working: Comment /attempt #8579 with your implementation plan
  2. Submit work: Create a pull request including /claim #8579 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to highlight/highlight!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🔴 @ezhil56x May 17, 2024, 2:19:32 AM WIP
🟢 @rajeshj11 May 17, 2024, 5:51:26 AM #8602

@neo773
Copy link
Contributor

neo773 commented May 15, 2024

@Vadman97
What should be the default title?

@Vadman97
Copy link
Member Author

@neo773 updated the description, thanks

@ezhil56x
Copy link

@Vadman97

I would like to work on this.
Currently for all Metrics the title is Dashboard. But the goal is to update the title with the Metrics name.
For example if the Metrics name is Insights then the title should be Dashboard - Insights.
Is this what you're expecting?

Copy link
Member Author

@ezhil56x please see the description. the default is currently Untitled metric view but should update based on the function / metric that are being graphed. In the description image example, the title should update to CountDistinct(Identifier)

@ezhil56x
Copy link

I would like to work on this
Can I get assigned?

@Vadman97
Copy link
Member Author

@ezhil56x see #8579 (comment) for instructions to get started - feel free to work on this issue.

@ezhil56x
Copy link

ezhil56x commented May 17, 2024

/attempt #8579

Algora profile Completed bounties Tech Active attempts Options
@ezhil56x 28 bounties from 11 projects
JavaScript, TypeScript,
Java & more
Cancel attempt

@rajeshj11
Copy link
Contributor

rajeshj11 commented May 17, 2024

/attempt #8579

Algora profile Completed bounties Tech Active attempts Options
@rajeshj11 1 bounty from 1 project
JavaScript, TypeScript,
HTML
Cancel attempt

Copy link

algora-pbc bot commented May 17, 2024

💡 @rajeshj11 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

Vadman97 pushed a commit that referenced this issue May 20, 2024
#8602)

fixes: #8579
/claim #8579 

## Summary
case 1: If the graph is created/edited without any title it will pick
from function type and metric. [functionType(metric)]
case 2: If the user wants to give a proper name to it, they can fill in
the title of their choice. The user's title will be given a higher
priority irrespective of the updation of function and metric.

note: If the user wants the system to pick the title. Make the title
empty. It will automatically pick the title based on function type and
metric.
<!--
Ideally, there is an attached GitHub issue that will describe the "why".

If relevant, use this section to call out any additional information
you'd like to _highlight_ to the reviewer.
-->

## How did you test this change?

<!--
Frontend - Leave a screencast or a screenshot to visually describe the
changes.
-->
https://www.loom.com/share/9fd9a1e000d84c5098afe7330f0dc6e5

## Are there any deployment considerations?

<!--
 Backend - Do we need to consider migrations or backfilling data?
-->
No

## Does this work require review from our design team?
No

<!--
 Request review from julian-highlight / our design team 
-->
Copy link

algora-pbc bot commented May 20, 2024

🎉🎈 @rajeshj11 has been awarded $50! 🎈🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants