Skip to content

Commit

Permalink
Fill in 5 rows, add caveats functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
michiel-de-muynck committed Nov 10, 2024
1 parent b0a5409 commit 12228fc
Show file tree
Hide file tree
Showing 3 changed files with 466 additions and 28 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# playground-engine-query

To visit the site, go to [https://datamindedbe.github.io/playground-engine-query/](https://datamindedbe.github.io/playground-engine-query/).

Feel free to contribute by making a PR:
* Info about query engines is in [query_engines.yaml](https://github.com/datamindedbe/playground-engine-query/blob/main/query_engines.yaml)
* Info about integrations, i.e., places to read or write to, is in [integrations.yaml](https://github.com/datamindedbe/playground-engine-query/blob/main/query_engines.yaml)
* Which query engines support which integrations is in [support_matrix.yaml](https://github.com/datamindedbe/playground-engine-query/blob/main/support_matrix.yaml)
* The site itself is Rust code, using the Leptos framework.
55 changes: 33 additions & 22 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct Integration {
struct Feature {
supported: bool,
evidence: String,
caveats: Option<String>
}

#[derive(Debug, Deserialize, Clone)]
Expand Down Expand Up @@ -131,25 +132,25 @@ fn main() {
>
{
let support = support_matrix.get().get(&qe.id).and_then(|qe_support_map| qe_support_map.get(&integration.id)).cloned();
if let Some(support) = support {
view! {
<div class="support-matrix-cell">
{
match (support.import.supported, support.export.supported) {
(true, true) => "✅",
(true, false) => "🔎",
(false, true) => "✍️",
(false, false) => "❌",
}
}
</div>
}
let support_text = if let Some(support) = support {
let support_text = match (support.import.supported, support.export.supported) {
(true, true) => "✅",
(true, false) => "🔎",
(false, true) => "✍️",
(false, false) => "❌",
};
let has_caveats = support.import.caveats.is_some() || support.export.caveats.is_some();
let caveats_text = if has_caveats {
"*"
} else {
""
};
format!("{}{}", support_text, caveats_text)
} else {
view! {
<div class="support-cell">
"❓"
</div>
}
"❓".to_string()
};
view! {
<div class="support-matrix-cell">{ support_text }</div>
}
}
</td>
Expand Down Expand Up @@ -196,18 +197,23 @@ fn main() {
<p>
{
if let Some(support) = &support {
let evidence_str = if let Some(caveats) = &support.import.caveats {
format!("{}\n\n⚠️ {}", support.import.evidence, caveats)
} else {
support.import.evidence.clone()
};
if support.import.supported {
view! {
<div>
<p><span class="popup-yesno">"Yes."</span></p>
<p><Markdown src={support.import.evidence.clone()} /></p>
<p><Markdown src={evidence_str} /></p>
</div>
}
} else {
view! {
<div>
<p><span class="popup-yesno">"No."</span></p>
<p><Markdown src={support.import.evidence.clone()} /></p>
<p><Markdown src={evidence_str} /></p>
</div>
}
}
Expand All @@ -233,18 +239,23 @@ fn main() {
<p>
{
if let Some(support) = &support {
let evidence_str = if let Some(caveats) = &support.export.caveats {
format!("{}\n\n⚠️ {}", support.export.evidence, caveats)
} else {
support.export.evidence.clone()
};
if support.export.supported {
view! {
<div>
<p><span class="popup-yesno">"Yes."</span></p>
<p><Markdown src={support.export.evidence.clone()} /></p>
<p><Markdown src={evidence_str} /></p>
</div>
}
} else {
view! {
<div>
<p><span class="popup-yesno">"No."</span></p>
<p><Markdown src={support.export.evidence.clone()} /></p>
<p><Markdown src={evidence_str} /></p>
</div>
}
}
Expand Down
Loading

0 comments on commit 12228fc

Please sign in to comment.