github.com/replicatedhq/ship@v0.55.0/pkg/lifecycle/render/config/resolve/test-cases/api/hidden-default.yml (about) 1 - name: hidden + default writes to value 2 input: 3 - {} 4 config: 5 - name: maths 6 items: 7 - name: two_plus_two 8 title: two plus two 9 hidden: true 10 default: '{{repl Add 2 3}}' 11 responses: 12 json: | 13 [ 14 { 15 "description": "", 16 "filters": null, 17 "items": [ 18 { 19 "affix": "", 20 "data_cmd": null, 21 "default": "5", 22 "default_cmd": null, 23 "filters": null, 24 "help_text": "", 25 "hidden": true, 26 "is_excluded_from_support": false, 27 "items": null, 28 "multi_value": null, 29 "multiple": false, 30 "name": "two_plus_two", 31 "props": null, 32 "readonly": false, 33 "recommended": false, 34 "required": false, 35 "test_proc": null, 36 "title": "two plus two", 37 "type": "text", 38 "value": "5", 39 "value_cmd": null, 40 "when": "" 41 } 42 ], 43 "name": "maths", 44 "test_proc": null, 45 "title": "", 46 "when": "" 47 } 48 ] 49 50 - name: hidden + default writes to value, unless a prior item was set in the state 51 input: 52 - {} 53 state: 54 two_plus_two: "100" 55 config: 56 - name: maths 57 items: 58 - name: two_plus_two 59 title: two plus two 60 hidden: true 61 default: '{{repl Add 2 3}}' 62 responses: 63 json: | 64 [ 65 { 66 "description": "", 67 "filters": null, 68 "items": [ 69 { 70 "affix": "", 71 "data_cmd": null, 72 "default": "5", 73 "default_cmd": null, 74 "filters": null, 75 "help_text": "", 76 "hidden": true, 77 "is_excluded_from_support": false, 78 "items": null, 79 "multi_value": null, 80 "multiple": false, 81 "name": "two_plus_two", 82 "props": null, 83 "readonly": false, 84 "recommended": false, 85 "required": false, 86 "test_proc": null, 87 "title": "two plus two", 88 "type": "text", 89 "value": "100", 90 "value_cmd": null, 91 "when": "" 92 } 93 ], 94 "name": "maths", 95 "test_proc": null, 96 "title": "", 97 "when": "" 98 } 99 ] 100 101 - name: hidden + default writes to value, unless a prior item was set in the state. Dependent template functions show correct value. 102 input: 103 - {} 104 state: 105 two_plus_two: "100" 106 config: 107 - name: maths 108 items: 109 - name: two_plus_two 110 title: two plus two 111 hidden: true 112 default: '{{repl Add 2 3}}' 113 - name: two_plus_two_plus_5 114 title: two plus two plus 5 115 readonly: true 116 value: '{{repl Add (ParseInt (ConfigOption "two_plus_two")) 5}}' 117 118 responses: 119 json: | 120 [ 121 { 122 "description": "", 123 "filters": null, 124 "items": [ 125 { 126 "affix": "", 127 "data_cmd": null, 128 "default": "5", 129 "default_cmd": null, 130 "filters": null, 131 "help_text": "", 132 "hidden": true, 133 "is_excluded_from_support": false, 134 "items": null, 135 "multi_value": null, 136 "multiple": false, 137 "name": "two_plus_two", 138 "props": null, 139 "readonly": false, 140 "recommended": false, 141 "required": false, 142 "test_proc": null, 143 "title": "two plus two", 144 "type": "text", 145 "value": "100", 146 "value_cmd": null, 147 "when": "" 148 }, 149 { 150 "affix": "", 151 "data_cmd": null, 152 "default": "", 153 "default_cmd": null, 154 "filters": null, 155 "help_text": "", 156 "hidden": false, 157 "is_excluded_from_support": false, 158 "items": null, 159 "multi_value": null, 160 "multiple": false, 161 "name": "two_plus_two_plus_5", 162 "props": null, 163 "readonly": true, 164 "recommended": false, 165 "required": false, 166 "test_proc": null, 167 "title": "two plus two plus 5", 168 "type": "text", 169 "value": "105", 170 "value_cmd": null, 171 "when": "" 172 } 173 ], 174 "name": "maths", 175 "test_proc": null, 176 "title": "", 177 "when": "" 178 } 179 ]