Skip to content

Commit

Permalink
fix(filter): separate display values
Browse files Browse the repository at this point in the history
  • Loading branch information
andylolz committed May 18, 2024
1 parent 2394977 commit e140262
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions output/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,32 +101,41 @@ Proposed [Twitter community notes](https://twitter.com/i/communitynotes/download
render: function (data, type, row, meta) {
if (!data) {
if (type === 'sort') {
return 'ZZZ (put this last)';
return '~ (put this last)';
}
return 'Unknown (deleted)';
if (type === 'display') {
return 'Unknown (deleted)';
}
return data;
}
const niceName = langLookup[data];
if (niceName === 'X') {
// there are a handful of language codes that are used for
// esoteric twitter things, including emoji-only tweets (`art`)
// and hashtag-only tweets (`qht`). We lump these all together
if (type === 'sort') {
return 'ZZZ (put this last)';
return '~ (put this last)';
}
if (type === 'display') {
return 'Twitter special';
}
return 'Twitter special';
return niceName;
}
return niceName + ' (' + data + ')';
if (type === 'display') {
return niceName + ' (' + data + ')';
}
return data;
}
},
{
data: 'deleted',
visible: false,
defaultContent: 0,
render: function (data, type, row, meta) {
if (type !== 'display') {
return data;
if (type === 'display') {
return (data === 1) ? 'Deleted' : 'Published';
}
return (data === 1) ? 'Deleted' : 'Published';
return data;
}
},
{
Expand All @@ -151,7 +160,7 @@ Proposed [Twitter community notes](https://twitter.com/i/communitynotes/download
preSelect: [
{
column: 5,
rows: ['English (en)', 'Twitter special', 'Unknown (deleted)']
rows: ['en', 'X', '']
},
{
column: 6,
Expand Down

0 comments on commit e140262

Please sign in to comment.