mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-06 08:08:10 +08:00
251d7c44d1
* Initial commit * SVG-based graph components * Add histogram, pull data into graphs * Loading animation, timespan descriptions * Improvements to read receipt / link tracking section * Initial pass at subject line analysis * Fixes to subject-line stats * Fix theme `ui-variables` include paths * Add “Share this report” button * Add “Learn More” button * Make it more clear how to edit your shortcuts * Merge activity-list and new activity-dashboard, move in sidebar
61 lines
1.3 KiB
JavaScript
61 lines
1.3 KiB
JavaScript
import {
|
|
Actions,
|
|
WorkspaceStore,
|
|
ComponentRegistry,
|
|
ExtensionRegistry,
|
|
MailboxPerspective,
|
|
} from 'mailspring-exports';
|
|
|
|
import Root from './root';
|
|
|
|
class ActivityMailboxPerspective extends MailboxPerspective {
|
|
sheet() {
|
|
return WorkspaceStore.Sheet.Activity;
|
|
}
|
|
threads() {
|
|
return null;
|
|
}
|
|
canReceiveThreadsFromAccountIds() {
|
|
return false;
|
|
}
|
|
unreadCount() {
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
const AccountSidebarExtension = {
|
|
name: 'Activity',
|
|
|
|
sidebarItem(accountIds) {
|
|
return {
|
|
id: 'Activity',
|
|
name: 'Activity',
|
|
iconName: 'activity.png',
|
|
perspective: new ActivityMailboxPerspective(accountIds),
|
|
};
|
|
},
|
|
};
|
|
|
|
export function activate() {
|
|
ExtensionRegistry.AccountSidebar.register(AccountSidebarExtension);
|
|
|
|
WorkspaceStore.defineSheet(
|
|
'Activity',
|
|
{ root: true },
|
|
{ list: ['RootSidebar', 'ActivityContent'] }
|
|
);
|
|
|
|
ComponentRegistry.register(Root, {
|
|
location: WorkspaceStore.Location.ActivityContent,
|
|
});
|
|
|
|
const { perspective } = AppEnv.savedState || {};
|
|
if (perspective && perspective.type === 'ActivityMailboxPerspective') {
|
|
Actions.selectRootSheet(WorkspaceStore.Sheet.Activity);
|
|
}
|
|
}
|
|
|
|
export function deactivate() {
|
|
ExtensionRegistry.AccountSidebar.unregister(AccountSidebarExtension);
|
|
ComponentRegistry.unregister(Root);
|
|
}
|