|
| 1 | +- name: checkbox with when on item -- hidden false |
| 2 | + input: |
| 3 | + - { airgap_install: "1" } |
| 4 | + config: |
| 5 | + - name: cluster_info |
| 6 | + title: Kubernetes cluster info |
| 7 | + items: |
| 8 | + - name: airgap_install |
| 9 | + title: Airgap cluster |
| 10 | + type: bool |
| 11 | + value: '1' |
| 12 | + - name: docker_registry_address |
| 13 | + title: Docker registry address |
| 14 | + type: text |
| 15 | + when: '{{repl ConfigOptionEquals "airgap_install" "1" }}' |
| 16 | + responses: |
| 17 | + json: | |
| 18 | +
|
| 19 | + [ |
| 20 | + { |
| 21 | + "description": "", |
| 22 | + "filters": null, |
| 23 | + "items": [ |
| 24 | + { |
| 25 | + "affix": "", |
| 26 | + "data_cmd": null, |
| 27 | + "default": "", |
| 28 | + "default_cmd": null, |
| 29 | + "filters": null, |
| 30 | + "help_text": "", |
| 31 | + "hidden": false, |
| 32 | + "is_excluded_from_support": false, |
| 33 | + "items": null, |
| 34 | + "multi_value": null, |
| 35 | + "multiple": false, |
| 36 | + "name": "airgap_install", |
| 37 | + "props": null, |
| 38 | + "readonly": false, |
| 39 | + "recommended": false, |
| 40 | + "required": false, |
| 41 | + "test_proc": null, |
| 42 | + "title": "Airgap cluster", |
| 43 | + "type": "bool", |
| 44 | + "value": "1", |
| 45 | + "value_cmd": null, |
| 46 | + "when": "" |
| 47 | + }, |
| 48 | + { |
| 49 | + "affix": "", |
| 50 | + "data_cmd": null, |
| 51 | + "default": "", |
| 52 | + "default_cmd": null, |
| 53 | + "filters": null, |
| 54 | + "help_text": "", |
| 55 | + "hidden": false, |
| 56 | + "is_excluded_from_support": false, |
| 57 | + "items": null, |
| 58 | + "multi_value": null, |
| 59 | + "multiple": false, |
| 60 | + "name": "docker_registry_address", |
| 61 | + "props": null, |
| 62 | + "readonly": false, |
| 63 | + "recommended": false, |
| 64 | + "required": false, |
| 65 | + "test_proc": null, |
| 66 | + "title": "Docker registry address", |
| 67 | + "type": "text", |
| 68 | + "value": "", |
| 69 | + "value_cmd": null, |
| 70 | + "when": "true" |
| 71 | + } |
| 72 | + ], |
| 73 | + "name": "cluster_info", |
| 74 | + "test_proc": null, |
| 75 | + "title": "Kubernetes cluster info", |
| 76 | + "when": "" |
| 77 | + } |
| 78 | + ] |
| 79 | +
|
| 80 | +
|
| 81 | +- name: checkbox with when on item -- hidden should be true |
| 82 | + input: |
| 83 | + - { airgap_install: "0" } |
| 84 | + config: |
| 85 | + - name: cluster_info |
| 86 | + title: Kubernetes cluster info |
| 87 | + items: |
| 88 | + - name: airgap_install |
| 89 | + title: Airgap cluster |
| 90 | + type: bool |
| 91 | + default: '1' |
| 92 | + - name: docker_registry_address |
| 93 | + title: Docker registry address |
| 94 | + type: text |
| 95 | + when: '{{repl ConfigOptionEquals "airgap_install" "1" }}' |
| 96 | + responses: |
| 97 | + json: | |
| 98 | +
|
| 99 | + [ |
| 100 | + { |
| 101 | + "description": "", |
| 102 | + "filters": null, |
| 103 | + "items": [ |
| 104 | + { |
| 105 | + "affix": "", |
| 106 | + "data_cmd": null, |
| 107 | + "default": "1", |
| 108 | + "default_cmd": null, |
| 109 | + "filters": null, |
| 110 | + "help_text": "", |
| 111 | + "hidden": false, |
| 112 | + "is_excluded_from_support": false, |
| 113 | + "items": null, |
| 114 | + "multi_value": null, |
| 115 | + "multiple": false, |
| 116 | + "name": "airgap_install", |
| 117 | + "props": null, |
| 118 | + "readonly": false, |
| 119 | + "recommended": false, |
| 120 | + "required": false, |
| 121 | + "test_proc": null, |
| 122 | + "title": "Airgap cluster", |
| 123 | + "type": "bool", |
| 124 | + "value": "0", |
| 125 | + "value_cmd": null, |
| 126 | + "when": "" |
| 127 | + }, |
| 128 | + { |
| 129 | + "affix": "", |
| 130 | + "data_cmd": null, |
| 131 | + "default": "", |
| 132 | + "default_cmd": null, |
| 133 | + "filters": null, |
| 134 | + "help_text": "", |
| 135 | + "hidden": true, |
| 136 | + "is_excluded_from_support": false, |
| 137 | + "items": null, |
| 138 | + "multi_value": null, |
| 139 | + "multiple": false, |
| 140 | + "name": "docker_registry_address", |
| 141 | + "props": null, |
| 142 | + "readonly": false, |
| 143 | + "recommended": false, |
| 144 | + "required": false, |
| 145 | + "test_proc": null, |
| 146 | + "title": "Docker registry address", |
| 147 | + "type": "text", |
| 148 | + "value": "", |
| 149 | + "value_cmd": null, |
| 150 | + "when": "false" |
| 151 | + } |
| 152 | + ], |
| 153 | + "name": "cluster_info", |
| 154 | + "test_proc": null, |
| 155 | + "title": "Kubernetes cluster info", |
| 156 | + "when": "" |
| 157 | + } |
| 158 | + ] |
| 159 | +
|
| 160 | +# this is wild -- ensures we do a deep copy of the config group, and re-render `when` on every POST /config/live call |
| 161 | +- name: checkbox with when on item -- hidden should be true after toggling |
| 162 | + input: |
| 163 | + - { airgap_install: "1" } |
| 164 | + - { airgap_install: "0" } |
| 165 | + config: |
| 166 | + - name: cluster_info |
| 167 | + title: Kubernetes cluster info |
| 168 | + items: |
| 169 | + - name: airgap_install |
| 170 | + title: Airgap cluster |
| 171 | + type: bool |
| 172 | + default: '1' |
| 173 | + - name: docker_registry_address |
| 174 | + title: Docker registry address |
| 175 | + type: text |
| 176 | + when: '{{repl ConfigOptionEquals "airgap_install" "1" }}' |
| 177 | + responses: |
| 178 | + json: | |
| 179 | +
|
| 180 | + [ |
| 181 | + { |
| 182 | + "description": "", |
| 183 | + "filters": null, |
| 184 | + "items": [ |
| 185 | + { |
| 186 | + "affix": "", |
| 187 | + "data_cmd": null, |
| 188 | + "default": "1", |
| 189 | + "default_cmd": null, |
| 190 | + "filters": null, |
| 191 | + "help_text": "", |
| 192 | + "hidden": false, |
| 193 | + "is_excluded_from_support": false, |
| 194 | + "items": null, |
| 195 | + "multi_value": null, |
| 196 | + "multiple": false, |
| 197 | + "name": "airgap_install", |
| 198 | + "props": null, |
| 199 | + "readonly": false, |
| 200 | + "recommended": false, |
| 201 | + "required": false, |
| 202 | + "test_proc": null, |
| 203 | + "title": "Airgap cluster", |
| 204 | + "type": "bool", |
| 205 | + "value": "0", |
| 206 | + "value_cmd": null, |
| 207 | + "when": "" |
| 208 | + }, |
| 209 | + { |
| 210 | + "affix": "", |
| 211 | + "data_cmd": null, |
| 212 | + "default": "", |
| 213 | + "default_cmd": null, |
| 214 | + "filters": null, |
| 215 | + "help_text": "", |
| 216 | + "hidden": true, |
| 217 | + "is_excluded_from_support": false, |
| 218 | + "items": null, |
| 219 | + "multi_value": null, |
| 220 | + "multiple": false, |
| 221 | + "name": "docker_registry_address", |
| 222 | + "props": null, |
| 223 | + "readonly": false, |
| 224 | + "recommended": false, |
| 225 | + "required": false, |
| 226 | + "test_proc": null, |
| 227 | + "title": "Docker registry address", |
| 228 | + "type": "text", |
| 229 | + "value": "", |
| 230 | + "value_cmd": null, |
| 231 | + "when": "false" |
| 232 | + } |
| 233 | + ], |
| 234 | + "name": "cluster_info", |
| 235 | + "test_proc": null, |
| 236 | + "title": "Kubernetes cluster info", |
| 237 | + "when": "" |
| 238 | + } |
| 239 | + ] |
0 commit comments