-
Notifications
You must be signed in to change notification settings - Fork 460
Update docs to include collapsible elements #1516
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
base: master
Are you sure you want to change the base?
Changes from all commits
bd9d715
64d2bfc
8d720ae
5176650
d1bc059
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -68,8 +68,9 @@ Each dialog supports elements for users to enter information. | |||||||||
| - `radio`: Radio button option. Use this to quickly select an option from pre-selected choices. | ||||||||||
| - `date`: Date picker field. Use this for selecting dates without time information. | ||||||||||
| - `datetime`: Date and time picker field. Use this for selecting both date and time with timezone support. | ||||||||||
| - `collapsible`: A section that groups child elements under a toggleable header. Use this to organize long forms; sections can be nested and can start expanded or collapsed. | ||||||||||
|
|
||||||||||
| Each element is required by default, otherwise the client will return an error as shown below. Note that the error message will appear below the help text, if one is specified. To make an element optional, set the field `"optional": "true"`. | ||||||||||
| Each element is required by default, otherwise the client will return an error as shown below. Note that the error message will appear below the help text, if one is specified. To make an element optional, set the field `"optional": true`. | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Reword this sentence for clarity. The ♻️ Proposed fix-Each element is required by default, otherwise the client will return an error as shown below. Note that the error message will appear below the help text, if one is specified. To make an element optional, set the field `"optional": true`.
+Each element is required by default; otherwise, the client will return an error as shown below. Note that the error message will appear below the help text if one is specified. To make an element optional, set the field `"optional": true`.📝 Committable suggestion
Suggested change
🧰 Tools🪛 LanguageTool[typographical] ~73-~73: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence. (THUS_SENTENCE) [typographical] ~73-~73: Usually, there’s no comma before “if”. (IF_NO_COMMA) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||
|
|
||||||||||
|  | ||||||||||
|
|
||||||||||
|
|
@@ -621,6 +622,48 @@ The `datetime_config` object groups date/datetime configuration into a single ne | |||||||||
| - `"time_interval": 60` creates options: 00:00, 01:00, 02:00, 03:00, etc. | ||||||||||
| - Invalid: `"time_interval": 7` (7 is not a divisor of 1440) | ||||||||||
|
|
||||||||||
| ### Collapsible elements | ||||||||||
| ##### Minimum Server Version: 11.10 | ||||||||||
|
Comment on lines
+625
to
+626
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Use the next heading level here. This jumps from ♻️ Proposed fix-##### Minimum Server Version: 11.10
+#### Minimum Server Version: 11.10📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.22.1)[warning] 626-626: Heading levels should only increment by one level at a time (MD001, heading-increment) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||
|
|
||||||||||
| Collapsible elements group other elements under a toggleable header, letting you organize long forms into sections. Sections start expanded by default; set `collapsed` to `true` to have a section start closed. By default a section renders with a box outline; set `borderless` to `true` to remove it. A `collapsible` element does not submit a value itself — only its child `elements` appear in the submission payload. There can be, at most, 3 levels of nesting. | ||||||||||
|
|
||||||||||
| ```json | ||||||||||
| { | ||||||||||
| "display_name": "Contact Details", | ||||||||||
| "name": "contact_section", | ||||||||||
| "type": "collapsible", | ||||||||||
| "collapsed": true, | ||||||||||
| "borderless": true, | ||||||||||
| "elements": [ | ||||||||||
| { | ||||||||||
| "display_name": "Email", | ||||||||||
| "name": "email", | ||||||||||
| "type": "text", | ||||||||||
| "subtype": "email", | ||||||||||
| "placeholder": "you@example.com" | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| "display_name": "Phone", | ||||||||||
| "name": "phone", | ||||||||||
| "type": "text", | ||||||||||
| "optional": true | ||||||||||
| } | ||||||||||
| ] | ||||||||||
| } | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| The full list of supported fields is included below: | ||||||||||
|
|
||||||||||
| | Field | Type | Description | | ||||||||||
| |----------------|---------|------------------------------------------------------------------------------------------------------------------------------------| | ||||||||||
| | `display_name` | String | Header text shown for the section. Maximum 24 characters. | | ||||||||||
| | `name` | String | Name of the section element used by the integration. Maximum 300 characters. You should use unique `name` fields in the same dialog. | | ||||||||||
| | `type` | String | Set this value to `collapsible` for a collapsible section. | | ||||||||||
| | `collapsed` | Boolean | (Optional) When `true`, the section starts collapsed. Default is `false` (expanded). | | ||||||||||
| | `borderless` | Boolean | (Optional) When `true`, the section renders without a box outline. Default is `false` (bordered). | | ||||||||||
| | `elements` | Array | Child elements rendered inside the section. May include other `collapsible` elements to create nested sections (up to 3 levels deep). Note that each collapsible element must have at least one child, or validation will fail.| | ||||||||||
|
|
||||||||||
|
|
||||||||||
| ## Dialog submission | ||||||||||
|
|
||||||||||
| When a user submits a dialog, Mattermost will perform client-side input validation to make sure: | ||||||||||
|
|
||||||||||
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.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: mattermost/mattermost-developer-documentation
Length of output: 1088
🏁 Script executed:
Repository: mattermost/mattermost-developer-documentation
Length of output: 4542
Handle destructured params before reading
prop.key.nameObjectPattern.propertiescan includeRestElementnodes, so this branch can throw on{ ...rest }and stop docs generation. The fallback also drops non-Identifierparams like array patterns and defaults.🤖 Prompt for AI Agents