-
Notifications
You must be signed in to change notification settings - Fork 23
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
[GCAL] today/tomorrow commands with styling #273
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## migrate-to-gcal #273 +/- ##
===================================================
- Coverage 15.29% 15.21% -0.08%
===================================================
Files 78 78
Lines 3780 3798 +18
===================================================
Hits 578 578
- Misses 3138 3156 +18
Partials 64 64
☔ View full report in Codecov by Sentry. |
I have to agree 🙂 The attachments version is a little difficult to visually at a glance. I think a structured view like a table works better here. Are you able to post a screenshot of the table version for a before & after comparison? 0/5 on if it should be the table view, and/or have a toggle for this. @DHaussermann I'm curious what you think about this? |
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.
Code LGTM 👍 Just a few comments
Table viewAttachment viewI believe in another PR i made the attachment titles links as well. cc: @matthewbirtch |
Looking at the before & after (table vs attachment view), I definitely prefer the table view. I think the attachment view is good for showing one event's information, but not so much when trying to visually parse several events at once. |
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.
LGTM, though I would like to see the table view supported for the daily summary. @matthewbirtch Do you have any thoughts on this?
+1 for a table view for a more concise daily summary of events |
I like the table view for the agenda too. It's quite easy to scan and consume the agenda. A couple questions:
|
I'm deferring to @mickmister on this one, since I don't think we can but I'm 0/5 on it.
Yes. For known links that's the plan, adding a "Join meeting" link.
To the event in the Google calendar website.
Yes, that can be done. |
@fmartingr Are you able to post a screenshot of what this looks like on mobile? I'm also pretty sure that we aren't able to display it differently on mobile |
MessageWhen you tap on the lower-right iconcc: @larkox |
Displaying different on mobile it is possible, but extremely annoying. Here would be the thing:
The other big issue? When the plugin is disabled (and therefore the custom type does not render on web), the posts will show the "Slack attachment" view, which is weird. All that being said, I would argue against having different views for them. |
…gcal/today-tomorrow
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.
Just one question regarding tomorrow
date calculation. Otherwise LGTM 👍
server/command/daily_summary.go
Outdated
@@ -29,11 +29,11 @@ func (c *Command) dailySummary(parameters ...string) (string, bool, error) { | |||
} | |||
return postStr, false, nil | |||
case "tomorrow": | |||
_, err := c.MSCalendar.GetDaySummaryForUser(time.Now().Add(time.Hour*24), c.user()) | |||
postStr, err := c.MSCalendar.GetDaySummaryForUser(time.Now().Add((time.Hour*24)*4), c.user()) |
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.
Why do we add (time.Hour*24)*4
here? Also do we need to take into account weekends (maybe that's the intention 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.
Oh no no no, I accidentaly commited that. Used to get the output of a specific day for a screenshot.
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.
Though this begs the question, should we have a special case for weekends? Currently, the daily summary job avoids sending the summary on the weekend, so there is already some convention in the plugin to avoid weekends. Maybe the tomorrow
command should do something similar?
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.
Didn't check that code, is it configurable? Does it take into consideration countries were weekends are longer/shorter/on different days?
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.
Here is the line that does this
if now.Weekday() == time.Saturday || now.Weekday() == time.Sunday { |
It's currently not configurable, but we can use WorkingHours
to figure out the correct days if available for gcal:
mattermost-plugin-mscalendar/server/remote/user.go
Lines 13 to 25 in 65b2e67
type WorkingHours struct { | |
StartTime string `json:"startTime"` | |
EndTime string `json:"endTime"` | |
TimeZone struct { | |
Name string `json:"name"` | |
} | |
DaysOfWeek []string `json:"daysOfWeek"` | |
} | |
type MailboxSettings struct { | |
TimeZone string `json:"timeZone"` | |
WorkingHours WorkingHours `json:"workingHours"` | |
} |
} | ||
|
||
func isKnownMeetingURL(location string) bool { | ||
return strings.Contains(location, "zoom.us/j/") || strings.Contains(location, "discord.gg") || strings.Contains(location, "meet.google.com") |
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.
Neat 👍 Something comes to mind, that a customer may have other call-related domains, including Mattermost Calls. Maybe have this configurable in some way?
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.
Yeah, I want to integrate calls too, but need to send the SITE_URL over to check the URL to do it properly, so it needs a bit more work. Also, Google sends conferenceData
for some events instead of location (I'm assuming they have a specific integration), so it wont work every time.
* oauth works * autocomplete * viewcal works * add unimplemented if blocks * fix tests and lint * implement CreateMySubscription, RenewSubscription, and DeleteSubscription gcal methods * WIP gcal subs * setup-attach make target * fix lint and tests * chore: more compatible tar command * add review comments * [GCAL] Create event logic (#269) * remote logic * allow datetimes without timezone * add calendar settings readonly scope to get tz * event conversion * scopes * revert datetime.time * bug: get timezone from datetime instead of event data (#271) * [GCAL] Allow building two different plugins under the same codebase (#268) * plugin profile images * receive provider flag * manifests * retrieve manifest id from file * Build time configuration * revert manifest * using go static configuration for providers * removed unused build flags * revert manifest * Added basic Google Calendar instructions * Update providers/GoogleCalendar.md Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * Update providers/GoogleCalendar.md Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * Update server/plugin/plugin.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * remoove log --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL] Endpoint to autocomplete connected calendar users (#275) * user_store: more information fields on the index * feat: endpoint to autocomplete calendar connected users * revert test event store hashed * Update server/api/autocomplete.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * Update server/api/autocomplete.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * dont expose private data in endpoint * lint * Update server/store/user_store.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL] Refactor Microsoft Calendar references to provider references (#276) * chore: replace provider display name * chore: replace command trigger references * revert previous changes * [GCAL] Enable notifications and reminders when a superuser token is not supported (#272) * nil control * use subscriptions default ttl * return specific error when no superuser token can be used * notification formatting logic to other file * Client.GetEventsBetweenDates * typo: import * shorter command name :) * availability without super user token * delete store subs only if we successfuly do on remote * comment * ignore missing subs * update sync method * allow switching acting user on the fly * daily summary without super user token * formatted imports * calendar -> calendarEvents * processAllDailySummaryByUser -> processAllDailySummaryWithIndividualCredentials * revert silenced error under notifications * msgraph GetEventsBetweenDates * Update server/mscalendar/daily_summary.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL] Create event logic (#269) * remote logic * allow datetimes without timezone * add calendar settings readonly scope to get tz * event conversion * scopes * revert datetime.time * Client.GetEventsBetweenDates * fix: store last post time * refactored availability logic * availability test * refactored daily summary logic * test: availability * daily summary tests (wip) * daily summary test * fix: merge duplications * slack attachment for notifications * lint and test * goimports * Update server/mscalendar/availability.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * remove logges * nullify client when changing acting user * move withActiveUser filter to fenced code outside of general method * tests: handling more scenarios * Fixed test after bugfix * fixed test assertions * allow engine copy to perform safe state mutations --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL] Added encrypted key value storage (#270) * Added encrypted kvstore * encrypt only oauth2 kv store * retrieve encryption setting from provider config * explicitly disable encrypted store for mscalendar * remove old comment * [GCAL] today/tomorrow commands with styling (#273) * feat: added today and tomorrow commands with attachments * remove unused function * linted * now -> day * remove unused code * today/tomorrow autocomplete * return tables on today/tomorrow commands * check for nil location * revert tomorrow day times four * fix markdown table render and test * [GCAL] Fix test in main branch from PR merges (#277) * fix: test from merges * add meeting url * [GCAL] Move configuration readyness logic to remotes (#279) * Move configuration logic to remotes * check encryption key as well * Update server/plugin/plugin.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL] Remove unused code (#278) * remove batch requests from gcal code * More info in readme * [GCAL] Fix event notifications not working due to missing scope permissions plus internal state (#282) * fix: notifications scope and acting user logic * remove log * avoid calling notifications if the engine fails to load * [GCAL] Unsubscriptions (#283) * fix: notifications scope and acting user logic * fix: gcal unsubscribe requiring more parameters * update gcal manifest (#285) * [GCAL] Better logging information (#287) * fix: better log information * log missing error * use correct manifest file on manifest calls (#290) * [GCAL] Embed tzdata and correctly parse location from event datetime (#288) * fix: embed tzdata to prevent errors on systems without it installed * move to main * avoid overwritting location if empty * use tags instead of import * [GCAL] Event notifications behind a feature flag (#292) * put event notifications behind a feature flag * admin only un/subscribe commands * properly fence notification processor * ignore notifications if there's no processor (#293) * [GCAL] Remove join event column (broken from merges) (#294) * remove join column from merges * revert manifest * [GCAL] Channels reminder underlying logic (#274) * nil control * use subscriptions default ttl * return specific error when no superuser token can be used * notification formatting logic to other file * Client.GetEventsBetweenDates * typo: import * shorter command name :) * availability without super user token * delete store subs only if we successfuly do on remote * comment * ignore missing subs * update sync method * allow switching acting user on the fly * daily summary without super user token * formatted imports * calendar -> calendarEvents * processAllDailySummaryByUser -> processAllDailySummaryWithIndividualCredentials * revert silenced error under notifications * msgraph GetEventsBetweenDates * Update server/mscalendar/daily_summary.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL] Create event logic (#269) * remote logic * allow datetimes without timezone * add calendar settings readonly scope to get tz * event conversion * scopes * revert datetime.time * Client.GetEventsBetweenDates * fix: store last post time * refactored availability logic * availability test * refactored daily summary logic * test: availability * daily summary tests (wip) * daily summary test * fix: merge duplications * slack attachment for notifications * lint and test * goimports * Allow poster to create posts * Allow store event metadata * styling * store recurring event id * deliver channel notifications * test: fixed for base case * test: channel reminders * test: recurring events * move from slice to map * Added store methods to interact with event metadata * lint * lint imports * restore logic lost in merge * duplicated test * Update server/mscalendar/availability_test.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * remove recurrent event id field --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * Updated google calendar readme * [GCAL] Summary command fixes (#286) * command trigger shown * added autocomplete to summary command * remove join meeting column * fix event subjects with table separator * fixed merge import * replace more characters in subject * [GCAL] Add a modal to create events (#281) * add webapp folder * WIP * opening create event modal from slash command works * add time selectors and initial impl of attendee selector * delete .npminstall * ignore .npminstall * [GCAL/MSCAL] Add endpoint to create events from the frontend (#291) * add remoteid to event attendee * api endpoint * conversion fixes * api logic * frontend logic to test * check if user belongs to channel * updated interface * use api/v1 prefix * implement getchannelmember * all day events * pluginAPI.CanLinkEventToChannel * autocomplete users * create event fetch call * channel autocomplete * improved error messages displayed to users * better error handling * channel selector store channel id * properly set email addresses for attendees * event location as string * response messages * little refactor * attendee selector can invite arbitrary emails * uppercase error dynamically * lowercase error * remove punctuation * linted ts files * goimports * fixed import * link events on creation * Add channel action to create events * add channel_id to payload * time selector every 15 minutes * time selector start/end with limits * capitalized error messages * don't allow 0 minute events * display timezone in channel reminders * utc time parsing * remove nullfunc * properly initialize variables * address some comments * npm run fix * Update webapp/src/components/time_selector.tsx Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * Update webapp/src/components/time_selector.tsx Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * refactor options with useMemo * capitalization in function for clarity * npm run fix * get plugin id from manifest * remove no-ops * refactor createEvent * fix channel autocomplete url * fix lint * fix user string typo * make it so `make apply` assumes gcal for now * more careful error handling * reorganize frontend error handling * default to CALENDAR_PROVIDER=gcal * use Client4.autocompleteChannels instead of custom plugin endpoint * fix manifest test --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * gofmt --------- Co-authored-by: Felipe Martin <me@fmartingr.com> Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com> * [GCAL/MSCAL] Store linked events per user to remove links on disconnection (#296) * add webapp folder * WIP * opening create event modal from slash command works * add time selectors and initial impl of attendee selector * delete .npminstall * ignore .npminstall * add remoteid to event attendee * api endpoint * conversion fixes * api logic * frontend logic to test * check if user belongs to channel * updated interface * use api/v1 prefix * implement getchannelmember * all day events * pluginAPI.CanLinkEventToChannel * autocomplete users * create event fetch call * channel autocomplete * improved error messages displayed to users * better error handling * channel selector store channel id * properly set email addresses for attendees * event location as string * response messages * little refactor * attendee selector can invite arbitrary emails * uppercase error dynamically * lowercase error * remove punctuation * linted ts files * goimports * fixed import * link events on creation * Add channel action to create events * add channel_id to payload * time selector every 15 minutes * time selector start/end with limits * capitalized error messages * don't allow 0 minute events * display timezone in channel reminders * utc time parsing * remove nullfunc * properly initialize variables * address some comments * npm run fix * store linked events for user to remove links on disconnection * typo * remove unused items after merge --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL/MSCAL] Remind only accepted events (#295) * remind only accepted events * fixed tests * excludeDeclinedEvents * normalize msgraph event response * Remove GoogleDomainVerifyKey setting (#299) * fix: encrypt user store (#297) * feat: send notifications when an event is created (#300) * typo: user already connected message (#301) * typo: user already connected message * test: fix change * typo: user already connected message (#301) * typo: user already connected message * test: fix change * [GCAL/MSCAL] Exclude rejected events from agenda commands (#302) * exclude rejected events from agenda commands * test: check that declied event are excluded * fix possible nil pointer * [GCAL/MSCAL] Create event modal only for connected accounts (#303) * only connected users chan use slash command * prevent channel menu action from allowing too * npm run fix * lint errors * retrieve provider configuration to use in messages * websocket events * add message to mobile users * npm run fix * Update webapp/src/plugin_hooks.ts Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * register modal in setup * events create * trigger from provide config * using dispatch * missing semicolon * Update webapp/src/plugin_hooks.ts Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * singular --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * updated settings to use style and removed current value line (#305) * show link to connect if not connected (#306) * [GCAL/MSCAL] Reduce welcome steps (#308) * reduce welcome steps and edit defaults * Update server/mscalendar/welcome_flow.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL/MSCAL] Control start/date times if the selected date is today (#307) * improvements to create event datetimes * reset starttime endtime on date change * repopulate times if date changed * npm run fix * database replication workaround (#312) * [GCAL/MSCAL] Catch errors when using `findmeetings` commands without enough parameters (#313) * fix: handle error in find meetings parameters command * changed loop variable usage * Replace Equals with ElementsMatch * makefile dist build for production (#314) * [GCAL/MSCAL] Create event UX improvements (#309) * Optional fields * time picker defaults * Add custom icon to Create Event menu item * add custom icon to date selector * npm run fix * header menu icon multiline * use scss * using proper typeRoots * scoped css style * [GCAL] Store conference data (#298) * extract conference data into new attribute * removed log * removed unused fuunction * tests * Update server/remote/gcal/get_default_calendar_view_test.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * more realistic datetime values --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * Common code refactor, back to mscalendar plugin (#334) * refactor: mscalendar -> engine * remove gcal assets * refactored common code outside server package * check-style * go mod tidy * REPO_URL -> REPOSITORY_URL * delete unknown file * updated mocks * apped user to handle after all actions (#335) * refactor msgraph to mscalendar * goimports * removed apply command from merge * remove "REVIEW:" comments --------- Co-authored-by: Felipe Martin <me@fmartingr.com> Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
* oauth works * autocomplete * viewcal works * add unimplemented if blocks * fix tests and lint * implement CreateMySubscription, RenewSubscription, and DeleteSubscription gcal methods * WIP gcal subs * setup-attach make target * fix lint and tests * chore: more compatible tar command * add review comments * [GCAL] Create event logic (#269) * remote logic * allow datetimes without timezone * add calendar settings readonly scope to get tz * event conversion * scopes * revert datetime.time * bug: get timezone from datetime instead of event data (#271) * [GCAL] Allow building two different plugins under the same codebase (#268) * plugin profile images * receive provider flag * manifests * retrieve manifest id from file * Build time configuration * revert manifest * using go static configuration for providers * removed unused build flags * revert manifest * Added basic Google Calendar instructions * Update providers/GoogleCalendar.md Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * Update providers/GoogleCalendar.md Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * Update server/plugin/plugin.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * remoove log --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL] Endpoint to autocomplete connected calendar users (#275) * user_store: more information fields on the index * feat: endpoint to autocomplete calendar connected users * revert test event store hashed * Update server/api/autocomplete.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * Update server/api/autocomplete.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * dont expose private data in endpoint * lint * Update server/store/user_store.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL] Refactor Microsoft Calendar references to provider references (#276) * chore: replace provider display name * chore: replace command trigger references * revert previous changes * [GCAL] Enable notifications and reminders when a superuser token is not supported (#272) * nil control * use subscriptions default ttl * return specific error when no superuser token can be used * notification formatting logic to other file * Client.GetEventsBetweenDates * typo: import * shorter command name :) * availability without super user token * delete store subs only if we successfuly do on remote * comment * ignore missing subs * update sync method * allow switching acting user on the fly * daily summary without super user token * formatted imports * calendar -> calendarEvents * processAllDailySummaryByUser -> processAllDailySummaryWithIndividualCredentials * revert silenced error under notifications * msgraph GetEventsBetweenDates * Update server/mscalendar/daily_summary.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL] Create event logic (#269) * remote logic * allow datetimes without timezone * add calendar settings readonly scope to get tz * event conversion * scopes * revert datetime.time * Client.GetEventsBetweenDates * fix: store last post time * refactored availability logic * availability test * refactored daily summary logic * test: availability * daily summary tests (wip) * daily summary test * fix: merge duplications * slack attachment for notifications * lint and test * goimports * Update server/mscalendar/availability.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * remove logges * nullify client when changing acting user * move withActiveUser filter to fenced code outside of general method * tests: handling more scenarios * Fixed test after bugfix * fixed test assertions * allow engine copy to perform safe state mutations --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL] Added encrypted key value storage (#270) * Added encrypted kvstore * encrypt only oauth2 kv store * retrieve encryption setting from provider config * explicitly disable encrypted store for mscalendar * remove old comment * [GCAL] today/tomorrow commands with styling (#273) * feat: added today and tomorrow commands with attachments * remove unused function * linted * now -> day * remove unused code * today/tomorrow autocomplete * return tables on today/tomorrow commands * check for nil location * revert tomorrow day times four * fix markdown table render and test * [GCAL] Fix test in main branch from PR merges (#277) * fix: test from merges * add meeting url * [GCAL] Move configuration readyness logic to remotes (#279) * Move configuration logic to remotes * check encryption key as well * Update server/plugin/plugin.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL] Remove unused code (#278) * remove batch requests from gcal code * More info in readme * [GCAL] Fix event notifications not working due to missing scope permissions plus internal state (#282) * fix: notifications scope and acting user logic * remove log * avoid calling notifications if the engine fails to load * [GCAL] Unsubscriptions (#283) * fix: notifications scope and acting user logic * fix: gcal unsubscribe requiring more parameters * update gcal manifest (#285) * [GCAL] Better logging information (#287) * fix: better log information * log missing error * use correct manifest file on manifest calls (#290) * [GCAL] Embed tzdata and correctly parse location from event datetime (#288) * fix: embed tzdata to prevent errors on systems without it installed * move to main * avoid overwritting location if empty * use tags instead of import * [GCAL] Event notifications behind a feature flag (#292) * put event notifications behind a feature flag * admin only un/subscribe commands * properly fence notification processor * ignore notifications if there's no processor (#293) * [GCAL] Remove join event column (broken from merges) (#294) * remove join column from merges * revert manifest * [GCAL] Channels reminder underlying logic (#274) * nil control * use subscriptions default ttl * return specific error when no superuser token can be used * notification formatting logic to other file * Client.GetEventsBetweenDates * typo: import * shorter command name :) * availability without super user token * delete store subs only if we successfuly do on remote * comment * ignore missing subs * update sync method * allow switching acting user on the fly * daily summary without super user token * formatted imports * calendar -> calendarEvents * processAllDailySummaryByUser -> processAllDailySummaryWithIndividualCredentials * revert silenced error under notifications * msgraph GetEventsBetweenDates * Update server/mscalendar/daily_summary.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL] Create event logic (#269) * remote logic * allow datetimes without timezone * add calendar settings readonly scope to get tz * event conversion * scopes * revert datetime.time * Client.GetEventsBetweenDates * fix: store last post time * refactored availability logic * availability test * refactored daily summary logic * test: availability * daily summary tests (wip) * daily summary test * fix: merge duplications * slack attachment for notifications * lint and test * goimports * Allow poster to create posts * Allow store event metadata * styling * store recurring event id * deliver channel notifications * test: fixed for base case * test: channel reminders * test: recurring events * move from slice to map * Added store methods to interact with event metadata * lint * lint imports * restore logic lost in merge * duplicated test * Update server/mscalendar/availability_test.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * remove recurrent event id field --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * Updated google calendar readme * [GCAL] Summary command fixes (#286) * command trigger shown * added autocomplete to summary command * remove join meeting column * fix event subjects with table separator * fixed merge import * replace more characters in subject * [GCAL] Add a modal to create events (#281) * add webapp folder * WIP * opening create event modal from slash command works * add time selectors and initial impl of attendee selector * delete .npminstall * ignore .npminstall * [GCAL/MSCAL] Add endpoint to create events from the frontend (#291) * add remoteid to event attendee * api endpoint * conversion fixes * api logic * frontend logic to test * check if user belongs to channel * updated interface * use api/v1 prefix * implement getchannelmember * all day events * pluginAPI.CanLinkEventToChannel * autocomplete users * create event fetch call * channel autocomplete * improved error messages displayed to users * better error handling * channel selector store channel id * properly set email addresses for attendees * event location as string * response messages * little refactor * attendee selector can invite arbitrary emails * uppercase error dynamically * lowercase error * remove punctuation * linted ts files * goimports * fixed import * link events on creation * Add channel action to create events * add channel_id to payload * time selector every 15 minutes * time selector start/end with limits * capitalized error messages * don't allow 0 minute events * display timezone in channel reminders * utc time parsing * remove nullfunc * properly initialize variables * address some comments * npm run fix * Update webapp/src/components/time_selector.tsx Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * Update webapp/src/components/time_selector.tsx Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * refactor options with useMemo * capitalization in function for clarity * npm run fix * get plugin id from manifest * remove no-ops * refactor createEvent * fix channel autocomplete url * fix lint * fix user string typo * make it so `make apply` assumes gcal for now * more careful error handling * reorganize frontend error handling * default to CALENDAR_PROVIDER=gcal * use Client4.autocompleteChannels instead of custom plugin endpoint * fix manifest test --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * gofmt --------- Co-authored-by: Felipe Martin <me@fmartingr.com> Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com> * [GCAL/MSCAL] Store linked events per user to remove links on disconnection (#296) * add webapp folder * WIP * opening create event modal from slash command works * add time selectors and initial impl of attendee selector * delete .npminstall * ignore .npminstall * add remoteid to event attendee * api endpoint * conversion fixes * api logic * frontend logic to test * check if user belongs to channel * updated interface * use api/v1 prefix * implement getchannelmember * all day events * pluginAPI.CanLinkEventToChannel * autocomplete users * create event fetch call * channel autocomplete * improved error messages displayed to users * better error handling * channel selector store channel id * properly set email addresses for attendees * event location as string * response messages * little refactor * attendee selector can invite arbitrary emails * uppercase error dynamically * lowercase error * remove punctuation * linted ts files * goimports * fixed import * link events on creation * Add channel action to create events * add channel_id to payload * time selector every 15 minutes * time selector start/end with limits * capitalized error messages * don't allow 0 minute events * display timezone in channel reminders * utc time parsing * remove nullfunc * properly initialize variables * address some comments * npm run fix * store linked events for user to remove links on disconnection * typo * remove unused items after merge --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL/MSCAL] Remind only accepted events (#295) * remind only accepted events * fixed tests * excludeDeclinedEvents * normalize msgraph event response * Remove GoogleDomainVerifyKey setting (#299) * fix: encrypt user store (#297) * feat: send notifications when an event is created (#300) * typo: user already connected message (#301) * typo: user already connected message * test: fix change * typo: user already connected message (#301) * typo: user already connected message * test: fix change * [GCAL/MSCAL] Exclude rejected events from agenda commands (#302) * exclude rejected events from agenda commands * test: check that declied event are excluded * fix possible nil pointer * [GCAL/MSCAL] Create event modal only for connected accounts (#303) * only connected users chan use slash command * prevent channel menu action from allowing too * npm run fix * lint errors * retrieve provider configuration to use in messages * websocket events * add message to mobile users * npm run fix * Update webapp/src/plugin_hooks.ts Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * register modal in setup * events create * trigger from provide config * using dispatch * missing semicolon * Update webapp/src/plugin_hooks.ts Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * singular --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * updated settings to use style and removed current value line (#305) * show link to connect if not connected (#306) * [GCAL/MSCAL] Reduce welcome steps (#308) * reduce welcome steps and edit defaults * Update server/mscalendar/welcome_flow.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * [GCAL/MSCAL] Control start/date times if the selected date is today (#307) * improvements to create event datetimes * reset starttime endtime on date change * repopulate times if date changed * npm run fix * database replication workaround (#312) * [GCAL/MSCAL] Catch errors when using `findmeetings` commands without enough parameters (#313) * fix: handle error in find meetings parameters command * changed loop variable usage * Replace Equals with ElementsMatch * makefile dist build for production (#314) * [GCAL/MSCAL] Create event UX improvements (#309) * Optional fields * time picker defaults * Add custom icon to Create Event menu item * add custom icon to date selector * npm run fix * header menu icon multiline * use scss * using proper typeRoots * scoped css style * [GCAL] Store conference data (#298) * extract conference data into new attribute * removed log * removed unused fuunction * tests * Update server/remote/gcal/get_default_calendar_view_test.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * more realistic datetime values --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * Common code refactor, back to mscalendar plugin (#334) * refactor: mscalendar -> engine * remove gcal assets * refactored common code outside server package * check-style * go mod tidy * REPO_URL -> REPOSITORY_URL * delete unknown file * updated mocks * apped user to handle after all actions (#335) * refactor msgraph to mscalendar * refactor: removed unused commands * Update calendar/command/command.go Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> * go mod tidy * removed added code from merge --------- Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> Co-authored-by: Raghav Aggarwal <raghav.aggarwal@brightscout.com> Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Summary
/trigger summary today
,/trigger summary tomorrow
/trigger today
,/trigger tomorrow
.GetDailySummaryForUser(user *User) (string, error)
toGetDaySummaryForUser(now time.Time, user *User) (string, error)
(allows sending the day, since the logic is the same).RenderDaySummary
which uses slack attachments to display each event (see screenshots below)DMWithMessageAndAttachments(mattermostUserID, message string, attachments ...*model.SlackAttachment) (string, error)
Ticket Link
Notes
Poster
cloud be improved by using a more generative approach: Example:Poster.DM(mattermostUserID, option.WithAttachments(attachments), options.WithMessage(message))
.Screenshots