From 886f21e95884ac3e298697a1bc36cc1a3dead8ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 13 Jul 2023 14:39:29 +0200 Subject: [PATCH] OAPI: refactor how 'eval-on-submit' settings are configured Refactor the job settings. The `autoevalLockable` boolean is now replaced with an `evalOnSubmit` nested object: ``` evalOnSubmit: { showButton: true, placeholder: "Scene frame range", }, ``` This makes it possible to add a placeholder text, and later maybe some other parameters. The `showButton: true` part always has to be there, as the entire feature is disabled with `showButton: false`, in which case it's better to just remove the entire `evalOnSubmit` sub-object altogether. Still, I think it's preferred to have that `showButton: true` in there, as it makes it more explicit what this section of the settings is for. This commit just contains the OpenAPI definition. --- pkg/api/flamenco-openapi.yaml | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/pkg/api/flamenco-openapi.yaml b/pkg/api/flamenco-openapi.yaml index 2f1ad75b..e2847bf1 100644 --- a/pkg/api/flamenco-openapi.yaml +++ b/pkg/api/flamenco-openapi.yaml @@ -1683,20 +1683,28 @@ components: "eval": type: string description: Python expression to be evaluated in order to determine the default value for this setting. - "autoevalLockable": - # This setting uses camelCase, as 'autoeval_lockable' would translate - # to an 'AutoevalLockable' property in the Go code, which should be - # accessed as 'autoevalLockable' in the job compiler JavaScript file. - # To keep things consistent, the property is just named - # `autoevalLockable` here too. - type: boolean - default: false + "evalOnSubmit": + type: object description: > - Enables a toggle option in the submission interface to enable - auto-evaluation. When toggled on, the `eval` setting will always be - evaluated on job submission. An example use is the to-be-rendered - frame range, which by default automatically follows the scene range, - but can be overridden manually when desired. + Enables the 'eval on submit' toggle button behavior for this setting. + A toggle button will be shown in Blender's submission interface. + When toggled on, the `eval` expression will determine the setting's + value. Manually editing the setting is then no longer possible, and + instead of an input field, the 'placeholder' string is shown. + + An example use is the to-be-rendered frame range, which by default + automatically follows the scene range, but can be overridden + manually when desired. + properties: + "showButton": + type: boolean + description: Enable or disable the 'eval on submit' toggle button. + "placeholder": + type: string + description: > + Placeholder text to show when the manual input field is hidden + (because eval-on-submit has been toggled on by the user). + required: [showButton, placeholder] "visible": $ref: "#/components/schemas/AvailableJobSettingVisibility" "required":