fix the import of the dumpv4&v5 when there is no instance-uid + rename the Kind+KindWithContent+Details variant for the DocumentImport and the Setting

This commit is contained in:
Irevoire 2022-10-21 18:03:10 +02:00 committed by Clément Renault
parent 131fe30934
commit 8d1408c65e
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
14 changed files with 98 additions and 77 deletions

View file

@ -255,7 +255,7 @@ async fn document_addition(
}
};
let task = KindWithContent::DocumentImport {
let task = KindWithContent::DocumentAdditionOrUpdate {
method,
content_file: uuid,
documents_count,

View file

@ -40,7 +40,7 @@ macro_rules! make_setting_route {
let new_settings = Settings { $attr: Setting::Reset, ..Default::default() };
let allow_index_creation = index_scheduler.filters().allow_index_creation;
let task = KindWithContent::Settings {
let task = KindWithContent::SettingsUpdate {
index_uid: index_uid.into_inner(),
new_settings,
is_deletion: true,
@ -78,7 +78,7 @@ macro_rules! make_setting_route {
};
let allow_index_creation = index_scheduler.filters().allow_index_creation;
let task = KindWithContent::Settings {
let task = KindWithContent::SettingsUpdate {
index_uid: index_uid.into_inner(),
new_settings,
is_deletion: false,
@ -436,7 +436,7 @@ pub async fn update_all(
);
let allow_index_creation = index_scheduler.filters().allow_index_creation;
let task = KindWithContent::Settings {
let task = KindWithContent::SettingsUpdate {
index_uid: index_uid.into_inner(),
new_settings,
is_deletion: false,
@ -467,7 +467,7 @@ pub async fn delete_all(
let new_settings = Settings::cleared().into_unchecked();
let allow_index_creation = index_scheduler.filters().allow_index_creation;
let task = KindWithContent::Settings {
let task = KindWithContent::SettingsUpdate {
index_uid: index_uid.into_inner(),
new_settings,
is_deletion: true,

View file

@ -121,12 +121,14 @@ pub struct DetailsView {
impl From<Details> for DetailsView {
fn from(details: Details) -> Self {
match details.clone() {
Details::DocumentAddition { received_documents, indexed_documents } => DetailsView {
received_documents: Some(received_documents),
indexed_documents,
..DetailsView::default()
},
Details::Settings { settings } => {
Details::DocumentAdditionOrUpdate { received_documents, indexed_documents } => {
DetailsView {
received_documents: Some(received_documents),
indexed_documents,
..DetailsView::default()
}
}
Details::SettingsUpdate { settings } => {
DetailsView { settings: Some(settings), ..DetailsView::default() }
}
Details::IndexInfo { primary_key } => {