feat(editor): Use number input component for time saved setting (#24331)

This commit is contained in:
Sandra Zollner
2026-01-14 16:40:55 +00:00
committed by GitHub
parent eb27530c43
commit 159c110a18
2 changed files with 21 additions and 13 deletions
@@ -240,7 +240,9 @@ describe('WorkflowSettingsVue', () => {
expect(getByTestId('workflow-settings-time-saved-per-execution')).toBeVisible();
});
const timeSavedPerExecutionInput = getByTestId('workflow-settings-time-saved-per-execution');
const timeSavedPerExecutionInput = getByTestId(
'workflow-settings-time-saved-per-execution',
)?.querySelector('input[type="number"]');
await userEvent.type(timeSavedPerExecutionInput as Element, '10');
expect(timeSavedPerExecutionInput).toHaveValue(10);
@@ -262,7 +264,9 @@ describe('WorkflowSettingsVue', () => {
expect(getByTestId('workflow-settings-time-saved-per-execution')).toBeVisible();
});
const timeSavedPerExecutionInput = getByTestId('workflow-settings-time-saved-per-execution');
const timeSavedPerExecutionInput = getByTestId(
'workflow-settings-time-saved-per-execution',
)?.querySelector('input[type="number"]');
await waitFor(() => expect(timeSavedPerExecutionInput).toHaveValue(10));
await userEvent.clear(timeSavedPerExecutionInput as Element);
@@ -287,7 +291,9 @@ describe('WorkflowSettingsVue', () => {
expect(getByTestId('workflow-settings-time-saved-per-execution')).toBeVisible();
});
const timeSavedPerExecutionInput = getByTestId('workflow-settings-time-saved-per-execution');
const timeSavedPerExecutionInput = getByTestId(
'workflow-settings-time-saved-per-execution',
)?.querySelector('input[type="number"]');
expect(timeSavedPerExecutionInput).toBeDisabled();
});
@@ -310,7 +316,9 @@ describe('WorkflowSettingsVue', () => {
expect(getByTestId('workflow-settings-time-saved-per-execution')).toBeVisible();
});
const timeSavedPerExecutionInput = getByTestId('workflow-settings-time-saved-per-execution');
const timeSavedPerExecutionInput = getByTestId(
'workflow-settings-time-saved-per-execution',
)?.querySelector('input[type="number"]');
expect(timeSavedPerExecutionInput).toBeDisabled();
});
@@ -18,6 +18,7 @@ import {
N8nButton,
N8nIcon,
N8nInput,
N8nInputNumber,
N8nLink,
N8nIconButton,
N8nOption,
@@ -1190,13 +1191,15 @@ onBeforeUnmount(() => {
<ElRow v-if="workflowSettings.timeSavedMode === 'fixed'">
<ElCol :span="14" :offset="10">
<div :class="$style['time-saved-input']">
<N8nInput
<N8nInputNumber
id="timeSavedPerExecution"
v-model="workflowSettings.timeSavedPerExecution"
controls-position="right"
size="medium"
:controls="true"
:disabled="readOnlyEnv || !workflowPermissions.update"
data-test-id="workflow-settings-time-saved-per-execution"
type="number"
min="0"
:min="0"
@update:model-value="updateTimeSavedPerExecution"
/>
<span>{{ i18n.baseText('workflowSettings.timeSavedPerExecution.hint') }}</span>
@@ -1341,13 +1344,10 @@ onBeforeUnmount(() => {
.time-saved-input {
display: flex;
align-items: center;
gap: var(--spacing--2xs);
:global(.el-input) {
width: var(--spacing--3xl);
}
span {
margin-left: var(--spacing--2xs);
:global(.el-input-number) {
width: var(--spacing--4xl);
}
}