-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: Add support for events #10628
base: develop
Are you sure you want to change the base?
feat: Add support for events #10628
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #10628 +/- ##
===========================================
+ Coverage 78.78% 79.27% +0.49%
===========================================
Files 924 178 -746
Lines 97580 23325 -74255
Branches 7776 520 -7256
===========================================
- Hits 76878 18491 -58387
+ Misses 20702 4834 -15868
|
name = 'Event1681429921400' | ||
|
||
async up(queryRunner) { | ||
await queryRunner.query(`DROP INDEX "public"."IDX_2cd3b2a6b4cf0b910b260afe08"`); |
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.
The migration generated appears to have a bunch of extraneous modifications. Should these be removed so that only the new Event related modifications are included?
- add localization strings - fixed duplicates in search (use offset when sorting by startDate)
I honestly can't think of a situation where I would use it, but if there was a webcal (iCal) link, I might want to use it. |
I'm currently adapting this PR, and using ics for iCal generation |
Need to get @syuilo to review the design of the content in the note. |
見る |
見てる |
半分くらい見た |
Event 実装といえば Friendica が挙がりそうだけど連合できるかしら |
Friendica and Mobilizon both have ActivityPub Events. They have some extensions to the base object. Friendica: https://activitystrea.ms/head/activity-schema.html#event, https://github.com/friendica/friendica/wiki/ActivityStreams#activity_obj_event Mastodon does not have Events |
概ね良さそう |
例えばEventが必ずNoteと紐づけられるのであればNoteEventとか? |
あとはEventAnnoucementとか思いついた |
Eventから離れたほうが良いと思う Scheduleとか…Programとか…あれ、両方コンピュータで使われがちだ… |
Sessionもまずい |
Off topic: |
I like this idea. 'Event' is already used in the repository to refer to other objects, so changing the name to 'NoteEvent' internally would help to disambiguate. |
|
@Column('jsonb', { | ||
default: { | ||
'@context': 'https://schema.org/', | ||
'@type': 'Event', | ||
}, | ||
comment: 'metadata object describing the event. Follows https://schema.org/Event', | ||
}) | ||
public metadata: EventSchema; |
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.
スキーマが予め決まっているデータだからJSONBでまとめて持つ必要はなさそう
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.
Schema.org has a defined schema, but not all platforms implement the same properties from it. Keeping it in JSONB ensures compatibility with other sources and flexibility if we want to support other properties later. Some common/required properties like 'start time' and 'end time' that will be queried/ordered often are included as their own SQL fields with indexes even if that adds some redundancy with the JSONB object.
What
Adding support for events in Misskey. See #3217
New
Event
typeImplemented like
Polls
(aNote
can have a child event in the database). The event data will show above the normal content of displayed notes if present.The required values in a child event are
start
andtitle
. Theend
andmetadata
are optional. The metadata is an Schema.org JSON object of type Event. The event editor provides the ability for users to specify elements in the metadata, but the API endpoint can support more properties than the UI.New API for searching Events
New endpoint created at
/notes/events/search
that queries events. Similar parameters to other searches with changes for Event specific values. The major addition are new filter options. These are objects that filter events based on metadata. Each object is treated as a separate AND condition. Each object contains a key array that selects the metadata property to filter on (ex:["location", "postalCode"]
selects location.postalCode in the Event metadata. Each object also has an array of string values that are considered as OR conditions for their respective metadata property. So if the prior location.postaCode selection wanted to select all events that had postal code 44113 and 44114 then they would use ["44113","44114"]. A value ofnull
indicates that a missing value in the event is matched.The individual values are interpreted as case insensitive regex values, so the user could run more complicated matches themselves; however, because regex is accepted, there is a timeout placed on the query (250 ms) to prevent long running queries from hurting performance (advice from Postgres docs). There can be multiple filters using the same metadata key, and these will have the effect of an AND condition on the same metadata value with two different match clauses.
The original issue has a proposal for an alternative API using a query string parameters in the URL. This PR does not implement this, but it could be implemented in a separate PR.
Event display component
A new Vue component to display events in notes was created. It formats the note information at the top of the note. Other note stuff is still accessible.
User Events page
Added a tab in the user details page to show their events. The events can be displayed in reverse chronological order (normal display order) or with events shown in date order (starting with the events that are most imminent). If showing imminent events, then past events are not shown.
Search Events page
Added a tab in the search page to search events. There is a custom form with parameters relevant to searching events. This includes a query string that searches the
title
andtext
of events, start/end date filters, and a option to change the sort order (like with the User Events page). Currently form elements to specify user filters and metadata filters are not included (using the API directly is the only way to filter with them). These should be added in a later PR.Event editor
Added an option in the note creation dialogue to make a note an event. When selected, extra forms appear where the user can fill in details. The title and start date/time are required while the rest are optional. A toggle is present that hides most of the advanced options unless needed.
Why
Enable users to create events to share and track activities that occur at a particular time.
Additional info
Implementation progress:
Checklist