* @brief Build planning rows for compatible (groupId, widgetType slug) pairs. */
| 223 | * @brief Build planning rows for compatible (groupId, widgetType slug) pairs. |
| 224 | */ |
| 225 | static QJsonArray buildPlanRows(const QJsonArray& groups, const QString& widgetFilterSlug) |
| 226 | { |
| 227 | QJsonArray rows; |
| 228 | for (const auto& gv : groups) { |
| 229 | const auto group = gv.toObject(); |
| 230 | const int groupId = group.value(QStringLiteral("groupId")).toInt(); |
| 231 | const auto title = group.value(QStringLiteral("title")).toString(); |
| 232 | const auto slugs = group.value(QStringLiteral("compatibleWidgetTypeSlugs")).toArray(); |
| 233 | const auto dataset = group.value(QStringLiteral("datasetSummary")).toArray(); |
| 234 | |
| 235 | for (const auto& sv : slugs) { |
| 236 | const auto slug = sv.toString(); |
| 237 | if (!widgetFilterSlug.isEmpty() && slug != widgetFilterSlug) |
| 238 | continue; |
| 239 | |
| 240 | QJsonObject row; |
| 241 | row[QStringLiteral("groupId")] = groupId; |
| 242 | row[QStringLiteral("groupTitle")] = title; |
| 243 | row[QStringLiteral("widgetType")] = slug; |
| 244 | row[QStringLiteral("datasetCount")] = dataset.size(); |
| 245 | rows.append(row); |
| 246 | } |
| 247 | } |
| 248 | return rows; |
| 249 | } |
| 250 | |
| 251 | /** |
| 252 | * @brief Plan a workspace: list compatible (group, widgetType) options for tile placement. |
no test coverage detected