From 7fb2aeca34eaf148d2e1152336319a28dc9654a9 Mon Sep 17 00:00:00 2001 From: mtaghiza Date: Tue, 24 May 2022 14:32:01 -0400 Subject: [PATCH 1/6] Backend - Added ping endpoint for load balancer checks. --- validation-tool-backend/src/app.controller.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/validation-tool-backend/src/app.controller.ts b/validation-tool-backend/src/app.controller.ts index 56edb0d..466e9f1 100644 --- a/validation-tool-backend/src/app.controller.ts +++ b/validation-tool-backend/src/app.controller.ts @@ -22,4 +22,9 @@ export class AppController { async login(@Request() req) { return this.authService.login(req.user); } + + @Get('/ping') + async getPingResponse(@Request() req) { + return 'Service is running.'; + } } From e6336aaa4a81d94782c2676c64692a796d3b9705 Mon Sep 17 00:00:00 2001 From: mtaghiza Date: Tue, 24 May 2022 14:34:58 -0400 Subject: [PATCH 2/6] Backend - Fixed seemly hardcoded generic_metadata's entity_id column in AssignNewItems functionality. --- .../src/review/review.interface.ts | 1 + validation-tool-backend/src/review/review.service.ts | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/validation-tool-backend/src/review/review.interface.ts b/validation-tool-backend/src/review/review.interface.ts index 43a28b8..d0f8472 100644 --- a/validation-tool-backend/src/review/review.interface.ts +++ b/validation-tool-backend/src/review/review.interface.ts @@ -35,6 +35,7 @@ export interface ValidationTableItemDto { export interface ReviewReportItem { user_metadata_source_id: number; + organization_source_id: number; email: string; organization_name: string; assigned_items: number; diff --git a/validation-tool-backend/src/review/review.service.ts b/validation-tool-backend/src/review/review.service.ts index 0521cb0..b242e42 100644 --- a/validation-tool-backend/src/review/review.service.ts +++ b/validation-tool-backend/src/review/review.service.ts @@ -285,11 +285,12 @@ export class ReviewService { let items: ReviewReportItem[] = []; const pool = await this.databaseService.getConnection(); const result = await pool.request().query(` select - ms.source_id as user_metadata_source_id, ms.email, ms.organization_name, + ms.source_id as user_metadata_source_id, ms2.source_id as organization_source_id, ms.email, ms.organization_name, sum(case when gm.generic_metadata_id is not null then 1 else 0 end) as assigned_items, sum(case when gm.generic_metadata_id is not null and (v_alias.value is null or v_alias_parent.value is null) then 1 else 0 end) as not_answered from metadata_source ms + join metadata_source ms2 on (ms2.organization_name = ms.organization_name and ms2.source_type = 'org') left join generic_metadata gm on ms.source_id = gm.entity_id and gm.metadata_name = 'text_snippet_to_review'-- added to see emails left join generic_metadata gm2 on cast(gm.metadata as INT) = gm2.generic_metadata_id --removed double casting @@ -312,16 +313,17 @@ sum(case when gm.generic_metadata_id is not null then 1 else 0 end) as assigned_ return items; } - async assignitems(source_id: number, organization_name: string) { + async assignitems(source_id: number, organization_source_id: number, organization_name: string) { const pool = await this.databaseService.getConnection(); const result = await pool .request() .input('SourceID', BigInt, source_id) + .input('OrganizationSourceID', BigInt, organization_source_id) .input('OrganizationName', VarChar, organization_name) .query(`INSERT INTO generic_metadata (source_id, entity_id, entity_type, metadata_name, metadata, last_updated_date) SELECT TOP 50 - 1, + @OrganizationSourceID, @SourceID, 'metadata_source', 'text_snippet_to_review', @@ -359,12 +361,12 @@ sum(case when gm.generic_metadata_id is not null then 1 else 0 end) as assigned_ const report = await this.getReviewReport(); for (const reportItem of report) { if ( - reportItem.not_answered === 0 && - ![6, 7].includes(reportItem.user_metadata_source_id) + reportItem.not_answered === 0 ) { await this.deleteAssignments(reportItem.user_metadata_source_id); await this.assignitems( reportItem.user_metadata_source_id, + reportItem.organization_source_id, reportItem.organization_name, ); } From 84813b4d7dce80b2fbcfb296461e8289b02505ba Mon Sep 17 00:00:00 2001 From: mtaghiza Date: Thu, 2 Jun 2022 15:00:01 -0400 Subject: [PATCH 3/6] Frontend - update help desk email --- validation-tool-frontend/src/views/Login.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation-tool-frontend/src/views/Login.vue b/validation-tool-frontend/src/views/Login.vue index 14db397..97bb193 100644 --- a/validation-tool-frontend/src/views/Login.vue +++ b/validation-tool-frontend/src/views/Login.vue @@ -11,7 +11,7 @@ You will be given up to 100 snippets to review initially, and then additional snippets in batches of 100.

-If you have any questions, please email us at support@coleridgeinitiative.org +If you have any questions, please email us at sciserver-helpdesk@jhu.edu

Login here to start the review process – and thank you so much for contributing to the public good. From f2f3c954d1e5c7a2685c0c8b565bf2ff93100684 Mon Sep 17 00:00:00 2001 From: mtaghiza Date: Thu, 2 Jun 2022 15:01:02 -0400 Subject: [PATCH 4/6] Frontend - change title to ShowUStheData Validation Tool --- validation-tool-frontend/src/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation-tool-frontend/src/App.vue b/validation-tool-frontend/src/App.vue index 5913559..762f6e4 100644 --- a/validation-tool-frontend/src/App.vue +++ b/validation-tool-frontend/src/App.vue @@ -1,7 +1,7 @@