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

Add notification of generated visuals within “Data Sources” upon drilldown #2725 #2734

Merged
merged 3 commits into from
Sep 13, 2022
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
2 changes: 1 addition & 1 deletion js/components/heading.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.heading-title {
font-size: 14px;
color: #000;
padding: 1rem 0rem 1rem 0rem;
padding: 1rem 0 1rem 0;
font-weight: 500;

& i {
Expand Down
2 changes: 1 addition & 1 deletion js/pages/data-sources/classes/Treemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ define([
this.tableData = ko.observable();
this.currentConcept = ko.observable();
this.currentConceptSubscription = this.currentConcept.subscribe(c => {
c && this.context.loadingReportDrilldown(true);
c && this.context.showLoadingDrilldownModal(true) && this.context.loadingDrilldownDone(false);
});

this.byFrequency = false;
Expand Down
4 changes: 2 additions & 2 deletions js/pages/data-sources/components/reports/treemap.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</div>
</div>
<atlas-modal params="{
showModal: context.loadingReportDrilldown,
showModal: context.showLoadingDrilldownModal,
iconClass: 'fa fa-chart-area',
title: ko.i18n('dataSources.loadingDrilldownReport', 'Loading Drilldown Report'),
backdropClosable: false,
Expand All @@ -52,7 +52,7 @@
</atlas-modal>
<!-- ko if: currentConcept() -->
<report-treemap-drilldown params="
context: context,
context: context,
currentReport: currentReport,
currentConcept: currentConcept,
byFrequency: byFrequency,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<!-- ko ifnot: context.loadingReportDrilldown() -->
<!-- ko if: context.loadingDrilldownDone() -->
<!-- ko if: isError -->
<empty-state params="message: ko.i18n('dataSources.drilldown.noData', 'No data')"></empty-state>
<!-- /ko -->

<div data-bind="visible: !isError()">
<div data-bind="visible: !isError()" id="drilldownReport">
<!-- ko if: currentConcept() -->
<heading-title params="name: ` ${currentConcept().name} ${ko.i18n('dataSources.drilldown.drilldownReport', 'Drilldown Report')()}`"></heading-title>
<span class="report-heading-title" data-bind="text: `${currentConcept().name} ${ko.i18n('dataSources.drilldown.drilldownReport', 'Drilldown Report')()}`"></span>
<a class="scroll-to-top-link" data-bind="click: () => document.getElementById('dataSourcesTop').scrollIntoView()">scroll to the top</a>
<!-- /ko -->

<div class="col-xs-12">
Expand Down
15 changes: 4 additions & 11 deletions js/pages/data-sources/components/reports/treemapDrilldown.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,6 @@ define([
},
};

this.scrollTo = function (s) {
var e = $(s);
if (e.length > 0) {
e[0].scrollIntoView();
}
}

this.currentReport = params.currentReport;
this.byFrequency = params.byFrequency;
this.byUnit = params.byUnit;
Expand Down Expand Up @@ -345,14 +338,14 @@ define([
this.getData()
.then((data) => {
this.parseData(data);
this.context.loadingDrilldownDone(true);
this.context.showLoadingDrilldownModal(false);
setTimeout(() => document.getElementById('drilldownReport').scrollIntoView(), 0);
})
.catch((er) => {
this.isError(true);
console.error(er);
})
.finally(() => {
this.context.loadingReportDrilldown(false);
this.scrollTo("#datasourceReportDrilldownTitle");
this.context.showLoadingDrilldownModal(false);
});
}
}
Expand Down
1 change: 1 addition & 0 deletions js/pages/data-sources/data-sources.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<div id="dataSourcesTop"></div>
<heading-title params="name: ko.i18n('dataSources.headingTitle', 'Data Sources'), icon: 'chart-area', theme: 'dark'"></heading-title>

<access-denied params="isAuthenticated: $component.isAuthenticated, isPermitted: canViewCdmResults"></access-denied>
Expand Down
5 changes: 3 additions & 2 deletions js/pages/data-sources/data-sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ define([
this.loadingReport = ko.observable(false);
this.hasError = ko.observable(false);
this.errorMessage = ko.observable();
this.loadingReportDrilldown = ko.observable(false);
this.showLoadingDrilldownModal = ko.observable(false);
this.loadingDrilldownDone = ko.observable(false);
this.isReportLoading = ko.pureComputed(function () {
return this.loadingReport() && !this.hasError() && !this.loadingReportDrilldown();
return this.loadingReport() && !this.hasError() && !this.showLoadingDrilldownModal();
}, this);

this.isAuthenticated = authApi.isAuthenticated;
Expand Down
15 changes: 15 additions & 0 deletions js/pages/data-sources/data-sources.less
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,19 @@
}
}
}

.report-heading-title {
display: inline-block;
font-size: 14px;
color: #000;
padding: 1rem 0 1rem 0;
font-weight: 500;
}

.scroll-to-top-link {
display: inline-block;
font-size: 12px;
margin-left: 20px;
cursor: pointer;
}
}