Skip to content

Commit

Permalink
chore: display "unspecified" when subgraph's URL is absent
Browse files Browse the repository at this point in the history
This changes the text from "N/A" (which often means "not available", and
somewhat sounds like we don't have access to it) to "unspecified" (which is
what it is; this is what it is though represented by `null` in the DB).

Closes #483
  • Loading branch information
abernix committed May 5, 2021
1 parent 2514b4f commit e7a231f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/command/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ impl RoverStdout {
table.add_row(row![bc => "Name", "Routing Url", "Last Updated"]);

for subgraph in &details.subgraphs {
// if the url is None or empty (""), then set it to "N/A"
let url = subgraph.url.clone().unwrap_or_else(|| "N/A".to_string());
// Default to "unspecified" if the url is None or empty.
let url = subgraph
.url
.clone()
.unwrap_or_else(|| "unspecified".to_string());
let url = if url.is_empty() {
"N/A".to_string()
"unspecified".to_string()
} else {
url
};
Expand Down

0 comments on commit e7a231f

Please sign in to comment.