diff --git a/.github/workflows/issue_labeler.yml b/.github/workflows/issue_labeler.yml index a8842872f..bda1ba726 100644 --- a/.github/workflows/issue_labeler.yml +++ b/.github/workflows/issue_labeler.yml @@ -12,22 +12,28 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | let labels = []; + context.payload.issue.labels.forEach(label => { labels.push(label.name) }); if (context.payload.issue.title.match(/\[request\]|feature request/i)) { - labels.push('type:request'); + labels.push('request'); + labels = labels.filter(label => label !== 'triage'); } if (context.payload.issue.title.match(/\[brainstorming\]/i)) { - labels.push('type:brainstorming'); + labels.push('brainstorming'); + labels = labels.filter(label => label !== 'triage'); } if (context.payload.issue.title.match(/\[rc feedback\]/i)) { - labels.push('type:rc feedback'); + labels.push('rc feedback'); + labels = labels.filter(label => label !== 'triage'); } - if (labels.length > 0) { - github.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: labels - }) + if (labels.length === 0) { + labels.push('triage'); } + + github.issues.setLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: labels + }) diff --git a/docs/features/custom_controls.rst b/docs/features/custom_controls.rst index ad8756bbe..522d392cb 100644 --- a/docs/features/custom_controls.rst +++ b/docs/features/custom_controls.rst @@ -172,9 +172,10 @@ Controls turn the button red. * - ``enabled`` - (Optional) A JavaScript snippet returning either ``true`` or ``false`` determining whether the control - should be enabled or not. This allow to override the default logic for this (disabled if printer is offline - or currently printing). The JavaScript snippet is ``eval``'d and processed in a context where the control - it is part of is provided as local variable ``data`` and the ``ControlViewModel`` is available as ``self``. + should be enabled or not. This allows to override the default logic for the enable state + of the control (disabled if printer is offline). The JavaScript snippet is ``eval``'d and processed + in a context where the control it is part of is provided as local variable ``data`` and the + ``ControlViewModel`` is available as ``self``. * - ``input`` - (Optional) A list of definitions of input parameters for a ``command`` or ``commands``, to be rendered as additional input fields. ``command``/``commands`` may contain placeholders to be replaced by the values obtained