diff --git a/frontend/resources/vue/views/ArgumentForm.vue b/frontend/resources/vue/views/ArgumentForm.vue index 6aa1e86..5cd3b00 100644 --- a/frontend/resources/vue/views/ArgumentForm.vue +++ b/frontend/resources/vue/views/ArgumentForm.vue @@ -29,7 +29,7 @@ :list="arg.suggestions ? `${arg.name}-choices` : undefined" :type="getInputComponent(arg) !== 'select' ? getInputType(arg) : undefined" :rows="arg.type === 'raw_string_multiline' ? 5 : undefined" - :step="arg.type === 'datetime' ? 1 : undefined" :pattern="getPattern(arg)" :required="arg.required" + :step="arg.type === 'datetime' ? 1 : undefined" :pattern="getPattern(arg)" @input="handleInput(arg, $event)" @change="handleChange(arg, $event)" /> @@ -202,6 +202,16 @@ async function validateArgument(arg, value) { return } + // Skip validation for datetime - backend will handle mangling values without seconds + if (arg.type === 'datetime') { + const inputElement = document.getElementById(arg.name) + if (inputElement) { + inputElement.setCustomValidity('') + } + delete formErrors.value[arg.name] + return + } + try { const validateArgumentTypeArgs = { value: value, @@ -286,10 +296,12 @@ async function startAction(actionArgs) { } try { - await window.client.startAction(startActionArgs) - console.log('Action started successfully with tracking ID:', startActionArgs.uniqueTrackingId) + const response = await window.client.startAction(startActionArgs) + console.log('Action started successfully with tracking ID:', response.executionTrackingId) + return response } catch (err) { console.error('Failed to start action:', err) + throw err } } @@ -319,9 +331,12 @@ async function handleSubmit(event) { const argvs = getArgumentValues() console.log('argument form has elements that passed validation') - await startAction(argvs) - - router.back() + try { + const response = await startAction(argvs) + router.push(`/logs/${response.executionTrackingId}`) + } catch (err) { + console.error('Failed to start action:', err) + } } function handleCancel() { diff --git a/integration-tests/configs/datetime/config.yaml b/integration-tests/configs/datetime/config.yaml index 34eb1ad..8647e15 100644 --- a/integration-tests/configs/datetime/config.yaml +++ b/integration-tests/configs/datetime/config.yaml @@ -12,6 +12,5 @@ actions: - name: datetime title: Select a date and time type: datetime - required: true description: Choose a date and time for the action diff --git a/integration-tests/test/datetime.mjs b/integration-tests/test/datetime.mjs index d90a077..3f799fc 100644 --- a/integration-tests/test/datetime.mjs +++ b/integration-tests/test/datetime.mjs @@ -47,10 +47,6 @@ describe('config: datetime', function () { const step = await datetimeInput.getAttribute('step') expect(step).to.equal('1', 'Step attribute should be 1') - // Verify it's required - const required = await datetimeInput.getAttribute('required') - expect(required).to.not.be.null - // Verify the label is present const label = await webdriver.findElement(By.css('label[for="datetime"]')) expect(await label.getText()).to.contain('Select a date and time')