Skip to content

Commit

Permalink
Change things discussed in meeting
Browse files Browse the repository at this point in the history
  • Loading branch information
mkzia committed Jul 17, 2019
1 parent 9d672d0 commit d9861c5
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 18 deletions.
6 changes: 3 additions & 3 deletions classes/Rest/Controllers/SummaryControllerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function setupRoutes(Application $app, ControllerCollection $controller)
$controller->delete("$root/layout", "$class::resetLayout");

$controller->get("$root/rolereport", "$class::getRoleReport");
$controller->get("$root/recentchartsreports", "$class::getRecentChartsReports");
$controller->get("$root/savedchartsreports", "$class::getSavedChartsReports");

$controller->post("$root/viewedUserTour", "$class::setViewedUserTour");
$controller->get("$root/viewedUserTour", "$class::getViewedUserTour");
Expand Down Expand Up @@ -299,9 +299,9 @@ public function getViewedUserTour(Request $request, Application $app)
));
}
/**
* Get recent charts and reports.
* Get saved charts and reports.
**/
public function getRecentChartsReports(Request $request, Application $app)
public function getSavedChartsReports(Request $request, Application $app)
{
$user = $this->authorize($request);
if (isset($user)) {
Expand Down
2 changes: 1 addition & 1 deletion configuration/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"js": [
"gui/js/modules/summary/ChartPortlet.js",
"gui/js/modules/summary/JobPortlet.js",
"gui/js/modules/summary/RecentChartsReportsPortlet.js",
"gui/js/modules/summary/SavedChartsReportsPortlet.js",
"gui/js/modules/summary/ReportThumbnailsPortlet.js"
],
"css": [
Expand Down
4 changes: 2 additions & 2 deletions html/gui/css/ReportThumbnailsPortlet.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
}

.images-view .thumb img {
height: 158px;
width: 270px;
height: 180px;
width: 278px;
}

.images-view .thumb-wrap {
Expand Down
64 changes: 57 additions & 7 deletions html/gui/js/modules/summary/ReportThumbnailsPortlet.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,54 @@ XDMoD.Modules.SummaryPortlets.ReportThumbnailsPortlet = Ext.extend(Ext.Panel, {
}
});
this.items = [this.panel];
this.tools = [
{
id: 'help',
qtip: [
'<ul>',
'<li style="padding-top:6px;margin-bottom:6px;">',
'<span style="width:20px;background:#ff0000;display:inline-block">&nbsp;</span>',
'<span><b>Failed Runs</b></span>',
'<ul>',
'<li style="margin-left:6px;">A run in which the app kernel failed to complete successfully.</li>',
'</ul>',
'</li>',
'<li style="margin-top:6px;margin-bottom:6px;">',
'<span style="width: 20px;background:#ffb336;display:inline-block">&nbsp;</span>',
'<span><b>Under Performing Runs</b></span>',
'<ul>',
'<li style="margin-left:6px;">A run in which the app kernel completed successfully but performed below the established control region.</li>',
'</ul>',
'</li>',
'<li style="margin-top:6px;margin-bottom:6px;">',
'<span style="width: 20px;background:#50b432;display:inline-block ">&nbsp;</span>',
'<span><b>In Control Runs</b></span>',
'<ul>',
'<li style="margin-left:6px;">A run in which the app kernel completed successfully and performed within the established control region.</li>',
'</ul>',
'</li>',
'<li style="margin-top:6px;padding-bottom:6px;">',
'<span style="width: 20px;background:#3c86ff;display:inline-block">&nbsp;</span>',
'<span><b>Over Performing Runs</b></span>',
'<ul>',
'<li style="margin-left:6px;">A run in which the app kernel completed successfully and performed better than the established control region.</li>',
'</ul>',
'</li>',
'</ul>'
].join(' '),
qwidth: 60
}
];
this.tbar = {
items: [
{
xtype: 'tbtext',
text: 'Time Range'
},
{
xtype: 'button',
text: 'Time Range',
text: timeframe_label,
iconCls: 'custom_date',
menu: [{
text: '30 day',
checked: timeframe_label === '30 day',
Expand All @@ -224,6 +267,8 @@ XDMoD.Modules.SummaryPortlets.ReportThumbnailsPortlet = Ext.extend(Ext.Panel, {
var start = lastMonth;
var end = today;
this.ownerCt.ownerCt.ownerCt.ownerCt.fireEvent('timeframe_change', start, end);
this.ownerCt.ownerCt.ownerCt.items.items[1].setText('30 day');
this.ownerCt.ownerCt.ownerCt.items.items[2].setText('<b>Summary Report - ' + self.timeframe.start_date + ' - ' + self.timeframe.end_date + '</b>');
}
}
},
Expand All @@ -239,6 +284,8 @@ XDMoD.Modules.SummaryPortlets.ReportThumbnailsPortlet = Ext.extend(Ext.Panel, {
var start = oneYearAgoStart;
var end = oneYearAgoEnd;
this.ownerCt.ownerCt.ownerCt.ownerCt.fireEvent('timeframe_change', start, end);
this.ownerCt.ownerCt.ownerCt.items.items[1].setText('Previous year');
this.ownerCt.ownerCt.ownerCt.items.items[2].setText('<b>Summary Report - ' + self.timeframe.start_date + ' - ' + self.timeframe.end_date + '</b>');
}
}
},
Expand All @@ -253,6 +300,8 @@ XDMoD.Modules.SummaryPortlets.ReportThumbnailsPortlet = Ext.extend(Ext.Panel, {
var start = last5Year;
var end = today;
this.ownerCt.ownerCt.ownerCt.ownerCt.fireEvent('timeframe_change', start, end);
this.ownerCt.ownerCt.ownerCt.items.items[1].setText('5 year');
this.ownerCt.ownerCt.ownerCt.items.items[2].setText('<b>Summary Report - ' + self.timeframe.start_date + ' - ' + self.timeframe.end_date + '</b>');
}
}
},
Expand All @@ -263,13 +312,17 @@ XDMoD.Modules.SummaryPortlets.ReportThumbnailsPortlet = Ext.extend(Ext.Panel, {
listeners: {
click: function (comp) {
this.ownerCt.ownerCt.ownerCt.ownerCt.fireEvent('timeframe_change');
this.ownerCt.ownerCt.ownerCt.items.items[1].setText('Report default');
this.ownerCt.ownerCt.ownerCt.items.items[2].setText('<b>Summary Report</b>');
}
}
}]
},
' ',
'|',
' ',
{
xtype: 'tbtext',
text: '<b>Summary Report - ' + self.timeframe.start_date + ' - ' + self.timeframe.end_date + '</b>'
},
'->',
{
text: 'Download Report',
icon: 'gui/images/report_generator/pdf_icon.png',
Expand All @@ -293,7 +346,6 @@ XDMoD.Modules.SummaryPortlets.ReportThumbnailsPortlet = Ext.extend(Ext.Panel, {
});
conn.request({
url: 'controllers/report_builder.php',

params: {
operation: 'send_report',
report_id: report_id,
Expand All @@ -302,9 +354,7 @@ XDMoD.Modules.SummaryPortlets.ReportThumbnailsPortlet = Ext.extend(Ext.Panel, {
start_date: start_date,
end_date: end_date
},

method: 'POST',

callback: function (options, success, response) {
if (success) {
var responseData = CCR.safelyDecodeJSONResponse(response);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Ext.namespace('XDMoD.Modules.SummaryPortlets');

XDMoD.Modules.SummaryPortlets.RecentChartsReportsPortlet = Ext.extend(Ext.ux.Portlet, {
XDMoD.Modules.SummaryPortlets.SavedChartsReportsPortlet = Ext.extend(CCR.xdmod.ui.Portlet, {

layout: 'fit',
autoScroll: true,
title: 'Recent Charts and Reports',
title: 'Saved Charts and Reports',
width: 1000,

initComponent: function () {
Expand All @@ -13,7 +13,7 @@ XDMoD.Modules.SummaryPortlets.RecentChartsReportsPortlet = Ext.extend(Ext.ux.Por
this.chartReportStore = new Ext.data.JsonStore({
// store configs
autoDestroy: true,
url: XDMoD.REST.url + '/summary/recentchartsreports',
url: XDMoD.REST.url + '/summary/savedchartsreports',
// reader configs
root: 'data',
idProperty: 'name',
Expand All @@ -28,6 +28,9 @@ XDMoD.Modules.SummaryPortlets.RecentChartsReportsPortlet = Ext.extend(Ext.ux.Por
{
name: 'ts',
convert: function (v, rec) {
if (rec.ts === '0') {
return 'Unknown';
}
return Ext.util.Format.date(new Date(rec.ts * 1000).toString(), 'Y-m-d h:i:s');
}
}
Expand Down Expand Up @@ -125,12 +128,19 @@ XDMoD.Modules.SummaryPortlets.RecentChartsReportsPortlet = Ext.extend(Ext.ux.Por

this.height = this.width * aspectRatio;
this.items = [this.chartReportGrid];
XDMoD.Modules.SummaryPortlets.RecentChartsReportsPortlet.superclass.initComponent.apply(this, arguments);
this.tools = [
{
id: 'help',
qtip: 'Porlet shows a list of saved charts and reports.',
qwidth: 60
}
];
XDMoD.Modules.SummaryPortlets.SavedChartsReportsPortlet.superclass.initComponent.apply(this, arguments);
}
});

/**
* The Ext.reg call is used to register an xtype for this class so it
* can be dynamically instantiated
*/
Ext.reg('RecentChartsReportsPortlet', XDMoD.Modules.SummaryPortlets.RecentChartsReportsPortlet);
Ext.reg('SavedChartsReportsPortlet', XDMoD.Modules.SummaryPortlets.SavedChartsReportsPortlet);

0 comments on commit d9861c5

Please sign in to comment.