Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide dashboard reports from Report Generator #1445

Merged
merged 2 commits into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions html/controllers/report_builder/enum_templates.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?php

try {

$user = \xd_security\getLoggedInUser();

$templates = XDReportManager::enumerateReportTemplates($user->getRoles());

$returnData['status'] = 'success';
$returnData['success'] = true;
$returnData['templates'] = $templates;
$returnData['count'] = count($templates);

\xd_controller\returnJSON($returnData);
try {
$user = \xd_security\getLoggedInUser();

}
catch (SessionExpiredException $see) {
// TODO: Refactor generic catch block below to handle specific exceptions,
// which would allow this block to be removed.
throw $see;
}
catch (Exception $e) {
$templates = XDReportManager::enumerateReportTemplates($user->getRoles());

\xd_response\presentError($e->getMessage());

}

?>
// We do not want to show the "Dashboard Tab Reports"
foreach($templates as $key => $value){
if ($value['name'] === 'Dashboard Tab Report') {
unset($templates[$key]);
}
}

$returnData['status'] = 'success';
$returnData['success'] = true;
$returnData['templates'] = $templates;
$returnData['count'] = count($templates);

\xd_controller\returnJSON($returnData);

} catch (SessionExpiredException $see) {
// TODO: Refactor generic catch block below to handle specific exceptions,
// which would allow this block to be removed.
throw $see;
} catch (Exception $e) {
\xd_response\presentError($e->getMessage());
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@
"name": "Quarterly Report - Center Director",
"description": "Quarterly Report - Center Director",
"use_submenu": "0"
},
{
"id": "2",
"name": "Dashboard Tab Report",
"description": "Dashboard Tab Report",
"use_submenu": "0"
}
],
"count": 2
"count": 1
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
{
"status": "success",
"success": true,
"templates": [
{
"id": "3",
"name": "Dashboard Tab Report",
"description": "Dashboard Tab Report",
"use_submenu": "0"
}
],
"count": 1
"templates": [],
"count": 0
}
75 changes: 1 addition & 74 deletions tests/artifacts/xdmod/ui/output/reportGenerator.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"centerstaff": {
"report_templates_available": true
"report_templates_available": false
},
"centerdirector": {
"report_templates": [
Expand Down Expand Up @@ -140,79 +140,6 @@
"timeframeType": "Year to date"
}
]
},
{
"name": "Dashboard Tab Report",
"created_name": "Dashboard Tab Report",
"created_reports_count": 8,
"reports_created": 1,
"delivery_format": "PDF",
"charts": [
{
"realm": "Jobs",
"startDate": "previousQuarterStartDate",
"endDate": "previousQuarterEndDate",
"title": "Total CPU Hours and Jobs",
"drillDetails": "",
"timeframeType": "Previous quarter"
},
{
"realm": "Jobs",
"startDate": "previousQuarterStartDate",
"endDate": "previousQuarterEndDate",
"title": "Percent Utilization",
"drillDetails": "",
"timeframeType": "Previous quarter"
},
{
"realm": "Jobs",
"startDate": "previousQuarterStartDate",
"endDate": "previousQuarterEndDate",
"title": "CPU Hours and Number of Jobs - Top 20 Users",
"drillDetails": "",
"timeframeType": "Previous quarter"
},
{
"realm": "Jobs",
"startDate": "previousQuarterStartDate",
"endDate": "previousQuarterEndDate",
"title": "CPU Hours and Number of Jobs",
"drillDetails": "by Resource",
"timeframeType": "Previous quarter"
},
{
"realm": "Jobs",
"startDate": "previousQuarterStartDate",
"endDate": "previousQuarterEndDate",
"title": "CPU Hours, Number of Jobs, and Wait Time per Job",
"drillDetails": "by Job Size",
"timeframeType": "Previous quarter"
},
{
"realm": "Jobs",
"startDate": "previousQuarterStartDate",
"endDate": "previousQuarterEndDate",
"title": "CPU Hours and User Expansion Factor",
"drillDetails": "by Job Size",
"timeframeType": "Previous quarter"
},
{
"realm": "Jobs",
"startDate": "previousQuarterStartDate",
"endDate": "previousQuarterEndDate",
"title": "Wait Hours per Job",
"drillDetails": "by Queue",
"timeframeType": "Previous quarter"
},
{
"realm": "Jobs",
"startDate": "previousQuarterStartDate",
"endDate": "previousQuarterEndDate",
"title": "CPU Hours and Number of Jobs",
"drillDetails": "by Queue",
"timeframeType": "Previous quarter"
}
]
}
],
"center": ""
Expand Down
74 changes: 1 addition & 73 deletions tests/ui/test/specs/xdmod/reportGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,78 +233,6 @@ describe('Report Generator', function () {
timeframeType: 'Year to date'
}
]
},
{
name: expected.centerdirector.report_templates[1].name,
chartsPerPage: 1,
schedule: 'Once',
deliveryFormat: 'PDF',
charts: [
{
realm: 'Jobs',
startDate: previousQuarterStartDate,
endDate: previousQuarterEndDate,
title: 'Total CPU Hours and Jobs',
drillDetails: '',
timeframeType: 'Previous quarter'
},
{
realm: 'Jobs',
startDate: previousQuarterStartDate,
endDate: previousQuarterEndDate,
title: 'Percent Utilization',
drillDetails: '',
timeframeType: 'Previous quarter'
},
{
realm: 'Jobs',
startDate: previousQuarterStartDate,
endDate: previousQuarterEndDate,
title: 'CPU Hours and Number of Jobs - Top 20 Users',
drillDetails: '',
timeframeType: 'Previous quarter'
},
{
realm: 'Jobs',
startDate: previousQuarterStartDate,
endDate: previousQuarterEndDate,
title: 'CPU Hours and Number of Jobs',
drillDetails: 'by Resource',
timeframeType: 'Previous quarter'
},
{
realm: 'Jobs',
startDate: previousQuarterStartDate,
endDate: previousQuarterEndDate,
title: 'CPU Hours, Number of Jobs, and Wait Time per Job',
drillDetails: 'by Job Size',
timeframeType: 'Previous quarter'
},
{
realm: 'Jobs',
startDate: previousQuarterStartDate,
endDate: previousQuarterEndDate,
title: 'CPU Hours and User Expansion Factor',
drillDetails: 'by Job Size',
timeframeType: 'Previous quarter'
},
{
realm: 'Jobs',
startDate: previousQuarterStartDate,
endDate: previousQuarterEndDate,
title: 'Wait Hours per Job',
drillDetails: 'by Queue',
timeframeType: 'Previous quarter'
},
{
realm: 'Jobs',
startDate: previousQuarterStartDate,
endDate: previousQuarterEndDate,
title: 'CPU Hours and Number of Jobs',
drillDetails: 'by Queue',
timeframeType: 'Previous quarter'
}
]
}
];

Expand Down Expand Up @@ -380,7 +308,7 @@ describe('Report Generator', function () {
it('No available charts listed', function () {
expect(reportGeneratorPage.getAvailableCharts().length, 'No charts in the list of available charts').to.be.equal(0);
});
it('Report templates available', function () {
it('No report templates available', function () {
expect(reportGeneratorPage.isNewBasedOnEnabled()).to.equal(expected.centerstaff.report_templates_available);
});
});
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/test/specs/xdmod/reportGenerator.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,8 @@ class ReportGenerator {
browser.waitForVisible(this.selectors.myReports.toolbar.downloadAsPdfButton());
browser.click(this.selectors.myReports.toolbar.downloadAsPdfButton());
// Wait for check mark image to appear and disappear.
browser.waitForVisible(this.selectors.checkmarkMask(), 10000);
browser.waitForInvisible(this.selectors.checkmarkMask(), 10000);
browser.waitForVisible(this.selectors.checkmarkMask(), 60000);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timings on a "fresh" install in my local docker (27.27, 8.11, 6.65, 11.52)

browser.waitForInvisible(this.selectors.checkmarkMask(), 60000);
}

/**
Expand Down