Skip to content

Commit

Permalink
[tools] Improve the about export (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Dec 4, 2024
1 parent d895cee commit 8eb4a0a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
11 changes: 9 additions & 2 deletions tools-public/toolpad/pages/muicomabout/page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,25 @@ spec:
height: 632
props:
rows:
$$jsExpression: |
queryAbout.rows
$$jsExpression: |-
queryAbout.rows.map((row) => ({
...row,
twitter: row.twitter ? `https://x.com/${row.twitter}` : null,
github: row.github ? `https://github.com/${row.github}` : null,
}))
columns:
- field: name
type: string
width: 175
headerName: Name
- field: title
type: string
width: 246
headerName: Title
- field: about
type: string
width: 472
headerName: About
- field: location
type: string
width: 296
Expand Down
12 changes: 6 additions & 6 deletions tools-public/toolpad/resources/queryAbout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function queryAbout() {
showInactive: false,
humanReadable: 'REPLACE',
fields: [
'root.fullName',
'root.displayName', // 'root.fullName', is the legal name, use the preferred name instead.
'address.country',
'address.city',
'work.title',
Expand Down Expand Up @@ -59,13 +59,13 @@ export async function queryAbout() {
.map((employee) => {
const country = countryFix[employee.address.country] || employee.address.country;
return {
name: employee.fullName,
name: employee.displayName,
title: employee.work.title,
about: employee.about?.custom?.field_1690557141686,
location: `${employee.address.city} - ${country}`,
location: `${employee.address.city}, ${country}`,
locationCountry: countryToISO[country],
twitter: employee.about?.socialData?.twitter,
github: employee.about?.custom?.field_1682954415714,
about: employee.about?.custom?.field_1690557141686,
twitter: employee.about?.socialData?.twitter?.replace('https://www.twitter.com/', ''),
github: employee.about?.custom?.field_1682954415714?.replace('https://github.com/', ''),
// ...employee,
};
});
Expand Down

0 comments on commit 8eb4a0a

Please sign in to comment.