mattermost / mattermost/mattermost-developer-documentation
Help Wanted: Recommend using `openModal` in webapp plugin development guide
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 90
- Forks
- 460
- Avg merge
- 9d 23h
- Merged PRs (30d)
- 2
Description
Related ticket https://mattermost.atlassian.net/browse/MM-41610
This change should be placed in a new file in the webapp plugin development guide https://developers.mattermost.com/integrate/plugins/webapp
Proposed addition to Documentation
If a webapp plugin needs to open a modal for its own use, it should use the globally exposed window.openModal function. This is recommended because it allows the core webapp to properly handle the lifecycle of the component.
Here's an example of using this function:
this.props.actions.openModal({
modalId: 'my-plugin-id_my-modal-id',
dialogType: MyModal,
dialogProps: {
someComponentProp: 'some value'.
},
});
- Replace
my-plugin-id,my-modal-id, with appropriate values. dialogTypeshould be a React component implemented by the plugin. This is the component that will be instantiated whenopenModalis called.- The component will receive the
dialogPropsobject as React props.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the webapp plugin development guide at developers.mattermost.com/integrate/plugins/webapp and review the linked window.openModal export for context. Add a new file containing the proposed recommendation, TypeScript example, and explanations of modalId, dialogType, and dialogProps; done means the guidance is published in the guide.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100