diff --git a/Cargo.lock b/Cargo.lock index 3a5f368e..ede79748 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1863,7 +1863,7 @@ dependencies = [ [[package]] name = "landscape2-academic" -version = "0.9.3" +version = "0.9.4" dependencies = [ "anyhow", "askama", @@ -1914,7 +1914,7 @@ dependencies = [ [[package]] name = "landscape2-core-academic" -version = "0.9.3" +version = "0.9.4" dependencies = [ "anyhow", "chrono", @@ -1935,7 +1935,7 @@ dependencies = [ [[package]] name = "landscape2-overlay-academic" -version = "0.9.3" +version = "0.9.4" dependencies = [ "anyhow", "landscape2-core-academic", diff --git a/Cargo.toml b/Cargo.toml index 37e724f2..6a9bb12b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["crates/cli", "crates/core", "crates/wasm/overlay"] [workspace.package] -version = "0.9.3" +version = "0.9.4" license = "Apache-2.0" edition = "2021" rust-version = "1.77" diff --git a/crates/cli/src/build/api.rs b/crates/cli/src/build/api.rs index 18c93f4d..1ddc2497 100644 --- a/crates/cli/src/build/api.rs +++ b/crates/cli/src/build/api.rs @@ -404,8 +404,12 @@ impl From<&data::Location> for Location { pub(crate) struct Academic { pub name: String, pub profile_url: String, - pub hindex: i32, - pub citations: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub hindex: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub citations: Option, #[serde(skip_serializing_if = "Option::is_none")] pub i10index: Option, diff --git a/crates/core/src/data.rs b/crates/core/src/data.rs index 98285a44..5ec3e1c4 100644 --- a/crates/core/src/data.rs +++ b/crates/core/src/data.rs @@ -691,8 +691,12 @@ pub struct Item { pub struct Academic { pub name: String, pub profile_url: String, - pub hindex: i32, - pub citations: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub hindex: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub citations: Option, #[serde(skip_serializing_if = "Option::is_none")] pub i10index: Option, diff --git a/crates/core/src/data/legacy.rs b/crates/core/src/data/legacy.rs index 7affe278..f9c13754 100644 --- a/crates/core/src/data/legacy.rs +++ b/crates/core/src/data/legacy.rs @@ -158,8 +158,12 @@ pub(crate) struct Location { pub(crate) struct Academic { pub name: String, pub profile_url: String, - pub hindex: i32, - pub citations: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub hindex: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub citations: Option, #[serde(skip_serializing_if = "Option::is_none")] pub i10index: Option, diff --git a/src/build/data.rs b/src/build/data.rs index 3e2c5599..22ddf776 100644 --- a/src/build/data.rs +++ b/src/build/data.rs @@ -640,8 +640,12 @@ pub(crate) struct Location { pub(crate) struct Academic { pub name: String, pub profile_url: String, - pub hindex: i32, - pub citations: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub hindex: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub citations: Option, #[serde(skip_serializing_if = "Option::is_none")] pub i10index: Option, @@ -930,8 +934,12 @@ mod legacy { pub(crate) struct Academic { pub name: String, pub profile_url: String, - pub hindex: i32, - pub citations: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub hindex: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub citations: Option, #[serde(skip_serializing_if = "Option::is_none")] pub i10index: Option, diff --git a/ui/webapp/src/layout/common/itemModal/AcademicSection.tsx b/ui/webapp/src/layout/common/itemModal/AcademicSection.tsx index 609a702c..5ef308cf 100644 --- a/ui/webapp/src/layout/common/itemModal/AcademicSection.tsx +++ b/ui/webapp/src/layout/common/itemModal/AcademicSection.tsx @@ -26,8 +26,8 @@ const AcademicSection = (props: Props) => {
- - + +
@@ -64,8 +64,8 @@ const AcademicSection = (props: Props) => { {q.name} - {prettifyNumber(q.citations, 1)} - {prettifyNumber(q.hindex, 1)} + {!isUndefined(q.citations) ? prettifyNumber(q.citations!, 1) : "-"} + {!isUndefined(q.hindex) ? prettifyNumber(q.hindex!, 1) : "-"} {!isUndefined(q.i10index) ? prettifyNumber(q.i10index!, 1) : "-"} );