From 06466ba11732029f46077562d42a69201d04095e Mon Sep 17 00:00:00 2001 From: Don Walizer <12420708+dwalizer@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:27:59 -0400 Subject: [PATCH] #2896 Clean up commented code, relocate function for reuse --- .../e2e/accessibility/accessibility_specs.js | 11 ----------- .../skills-display-transcript-export_spec.js | 12 ------------ .../self-report/selfReport-approvalHistory_spec.js | 11 ----------- e2e-tests/cypress/support/commands.js | 14 +++++++++++++- .../skills/skillLoading/SubjectDataLoader.groovy | 11 ----------- 5 files changed, 13 insertions(+), 46 deletions(-) diff --git a/e2e-tests/cypress/e2e/accessibility/accessibility_specs.js b/e2e-tests/cypress/e2e/accessibility/accessibility_specs.js index 1ce243060d..9494ed30bf 100644 --- a/e2e-tests/cypress/e2e/accessibility/accessibility_specs.js +++ b/e2e-tests/cypress/e2e/accessibility/accessibility_specs.js @@ -250,17 +250,6 @@ describe('Accessibility Tests', () => { }); }); }); - Cypress.Commands.add('approveAllRequests', () => { - cy.request('/admin/projects/proj1/approvals?limit=10&ascending=true&page=1&orderBy=userId') - .then((response) => { - response.body.data.forEach((item) => { - cy.wait(200); // that way sort works properly - cy.request('POST', '/admin/projects/proj1/approvals/approve', { - skillApprovalIds: [item.id], - }); - }); - }); - }); cy.createProject(1); cy.createSubject(1, 1); diff --git a/e2e-tests/cypress/e2e/client-display/skills-display-transcript-export_spec.js b/e2e-tests/cypress/e2e/client-display/skills-display-transcript-export_spec.js index a08d71ec59..2b74de9bb3 100644 --- a/e2e-tests/cypress/e2e/client-display/skills-display-transcript-export_spec.js +++ b/e2e-tests/cypress/e2e/client-display/skills-display-transcript-export_spec.js @@ -18,18 +18,6 @@ const moment = require("moment-timezone"); describe('Transcript export tests', () => { - Cypress.Commands.add('approveAllRequests', () => { - cy.request('/admin/projects/proj1/approvals?limit=10&ascending=true&page=1&orderBy=userId') - .then((response) => { - response.body.data.forEach((item) => { - cy.wait(200); // that way sort works properly - cy.request('POST', '/admin/projects/proj1/approvals/approve', { - skillApprovalIds: [item.id], - }); - }); - }); - }); - const deleteDownloadDir = () => { try { rmdirSync('cypress/downloads', { maxRetries: 5, recursive: true }); diff --git a/e2e-tests/cypress/e2e/self-report/selfReport-approvalHistory_spec.js b/e2e-tests/cypress/e2e/self-report/selfReport-approvalHistory_spec.js index 00e2d74836..5d84bf7761 100644 --- a/e2e-tests/cypress/e2e/self-report/selfReport-approvalHistory_spec.js +++ b/e2e-tests/cypress/e2e/self-report/selfReport-approvalHistory_spec.js @@ -39,17 +39,6 @@ describe('Self Report Approval History Tests', () => { }); }); }); - Cypress.Commands.add('approveAllRequests', () => { - cy.request('/admin/projects/proj1/approvals?limit=10&ascending=true&page=1&orderBy=userId') - .then((response) => { - response.body.data.forEach((item) => { - cy.wait(200); // that way sort works properly - cy.request('POST', '/admin/projects/proj1/approvals/approve', { - skillApprovalIds: [item.id], - }); - }); - }); - }); }); it('empty approval history', () => { diff --git a/e2e-tests/cypress/support/commands.js b/e2e-tests/cypress/support/commands.js index 6c86163efd..4c70eca222 100644 --- a/e2e-tests/cypress/support/commands.js +++ b/e2e-tests/cypress/support/commands.js @@ -1551,4 +1551,16 @@ Cypress.Commands.add("setDarkModeIfNeeded", (darkMode) => { if (darkMode && darkMode.length > 0) { cy.configureDarkMode() } -}) \ No newline at end of file +}) + +Cypress.Commands.add('approveAllRequests', () => { + cy.request('/admin/projects/proj1/approvals?limit=10&ascending=true&page=1&orderBy=userId') + .then((response) => { + response.body.data.forEach((item) => { + cy.wait(200); + cy.request('POST', '/admin/projects/proj1/approvals/approve', { + skillApprovalIds: [item.id], + }); + }); + }); +}); \ No newline at end of file diff --git a/service/src/main/java/skills/skillLoading/SubjectDataLoader.groovy b/service/src/main/java/skills/skillLoading/SubjectDataLoader.groovy index 39faf7d7d9..b57e6d391b 100644 --- a/service/src/main/java/skills/skillLoading/SubjectDataLoader.groovy +++ b/service/src/main/java/skills/skillLoading/SubjectDataLoader.groovy @@ -367,17 +367,6 @@ class SubjectDataLoader { ) } -// HashMap skillList = new HashMap() -// -// res.forEach { -// def id = it.skillDef.skillId + '-' + it.skillDef.projectId -// if(!skillList.containsKey(id) || it.approval.updated > skillList[id].approval.updated) { -// skillList[id] = it -// } -// } -// -// res = skillList.values().toList() - return res?.findAll {it.skillDef.type != SkillDef.ContainerType.SkillsGroup || it.skillDef.totalPoints > 0 }.sort { it.skillDef.displayOrder } }