Fixed base sequence diagram test cases after refactor
This commit is contained in:
@@ -29,14 +29,22 @@ common::model::diagram_t diagram::type() const
|
||||
}
|
||||
|
||||
common::optional_ref<common::model::diagram_element> diagram::get(
|
||||
const std::string & /*full_name*/) const
|
||||
const std::string & full_name) const
|
||||
{
|
||||
for(const auto& [id, participant] : participants) {
|
||||
if(participant->full_name(false) == full_name)
|
||||
return {*participant};
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
common::optional_ref<common::model::diagram_element> diagram::get(
|
||||
const common::model::diagram_element::id_t /*id*/) const
|
||||
const common::model::diagram_element::id_t id) const
|
||||
{
|
||||
if(participants.find(id) != participants.end())
|
||||
return {*participants.at(id)};
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -53,6 +61,11 @@ inja::json diagram::context() const
|
||||
|
||||
inja::json::array_t elements{};
|
||||
|
||||
// Add classes
|
||||
for (const auto &[id, p] : participants) {
|
||||
elements.emplace_back(p->context());
|
||||
}
|
||||
|
||||
ctx["elements"] = elements;
|
||||
|
||||
return ctx;
|
||||
|
||||
@@ -201,7 +201,6 @@ std::string abbreviate(const std::string &s, const unsigned int max_length)
|
||||
bool find_element_alias(
|
||||
const std::string &input, std::tuple<std::string, size_t, size_t> &result)
|
||||
{
|
||||
|
||||
std::regex alias_regex("(@A\\([^\\).]+\\))");
|
||||
|
||||
auto alias_it =
|
||||
|
||||
Reference in New Issue
Block a user