mirror of
https://github.com/discourse/discourse.git
synced 2024-12-11 16:33:41 +08:00
9b10a78d82
* Extract QuickAccessPanel from UserNotifications. * FEATURE: Quick access panels in user menu. This feature adds quick access panels for bookmarks and personal messages. It allows uses to browse recent items directly in the user menu, without being redirected to the full pages. * REFACTOR: Use QuickAccessItem for messages. Reusing `DefaultNotificationItem` feels nice but it actually requires a lot of extra work that is not needed for a quick access item. Also, `DefaultNotificationItem` shows an incorrect tooptip ("unread private message"), and it is not trivial to remove / override that. * Use a plain JS object instead. An Ember object was required when `DefaultNotificationItem` was used. * Prefix instead suffix `_` for private helpers. * Set to null instead of deleting object keys. JavaScript engines can optimize object property access based on the object’s shape. https://mathiasbynens.be/notes/shapes-ics * Change trivial try/catch to one-liners. * Return the promise in case needs to be waited on. * Refactor showAll to a link with href * Store `emptyStatePlaceholderItemText` in state. * Store items in Session singleton instead. We can drop `staleItems` (and `findStaleItems`) altogether. Because `(old) items === staleItems` when switching back to a quick access panel. * Add `limit` parameter to the `user_actions` API. * Explicitly import Session instead.
80 lines
2.1 KiB
JavaScript
80 lines
2.1 KiB
JavaScript
/*jshint maxlen:10000000 */
|
|
export default {
|
|
"/topics/private-messages/eviltrout.json": {
|
|
users: [
|
|
{
|
|
id: 19,
|
|
username: "eviltrout",
|
|
name: null,
|
|
avatar_template: "/letter_avatar_proxy/v4/letter/t/f9ae1b/{size}.png"
|
|
},
|
|
{
|
|
id: 13,
|
|
username: "mixtape",
|
|
name: null,
|
|
avatar_template: "/letter_avatar_proxy/v4/letter/m/34f0e0/{size}.png"
|
|
}
|
|
],
|
|
primary_groups: [],
|
|
topic_list: {
|
|
can_create_topic: true,
|
|
draft: null,
|
|
draft_key: "new_topic",
|
|
draft_sequence: 33,
|
|
per_page: 30,
|
|
topics: [
|
|
{
|
|
id: 174,
|
|
title: "BUG: Can not render emoji properly :/",
|
|
fancy_title: "BUG: Can not render emoji properly :confused:",
|
|
slug: "bug-can-not-render-emoji-properly",
|
|
posts_count: 1,
|
|
reply_count: 0,
|
|
highest_post_number: 2,
|
|
image_url: null,
|
|
created_at: "2019-07-26T01:29:24.008Z",
|
|
last_posted_at: "2019-07-26T01:29:24.177Z",
|
|
bumped: true,
|
|
bumped_at: "2019-07-26T01:29:24.177Z",
|
|
unseen: false,
|
|
last_read_post_number: 2,
|
|
unread: 0,
|
|
new_posts: 0,
|
|
pinned: false,
|
|
unpinned: null,
|
|
visible: true,
|
|
closed: false,
|
|
archived: false,
|
|
notification_level: 3,
|
|
bookmarked: false,
|
|
liked: false,
|
|
views: 5,
|
|
like_count: 0,
|
|
has_summary: false,
|
|
archetype: "private_message",
|
|
last_poster_username: "mixtape",
|
|
category_id: null,
|
|
pinned_globally: false,
|
|
featured_link: null,
|
|
posters: [
|
|
{
|
|
extras: "latest single",
|
|
description: "Original Poster, Most Recent Poster",
|
|
user_id: 13,
|
|
primary_group_id: null
|
|
}
|
|
],
|
|
participants: [
|
|
{
|
|
extras: "latest",
|
|
description: null,
|
|
user_id: 13,
|
|
primary_group_id: null
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
};
|