mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 13:44:41 +08:00
d3dcf89e9f
Summary: This commit adds the ability to perform event search in the calendar window. To achieve this, SearchBar has been moved from the thread-search package to be a part of the nylas-component-kit, and reused by both thread-search and nylas-calendar When an event is selected from search results, the calendar view is moved to the selected event. Depends on D3396 to open the event popover. Test Plan: Manual Reviewers: halla, bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D3424
33 lines
617 B
JavaScript
33 lines
617 B
JavaScript
import {Event, ModelSearchIndexer} from 'nylas-exports'
|
|
|
|
|
|
const INDEX_VERSION = 1
|
|
|
|
class EventSearchIndexer extends ModelSearchIndexer {
|
|
|
|
get ConfigKey() {
|
|
return 'eventSearchIndexVersion';
|
|
}
|
|
|
|
get IndexVersion() {
|
|
return INDEX_VERSION;
|
|
}
|
|
|
|
get ModelClass() {
|
|
return Event;
|
|
}
|
|
|
|
getIndexDataForModel(event) {
|
|
const {title, description, location, participants} = event
|
|
return {
|
|
title,
|
|
location,
|
|
description,
|
|
participants: participants
|
|
.map((c) => `${c.name || ''} ${c.email || ''}`)
|
|
.join(' '),
|
|
}
|
|
}
|
|
}
|
|
|
|
export default new EventSearchIndexer()
|