Frontend: only send modified inputs in Pipeline New mutation
Overview
We need to modify the PipelineInputsForm component to behave differently when used in the Pipeline New Form vs. Pipeline Schedules Form. In the Pipeline New Form, it should only emit modified inputs, while in the Pipeline Schedules Form, it should continue to emit all inputs.
Implementation Steps
- Add a boolean prop to
pipeline_inputs_form.vue
- Add
emitModifiedOnly: { type: Boolean, required: false, default: false } - This prop will control whether to emit all inputs (default behavior) or only modified inputs
- Update
pipeline_new_form.vueto use the new prop
- Add
emit-modified-onlyto the<pipeline-inputs-form>component props - The Pipeline Schedules Form doesn't need changes as it will use the default value
- Refactor the input emission logic
- Update file to emit some or all inputs based on
this.emitModifiedOnly
- Update tests
- Update
pipeline_inputs_form_spec.jsto test both emission modes - Update
pipeline_new_form_spec.jsto verify it correctly uses the modified-only mode - Ensure there are tests that verify:
- Modified inputs are emitted when
emitModifiedOnlyis true
- Modified inputs are emitted when
Definition of "Modified Input"
For clarity, a "modified input" is any input whose current value differs from the original default value in the CI/CD configuration, regardless of whether that modification came from user interaction or from loaded saved values.
Technical Notes
- The current implementation emits all inputs regardless of whether they've been modified
- This change allows components to opt into receiving only modified inputs when needed
- No changes needed to the Pipeline Schedules Form as it will continue using the default behavior
Edited by Briley Sandlin