diff --git a/admin-ui/app/components/app-detail/include/activity.js b/admin-ui/app/components/app-detail/include/activity.js
index 6dbfa337ba..6cf28d9906 100644
--- a/admin-ui/app/components/app-detail/include/activity.js
+++ b/admin-ui/app/components/app-detail/include/activity.js
@@ -11,12 +11,17 @@ angular.module('upsConsole')
this.currentEnd = 0;
this.perPage = 10;
this.searchString = '';
+ this.activeSearch = '';
var refreshInterval;
+ /**
+ * Fetches new data, reflecting provided page and searchString
+ */
function fetchMetrics( page, searchString ) {
return metricsEndpoint.fetchApplicationMetrics(self.app.pushApplicationID, searchString, page, self.perPage)
.then(function( data ) {
+ self.activeSearch = searchString;
self.metrics.forEach(function( originalMetric ) {
data.pushMetrics.some(function ( newMetric ) {
if (originalMetric.id === newMetric.id && originalMetric.$toggled) {
@@ -43,6 +48,18 @@ angular.module('upsConsole')
});
}
+ /**
+ * Determines whether search is active - either the user typed search string or the data doesn't reflect the search string yet.
+ *
+ * @return false if searchString if false and data reflects that searchString; true otherwise
+ */
+ this.isSearchActive = function() {
+ return self.searchString || self.activeSearch;
+ };
+
+ /**
+ * Fetches new data on page change
+ */
this.onPageChange = function ( page ) {
fetchMetrics( page, self.searchString );
};
diff --git a/admin-ui/app/components/app-detail/include/analytics.html b/admin-ui/app/components/app-detail/include/analytics.html
index 6f8c0591b8..77006c2168 100644
--- a/admin-ui/app/components/app-detail/include/analytics.html
+++ b/admin-ui/app/components/app-detail/include/analytics.html
@@ -94,7 +94,7 @@
No Charts yet
There are no registered device for this application.
- Check out the documentation on how to get started to
register a device.
+
Check out the documentation on how to get started to register a device.