Mattermost-server: [MM-14185] Demo plugin: illustrate interactive dialogs

Created on 14 Feb 2019  ·  18Comments  ·  Source: mattermost/mattermost-server

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. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.


Notes: Jira ticket

The Mattermost Demo Plugin is intended to illustrate everything a Mattermost plugin can do. Right now, however, it doesn't show off the full power of interactive messages, particularly the interactive dialogs: https://docs.mattermost.com/developer/interactive-dialogs.html

This ticket would involve the following three parts, giving you a great introduction to plugins and interactive dialogs.

1) Have the demo plugin register a slash command “/dialog”. When posted, an interactive dialog is returned with the dialog parameters that follows the example provided in the documentation: https://docs.mattermost.com/developer/interactive-dialogs.html#example

You are welcome to make changes to the parameters of your choice. We recommend keeping the types and subtypes for each element unchanged, so that different types are highlighted in the plugin.

2) Have the demo plugin output a post with an interactive message button and an interactive message menu, both opening a dialog.

3) Ideally, the README.md would reflect a screenshot of the interactive dialog showing some of the fields and explaining the new behaviour. The QA team at Mattermost could then have a reference by which to verify the expected plugin behaviour from release to release to ensure that the dialog remains functional.

4) After the user has submitted the dialog, post a message containing the provided information in the channel.

As an additional bonus, use of the ability to validating input (https://docs.mattermost.com/developer/interactive-dialogs.html#dialog-submission) when submitting a dialog.

Feel free to join us the community discussion if you have questions or want to flesh out a proposal.

AreIntegrations Medium Help Wanted PR Exists TecGo

Most helpful comment

@hanzei Just started working on it. Will post in developer channel question I have.

All 18 comments

Hi, Does this require any react changes as well? If not, I can try it.

This is a pure Go ticket. Do you want to take care of it @gupsho?

Sure, will give it a try.

Hey @gupsho,

Just wanted to check how your work on this ticket is going. Do you have any questions?

@hanzei Just started working on it. Will post in developer channel question I have.

@hanzei extremely sorry, I havent been able to work on this and will not get a chance for at least 2 more weeks. Can you please open this up for everyone again and as soon as I have more time, if this is available I will it up again.

Hey @gupsho,

Thanks for the heads up. :+1: No problem, if will just make this ticket available to everyone again.

Let me know, if you have the time to work on this again.

I will work on this

@jasonblais A few questions about this ticket:

  1. Have the demo plugin output a post with an interactive message button and an interactive message menu, both opening a dialog.

When should this message be posted? When a new slash command is triggered?

  1. After the user has submitted the dialog, post a message containing the provided information in the channel.

What do you think about this solution?
Screenshot from 2019-04-28 12-05-14

I would like to also add a dialog with no elements manly as a preparation for https://github.com/mattermost/mattermost-server/issues/10686. When should this dialog be opened? Options I can see:

  • When a new slash command /dialog_without_elements is executed.
  • Add a new parameter to the /dialog command, like /dialog without_elements

What do you think about this?

Step 2: I'm actually not sure if this is needed. I don't remember the use case. So maybe we leave this one out for now.

Step 4: Yes, but I'm wondering if we should make this an ephemeral message given it has an email field.

For a dialog with no elements, I prefer the second option with only a single slash command to trigger a dialog. I'm 0/5 on the name of the parameter. Another option is /dialog no-elements

Step 2: :ok:
Step 4: Is your concern that people fill this with personal data? At the end this is just a demo.

Let's go with /dialog no-elements.

Step 4: Right. Someone may use the demo plugin as a sample for their own plugin. So even if it's just a demo plugin, we don't want to make it a best practice to post the output containing personal data into a channel.

Step 4: My reason to post it as a "normal" message is that we can use the custom post type to show the data in this "black style", which is consistent with the other posts we make.

Let's defer this questions for later.

@hanzei We could just omit the email and post the other data. Gives an example for someone to output only part of the data back to the channel.

Hey guys, I' very new here and I'm just trying to run this using:

server: HEAD -> 5.11.0, tag: v5.11.0-rc3, tag: v5.11.0, upstream/release-5.11
webapp: HEAD -> 5.11.0, tag: v5.11.0-rc3, tag: v5.11.0, upstream/release-5.11
  • I cleaned, nuked and ran again.
  • Plugin tests are passing
  • But I'm getting this error on the client:
Uncaught TypeError: e.registerTranslations is not a function

Is this something interesting for this PR? or It's just me screwing something.

Excuse me if this is not the channel to share something like this if there is a better way I would like to learn so please send me to the doc I'm missing reading. I'm assuming its ok since this was not happening on other commit but on this specific tag for this plugin.

Hey @scastillo,

Thanks for your interest in this project. The error you see is not related to this ticket. But if you are interested it fixing this, it would be highly appreciated.

Just to be explicid: I'm currently working on this ticket. The PR can be found at https://github.com/mattermost/mattermost-plugin-demo/pull/28. But after this is merged, help with improving this would be appreciated.

Feel free to join the "Extensions" Channel on the Mattermost Community Server for more discussion about plugins and integrations.

Oh its actually same issue mentioned here in (1): https://github.com/mattermost/mattermost-plugin-demo/pull/28#issuecomment-489373907

And yeah I would love to help to fix this if it ends up being a real issue. So I'm moving to extensions and asking more about how to create an issue about it. Is that an acceptable way to continue?

Danke.

Fixing console errors is always a good thing :wink:

You really need an issue to submit a PR. But if you want, I can create on on this repo.

Was this page helpful?
0 / 5 - 0 ratings