Skip to content

Commit bd53e58

Browse files
committed
Add bundles to GetComponentsInfo request
1 parent 0e88ae0 commit bd53e58

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

tools/projmgr/src/ProjMgrRpcServer.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,14 @@ namespace Args {
119119
optional<string> description;
120120
optional<string> doc;
121121
};
122+
struct Bundle {
123+
string id;
124+
optional<string> description;
125+
optional<string> doc;
126+
};
122127
struct ComponentsInfo {
123128
vector<Api> apis;
129+
vector<Bundle> bundles;
124130
vector<Component> components;
125131
vector<Taxonomy> taxonomy;
126132
};
@@ -144,8 +150,14 @@ namespace Args {
144150
to_json(j, "description" , t.description);
145151
to_json(j, "doc" , t.doc);
146152
}
153+
void to_json(nlohmann::json& j, const Bundle& t) {
154+
to_json(j, "id" , t.id);
155+
to_json(j, "description" , t.description);
156+
to_json(j, "doc" , t.doc);
157+
}
147158
void to_json(nlohmann::json& j, const ComponentsInfo& info) {
148159
to_json(j, "apis" , info.apis);
160+
to_json(j, "bundles" , info.bundles);
149161
to_json(j, "components" , info.components);
150162
to_json(j, "taxonomy" , info.taxonomy);
151163
}
@@ -439,6 +451,19 @@ const Args::ComponentsInfo RpcHandler::GetComponentsInfo(const string& context)
439451
}
440452
componentsInfo.taxonomy.push_back(t);
441453
}
454+
for (auto& [bundle, bundleItem] : m_globalContext.rteActiveTarget->GetFilteredModel()->GetBundles()) {
455+
Args::Bundle b;
456+
b.id = bundle;
457+
const auto& description = bundleItem->GetDescription();
458+
if (!description.empty()) {
459+
b.description = description;
460+
}
461+
const auto& doc = bundleItem->GetDocFile();
462+
if (!doc.empty()) {
463+
b.doc = doc;
464+
}
465+
componentsInfo.bundles.push_back(b);
466+
}
442467
return componentsInfo;
443468
}
444469

0 commit comments

Comments
 (0)