.
This commit is contained in:
+5
-5
@@ -44,7 +44,7 @@ pub(crate) enum Message {
|
||||
UnhoverRow(QuadKey),
|
||||
QueryUpdated(String),
|
||||
SetSearchResults(Vec<SearchDocument>),
|
||||
QueryTypeUpdated(NamedNode),
|
||||
QueryTypeUpdated(LabeledIri),
|
||||
SearchResultClicked(NamedNode),
|
||||
DatatypeUpdated(QuadKey, Option<String>),
|
||||
LanguageUpdated(QuadKey, Option<String>),
|
||||
@@ -117,6 +117,7 @@ impl Publisher {
|
||||
let mut document = doc!(
|
||||
Schema::type_field() => entry.catalog_id,
|
||||
Schema::iri_field() => individual.as_str(),
|
||||
Schema::curie_field() => ontology.abbreviate(individual.as_ref()),
|
||||
);
|
||||
for (key, value) in entry.fields {
|
||||
document.add_text(Schema::field(&key, language::ENGLISH_PRIMARY), value.as_str());
|
||||
@@ -328,9 +329,8 @@ impl Publisher {
|
||||
}
|
||||
Message::QueryTypeUpdated(type_) => {
|
||||
if let Some(search_state) = &mut self.search_state {
|
||||
if let Some(type_) = self.ontology.labeled_entity(&type_) {
|
||||
search_state.type_ = type_;
|
||||
}
|
||||
search_state.type_ = type_;
|
||||
task = Task::done(Message::QueryUpdated(search_state.query.clone()));
|
||||
}
|
||||
}
|
||||
Message::QueryUpdated(new_query) => {
|
||||
@@ -676,7 +676,7 @@ impl Publisher {
|
||||
entities.sort_by(|a, b| Ord::cmp(&a.label, &b.label));
|
||||
|
||||
let type_selector = pick_list(Some(&search_state.type_), entities, ToString::to_string)
|
||||
.on_select(|selection| Message::QueryTypeUpdated(selection.iri));
|
||||
.on_select(|selection| Message::QueryTypeUpdated(selection));
|
||||
|
||||
let fields = self.ontology.fields_for_class(&search_state.type_.iri, &*language::ENGLISH_OR_UNTAGGED)
|
||||
.expect("Unable to load fields for class");
|
||||
|
||||
Reference in New Issue
Block a user