Skip to content

Feat/dashboard front#144

Open
Arth-M wants to merge 7 commits intomainfrom
feat/dashboard-front
Open

Feat/dashboard front#144
Arth-M wants to merge 7 commits intomainfrom
feat/dashboard-front

Conversation

@Arth-M
Copy link
Copy Markdown
Collaborator

@Arth-M Arth-M commented Apr 24, 2026

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.

Copy link
Copy Markdown
Collaborator

@arnaudfnr arnaudfnr left a comment

Choose a reason for hiding this comment

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

Don't forget to rebase main branch

return data
}

function twoDecimals(data: Record<string, DataField>) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You should use the already existing util function preciseNumericIndicators instead of your own (which has some typescript errors) :

export function preciseNumericIndicators<T extends Record<string, any>>(

An example of use is available here

Comment thread webapp/src/pages/dashboard/DashboardPage.tsx
Comment on lines +240 to +244
useEffect (() => {
// setData(twoDecimals(fakeData));
const rawData = request(api);
setData(twoDecimals(rawData));
}, [])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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])

@arnaudfnr arnaudfnr linked an issue Apr 29, 2026 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Feat: Show Dashboard for Bodiversity Data

2 participants