Skip to content

Commit bcbdd3e

Browse files
neflytecwarnermmaziglerlevb
authored
Create new content for Apps Structure topic (#1111)
* Update Apps Structure Manifest topic; Update styles to not break words in links of table cells; Fix trailing space when newtabref shortcode is rendered * Update existing content in Apps Structure topic; Fix missing CSS styles for h4, h5, and h6 headings; Modify CSS to not break words used in links in a table cell * Add support for Compass Icons; Move FontAwesome files from fonts directory to font directory since compass-icons.css expects its files there; Update Apps structure main topic, manifest, and calls topics; Moved call metadata (expand) to its own topic * Add image to Apps Structure topic homepage which illustrates call handlers binding to locations * More improvements to App Calls topic * Remove unimplemented or unsupported struct fields; Improve context example * Pull compass icons assets once and commit instead of pulling with each build; Update Makefile dist target to not pull compass icons; Update Structure topic homepage diagram with simplified version; Update Call metadata topic * Start updating Bindings sub topic * Further updates to Bindings, call, and call metadata topics; Update CSS styles to not word-break monospaced text in a table cell * Finish up changes to Bindings topic; Use star icon as the symbol to denote extra information instead of a different symbol for each case * Improve support for collapsable blocks using existing Bootstrap components and Compass icons; Update collapsable blocks in bindings topic * Add content in Static assets topic * Apply suggestions from code review Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Changes based on PR feedback * Apply suggestions from code review Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update site/content/integrate/apps/functionality/_index.md Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Modify collapse, compass-icon, newtabref, and note shortcodes to use alt text and screen reader support for all icons; Add alt text and screen reader support for icons in the Structure section * Update description of Bindings * Apply suggestions from code review Co-authored-by: Lev <1187448+levb@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Lev <1187448+levb@users.noreply.github.com> * Apply changes from PR reviews Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> Co-authored-by: Andrew Zigler <andrewzigler@gmail.com> Co-authored-by: Lev <1187448+levb@users.noreply.github.com>
1 parent 552d6b5 commit bcbdd3e

31 files changed

+1139
-376
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,10 @@ run:
2727
build:
2828
rm -rf ./dist
2929
hugo -s site --verbose --destination ../dist/html --printUnusedTemplates --printPathWarnings --gc
30+
31+
.PHONY: compass-icons
32+
compass-icons:
33+
mkdir -p site/static/css
34+
mkdir -p site/static/font
35+
curl --no-progress-meter -o site/static/css/compass-icons.css https://mattermost.github.io/compass-icons/css/compass-icons.css
36+
curl --no-progress-meter -o "site/static/font/compass-icons.#1" "https://mattermost.github.io/compass-icons/font/compass-icons.{eot,woff2,woff,ttf,svg}"

site/config.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ pygmentsStyle = "manni"
1919
email = ""
2020
ghrepo = "https://github.com/mattermost/mattermost-developer-documentation/"
2121

22+
# Parameters controlling collapsable blocks
23+
[params.collapse]
24+
collapsedIcon = "icon-chevron-right" # Icon to show when the block is collapsed
25+
expandedIcon = "icon-chevron-down" # Icon to show when the block is expanded
26+
collapseShowClass = "show" # CSS class to add when expanding the block
27+
toggleClass = "collapseToggle" # CSS class to control icon attributes (e.g. size)
28+
2229
[params.mailinglist]
2330
enable = false
2431

site/content/integrate/apps/functionality/_index.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ title: Functionality
33
description: Apps API functionality
44
weight: 60
55
---
6+
In addition to the {{<newtabref title="Mattermost REST APIs" href="https://api.mattermost.com">}}, the Apps framework provides additional functionality:
67

7-
### Coming soon!
8-
In the future this section will explore additional functionality that Apps provide. For example, event subscriptions.
8+
- [KV Store]({{< ref "kv-store" >}}) - a simple key-value store for App-specific data.
9+
10+
- [OAuth2 Store]({{< ref "mattermost-api#apps-api" >}}) - store, expand, and retrieve user and App OAuth2 configuration data.
11+
12+
- [Calling other Apps]({{< ref "mattermost-api#apps-api" >}}) - use the Call API to invoke other Apps (experimental).
13+
14+
- [Subscriptions]({{< ref "subscriptions" >}}) learn how to subscribe to notifications about Mattermost events. For example: have your App notified whenever a message is posted in a channel that mentions your @bot account.
15+
16+
- [External webhooks]({{< ref "external-webhooks" >}}) learn how to subscribe to webhooks from third-party systems.
17+
18+
See [Authenticating with Mattermost]({{< ref "/integrate/apps/authentication/app-to-mattermost" >}}) to learn how to authenticate to all these services.

site/content/integrate/apps/structure/_index.md

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,14 @@ aliases:
99

1010
Apps consist of three kinds of assets:
1111

12-
- [manifest.json]({{< ref "manifest" >}}) file
12+
1. A [manifest]({{< ref "manifest" >}}), which contains App details such as name, version, requested permissions, and deployment methods.
1313

14-
- [Call]({{< ref "call" >}}) handlers, starting with `/bindings` (see
15-
[Bindings]({{< ref "bindings" >}})) and `/on_install` (see
16-
[Manifest]({{< ref "manifest" >}})). Call handlers are typically source files
17-
in a programming language like JavaScript, Python, or Go.
14+
2. [Call]({{< ref "call" >}}) handlers, which are functions that handle incoming requests from the Mattermost server.
1815

19-
- Static assets, currently solely icon files
16+
3. [Static assets]({{<ref "static-assets">}}), such as images.
2017

21-
## Interactivity: Bindings and forms
18+
To interact with users, an App must [bind]({{< ref "bindings" >}}) a call handler to a [location]({{<ref "manifest#locations">}}) in the Mattermost user interface. These locations may be slash commands, toolbar and menu items, or embedded in posts.
2219

23-
- To interact with users an App must [bind]({{< ref "bindings" >}}) a call to a
24-
location in the Mattermost user interface. These locations may be
25-
`/`-commands, toolbar and menu items, and embedded in posts.
20+
![image](apps-calls_bindings_locations_v2.svg)
2621

27-
- A [binding]({{< ref "bindings" >}}) may display a [Form]({{< ref
28-
"interactivity" >}}), or it may invoke a `Call` that will return a `Form`.
29-
Forms allow to gather fields with limited dynamic behavior
30-
(dynamically-populated selects, form refresh on field changes). A Form invokes
31-
a `Call` when it is submitted. A `/`-command is just another way of filling
32-
out a `Form` and submitting it.
33-
34-
## Use Mattermost APIs
35-
36-
Apps can use all general [Mattermost REST API]({{< ref "mattermost-api" >}})s,
37-
as well as special services that are provided to the apps.
38-
39-
See [Authenticating with Mattermost]({{< ref "app-to-mattermost" >}}) for how
40-
to authenticate to all these services.
41-
42-
App services:
43-
44-
- [KV Store]({{< ref "mattermost-api#apps-api" >}}) - store and retrive app-specific data.
45-
46-
- [OAuth2 Store]({{< ref "mattermost-api#apps-api" >}}) - store, expand, and retrieve user and
47-
app OAuth2 configuration data.
48-
49-
- [Calling other Apps]({{< ref "mattermost-api#apps-api" >}}) - use the `Call` API to invoke
50-
other apps (experimental).
51-
52-
## Other
53-
54-
- [Subscriptions]({{< ref "subscriptions" >}}) covers how to subscribe to
55-
notifications abdout Mattermost events. Examples of a subscription include having your App notified whenever a message is posted in a channel that mentions your @bot account.
56-
57-
- [External webhooks]({{< ref "/integrate/apps/functionality/external-webhooks" >}}) covers subscribing to
58-
webhooks from third-party systems.
59-
60-
- [Lifecycle]({{< ref "lifecycle" >}}) covers lifecycle callback API, i. e.
61-
`on_install`. This is useful for calling your app when it is first installed, or the user is attempting to uninstall it and gives you a chance to initialize or clean up data (such as from the KV store) before uninstalling your app.
62-
22+
A [Binding]({{< ref "bindings" >}}) may display a [Form]({{< ref "interactivity" >}}), or it may invoke a call that will return a form. Forms allow the user to input information with limited dynamic behavior, such as dynamically-populated pick lists, or form refreshes on field changes.

0 commit comments

Comments
 (0)