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

ANGOLASUP-938: Enabled report configuration from the UI level #188

Merged
merged 1 commit into from
Oct 24, 2024
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
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 openlmis-home-page-report.component:openlmisHomePageReport
*
* @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 openlmis-home-page-report.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 = '3a792c67-1221-4d15-bbc9-cb3573b53e4c';
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'
]);

})();
Loading