From 0cdbd52ab5c6017ce6c93bace9ca5ec10e98ae09 Mon Sep 17 00:00:00 2001 From: Mike Bryant Date: Tue, 19 Nov 2024 16:24:33 +0000 Subject: [PATCH] Add the option to scan all items for missing metadata... Not just those that were created manually --- modules/admin/app/actors/datamodel/Auditor.scala | 8 ++++---- modules/admin/app/actors/datamodel/AuditorManager.scala | 2 +- modules/admin/app/assets/js/dmeditor/auditor-app.vue | 8 +++++++- modules/admin/conf/messages | 2 ++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/admin/app/actors/datamodel/Auditor.scala b/modules/admin/app/actors/datamodel/Auditor.scala index 1a275597b..78cf652d8 100644 --- a/modules/admin/app/actors/datamodel/Auditor.scala +++ b/modules/admin/app/actors/datamodel/Auditor.scala @@ -86,9 +86,9 @@ case class Auditor(searchEngine: SearchEngine, resolver: SearchItemResolver, fie private def initSearch(task: AuditTask): SearchQuery = { val paging: PageParams = PageParams(limit = batchSize) - val params: SearchParams = SearchParams(entities = Seq(task.entityType), query = task.idPrefix.map(p => s"$p*"), sort = Some(SearchSort.Id)) - val cpFacet = AppliedFacet(SearchConstants.CREATION_PROCESS, Seq(Description.CreationProcess.Manual.toString)) - val facets = List(FieldFacetClass(key = SearchConstants.CREATION_PROCESS, name = "Creation Process", param = "creation")) - SearchQuery(params = params, paging = paging, appliedFacets = Seq(cpFacet), user = userOpt, facetClasses = facets) + val params: SearchParams = SearchParams(entities = Seq(task.entityType), query = task.idPrefix.filter(_.nonEmpty).map(p => s"$p*"), sort = Some(SearchSort.Id)) + val facets = if(task.manualOnly) List(FieldFacetClass(key = SearchConstants.CREATION_PROCESS, name = "Creation Process", param = "creation")) else Nil + val applied = if(task.manualOnly) Seq(AppliedFacet(SearchConstants.CREATION_PROCESS, Seq(Description.CreationProcess.Manual.toString))) else Nil + SearchQuery(params = params, paging = paging, appliedFacets = applied, user = userOpt, facetClasses = facets) } } diff --git a/modules/admin/app/actors/datamodel/AuditorManager.scala b/modules/admin/app/actors/datamodel/AuditorManager.scala index d3c8d1cb0..3f1057492 100644 --- a/modules/admin/app/actors/datamodel/AuditorManager.scala +++ b/modules/admin/app/actors/datamodel/AuditorManager.scala @@ -17,7 +17,7 @@ import scala.concurrent.duration.DurationInt object AuditorManager { - case class AuditTask(entityType: EntityType.Value, idPrefix: Option[String] = None, mandatoryOnly: Boolean) + case class AuditTask(entityType: EntityType.Value, idPrefix: Option[String] = None, mandatoryOnly: Boolean = true, manualOnly: Boolean = true) object AuditTask { implicit val _format: Format[AuditTask] = Json.format[AuditTask] } diff --git a/modules/admin/app/assets/js/dmeditor/auditor-app.vue b/modules/admin/app/assets/js/dmeditor/auditor-app.vue index b857be464..37d939342 100644 --- a/modules/admin/app/assets/js/dmeditor/auditor-app.vue +++ b/modules/admin/app/assets/js/dmeditor/auditor-app.vue @@ -19,6 +19,7 @@ export default { running: false, idPrefix: '', mandatoryOnly: true, + manualOnly: true, entityType: 'Repository' as EntityType, filter: {value: '', active: false}, api: new AuditorApi(this.service), @@ -42,7 +43,8 @@ export default { let {url, jobId} = await this.api.runAudit({ idPrefix: this.idPrefix, entityType: this.entityType, - mandatoryOnly: this.mandatoryOnly + mandatoryOnly: this.mandatoryOnly, + manualOnly: this.manualOnly, }); console.log("Monitor: ", url, jobId); self.jobId = jobId; @@ -138,6 +140,10 @@ export default { +
+ + +