Skip to content

Commit

Permalink
#2896 Clean up commented code, relocate function for reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
dwalizer committed Oct 31, 2024
1 parent 2758e1b commit 06466ba
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 46 deletions.
11 changes: 0 additions & 11 deletions e2e-tests/cypress/e2e/accessibility/accessibility_specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
14 changes: 13 additions & 1 deletion e2e-tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -1551,4 +1551,16 @@ Cypress.Commands.add("setDarkModeIfNeeded", (darkMode) => {
if (darkMode && darkMode.length > 0) {
cy.configureDarkMode()
}
})
})

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],
});
});
});
});
11 changes: 0 additions & 11 deletions service/src/main/java/skills/skillLoading/SubjectDataLoader.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -367,17 +367,6 @@ class SubjectDataLoader {
)
}

// HashMap<String, SkillDefAndUserPoints> skillList = new HashMap<String, SkillDefAndUserPoints>()
//
// 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 }
}

Expand Down

0 comments on commit 06466ba

Please sign in to comment.