-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Recents + Popular API Format - Frontend #42305
Conversation
934e2ea
to
277fff3
Compare
Codenotify: Notifying subscribers in CODENOTIFY files for diff 8bb8b77...2d23023.
|
277fff3
to
e032be7
Compare
|
card: Card | null, | ||
card: Partial< | ||
Pick<Card, "id" | "name" | "type" | "card_id" | "model"> | ||
> | null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be off my head but would Partial<Card> | null
work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would work, but I kind of like how Pick
describes what the component actually might use. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I dig it!
4a26947
to
ecbdc46
Compare
3bea769
to
2d23023
Compare
8bb8b77
to
ccfc00b
Compare
* fix tests * new API payload format for recents and populars * update url generation * update recents components * update tests * only show 5 recents in command palette * remove unused types * update tests * obey the linter * type updates * fix unit test * change where we filter recents --------- Co-authored-by: Bryan Maass <[email protected]>
* wip * adds more collection-touch events * remove sneaky dep that slipped in * cleaning up, and adding tests * respond to review comments + mini bug reports * make it official * double official * cleanup + return recent-views/Item for `GET activity/popular_items` * get popular_items returning the proper shape * compare doesn't what I thought * add display_name to tables * table.database.name should be the db name, not the table name * add table.database.initial_sync_status * improve call to toucan2 * light renaming + many text fixes * include moderated_status in cards and datasets * look up Dashboard permissions for Dashboards * stop double-querying for `can-write?` checks - also include some debug logging * fix card <-> model dispatching also gets tests passing locally * let the test runner run the tests * fix gc test * adds description * description can be null * better tests no more nils passed through the app * debugging test * fix tests and skip archived * mysql finesse * ellide inactive tables * wip * adds more collection-touch events * remove sneaky dep that slipped in * cleaning up, and adding tests * respond to review comments + mini bug reports * make it official * double official * cleanup + return recent-views/Item for `GET activity/popular_items` * get popular_items returning the proper shape * compare doesn't what I thought * add display_name to tables * table.database.name should be the db name, not the table name * add table.database.initial_sync_status * improve call to toucan2 * light renaming + many text fixes * include moderated_status in cards and datasets * look up Dashboard permissions for Dashboards * stop double-querying for `can-write?` checks - also include some debug logging * fix card <-> model dispatching also gets tests passing locally * let the test runner run the tests * fix gc test * adds description * description can be null * better tests no more nils passed through the app * debugging test * fix tests and skip archived * mysql finesse * New Recents + Popular API Format - Frontend (#42305) * fix tests * new API payload format for recents and populars * update url generation * update recents components * update tests * only show 5 recents in command palette * remove unused types * update tests * obey the linter * type updates * fix unit test * change where we filter recents --------- Co-authored-by: Bryan Maass <[email protected]> * fix modelToUrl types * respond to review comments * post merge test fix --------- Co-authored-by: Ryan Laurie <[email protected]> Co-authored-by: Ryan Laurie <[email protected]>
Note
The frontend code here is ready for review, but there is one little piece missing in the backend: models should return with
model: dataset
, but currently they havemodel: card
Important
I highly recommend looking at this PR by commit, rather than all at once. The first few commits have all the substance, and the bulk of the PR is just cleaning up types and test mocks
Closes #41957
Description
Uses a better, beefier recents format from the backend, and handles a larger number of recent items.
Recents appear in:
Popular items only appear on the home page for brand new users.
To test this component, i'd recommend just modifying the if statement in
HomeContent.tsx
like so:Checklist