summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
author6543 <m.huber@kithara.com>2024-03-04 01:37:00 +0100
committerGitHub <noreply@github.com>2024-03-04 01:37:00 +0100
commit77e29e0c39392f142627303bd798fb55258072b2 (patch)
treefe2d996c1a569688a280f677690581e06ff3eb22 /docs
parent2fb917f69e59f8b75825bf4fe659856b9dd02f44 (diff)
downloadgitea-77e29e0c39392f142627303bd798fb55258072b2.tar.gz
gitea-77e29e0c39392f142627303bd798fb55258072b2.zip
Extend issue template yaml engine (#29274)
Add new option: `visible`: witch can hide a specific field of the form or the created content afterwards It is a string array witch can contain `form` and `content`. If only `form` is present, it wont show up in the created issue afterwards and the other way around. By default it sets both except for markdown As they are optional and github don't have any similar thing, it is non breaking and also do not conflict with it. With this you can: - define "post issue creation" elements like a TODO list to track an issue state - make sure to have a checkbox that reminds the user to check for a thing but dont have it in the created issue afterwards - define markdown for the created issue (was the downside of using yaml instead of md in the past) - ... ## Demo ```yaml name: New Contribution description: External Contributor creating a pull body: - type: checkboxes id: extern-todo visible: [form] attributes: label: Contribution Guidelines options: - label: I checked there exist no similar feature to be extended required: true - label: I did read the CONTRIBUTION.MD required: true - type: checkboxes id: intern-todo visible: [content] attributes: label: Maintainer Check-List options: - label: Does this pull follow the KISS principe - label: Checked if internal bord was notifyed # .... ``` [Demo Video](https://cloud.obermui.de/s/tm34fSAbJp9qw9z/download/vid-20240220-152751.mkv) --- *Sponsored by Kithara Software GmbH* --------- Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'docs')
-rw-r--r--docs/content/usage/issue-pull-request-templates.en-us.md52
1 files changed, 37 insertions, 15 deletions
diff --git a/docs/content/usage/issue-pull-request-templates.en-us.md b/docs/content/usage/issue-pull-request-templates.en-us.md
index b031b262fb..e203c0d379 100644
--- a/docs/content/usage/issue-pull-request-templates.en-us.md
+++ b/docs/content/usage/issue-pull-request-templates.en-us.md
@@ -136,6 +136,12 @@ body:
attributes:
value: |
Thanks for taking the time to fill out this bug report!
+ # some markdown that will only be visible once the issue has been created
+ - type: markdown
+ attributes:
+ value: |
+ This issue was created by an issue **template** :)
+ visible: [content]
- type: input
id: contact
attributes:
@@ -187,11 +193,16 @@ body:
options:
- label: I agree to follow this project's Code of Conduct
required: true
+ - label: I have also read the CONTRIBUTION.MD
+ required: true
+ visible: [form]
+ - label: This is a TODO only visible after issue creation
+ visible: [content]
```
### Markdown
-You can use a `markdown` element to display Markdown in your form that provides extra context to the user, but is not submitted.
+You can use a `markdown` element to display Markdown in your form that provides extra context to the user, but is not submitted by default.
Attributes:
@@ -199,6 +210,8 @@ Attributes:
|-------|--------------------------------------------------------------|----------|--------|---------|--------------|
| value | The text that is rendered. Markdown formatting is supported. | Required | String | - | - |
+visible: Default is **[form]**
+
### Textarea
You can use a `textarea` element to add a multi-line text field to your form. Contributors can also attach files in `textarea` fields.
@@ -219,6 +232,8 @@ Validations:
|----------|------------------------------------------------------|----------|---------|---------|--------------|
| required | Prevents form submission until element is completed. | Optional | Boolean | false | - |
+visible: Default is **[form, content]**
+
### Input
You can use an `input` element to add a single-line text field to your form.
@@ -240,6 +255,8 @@ Validations:
| is_number | Prevents form submission until element is filled with a number. | Optional | Boolean | false | - |
| regex | Prevents form submission until element is filled with a value that match the regular expression. | Optional | String | - | a [regular expression](https://en.wikipedia.org/wiki/Regular_expression) |
+visible: Default is **[form, content]**
+
### Dropdown
You can use a `dropdown` element to add a dropdown menu in your form.
@@ -259,6 +276,8 @@ Validations:
|----------|------------------------------------------------------|----------|---------|---------|--------------|
| required | Prevents form submission until element is completed. | Optional | Boolean | false | - |
+visible: Default is **[form, content]**
+
### Checkboxes
You can use the `checkboxes` element to add a set of checkboxes to your form.
@@ -266,17 +285,20 @@ You can use the `checkboxes` element to add a set of checkboxes to your form.
Attributes:
| Key | Description | Required | Type | Default | Valid values |
-|-------------|-------------------------------------------------------------------------------------------------------|----------|--------|--------------|--------------|
+| ----------- | ----------------------------------------------------------------------------------------------------- | -------- | ------ | ------------ | ------------ |
| label | A brief description of the expected user input, which is displayed in the form. | Required | String | - | - |
| description | A description of the set of checkboxes, which is displayed in the form. Supports Markdown formatting. | Optional | String | Empty String | - |
| options | An array of checkboxes that the user can select. For syntax, see below. | Required | Array | - | - |
For each value in the options array, you can set the following keys.
-| Key | Description | Required | Type | Default | Options |
-|----------|------------------------------------------------------------------------------------------------------------------------------------------|----------|---------|---------|---------|
-| label | The identifier for the option, which is displayed in the form. Markdown is supported for bold or italic text formatting, and hyperlinks. | Required | String | - | - |
-| required | Prevents form submission until element is completed. | Optional | Boolean | false | - |
+| Key | Description | Required | Type | Default | Options |
+|--------------|------------------------------------------------------------------------------------------------------------------------------------------|----------|--------------|---------|---------|
+| label | The identifier for the option, which is displayed in the form. Markdown is supported for bold or italic text formatting, and hyperlinks. | Required | String | - | - |
+| required | Prevents form submission until element is completed. | Optional | Boolean | false | - |
+| visible | Whether a specific checkbox appears in the form only, in the created issue only, or both. Valid options are "form" and "content". | Optional | String array | false | - |
+
+visible: Default is **[form, content]**
## Syntax for issue config
@@ -292,15 +314,15 @@ contact_links:
### Possible Options
-| Key | Description | Type | Default |
-|----------------------|-------------------------------------------------------------------------------------------------------|--------------------|----------------|
-| blank_issues_enabled | If set to false, the User is forced to use a Template | Boolean | true |
-| contact_links | Custom Links to show in the Choose Box | Contact Link Array | Empty Array |
+| Key | Description | Type | Default |
+|----------------------|-------------------------------------------------------|--------------------|-------------|
+| blank_issues_enabled | If set to false, the User is forced to use a Template | Boolean | true |
+| contact_links | Custom Links to show in the Choose Box | Contact Link Array | Empty Array |
### Contact Link
-| Key | Description | Type | Required |
-|----------------------|-------------------------------------------------------------------------------------------------------|---------|----------|
-| name | the name of your link | String | true |
-| url | The URL of your Link | String | true |
-| about | A short description of your Link | String | true |
+| Key | Description | Type | Required |
+|-------|----------------------------------|--------|----------|
+| name | the name of your link | String | true |
+| url | The URL of your Link | String | true |
+| about | A short description of your Link | String | true |