(&self, cx: &App)
| 138 | key: row.key_input.read(cx).text().to_string(), |
| 139 | value: row.value_input.read(cx).text().to_string(), |
| 140 | file_path: row.file_path.clone(), |
| 141 | enabled: row.enabled, |
| 142 | }) |
| 143 | .collect() |
| 144 | } |
| 145 | |
| 146 | pub fn get_form_data(&self, cx: &App) -> std::collections::HashMap<String, String> { |
| 147 | let mut map = std::collections::HashMap::new(); |
| 148 | for field in self.get_fields(cx) { |
| 149 | if field.enabled && !field.key.is_empty() { |
| 150 | if let Some(path) = field.file_path { |
| 151 | map.insert(field.key, format!("@{}", path.display())); |
| 152 | } else { |
| 153 | map.insert(field.key, field.value); |
| 154 | } |
| 155 | } |
| 156 | } |
| 157 | map |
| 158 | } |
| 159 | |
| 160 | pub fn get_multipart_fields(&self, cx: &App) -> Vec<crate::entities::MultipartField> { |
| 161 | self.get_fields(cx) |
| 162 | .into_iter() |
| 163 | .filter(|f| f.enabled && !f.key.is_empty()) |
no test coverage detected