Skip to content

Commit

Permalink
Merge pull request #552 from BloomBooks/BL-13567LangCodesInGrid
Browse files Browse the repository at this point in the history
BL-13567 add lang codes to grid
  • Loading branch information
andrew-polk authored Jun 7, 2024
2 parents ccc3444 + 78209eb commit a82a327
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/Grid/GridColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ export function getBookGridColumnsDefinitions(): IGridColumn[] {
filter.language = value;
},
},
{
name: "languagecodes",
title: "Language Codes",
defaultVisible: true,
getCellValue: (b: Book) =>
b.languages?.map((l) => l.isoCode).join(", "),
addToFilter: (filter: IFilter, value: string) => {
filter.language = value;
},
},
{
name: "tags",
title: "Other Tags",
Expand Down
2 changes: 2 additions & 0 deletions src/components/Grid/GridExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ function getStringForItem(book: Book, key: string): string {
return `=HYPERLINK("${window.location.origin}/book/${book.id}")`;
case "languages":
return book.languages.map((lang) => lang.name).join(", ");
case "languagecodes":
return book.languages.map((lang) => lang.isoCode).join(", ");
case "uploader":
return book.uploader?.username ?? "";
case "topic":
Expand Down

0 comments on commit a82a327

Please sign in to comment.