From 0ecbc157ac5310531d66511941daff8241709c42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Mar 2024 10:24:17 +0000 Subject: [PATCH 01/13] Bump ip from 1.1.5 to 1.1.9 in /frontend Bumps [ip](https://github.com/indutny/node-ip) from 1.1.5 to 1.1.9. - [Commits](https://github.com/indutny/node-ip/compare/v1.1.5...v1.1.9) --- updated-dependencies: - dependency-name: ip dependency-type: indirect ... Signed-off-by: dependabot[bot] --- frontend/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 6f516338..f6eb8ce4 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -8007,9 +8007,9 @@ __metadata: linkType: hard "ip@npm:^1.1.5": - version: 1.1.5 - resolution: "ip@npm:1.1.5" - checksum: 30133981f082a060a32644f6a7746e9ba7ac9e2bc07ecc8bbdda3ee8ca9bec1190724c390e45a1ee7695e7edfd2a8f7dda2c104ec5f7ac5068c00648504c7e5a + version: 1.1.9 + resolution: "ip@npm:1.1.9" + checksum: b6d91fd45a856e3bd6d4f601ea0619d90f3517638f6918ebd079f959a8a6308568d8db5ef4fdf037e0d9cfdcf264f46833dfeea81ca31309cf0a7eb4b1307b84 languageName: node linkType: hard From 379d221584bfdc9607d9c93fc4fcd493b548b604 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Mar 2024 23:41:49 +0000 Subject: [PATCH 02/13] Bump follow-redirects from 1.15.4 to 1.15.6 in /frontend Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] --- frontend/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 5c1caaca..5254087c 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -7065,12 +7065,12 @@ __metadata: linkType: hard "follow-redirects@npm:^1.0.0": - version: 1.15.4 - resolution: "follow-redirects@npm:1.15.4" + version: 1.15.6 + resolution: "follow-redirects@npm:1.15.6" peerDependenciesMeta: debug: optional: true - checksum: e178d1deff8b23d5d24ec3f7a94cde6e47d74d0dc649c35fc9857041267c12ec5d44650a0c5597ef83056ada9ea6ca0c30e7c4f97dbf07d035086be9e6a5b7b6 + checksum: a62c378dfc8c00f60b9c80cab158ba54e99ba0239a5dd7c81245e5a5b39d10f0c35e249c3379eae719ff0285fff88c365dd446fab19dee771f1d76252df1bbf5 languageName: node linkType: hard From f0a4e4770e310d3b43fb8dae4fd07c83a697d18e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 19:37:30 +0000 Subject: [PATCH 03/13] Bump webpack-dev-middleware from 5.3.3 to 5.3.4 in /frontend Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.3.3 to 5.3.4. - [Release notes](https://github.com/webpack/webpack-dev-middleware/releases) - [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v5.3.4/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v5.3.3...v5.3.4) --- updated-dependencies: - dependency-name: webpack-dev-middleware dependency-type: indirect ... Signed-off-by: dependabot[bot] --- frontend/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 5c1caaca..0b1aa48a 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -13098,8 +13098,8 @@ __metadata: linkType: hard "webpack-dev-middleware@npm:^5.3.1": - version: 5.3.3 - resolution: "webpack-dev-middleware@npm:5.3.3" + version: 5.3.4 + resolution: "webpack-dev-middleware@npm:5.3.4" dependencies: colorette: ^2.0.10 memfs: ^3.4.3 @@ -13108,7 +13108,7 @@ __metadata: schema-utils: ^4.0.0 peerDependencies: webpack: ^4.0.0 || ^5.0.0 - checksum: dd332cc6da61222c43d25e5a2155e23147b777ff32fdf1f1a0a8777020c072fbcef7756360ce2a13939c3f534c06b4992a4d659318c4a7fe2c0530b52a8a6621 + checksum: 90cf3e27d0714c1a745454a1794f491b7076434939340605b9ee8718ba2b85385b120939754e9fdbd6569811e749dee53eec319e0d600e70e0b0baffd8e3fb13 languageName: node linkType: hard From cb781951f82115b85db45137be8979be350fa1b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 17:37:56 +0000 Subject: [PATCH 04/13] Bump express from 4.18.2 to 4.19.2 in /frontend Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2) --- updated-dependencies: - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] --- frontend/yarn.lock | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 5c1caaca..dde9362a 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -4923,12 +4923,12 @@ __metadata: languageName: node linkType: hard -"body-parser@npm:1.20.1": - version: 1.20.1 - resolution: "body-parser@npm:1.20.1" +"body-parser@npm:1.20.2": + version: 1.20.2 + resolution: "body-parser@npm:1.20.2" dependencies: bytes: 3.1.2 - content-type: ~1.0.4 + content-type: ~1.0.5 debug: 2.6.9 depd: 2.0.0 destroy: 1.2.0 @@ -4936,10 +4936,10 @@ __metadata: iconv-lite: 0.4.24 on-finished: 2.4.1 qs: 6.11.0 - raw-body: 2.5.1 + raw-body: 2.5.2 type-is: ~1.6.18 unpipe: 1.0.0 - checksum: f1050dbac3bede6a78f0b87947a8d548ce43f91ccc718a50dd774f3c81f2d8b04693e52acf62659fad23101827dd318da1fb1363444ff9a8482b886a3e4a5266 + checksum: 14d37ec638ab5c93f6099ecaed7f28f890d222c650c69306872e00b9efa081ff6c596cd9afb9930656aae4d6c4e1c17537bea12bb73c87a217cb3cfea8896737 languageName: node linkType: hard @@ -5592,6 +5592,13 @@ __metadata: languageName: node linkType: hard +"content-type@npm:~1.0.5": + version: 1.0.5 + resolution: "content-type@npm:1.0.5" + checksum: 566271e0a251642254cde0f845f9dd4f9856e52d988f4eb0d0dcffbb7a1f8ec98de7a5215fc628f3bce30fe2fb6fd2bc064b562d721658c59b544e2d34ea2766 + languageName: node + linkType: hard + "convert-source-map@npm:^1.5.1, convert-source-map@npm:^1.7.0": version: 1.8.0 resolution: "convert-source-map@npm:1.8.0" @@ -5608,10 +5615,10 @@ __metadata: languageName: node linkType: hard -"cookie@npm:0.5.0": - version: 0.5.0 - resolution: "cookie@npm:0.5.0" - checksum: 1f4bd2ca5765f8c9689a7e8954183f5332139eb72b6ff783d8947032ec1fdf43109852c178e21a953a30c0dd42257828185be01b49d1eb1a67fd054ca588a180 +"cookie@npm:0.6.0": + version: 0.6.0 + resolution: "cookie@npm:0.6.0" + checksum: f56a7d32a07db5458e79c726b77e3c2eff655c36792f2b6c58d351fb5f61531e5b1ab7f46987150136e366c65213cbe31729e02a3eaed630c3bf7334635fb410 languageName: node linkType: hard @@ -6817,15 +6824,15 @@ __metadata: linkType: hard "express@npm:^4.17.3": - version: 4.18.2 - resolution: "express@npm:4.18.2" + version: 4.19.2 + resolution: "express@npm:4.19.2" dependencies: accepts: ~1.3.8 array-flatten: 1.1.1 - body-parser: 1.20.1 + body-parser: 1.20.2 content-disposition: 0.5.4 content-type: ~1.0.4 - cookie: 0.5.0 + cookie: 0.6.0 cookie-signature: 1.0.6 debug: 2.6.9 depd: 2.0.0 @@ -6851,7 +6858,7 @@ __metadata: type-is: ~1.6.18 utils-merge: 1.0.1 vary: ~1.1.2 - checksum: 3c4b9b076879442f6b968fe53d85d9f1eeacbb4f4c41e5f16cc36d77ce39a2b0d81b3f250514982110d815b2f7173f5561367f9110fcc541f9371948e8c8b037 + checksum: 212dbd6c2c222a96a61bc927639c95970a53b06257080bb9e2838adb3bffdb966856551fdad1ab5dd654a217c35db94f987d0aa88d48fb04d306340f5f34dca5 languageName: node linkType: hard @@ -10828,15 +10835,15 @@ __metadata: languageName: node linkType: hard -"raw-body@npm:2.5.1": - version: 2.5.1 - resolution: "raw-body@npm:2.5.1" +"raw-body@npm:2.5.2": + version: 2.5.2 + resolution: "raw-body@npm:2.5.2" dependencies: bytes: 3.1.2 http-errors: 2.0.0 iconv-lite: 0.4.24 unpipe: 1.0.0 - checksum: 5362adff1575d691bb3f75998803a0ffed8c64eabeaa06e54b4ada25a0cd1b2ae7f4f5ec46565d1bec337e08b5ac90c76eaa0758de6f72a633f025d754dec29e + checksum: ba1583c8d8a48e8fbb7a873fdbb2df66ea4ff83775421bfe21ee120140949ab048200668c47d9ae3880012f6e217052690628cf679ddfbd82c9fc9358d574676 languageName: node linkType: hard From 58d7985b59b5869fd55c78c245fca64df946109e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 00:37:43 +0000 Subject: [PATCH 05/13] Bump tar from 6.1.11 to 6.2.1 in /frontend Bumps [tar](https://github.com/isaacs/node-tar) from 6.1.11 to 6.2.1. - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/isaacs/node-tar/compare/v6.1.11...v6.2.1) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] --- frontend/yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 5c1caaca..cfeb015a 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -12453,16 +12453,16 @@ __metadata: linkType: hard "tar@npm:^6.1.11, tar@npm:^6.1.2": - version: 6.1.11 - resolution: "tar@npm:6.1.11" + version: 6.2.1 + resolution: "tar@npm:6.2.1" dependencies: chownr: ^2.0.0 fs-minipass: ^2.0.0 - minipass: ^3.0.0 + minipass: ^5.0.0 minizlib: ^2.1.1 mkdirp: ^1.0.3 yallist: ^4.0.0 - checksum: a04c07bb9e2d8f46776517d4618f2406fb977a74d914ad98b264fc3db0fe8224da5bec11e5f8902c5b9bcb8ace22d95fbe3c7b36b8593b7dfc8391a25898f32f + checksum: f1322768c9741a25356c11373bce918483f40fa9a25c69c59410c8a1247632487edef5fe76c5f12ac51a6356d2f1829e96d2bc34098668a2fc34d76050ac2b6c languageName: node linkType: hard From 4740fb9ba4e59a8de98d9f09ef113f8cb1bde858 Mon Sep 17 00:00:00 2001 From: Loris Sauter Date: Mon, 6 May 2024 13:40:48 +0200 Subject: [PATCH 06/13] Fixed some issues relating to the export of the run --- .../handler/download/EvaluationDownloadHandler.kt | 11 +++++------ .../download/EvaluationTemplateDownloadHandler.kt | 9 +++++---- .../dev/dres/api/rest/types/evaluation/ApiTask.kt | 6 ++++-- .../src/main/kotlin/dev/dres/data/model/run/DbTask.kt | 11 ++++++++--- doc/oas-client.json | 6 +++--- doc/oas.json | 10 +++++----- 6 files changed, 30 insertions(+), 23 deletions(-) diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/download/EvaluationDownloadHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/download/EvaluationDownloadHandler.kt index d881f49c..ec935beb 100644 --- a/backend/src/main/kotlin/dev/dres/api/rest/handler/download/EvaluationDownloadHandler.kt +++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/download/EvaluationDownloadHandler.kt @@ -1,7 +1,7 @@ package dev.dres.api.rest.handler.download -import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import dev.dres.api.rest.handler.GetRestHandler +import dev.dres.api.rest.types.evaluation.ApiEvaluation import dev.dres.api.rest.types.status.ErrorStatus import dev.dres.api.rest.types.status.ErrorStatusException import dev.dres.data.model.run.DbEvaluation @@ -18,7 +18,7 @@ import kotlinx.dnq.query.query * @author Ralph Gasser * @version 1.0.0 */ -class EvaluationDownloadHandler(private val store: TransientEntityStore) : AbstractDownloadHandler(), GetRestHandler { +class EvaluationDownloadHandler(private val store: TransientEntityStore) : AbstractDownloadHandler(), GetRestHandler { /** The route of this [EvaluationDownloadHandler]. */ override val route = "download/evaluation/{evaluationId}" @@ -32,14 +32,14 @@ class EvaluationDownloadHandler(private val store: TransientEntityStore) : Abstr OpenApiParam("evaluationId", String::class, "The evaluation ID.", required = true) ], responses = [ - OpenApiResponse("200", [OpenApiContent(String::class, type = "application/json")]), + OpenApiResponse("200", [OpenApiContent(ApiEvaluation::class)]), OpenApiResponse("400", [OpenApiContent(ErrorStatus::class)]), OpenApiResponse("401", [OpenApiContent(ErrorStatus::class)]), OpenApiResponse("404", [OpenApiContent(ErrorStatus::class)]) ], methods = [HttpMethod.GET] ) - override fun doGet(ctx: Context): String { + override fun doGet(ctx: Context): ApiEvaluation { /* Obtain run id and run. */ val evaluationId = ctx.pathParamMap().getOrElse("evaluationId") { throw ErrorStatusException(400, "Parameter 'evaluationId' is missing!'", ctx) } val evaluation = this.store.transactional(true) { @@ -51,7 +51,6 @@ class EvaluationDownloadHandler(private val store: TransientEntityStore) : Abstr ctx.header("Content-Disposition", "attachment; filename=\"run-${evaluationId}.json\"") /* Return value. */ - val mapper = jacksonObjectMapper() - return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(evaluation) + return evaluation } } diff --git a/backend/src/main/kotlin/dev/dres/api/rest/handler/download/EvaluationTemplateDownloadHandler.kt b/backend/src/main/kotlin/dev/dres/api/rest/handler/download/EvaluationTemplateDownloadHandler.kt index c222f7d0..28bb108b 100644 --- a/backend/src/main/kotlin/dev/dres/api/rest/handler/download/EvaluationTemplateDownloadHandler.kt +++ b/backend/src/main/kotlin/dev/dres/api/rest/handler/download/EvaluationTemplateDownloadHandler.kt @@ -4,6 +4,7 @@ import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import dev.dres.api.rest.handler.GetRestHandler import dev.dres.api.rest.types.status.ErrorStatus import dev.dres.api.rest.types.status.ErrorStatusException +import dev.dres.api.rest.types.template.ApiEvaluationTemplate import dev.dres.data.model.template.DbEvaluationTemplate import io.javalin.http.Context import io.javalin.openapi.* @@ -18,7 +19,8 @@ import kotlinx.dnq.query.query * @author Ralph Gasser * @version 1.0.0 */ -class EvaluationTemplateDownloadHandler(private val store: TransientEntityStore) : AbstractDownloadHandler(), GetRestHandler { +class EvaluationTemplateDownloadHandler(private val store: TransientEntityStore) : AbstractDownloadHandler(), + GetRestHandler { /** The route of this [EvaluationTemplateDownloadHandler]. */ override val route = "download/template/{templateId}" @@ -39,7 +41,7 @@ class EvaluationTemplateDownloadHandler(private val store: TransientEntityStore) ], methods = [HttpMethod.GET] ) - override fun doGet(ctx: Context): String { + override fun doGet(ctx: Context): ApiEvaluationTemplate { /* Obtain run id and run. */ val templateId = ctx.pathParamMap()["templateId"] ?: throw ErrorStatusException(400, "Parameter 'templateId' is missing!'", ctx) val template = this.store.transactional(true) { @@ -51,7 +53,6 @@ class EvaluationTemplateDownloadHandler(private val store: TransientEntityStore) ctx.header("Content-Disposition", "attachment; filename=\"evaluation-template-${templateId}.json") /* Return value. */ - val mapper = jacksonObjectMapper() - return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(template) + return template } } diff --git a/backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/ApiTask.kt b/backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/ApiTask.kt index 031a9888..ad8500e1 100644 --- a/backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/ApiTask.kt +++ b/backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/ApiTask.kt @@ -1,6 +1,8 @@ package dev.dres.api.rest.types.evaluation import dev.dres.api.rest.types.evaluation.submission.ApiAnswerSet +import dev.dres.api.rest.types.evaluation.submission.ApiClientSubmission +import dev.dres.api.rest.types.evaluation.submission.ApiSubmission import dev.dres.data.model.run.DbTask import dev.dres.data.model.run.TaskId import dev.dres.data.model.template.TemplateId @@ -19,5 +21,5 @@ data class ApiTask( val templateId: TemplateId, val started: Long?, val ended: Long?, - val submissions: List -) \ No newline at end of file + val submissions: List +) diff --git a/backend/src/main/kotlin/dev/dres/data/model/run/DbTask.kt b/backend/src/main/kotlin/dev/dres/data/model/run/DbTask.kt index c5b70370..69d3be52 100644 --- a/backend/src/main/kotlin/dev/dres/data/model/run/DbTask.kt +++ b/backend/src/main/kotlin/dev/dres/data/model/run/DbTask.kt @@ -1,6 +1,7 @@ package dev.dres.data.model.run import dev.dres.api.rest.types.evaluation.ApiTask +import dev.dres.api.rest.types.evaluation.submission.ApiClientSubmission import dev.dres.data.model.PersistentEntity import dev.dres.data.model.submissions.AnswerSet import dev.dres.data.model.template.task.DbTaskTemplate @@ -11,6 +12,7 @@ import dev.dres.data.model.template.team.DbTeam import jetbrains.exodus.entitystore.Entity import kotlinx.dnq.* import kotlinx.dnq.query.asSequence +import kotlinx.dnq.query.mapDistinct import kotlinx.dnq.util.isInstanceOf import java.lang.IllegalStateException @@ -47,9 +49,12 @@ class DbTask(entity: Entity) : PersistentEntity(entity) { /** Link to a [DbTeam] this [DbTask] was created for. Can be NULL!*/ var team by xdLink0_1(DbTeam) - /** List of [DbSubmission]s received by this [DbTask]. */ + /** List of [DbAnswerSet]s received by this [DbTask]. */ val answerSets by xdLink0_N(DbAnswerSet::task) + /** List of [DbSubmission]s received by this [DbTask].*/ + fun submissions() = this.answerSets.asSequence().map{it.submission}.toList() + /** * Converts this [DbTask] to a RESTful API representation [ApiTask]. * @@ -62,6 +67,6 @@ class DbTask(entity: Entity) : PersistentEntity(entity) { templateId = this.template.id, started = this.started, ended = this.ended, - submissions = this.answerSets.asSequence().map { it.toApi() }.toList() + submissions = submissions().map { it.toApi() }.toList() ) -} \ No newline at end of file +} diff --git a/doc/oas-client.json b/doc/oas-client.json index 37ca2dc6..e49851c2 100644 --- a/doc/oas-client.json +++ b/doc/oas-client.json @@ -2,8 +2,8 @@ "openapi" : "3.0.3", "info" : { "title" : "DRES Client API", - "version" : "2.0.0-RC5", - "description" : "Client API for DRES (Distributed Retrieval Evaluation Server), Version 2.0.0-RC5" + "version" : "2.0.0", + "description" : "Client API for DRES (Distributed Retrieval Evaluation Server), Version 2.0.0" }, "paths" : { "/api/v2/client/evaluation/currentTask/{evaluationId}" : { @@ -1342,7 +1342,7 @@ "submissions" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/ApiAnswerSet" + "$ref" : "#/components/schemas/ApiSubmission" } } }, diff --git a/doc/oas.json b/doc/oas.json index d62691e4..5bfc68ae 100644 --- a/doc/oas.json +++ b/doc/oas.json @@ -2,8 +2,8 @@ "openapi" : "3.0.3", "info" : { "title" : "DRES API", - "version" : "2.0.0-RC5", - "description" : "API for DRES (Distributed Retrieval Evaluation Server), Version 2.0.0-RC5", + "version" : "2.0.0", + "description" : "API for DRES (Distributed Retrieval Evaluation Server), Version 2.0.0", "contact" : { "name" : "The DRES Dev Team", "url" : "https://dres.dev" @@ -594,9 +594,9 @@ "200" : { "description" : "OK", "content" : { - "text/plain" : { + "application/json" : { "schema" : { - "type" : "string" + "$ref" : "#/components/schemas/ApiEvaluation" } } } @@ -5756,7 +5756,7 @@ "submissions" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/ApiAnswerSet" + "$ref" : "#/components/schemas/ApiSubmission" } } }, From cded493b63bdfef39d34b1a2131044b3bd80f028 Mon Sep 17 00:00:00 2001 From: Loris Sauter Date: Wed, 22 May 2024 17:07:27 +0200 Subject: [PATCH 07/13] Added a filter to the team building dialog --- .../services/pipes/not-in-list-filter.pipe.ts | 18 +++++++++++ frontend/src/app/services/services.module.ts | 5 ++- .../search-box/search-box.component.html | 16 ++++++++++ .../search-box/search-box.component.scss | 0 .../shared/search-box/search-box.component.ts | 27 ++++++++++++++++ frontend/src/app/shared/shared.module.ts | 9 ++++-- .../team-builder-dialog.component.html | 12 ++++--- .../team-builder-dialog.component.scss | 2 +- .../team-builder-dialog.component.ts | 31 ++++++++++++++++++- .../user-list-filter.pipe.ts | 27 ++++++++++++++++ .../user-list-in-other-filter.pipe.ts | 22 +++++++++++++ .../template-builder-components.module.ts | 6 +++- 12 files changed, 165 insertions(+), 10 deletions(-) create mode 100644 frontend/src/app/services/pipes/not-in-list-filter.pipe.ts create mode 100644 frontend/src/app/shared/search-box/search-box.component.html create mode 100644 frontend/src/app/shared/search-box/search-box.component.scss create mode 100644 frontend/src/app/shared/search-box/search-box.component.ts create mode 100644 frontend/src/app/template/template-builder/components/team-builder-dialog/user-list-filter.pipe.ts create mode 100644 frontend/src/app/template/template-builder/components/team-builder-dialog/user-list-in-other-filter.pipe.ts diff --git a/frontend/src/app/services/pipes/not-in-list-filter.pipe.ts b/frontend/src/app/services/pipes/not-in-list-filter.pipe.ts new file mode 100644 index 00000000..a60c1e5f --- /dev/null +++ b/frontend/src/app/services/pipes/not-in-list-filter.pipe.ts @@ -0,0 +1,18 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'notInListFilter' +}) +export class NotInListFilterPipe implements PipeTransform { + + transform(list: any[], filter: any): any[] { + if(!list){ + return []; + } + if(!filter){ + return list; + } + return list.filter(it => it != filter); + } + +} diff --git a/frontend/src/app/services/services.module.ts b/frontend/src/app/services/services.module.ts index 2eb79b93..bf25de64 100644 --- a/frontend/src/app/services/services.module.ts +++ b/frontend/src/app/services/services.module.ts @@ -23,6 +23,7 @@ import { OrderByPipe } from './pipes/order-by.pipe'; import { FilterNotInPipe } from './pipes/filter-not-in.pipe'; import { UnderscoreWordBreakPipe } from './pipes/underscore-wordbreak.pipe'; import { SubmissionsOfPipe } from './pipes/submissions-of.pipe'; +import { NotInListFilterPipe } from './pipes/not-in-list-filter.pipe'; /** * Provides the {@link AppConfig} reference. @@ -59,7 +60,8 @@ export function initializeApiConfig(appConfig: AppConfig) { OrderByPipe, FilterNotInPipe, UnderscoreWordBreakPipe, - SubmissionsOfPipe + SubmissionsOfPipe, + NotInListFilterPipe ], declarations: [ RoundPipePipe, @@ -81,6 +83,7 @@ export function initializeApiConfig(appConfig: AppConfig) { FilterNotInPipe, UnderscoreWordBreakPipe, SubmissionsOfPipe, + NotInListFilterPipe, ], providers: [ AuthenticationService, diff --git a/frontend/src/app/shared/search-box/search-box.component.html b/frontend/src/app/shared/search-box/search-box.component.html new file mode 100644 index 00000000..4fcdd5b8 --- /dev/null +++ b/frontend/src/app/shared/search-box/search-box.component.html @@ -0,0 +1,16 @@ + + + search + + + diff --git a/frontend/src/app/shared/search-box/search-box.component.scss b/frontend/src/app/shared/search-box/search-box.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/frontend/src/app/shared/search-box/search-box.component.ts b/frontend/src/app/shared/search-box/search-box.component.ts new file mode 100644 index 00000000..3c12d10e --- /dev/null +++ b/frontend/src/app/shared/search-box/search-box.component.ts @@ -0,0 +1,27 @@ +import { Component, EventEmitter, OnInit, Output } from "@angular/core"; + +@Component({ + selector: 'app-search-box', + templateUrl: './search-box.component.html', + styleUrls: ['./search-box.component.scss'] +}) +export class SearchBoxComponent{ + // Source: https://angular-htpgvx.stackblitz.io + @Output() filterChanged = new EventEmitter(); + public searchBoxActive = false; + filter: string; + + onFilterClear(){ + this.filter = ''; + this.searchBoxActive = false; + this.filterChanged.emit(this.filter); + } + + onTextChanged(){ + this.filterChanged.emit(this.filter); + } + + public clear(){ + this.onFilterClear(); + } +} diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts index b725d905..902aaed5 100644 --- a/frontend/src/app/shared/shared.module.ts +++ b/frontend/src/app/shared/shared.module.ts @@ -17,6 +17,9 @@ import { ServerInfoComponent } from './server-info/server-info.component'; import { TargetMediaViewerComponent } from './target-media-viewer/target-media-viewer.component'; import { MediaItemViewerComponent } from './media-item-viewer/media-item-viewer.component'; import { InformationDialogComponent } from './information-dialog/information-dialog.component'; +import { SearchBoxComponent } from './search-box/search-box.component'; +import { MatInputModule } from "@angular/material/input"; +import { FormsModule } from "@angular/forms"; @NgModule({ declarations: [ @@ -31,6 +34,7 @@ import { InformationDialogComponent } from './information-dialog/information-dia TargetMediaViewerComponent, MediaItemViewerComponent, InformationDialogComponent, + SearchBoxComponent, ], exports: [ BackButtonComponent, @@ -42,8 +46,9 @@ import { InformationDialogComponent } from './information-dialog/information-dia UploadJsonButtonComponent, ActionableDynamicTable, TargetMediaViewerComponent, - MediaItemViewerComponent + MediaItemViewerComponent, + SearchBoxComponent ], - imports: [CommonModule, MatButtonModule, ServicesModule, MatIconModule, MatTooltipModule, MatDialogModule, MatTableModule] + imports: [CommonModule, MatButtonModule, ServicesModule, MatIconModule, MatTooltipModule, MatDialogModule, MatTableModule, MatInputModule, FormsModule] }) export class SharedModule {} diff --git a/frontend/src/app/template/template-builder/components/team-builder-dialog/team-builder-dialog.component.html b/frontend/src/app/template/template-builder/components/team-builder-dialog/team-builder-dialog.component.html index 832d043b..a81ff34b 100644 --- a/frontend/src/app/template/template-builder/components/team-builder-dialog/team-builder-dialog.component.html +++ b/frontend/src/app/template/template-builder/components/team-builder-dialog/team-builder-dialog.component.html @@ -55,14 +55,16 @@

Add team

Users in Team help

+
- + {{user.username}}
@@ -71,14 +73,16 @@

Users in Team

Users Available help

+
- + {{user.username}}
diff --git a/frontend/src/app/template/template-builder/components/team-builder-dialog/team-builder-dialog.component.scss b/frontend/src/app/template/template-builder/components/team-builder-dialog/team-builder-dialog.component.scss index 53b2eadc..1aae443f 100644 --- a/frontend/src/app/template/template-builder/components/team-builder-dialog/team-builder-dialog.component.scss +++ b/frontend/src/app/template/template-builder/components/team-builder-dialog/team-builder-dialog.component.scss @@ -26,7 +26,7 @@ min-height: 48px; background: rgba(74,74,74, 0.84); border-radius: 4px; - overflow: hidden; + overflow: auto; display: block; } diff --git a/frontend/src/app/template/template-builder/components/team-builder-dialog/team-builder-dialog.component.ts b/frontend/src/app/template/template-builder/components/team-builder-dialog/team-builder-dialog.component.ts index 12fa9b43..8f6c282c 100644 --- a/frontend/src/app/template/template-builder/components/team-builder-dialog/team-builder-dialog.component.ts +++ b/frontend/src/app/template/template-builder/components/team-builder-dialog/team-builder-dialog.component.ts @@ -10,6 +10,7 @@ import { COMMA, ENTER } from "@angular/cdk/keycodes"; import { MatChipInput, MatChipInputEvent } from "@angular/material/chips"; import { TemplateBuilderService } from "../../template-builder.service"; import { CdkDragDrop, moveItemInArray, transferArrayItem } from "@angular/cdk/drag-drop"; +import { SearchBoxComponent } from "../../../../shared/search-box/search-box.component"; @Component({ selector: 'app-team-builder-dialog', @@ -20,9 +21,13 @@ export class TeamBuilderDialogComponent { form: FormGroup; separatorKeyCodes: number[] = [ENTER, COMMA]; @ViewChild('userInput') userInput: ElementRef + @ViewChild('memberFilter') memberFilter: SearchBoxComponent + @ViewChild('userFilter') userFilter: SearchBoxComponent logoName = ''; users: ApiUser[]; + memberFilterText: string; + availableFilterText: string; availableUsers: Observable; colorPalette = [ '#BF0000', @@ -97,13 +102,27 @@ export class TeamBuilderDialogComponent { } public drop(event: CdkDragDrop){ + let prevList = event.previousContainer.data; + let newList = event.container.data; if(event.previousContainer === event.container){ moveItemInArray(event.container.data, event.previousIndex, event.currentIndex) }else{ - transferArrayItem(event.previousContainer.data, event.container.data, event.previousIndex, event.currentIndex) + if(event.previousContainer.id === "memberList"){ + prevList = this.form.get('users').value; + newList = this.users; + }else{ + newList = this.form.get('users').value; + prevList = this.users; + } + let prevIdx = prevList.indexOf(event.previousContainer.data[event.previousIndex]) + let currIdx = newList.indexOf(event.container.data[event.currentIndex]) + transferArrayItem(prevList, newList, prevIdx, currIdx) } + this.memberFilter?.clear() + this.userFilter?.clear(); } + /** * Removes the selected user from the list of users. * @@ -163,6 +182,16 @@ export class TeamBuilderDialogComponent { } as ApiTeam; } + onMemberFilterChanged(filter: string){ + console.log(`MEMBER: was: ${this.memberFilterText} is: ${filter}`) + this.memberFilterText = filter; + } + + onAvailalbeFilterChanged(filter: string){ + console.log(`AVAIL: was: ${this.availableFilterText} is: ${filter}`) + this.availableFilterText= filter; + } + /** * Closes the dialog without saving. */ diff --git a/frontend/src/app/template/template-builder/components/team-builder-dialog/user-list-filter.pipe.ts b/frontend/src/app/template/template-builder/components/team-builder-dialog/user-list-filter.pipe.ts new file mode 100644 index 00000000..3b39162d --- /dev/null +++ b/frontend/src/app/template/template-builder/components/team-builder-dialog/user-list-filter.pipe.ts @@ -0,0 +1,27 @@ +import { Pipe, PipeTransform } from '@angular/core'; +import { ApiUser } from "../../../../../../openapi"; + +/** + * A pipe enabling the filtering of a list of [ApiUser]s based on their username. + */ +@Pipe({ + name: 'userListFilter' +}) +export class UserListFilterPipe implements PipeTransform { + + transform(list: ApiUser[], filter: string): ApiUser[] { + if(!list){ + // Catch no / empty list; + return []; + } + if(!filter){ + // Catch no / empty filter provided + return list; + }else{ + return list.filter(user => { + return user.username.toLowerCase().includes(filter.toLowerCase()) + }); + } + } + +} diff --git a/frontend/src/app/template/template-builder/components/team-builder-dialog/user-list-in-other-filter.pipe.ts b/frontend/src/app/template/template-builder/components/team-builder-dialog/user-list-in-other-filter.pipe.ts new file mode 100644 index 00000000..220dc1f1 --- /dev/null +++ b/frontend/src/app/template/template-builder/components/team-builder-dialog/user-list-in-other-filter.pipe.ts @@ -0,0 +1,22 @@ +import { Pipe, PipeTransform } from '@angular/core'; +import { ApiUser } from "../../../../../../openapi"; + +/** + * Simple filter which filters a list of [ApiUser]s based on whether they are present in another list. + */ +@Pipe({ + name: 'userListInOtherFilter' +}) +export class UserListInOtherFilterPipe implements PipeTransform { + + transform(list: ApiUser[], other: ApiUser[]): ApiUser[] { + if(!list){ + return []; + } + if(!other){ + return list; + } + return list.filter(it => !other.includes(it)) + } + +} diff --git a/frontend/src/app/template/template-builder/components/template-builder-components.module.ts b/frontend/src/app/template/template-builder/components/template-builder-components.module.ts index 60999034..7876c686 100644 --- a/frontend/src/app/template/template-builder/components/template-builder-components.module.ts +++ b/frontend/src/app/template/template-builder/components/template-builder-components.module.ts @@ -49,6 +49,8 @@ import { ColorPickerModule } from "ngx-color-picker"; import {CdkDrag, CdkDropList} from '@angular/cdk/drag-drop'; import { MatCardModule } from "@angular/material/card"; import { ViewersListComponent } from './viewers-list/viewers-list.component'; +import { UserListFilterPipe } from './team-builder-dialog/user-list-filter.pipe'; +import { UserListInOtherFilterPipe } from './team-builder-dialog/user-list-in-other-filter.pipe'; @NgModule({ @@ -69,7 +71,9 @@ import { ViewersListComponent } from './viewers-list/viewers-list.component'; QueryDescriptionExternalVideoFormFieldComponent, QueryDescriptionExternalImageFormFieldComponent, TeamBuilderDialogComponent, - ViewersListComponent + ViewersListComponent, + UserListFilterPipe, + UserListInOtherFilterPipe ], imports: [ CommonModule, From 12286bddfc96526b13d131397c5c3f2c08f8f1ac Mon Sep 17 00:00:00 2001 From: Loris Sauter Date: Fri, 24 May 2024 08:54:10 +0200 Subject: [PATCH 08/13] Added recovery for broken runs and disabled the start run button if there are no tasks or are no teams --- .../src/main/kotlin/dev/dres/run/RunExecutor.kt | 16 +++++++++++++--- .../template-list/template-list.component.html | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/backend/src/main/kotlin/dev/dres/run/RunExecutor.kt b/backend/src/main/kotlin/dev/dres/run/RunExecutor.kt index 7c740aca..2dc5b44c 100644 --- a/backend/src/main/kotlin/dev/dres/run/RunExecutor.kt +++ b/backend/src/main/kotlin/dev/dres/run/RunExecutor.kt @@ -59,9 +59,19 @@ object RunExecutor { DbEvaluation.filter { (it.ended eq null) }.asSequence().forEach { evaluation -> try { this.schedule(evaluation.toRunManager(store)) /* Re-schedule evaluations. */ - } catch (e: IllegalStateException) { - logger.error("Could not re-schedule previous run: ${e.message}") - evaluation.ended = System.currentTimeMillis() + } catch (e: RuntimeException) { + when (e) { + is IllegalStateException, + is IllegalArgumentException -> { + logger.error("Could not re-schedule previous run: ${e.message}") + evaluation.ended = System.currentTimeMillis() + } + + else -> { + logger.error("Fatal error during re-scheduling of previous run (${evaluation.evaluationId}): ${e.message}") + throw e + } + } } } } diff --git a/frontend/src/app/template/template-list/template-list.component.html b/frontend/src/app/template/template-list/template-list.component.html index 7c6aee6f..a842503b 100644 --- a/frontend/src/app/template/template-list/template-list.component.html +++ b/frontend/src/app/template/template-list/template-list.component.html @@ -30,6 +30,7 @@

Evaluation Templates

- + search