Giter VIP home page Giter VIP logo

mattermost-plugin-google-calendar's Introduction

⚠️ Disclaimer

This repository is community supported and not maintained by Mattermost. Mattermost disclaims any and all liability for integrations, including Third Party Integrations and Mattermost Integrations. All integrations are provided "AS IS", and may be used at your own risk. Integrations may be modified or discontinued at any time.

Mattermost Google Calendar Plugin

Delivery status Code Coverage Release HW

A Google Calendar plugin for Mattermost.

Documentation

About | Set up | Configure | Use

Features

  • Receive a daily summary at a specific time
  • Receive event reminders 5 minutes before a meeting via direct message
  • Create events directly from a channel, optionally linking them to a channel for reminders
  • Receive event remidners 5 minutes before a meeting via message post
  • Automatically set an user status (away, DND) during meetings
  • View your today or tomorrow's agenda with a slash command
  • Easily configurable settings using an attachment interface

Contribute

Requirements

Build the plugin

  1. Clone this repository.
  2. Run make dist.
  3. When the build process finishes the plugin tarball will be available at dist/com.mattermost.gcal-$(VERSION).tar.gz
  4. In your Mattermost Server, go to System Console > Plugin Management and upload the .tar.gz file to install the plugin.

Acknowledgments

mattermost-plugin-google-calendar's People

Contributors

abdulsmapara avatar augustasv avatar byeongsupark avatar crspeller avatar cwarnermm avatar dependabot[bot] avatar fmartingr avatar godlikepenguin avatar hahmadia avatar hanzei avatar justinegeffen avatar mickmister avatar streamer45 avatar svenseeberg avatar tarrow avatar wiersgallak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mattermost-plugin-google-calendar's Issues

Don't send two notifications for upcoming meeting

If you currently have the setting Get Confirmation before changing status, you get two notifications back to back before any meeting. It would be ideal if these could be condensed into one to reduce the amount of mentions received per meeting (so adding the question of status change to the reminder notification).

Current notifications before the meeting:

Screen Shot 2023-10-19 at 11 58 31 AM

Share summary list in channel

We want a bot to post the daily summary of events in a channel. This is basically the same functionality of /calendar summary, with the output sent to the current channel instead of a direct message. Would a PR for this be welcome?

I think we should add a new command for this, for example /calendar share or /calendar share-summary. Is there a better solution?

Then it would be pretty straight forward:

  1. Add a new switch in https://github.com/mattermost/mattermost-plugin-google-calendar/blob/master/server/command_hooks.go#L112
  2. Create a function that "duplicates" https://github.com/mattermost/mattermost-plugin-google-calendar/blob/master/server/command_hooks.go#L190 and sends the result to the current channel instead of p.CreateBotDMPost(userID, text)

Regenerating the encryption key should delete plugin records from the key value store

Using Mattermost 9.2.3 on Oracle Linux 9.1, the Google Calendar plugin keeps on crashing until Mattermost disables it; The error messages all contain "cipher: message authentication failed".

I've tried reinstalling the plugin multiple times, as well as recreating the OAuth tokens, and I've changed the encryption key, so is there anything I'm missing?

The full log for my latest attempt is in this Github gist, but here are the errors sent directly by gcal to the admin account:

(log WARN) Not able to load user 46fpc3eaabd4untu5zaupcnfhy from user index. err=cipher: message authentication failed
(log ERROR) Error renewing subscription. err=It looks like your Mattermost account is not connected to Google Calendar. Please connect your account using /gcal connect.: cipher: message authentication failed

Original issue title: Plugin not working because of cipher errors

[Request] Customizable reminder timing

The current version sends out a reminder 5 minutes before an event. My workplace is currently needing to modify this by hand to be 1 minute before as a reminder, since some people have a tendency to be focused and forget while they do something else during that 5 minute window.

Ideally, though, this could be customizable per user. And maybe a user could get multiple reminders.

For example, I'd prefer 5 minute reminders to 1 minute reminders (but management wants 1m). But if I could get both 5m and 1m reminders, that would be even better (for me)! But I suspect most of my coworkers would only want one reminder, not multiple.

For simplicity, this could be specified by user as something like 1|5|10 or 10 or 1|5 with a single text box.

Allow users to RSVP events in event reminders in DMs

Allow users to answer attendance status of the events directly from event notifications sent in DMs.

Mockup screenshot

Screenshot 2023-08-31 at 15 05 17

Acceptance criteria

  • Allow users to answer to new events or event changes in DMs. (Requires #51)
  • Display clearly the user choice in the message.
  • Must work on desktop and mobile.

Related tasks

  • Requires: #51

Integrate GolangCI-Lint

Mattermost is currently in the process of using golangci-lint as the default linter for all go projects. mattermost-community/mattermost-plugin-autolink#108 serves as an example of how the migration should look like:

  1. Copy .golangci.yml from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.
  2. Copy Makefile from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.
  3. Copy build/ from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.
  4. Run go mod tidy and make dist to ensure the build system works fine.
  5. Update linters-settings.goimports.local-prefixes to the go module path i.e. to github.com/mattermost/mattermost-plugin-aws-SNS.
  6. Run make golangci-lint and fix all issues that arise.

Fixing an linter issue is sometimes trivial but can also be quite complicated. There might be cases, where ignoring an issue using issues.exclude-rules is needed. If you don't know how to resolve an error, please reach out to @hanzei on the Mattermost Community Server or ask the question here.

Allow event change notifications for Google Calendar

Currently the Google Calendar provider doesn't have event notifications enabled, meaning that users and channels won't get notified on event changes.

Acceptance criteria

  • Allow Google Calendar event notifications via webhooks (or any other method available that meets the criteria below)
  • Users should receive DM notifications on event changes, highlighting what changed.
  • Channels with linked events should receive posts on event changes, highlighting what changed.

Installing

I want to install your plugin, but it isn't on Marketplace, so reading the instructions point '7. Upload the plugin to Mattermost...' I can't figure out how, I have no upload button. I am currently on a trial account does this make a difference?

Thank you

Refactor response status textToPost

Summary

The updateEventsInDatabase() function could benefit from refactoring. This ticket is a request to create a utility function to share this duplicated code.

Here is the relevant code that needs to be modified:
https://github.com/mattermost/mattermost-plugin-google-calendar/blob/master/server/utils.go#L202
https://github.com/mattermost/mattermost-plugin-google-calendar/blob/master/server/utils.go#L372


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team.

New contributors, please see our Developer's Guide and our Plugins Guide.

Stuck at Sign-on Stage

I uploaded the alpha release of the plugin on my mattermost setup , i was able to complete the setup , however when i am using /calendar connect to connect to my calendar , it gets stuck on the sign-on part after asking for permissions (I am allowing them) , what can I do to resolve this issue i am facing.Thanks!!

Missing option to link events to a channel for reminders.

Looking at the features list, I'm trying to see how to do the second part of this: "Create events directly from a channel, optionally linking them to a channel for reminders"
Specifically, I want the daily reminders to post to a channel where everyone on the server can see it. My org has a shared google account for meetings and this would allow us to mimic the functionality we got out of slack, where we get a daily post of the upcoming meetings for the day.

`/gcal viewcal` and daily summary show up declined events

The current implementation of the /trigger viewcal and the daily summary show up declined events for Google Calendar. For consistency, we should make it so declined events do not show up in those command results.

Acceptance criteria

  • Using /gcal viewcal will show up only events that are not declined. (Accepted, Tentative, not-answered)
  • The daily summary should not display events that are declined.

Related tasks

make fails

hi, I am getting the following error when executing make

WARN [runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner.  
server/plugin.go:15:13: fieldalignment: struct with 72 pointer bytes could be 48 (govet)
type Plugin struct {
            ^
make: *** [Makefile:47: golangci-lint] Error 1

system:

ubuntu 20.04 lts
$ go version
go version go1.15.5 linux/amd64

golangci-lint version
golangci-lint has version 1.46.2 built from a3336890 on 2022-05-17T11:31:29Z

best, dan

Trying to apply a user settings fails with a 400 bad request error

When using /gcal settings and clicking one of the options nothing happens. When looking into the Dev Console you can see the following request being responded to with a error 400.

When inspecting the request you can see that the selected_option is empty.

POST https://mattermost.xxxx.com/api/v4/posts/~redacted~/actions/~redacted~

{"selected_option":""}

The server then responds with:

{
    "id": "api.post.do_action.action_integration.app_error",
    "message": "Action integration error.",
    "detailed_error": "",
    "request_id": "<redacted>",
    "status_code": 400
}

Server version is 8.1.6
Plugin version is 1.0.1

How to reproduce

  1. Setup the plugin
  2. Go through gcal connect
  3. execute gcal settings
  4. Click any of the settings
  5. Nothing happens. Bad request error in the dev console

Could someone point me to where the code for this functionality lives? I tried looking into it however its not clear to me which part of the code handles this.

Unable to make dist

Using an macBook Air M2, when I try to 'make dist' I get the following error:
npm, gcc and go on newest version

npm WARN deprecated [email protected]: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
npm WARN deprecated [email protected]: Package moved to @redux-devtools/serialize.
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: Package moved to @redux-devtools/instrument.
npm WARN deprecated [email protected]: Package moved to @redux-devtools/app.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: 1.x.x versions of the SDK are deprecated. Please upgrade to the latest (2.x.x) version
npm WARN deprecated [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated @types/[email protected]: This is a stub types definition. history provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.

added 1509 packages, and audited 1510 packages in 1m

165 packages are looking for funding
  run `npm fund` for details

6 vulnerabilities (1 low, 2 moderate, 1 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
touch webapp/.npminstall
cd webapp && /opt/homebrew/bin/npm run build;

> build
> webpack --mode=production

assets by status 1.05 KiB [cached] 1 asset
./src/index.tsx 39 bytes [built] [code generated] [1 error]

ERROR in ./src/index.tsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:68:19)
    at Object.createHash (node:crypto:138:10)
    at filename (/Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:94:23)
    at /Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:120:39
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:3:103)
    at _next (/Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:5:194)
    at /Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:5:364
    at new Promise (<anonymous>)
    at /Users/michaelklomfass/mattermost-plugin-google-calendar/webapp/node_modules/babel-loader/lib/cache.js:5:97

webpack 5.75.0 compiled with 1 error in 384 ms
make: *** [webapp] Error 1

Unable to view calendars shared to user

I have connected my Google account but I am unable to see calendars shared with me.

I hope to be able to see calendars shared with me and create events on them as well

Make command failed

I installed listed dependencies, then cloned the repository and run command make.

This is the error:

build/deploy/main.go:116:8: undeclared name: `archiver` (typecheck)
        err = archiver.Unarchive(bundlePath, targetPath)
              ^
build/deploy/main.go:12:2: "github.com/mholt/archiver/v3" imported but not used (typecheck)
        "github.com/mholt/archiver/v3"
        ^
server/utils.go:63:54: undeclared name: `calendar` (typecheck)
func (p *Plugin) getCalendarService(userID string) (*calendar.Service, error) {
                                                     ^
server/utils.go:141:73: undeclared name: `calendar` (typecheck)
func (p *Plugin) updateEventsInDatabase(userID string, changedEvents []*calendar.Event) {
                                                                        ^
server/utils.go:334:57: undeclared name: `calendar` (typecheck)
func (p *Plugin) printEventSummary(userID string, item *calendar.Event) string {
                                                        ^
server/api.go:53:14: p.API undefined (type *Plugin has no field or method API) (typecheck)
        if err := p.API.KVSet(state, []byte(state)); err != nil {
                    ^
server/api.go:89:27: p.API undefined (type *Plugin has no field or method API) (typecheck)
        storedState, apiErr := p.API.KVGet(state)
                                 ^
server/api.go:100:14: p.API undefined (type *Plugin has no field or method API) (typecheck)
        if err := p.API.KVDelete(state); err != nil {
                    ^
server/plugin.go:37:18: p.Helpers undefined (type *Plugin has no field or method Helpers) (typecheck)
        botID, err := p.Helpers.EnsureBot(&model.Bot{
                        ^
server/api.go:13:2: "google.golang.org/api/calendar/v3" imported but not used (typecheck)
        "google.golang.org/api/calendar/v3"
        ^
server/command_hooks.go:14:2: "google.golang.org/api/calendar/v3" imported but not used (typecheck)
        "google.golang.org/api/calendar/v3"
        ^
server/utils.go:19:2: "google.golang.org/api/calendar/v3" imported but not used (typecheck)
        "google.golang.org/api/calendar/v3"
        ^
../../../snap/golangci-lint/80/src/runtime/cgo/cgo.go:34:8: could not import C (cgo preprocessing failed) (typecheck)
import "C"
       ^
make: *** [Makefile:47: golangci-lint] Error 1

Use Custom Status and times from Calendar sync

Allow the Plugin to use the Custom status and make a meeting with a time from the calendar as the time limit

Having this directly blocking out your time will help with showing availability, having the option to still use away and DND would be good also but having it reflect in the status would be amazing

image


Add autocomplete icon

Since v5.24 slash commands can provide an svg via AutocompleteIconData in model.Command that is then shown in the autocomplete list. This ticket is about adding the icon in assets to the slash command.

Include screenhots from a dark and a bright theme in the PR description, as there might be the need for a separate icon with a white background for autocomplete.

Similar PRs:
For GitHub plugin mattermost/mattermost-plugin-github#359
For Jira plugin mattermost/mattermost-plugin-jira#653

Switch time inputs to `input[type="time"]`

The create event modal uses simple <select/> elements to select the time of the event. <input/> elements can be of type time which will leave the implementation to the browser with an already defined UI and they also allow for a min/max/step parameters to customize the options.

Acceptance criteria

  • Migrate custom selects to input[type="time"]
  • Do not break current integration with the date field:
    • If the date is today, we should only allow a start/end time after the current time.
    • End time should only allow times after Start time.

Related tasks

gcal plugin fails to start without siteurl but still appears enabled

With the siteURL blank in Mattermost the gcal plugin appears to start, but in fact it crashes.

{"timestamp":"2024-05-01 19:36:14.820 Z","level":"info","msg":"[ERROR] call to OnConfigurationChange failed, error: plugin requires Mattermost Site URL to be set","caller":"io/io.go:429","plugin_id":"com.mattermost.gcal","source":"plugin_stderr"}
{"timestamp":"2024-05-01 19:36:14.820 Z","level":"info","msg":"[ERROR] call to OnConfigurationChange failed, error: plugin requires Mattermost Site URL to be set","plugin_id":"com.mattermost.gcal","source":"plugin_stderr"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"panic: runtime error: invalid memory address or nil pointer dereference","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x107af61]","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"goroutine 42 [running]:","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"panic: runtime error: invalid memory address or nil pointer dereference","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x107af61]","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"","plugin_id":"com.mattermost.gcal"}
{"timestamp":"2024-05-01 19:36:14.825 Z","level":"debug","msg":"goroutine 42 [running]:","plugin_id":"com.mattermost.gcal"}

{"timestamp":"2024-05-01 19:36:44.413 Z","level":"debug","msg":"Deactivating plugin due to multiple crashes","id":"com.mattermost.gcal"}

Ideally, you can't even enable to gcal plugin without setting the siteurl

Create functions for ExecuteCommand Switch statement

Summary

The ExecuteCommand() function handles the slash commands for a plugin, with the use of a switch statement. Currently each case contains all the logic to handle each slash command. This ticket is a request to modify each case to return a call to a function which will contain all of the logic. This will make the ExecuteCommand() function more readable and easy to understand, plus delegate a function to handle each slash command input.

Here is the relevant code that needs to be modified:
https://github.com/mattermost/mattermost-plugin-google-calendar/blob/master/server/command_hooks.go#L83

The https://github.com/mattermost/mattermost-plugin-demo example has an example for the proposed changes.
https://github.com/mattermost/mattermost-plugin-demo/blob/master/server/command_hooks.go#L111


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team.

New contributors please see our Developer's Guide and our Plugins Guide.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.