Git Product home page Git Product logo

Comments (2)

linear avatar linear commented on June 8, 2024

HIG-4661 dashboard units polish

from highlight.

greptile-apps avatar greptile-apps commented on June 8, 2024

To polish the dashboard units for active_length to show number formatting, follow these steps:

  1. Update the Resolver in schema.resolvers.go:

    // Add number formatting for active_length
    func (r *dashboardMetricResolver) ActiveLength(ctx context.Context, obj *model.DashboardMetric) (string, error) {
        formattedLength := fmt.Sprintf("%d", obj.ActiveLength) // Format the number
        return formattedLength, nil
    }
  2. Update the DashboardMetric struct in model.go:

    Ensure that ActiveLength is defined as an integer or the appropriate type for number formatting.

    type DashboardMetric struct {
        ActiveLength int `json:"active_length"`
    }
  3. Update the DashboardPage component in DashboardPage.tsx:

    Ensure that the active_length is displayed correctly with the formatted number.

    // Display the formatted active_length
    <div>{dashboardMetric.active_length}</div>

References

/backend/private-graph/graph/schema.resolvers.go
/backend/model/model.go
/frontend/src/pages/Dashboards/pages/Dashboard/DashboardPage.tsx

Ask Greptile

from highlight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.