From d62b9f00def7f5ab3c04c2fbeb1fd34a637b8ef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 8 Oct 2020 13:40:13 +0200 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=93=9D=20Fix=20documented=20default?= =?UTF-8?q?=20enable=20logic=20on=20custom=20controls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They are only disabled when the printer is disconnected, not when it is printing. This behaviour can be overridden with the `enabled` property. Closes #3758 --- docs/features/custom_controls.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 From 23b6bd1101ff4fabe418aaf4246ddff2ac6015a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 8 Oct 2020 15:05:53 +0200 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=EF=B8=8F=20Update=20l?= =?UTF-8?q?abeler=20workflow=20with=20new=20labels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue_labeler.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/issue_labeler.yml b/.github/workflows/issue_labeler.yml index a8842872f..0960f6580 100644 --- a/.github/workflows/issue_labeler.yml +++ b/.github/workflows/issue_labeler.yml @@ -11,23 +11,29 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - let labels = []; + let labels = []: + context.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 + }) From 4392ca735284412ac758b53b98b8f064269985f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 8 Oct 2020 15:10:44 +0200 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=EF=B8=8F=20Fix=20a=20?= =?UTF-8?q?syntax=20error=20in=20github=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue_labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue_labeler.yml b/.github/workflows/issue_labeler.yml index 0960f6580..c2250fbaf 100644 --- a/.github/workflows/issue_labeler.yml +++ b/.github/workflows/issue_labeler.yml @@ -11,7 +11,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - let labels = []: + let labels = []; context.issue.labels.forEach(label => { labels.push(label.name) }); if (context.payload.issue.title.match(/\[request\]|feature request/i)) { From 90130dcd7d490bb6bf357d2d269556856e202bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 8 Oct 2020 15:21:16 +0200 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=EF=B8=8F=20Fix=20acce?= =?UTF-8?q?ss=20to=20current=20issue=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue_labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue_labeler.yml b/.github/workflows/issue_labeler.yml index c2250fbaf..bda1ba726 100644 --- a/.github/workflows/issue_labeler.yml +++ b/.github/workflows/issue_labeler.yml @@ -12,7 +12,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | let labels = []; - context.issue.labels.forEach(label => { labels.push(label.name) }); + context.payload.issue.labels.forEach(label => { labels.push(label.name) }); if (context.payload.issue.title.match(/\[request\]|feature request/i)) { labels.push('request');