* @brief Toggles the target dataset to virtual when the apply request asks for it. */
| 1222 | * @brief Toggles the target dataset to virtual when the apply request asks for it. |
| 1223 | */ |
| 1224 | static QJsonObject maybeMarkDatasetVirtual(const QJsonObject& args, |
| 1225 | int groupId, |
| 1226 | int datasetId, |
| 1227 | QJsonArray& steps) |
| 1228 | { |
| 1229 | if (!args.value(QStringLiteral("virtual")).toBool(false)) |
| 1230 | return {}; |
| 1231 | |
| 1232 | const QJsonObject virtualArgs{ |
| 1233 | {QStringLiteral("groupId"), groupId}, |
| 1234 | { Keys::DatasetId, datasetId}, |
| 1235 | {QStringLiteral("virtual"), true} |
| 1236 | }; |
| 1237 | const auto virtualReply = runCommand(QStringLiteral("project.dataset.setVirtual"), virtualArgs); |
| 1238 | steps.append(QJsonObject{ |
| 1239 | {QStringLiteral("command"), QStringLiteral("project.dataset.setVirtual")}, |
| 1240 | { QStringLiteral("ok"), virtualReply.value(QStringLiteral("ok")).toBool()} |
| 1241 | }); |
| 1242 | return virtualReply; |
| 1243 | } |
| 1244 | |
| 1245 | /** |
| 1246 | * @brief Applies a transform script to its target dataset, optionally promoting it to virtual. |
no test coverage detected