File tree Expand file tree Collapse file tree
ui/webapp/src/layout/common/itemModal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ resolver = "2"
33members = [" crates/cli" , " crates/core" , " crates/wasm/overlay" ]
44
55[workspace .package ]
6- version = " 0.9.3 "
6+ version = " 0.9.4 "
77license = " Apache-2.0"
88edition = " 2021"
99rust-version = " 1.77"
Original file line number Diff line number Diff line change @@ -404,8 +404,12 @@ impl From<&data::Location> for Location {
404404pub ( crate ) struct Academic {
405405 pub name : String ,
406406 pub profile_url : String ,
407- pub hindex : i32 ,
408- pub citations : i32 ,
407+
408+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
409+ pub hindex : Option < i32 > ,
410+
411+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
412+ pub citations : Option < i32 > ,
409413
410414 #[ serde( skip_serializing_if = "Option::is_none" ) ]
411415 pub i10index : Option < i32 > ,
Original file line number Diff line number Diff line change @@ -691,8 +691,12 @@ pub struct Item {
691691pub struct Academic {
692692 pub name : String ,
693693 pub profile_url : String ,
694- pub hindex : i32 ,
695- pub citations : i32 ,
694+
695+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
696+ pub hindex : Option < i32 > ,
697+
698+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
699+ pub citations : Option < i32 > ,
696700
697701 #[ serde( skip_serializing_if = "Option::is_none" ) ]
698702 pub i10index : Option < i32 > ,
Original file line number Diff line number Diff line change @@ -158,8 +158,12 @@ pub(crate) struct Location {
158158pub ( crate ) struct Academic {
159159 pub name : String ,
160160 pub profile_url : String ,
161- pub hindex : i32 ,
162- pub citations : i32 ,
161+
162+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
163+ pub hindex : Option < i32 > ,
164+
165+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
166+ pub citations : Option < i32 > ,
163167
164168 #[ serde( skip_serializing_if = "Option::is_none" ) ]
165169 pub i10index : Option < i32 > ,
Original file line number Diff line number Diff line change @@ -640,8 +640,12 @@ pub(crate) struct Location {
640640pub ( crate ) struct Academic {
641641 pub name : String ,
642642 pub profile_url : String ,
643- pub hindex : i32 ,
644- pub citations : i32 ,
643+
644+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
645+ pub hindex : Option < i32 > ,
646+
647+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
648+ pub citations : Option < i32 > ,
645649
646650 #[ serde( skip_serializing_if = "Option::is_none" ) ]
647651 pub i10index : Option < i32 > ,
@@ -930,8 +934,12 @@ mod legacy {
930934 pub ( crate ) struct Academic {
931935 pub name : String ,
932936 pub profile_url : String ,
933- pub hindex : i32 ,
934- pub citations : i32 ,
937+
938+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
939+ pub hindex : Option < i32 > ,
940+
941+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
942+ pub citations : Option < i32 > ,
935943
936944 #[ serde( skip_serializing_if = "Option::is_none" ) ]
937945 pub i10index : Option < i32 > ,
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ const AcademicSection = (props: Props) => {
2626 </ div >
2727
2828 < div class = "row g-4 my-0 mb-2" >
29- < Box value = { prettifyNumber ( primary ( ) ! . citations , 1 ) } legend = "Citations" />
30- < Box value = { prettifyNumber ( primary ( ) ! . hindex , 1 ) } legend = "h-index" />
29+ < Box value = { ! isUndefined ( primary ( ) ! . citations ) ? prettifyNumber ( primary ( ) ! . citations ! , 1 ) : "-" } legend = "Citations" />
30+ < Box value = { ! isUndefined ( primary ( ) ! . hindex ) ? prettifyNumber ( primary ( ) ! . hindex ! , 1 ) : "-" } legend = "h-index" />
3131 < Box value = { ! isUndefined ( primary ( ) ! . i10index ) ? prettifyNumber ( primary ( ) ! . i10index ! , 1 ) : "-" } legend = "i10-index" />
3232 </ div >
3333
@@ -64,8 +64,8 @@ const AcademicSection = (props: Props) => {
6464 { q . name }
6565 </ ExternalLink >
6666 </ td >
67- < td class = "px-3 text-center text-nowrap" > { prettifyNumber ( q . citations , 1 ) } </ td >
68- < td class = "px-3 text-center text-nowrap" > { prettifyNumber ( q . hindex , 1 ) } </ td >
67+ < td class = "px-3 text-center text-nowrap" > { ! isUndefined ( q . citations ) ? prettifyNumber ( q . citations ! , 1 ) : "-" } </ td >
68+ < td class = "px-3 text-center text-nowrap" > { ! isUndefined ( q . hindex ) ? prettifyNumber ( q . hindex ! , 1 ) : "-" } </ td >
6969 < td class = "px-3 text-center text-nowrap" > { ! isUndefined ( q . i10index ) ? prettifyNumber ( q . i10index ! , 1 ) : "-" } </ td >
7070 </ tr >
7171 ) ;
You can’t perform that action at this time.
0 commit comments