Skip to content

Commit ec617c1

Browse files
committed
wip
1 parent b27dcc1 commit ec617c1

File tree

5 files changed

+25
-7
lines changed

5 files changed

+25
-7
lines changed

.vscode/launch.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "lldb",
9+
"request": "launch",
10+
"name": "Debug",
11+
"program": "${workspaceFolder}/<your program>",
12+
"args": [],
13+
"cwd": "${workspaceFolder}"
14+
}
15+
]
16+
}

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rover-client/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ serde = "1"
1414
serde_json = "1"
1515
thiserror = "1"
1616
tracing = "0.1"
17+
chrono = "0.4"
1718

1819
[build-dependencies]
1920
online = "0.2.2"

crates/rover-client/src/query/subgraph/list.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn run(
4242
let root_url = response_data.frontend_url_root.clone();
4343
let subgraphs = get_subgraphs_from_response_data(response_data, &graph_name)?;
4444
Ok(ListDetails {
45-
subgraphs: format_subgraphs(subgraphs),
45+
subgraphs: format_subgraphs(&subgraphs),
4646
root_url,
4747
graph_name,
4848
})
@@ -83,7 +83,7 @@ fn get_subgraphs_from_response_data(
8383

8484
/// puts the subgraphs into a vec of SubgraphInfo, sorted by updated_at
8585
/// timestamp. Newer updated services will show at top of list
86-
fn format_subgraphs(subgraphs: Vec<RawSubgraphInfo>) -> Vec<SubgraphInfo> {
86+
fn format_subgraphs(subgraphs: &[RawSubgraphInfo]) -> Vec<SubgraphInfo> {
8787
let mut subgraphs: Vec<SubgraphInfo> = subgraphs
8888
.iter()
8989
.map(|subgraph| SubgraphInfo {

src/command/output.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ impl RoverStdout {
4848
table.add_row(row!["Name", "Routing Url", "Last Updated"]);
4949

5050
for subgraph in &details.subgraphs {
51-
table.add_row(row![
52-
subgraph.name,
53-
subgraph.url.clone().unwrap_or_else(|| "".to_string()),
54-
subgraph.updated_at
55-
]);
51+
// if the url is None or empty (""), then set it to "N/A"
52+
let url = subgraph.url.clone().unwrap_or_else(|| "N/A".to_string());
53+
let url = if url == "" { "N/A".to_string() } else { url };
54+
55+
table.add_row(row![subgraph.name, url, subgraph.updated_at]);
5656
}
5757

5858
println!("{}", table);

0 commit comments

Comments
 (0)