Skip to content

Commit

Permalink
ANGOLASUP-938: Enabled report configuration from the UI level
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikNoga committed Oct 23, 2024
1 parent fb506ab commit 6e2fb17
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 10 deletions.
Empty file.
34 changes: 34 additions & 0 deletions src/openlmis-home-page-report/home-page-report.component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2017 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*  
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
* See the GNU Affero General Public License for more details. You should have received a copy of
* the GNU Affero General Public License along with this program. If not, see
* http://www.gnu.org/licenses.  For additional information contact [email protected]
*/

(function() {

'use strict';

/**
* @ngdoc component
* @name Module.component:Component
*
* @description
* Component responsible for displaying home page embedded report
*/
angular
.module('openlmis-home-page-report')
.component('openlmisHomePageReport', {
templateUrl: 'openlmis-home-page-report/home-page-report.html',
controller: 'OpenlmisHomePageReportController',
controllerAs: 'vm'
});
})();
46 changes: 46 additions & 0 deletions src/openlmis-home-page-report/home-page-report.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2017 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*  
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
* See the GNU Affero General Public License for more details. You should have received a copy of
* the GNU Affero General Public License along with this program. If not, see
* http://www.gnu.org/licenses.  For additional information contact [email protected]
*/

(function() {

'use strict';

/**
* @ngdoc controller
* @name Module.controller:OpenlmisHomePageReportController *
* @description
* Manages the openlmis-home-page-report component
*/
angular
.module('openlmis-home-page-report')
.controller('OpenlmisHomePageReportController', OpenlmisHomePageReportController);

OpenlmisHomePageReportController.$inject = ['reportEmbeddedService', '$sce'];

function OpenlmisHomePageReportController(reportEmbeddedService, $sce) {
var vm = this;
var DASHBOARD_REPORT_URL = '4a1ac90e-ebe2-450d-893b-2fe968712bb1';
vm.report = undefined;
vm.$onInit = onInit;

function onInit() {
reportEmbeddedService.get(DASHBOARD_REPORT_URL).then(function(report) {
vm.report = report;
var trustedUrl = $sce.trustAsResourceUrl(vm.report.url);
vm.report.url = trustedUrl;
});
}
}
})();
8 changes: 8 additions & 0 deletions src/openlmis-home-page-report/home-page-report.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<iframe
title="expiring_stock_summary_report"
style="width: 95vw; height: 90vh"
src="{{ vm.report.url }}"
frameborder="0"
scrolling="auto"
allowFullScreen="true">
</iframe>
29 changes: 29 additions & 0 deletions src/openlmis-home-page-report/home-page-report.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2017 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*  
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
* See the GNU Affero General Public License for more details. You should have received a copy of
* the GNU Affero General Public License along with this program. If not, see
* http://www.gnu.org/licenses.  For additional information contact [email protected]
*/

(function() {

'use strict';

/**
* @module openlmis-home-page-report
*
* @description
* Responsible for displaying embedded home page report
*/
angular.module('openlmis-home-page-report', [
'report-embedded'
]);
})();
10 changes: 1 addition & 9 deletions src/openlmis-home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ <h3 ng-if="!vm.homePageSystemNotifications || vm.homePageSystemNotifications.len
<!-- OAM-18: ends here -->

<!-- ANGOLASUP-903: start -->
<iframe
title="expiring_stock_summary_report"
style="width: 95vw; height: 90vh"
src="https://app.powerbi.com/view?r=eyJrIjoiNGQ4YzA0NzctMjQ4Ni00MmIyLThmMjAtZTk5ZmJkY2NkNjYwIiwidCI6IjAwNTMxNzRhLTkxMDAtNGU4ZS05NzlhLTQ0MzZkYTAxYjBlZSIsImMiOjZ9"
frameborder="0"
scrolling="auto"
allowFullScreen="true"
>
</iframe>
<openlmis-home-page-report></openlmis-home-page-report>
<!-- ANGOLASUP-903: end -->
</div>
3 changes: 2 additions & 1 deletion src/openlmis-home/openlmis-home.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
// OAM-18: Homepage UI alerts
'openlmis-home-alerts-panel',
// OAM-18: ends here
'ui.router'
'ui.router',
'openlmis-home-page-report'
]);

})();

0 comments on commit 6e2fb17

Please sign in to comment.