apucher closed pull request #3465: [TE] frontend - aaronucsd/home - changes to
sort the application list
URL: https://github.com/apache/incubator-pinot/pull/3465
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/thirdeye/thirdeye-frontend/app/pods/home/index/controller.js
b/thirdeye/thirdeye-frontend/app/pods/home/index/controller.js
index a44674fdac..256eea3630 100644
--- a/thirdeye/thirdeye-frontend/app/pods/home/index/controller.js
+++ b/thirdeye/thirdeye-frontend/app/pods/home/index/controller.js
@@ -6,6 +6,7 @@ import moment from 'moment';
import _ from 'lodash';
import { setUpTimeRangeOptions } from
'thirdeye-frontend/utils/manage-alert-utils';
import * as anomalyUtil from 'thirdeye-frontend/utils/anomaly';
+import { inject as service } from '@ember/service';
const TIME_PICKER_INCREMENT = 5; // tells date picker hours field how
granularly to display time
const DEFAULT_ACTIVE_DURATION = '1d'; // setting this date range selection as
default (Last 24 Hours)
@@ -16,6 +17,7 @@ const TIME_RANGE_OPTIONS = ['today', '1d', '2d', '1w'];
export default Controller.extend({
toggleCollapsed: false, /* hide/show accordians */
isReportAnomalyEnabled: false,
+ store: service('store'),
/**
* Overrides ember-models-table's css classes
@@ -39,6 +41,17 @@ export default Controller.extend({
});
},
+ sortedApplications: computed(
+ 'model.applications',
+ function() {
+ let model = get(this, 'model');
+
+ // Iterate through each anomaly
+ let applications =
this.get('store').peekAll('application').sortBy('application');
+ return applications;
+ }
+ ),
+
filteredAnomalyMapping: computed(
'model.{anomalyMapping,feedbackType}',
function() {
diff --git a/thirdeye/thirdeye-frontend/app/pods/home/index/template.hbs
b/thirdeye/thirdeye-frontend/app/pods/home/index/template.hbs
index b3797cb30a..674f337ca3 100644
--- a/thirdeye/thirdeye-frontend/app/pods/home/index/template.hbs
+++ b/thirdeye/thirdeye-frontend/app/pods/home/index/template.hbs
@@ -10,10 +10,11 @@
predefinedRanges=pill.predefinedRanges
selectAction=(action "onRangeSelection")
}}
-
- {{#link-to "home.share-dashboard" (query-params appName=appName
duration=duration startDate=startDate endDate=endDate feedbackType=feedbackType
shareId=null) tagName="button" type="button" class="pull-right te-button
te-button--outline"}}
- Share
- {{/link-to}}
+ {{#if (gt anomaliesCount 0)}}
+ {{#link-to "home.share-dashboard" (query-params appName=appName
duration=duration startDate=startDate endDate=endDate feedbackType=feedbackType
shareId=null) tagName="button" type="button" class="pull-right te-button
te-button--outline"}}
+ Share
+ {{/link-to}}
+ {{/if}}
</header>
<article class="dashboard-container__body">
@@ -21,7 +22,7 @@
<h2
class="dashboard-container__title">Application:<span>{{appName}}</span></h2>
<div class="dashboard-container__application-header-dropdown">
{{#power-select
- options=model.applications
+ options=sortedApplications
selected=appNameSelected
searchField="application"
searchEnabled=true
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]