Conversation
arnaudfnr
reviewed
Apr 28, 2026
Collaborator
arnaudfnr
left a comment
There was a problem hiding this comment.
Don't forget to rebase main branch
| return data | ||
| } | ||
|
|
||
| function twoDecimals(data: Record<string, DataField>) { |
Collaborator
There was a problem hiding this comment.
You should use the already existing util function preciseNumericIndicators instead of your own (which has some typescript errors) :
An example of use is available here
Comment on lines
+240
to
+244
| useEffect (() => { | ||
| // setData(twoDecimals(fakeData)); | ||
| const rawData = request(api); | ||
| setData(twoDecimals(rawData)); | ||
| }, []) |
Collaborator
There was a problem hiding this comment.
You can use the utils function like this:
Suggested change
| useEffect (() => { | |
| // setData(twoDecimals(fakeData)); | |
| const rawData = request(api); | |
| setData(twoDecimals(rawData)); | |
| }, []) | |
| const indicatorKeys = Object.keys(data) as (keyof typeof data)[] as NumericKeys<RawData>; | |
| useEffect (() => { | |
| // setData(twoDecimals(fakeData)); | |
| request(api).then((res) => setData(preciseNumericIndicators<RawData>(res, indicatorKeys, "N/A"))) | |
| }, [api, request]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
J'ai intégré le premier chart avec les data que tu m'as envoyées Arnaud (j'ai fait une variable fake data), j'ai aussi intégré le header que j'ai du légèrement modifier pour prendre en compte la nav vers dashboard mais aussi à l'inverse vers la map (home) => changement dans index du header, changement dans URLS (création de HOME url). J'en ai profité pour ajouter une entrée dans le i18n fr pour l'intitulé du bouton comme ça on pourra le changer facilement si ça ne vous convient pas.