Skip to content

Add mobile support for "Run pipeline" variables form

Miguel Rincon requested to merge 30101-run-pipeline-form-mobile into master

What does this MR do?

Layout improvements related to #30101 (closed)

Mobile support improvement

before after
image image
image image

New setVariable method

This method will be useful in the next MR, so that variables values can be loaded asynchronously after the form has been loaded.

No changes are needed in the spec 💪 as this is just a refactor of current functions.

For example, to simulate loading different variables when changing the selection for branch, we can add this code:

diff --git a/app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue b/app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue
index afcce5b4f33..163708c6fe9 100644
--- a/app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue
+++ b/app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue
@@ -121,6 +121,14 @@ export default {
       this.setVariableParams(FILE_TYPE, this.fileParams);
     }
   },
+  watch: {
+    refValue(value) {
+      this.setVariableParams(VARIABLE_TYPE, {
+        value,
+        [`${value}_1`]: 'value_1',
+      });
+    },
+  },
   methods: {
     setVariable(type, key, value) {
       const variable = this.variables.find(v => v.key === key);

Variables will be added in the right order, and values will be replaced when if makes sense.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Miguel Rincon

Merge request reports