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

[Views] fixed loading state #5656

Merged
merged 2 commits into from
Oct 9, 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
14 changes: 6 additions & 8 deletions plugins/views/frontend/public/javascripts/countly.views.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
showViewCountWarning: false,
tableDynamicCols: dynamicCols,
isGraphLoading: true,
isTableLoading: false,
isTableLoading: true,
showActionMapColumn: showActionMapColumn, //for action map
domains: [], //for action map
persistentSettings: [],
Expand All @@ -320,7 +320,6 @@
this.$store.dispatch('countlyViews/onSetSelectedViews', self.persistentSettings);
this.$store.dispatch('countlyViews/fetchData').then(function() {
self.calculateGraphSeries();
self.isGraphLoading = false;
self.showActionsMapColumn(); //for action map
self.setUpDomains(); //for action map
});
Expand All @@ -342,7 +341,6 @@
}
this.$store.dispatch('countlyViews/fetchData').then(function() {
self.calculateGraphSeries();
self.isGraphLoading = false;
self.showActionsMapColumn();//for action map
self.setUpDomains();//for action map
});
Expand Down Expand Up @@ -426,11 +424,10 @@
self.isGraphLoading = true;
self.$store.dispatch('countlyViews/fetchData').then(function() {
self.calculateGraphSeries();
self.isGraphLoading = false;
});
});

this.refresh();
this.refresh(true);
},
handleSelectionChange: function(selectedRows) {
var self = this;
Expand Down Expand Up @@ -467,7 +464,6 @@
self.isGraphLoading = true;
self.$store.dispatch('countlyViews/fetchData').then(function() {
self.calculateGraphSeries();
self.isGraphLoading = false;
});
});
return true;
Expand All @@ -486,10 +482,10 @@
}
this.$store.dispatch('countlyViews/fetchData').then(function() {
self.calculateGraphSeries();
self.isGraphLoading = false;
});
this.$store.dispatch("countlyViews/fetchViewsMainTable", {"segmentKey": this.$store.state.countlyViews.selectedSegment, "segmentValue": this.$store.state.countlyViews.selectedSegmentValue}).then(function() {
self.isTableLoading = false;
});
this.$store.dispatch("countlyViews/fetchViewsMainTable", {"segmentKey": this.$store.state.countlyViews.selectedSegment, "segmentValue": this.$store.state.countlyViews.selectedSegmentValue});
},
calculateTotalCards: function() {
var totals = this.$store.state.countlyViews.totals || {};
Expand Down Expand Up @@ -568,6 +564,7 @@
}
};
}
self.isGraphLoading = false;
});
},
getExportQuery: function() {
Expand Down Expand Up @@ -617,6 +614,7 @@
},
dateChanged: function() {
this.isSpecialPeriod = countlyCommon.periodObj.isSpecialPeriod;
this.refresh(true);
},
openDrillViewDrawer: function() {
let self = this;
Expand Down
2 changes: 1 addition & 1 deletion plugins/views/frontend/public/templates/views.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h4 class="bu-pt-1" data-test-id="for-label">{{i18n('views.for')}}</h4>
</template>
</template>
</cly-datatable-n>
<cly-datatable-n v-else resizable border :force-loading="isTableLoading" test-id="datatable-analytics-views"
<cly-datatable-n v-else resizable border v-loading="isTableLoading" :force-loading="isTableLoading" test-id="datatable-analytics-views"
:default-sort="{prop: 'u', order: 'descending'}" :available-dynamic-cols="tableDynamicCols"
:persist-key="tablePersistKey" :data-source="remoteTableDataSource" :export-query="getExportQuery"
ref="viewsTable" @selection-change="handleSelectionChange">
Expand Down
Loading