iguazio.dashboard-controls 1.2.5 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iguazio.dashboard-controls",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "main": "dist/js/iguazio.dashboard-controls.js",
5
5
  "description": "Collection of resources (such as CSS styles, fonts and images) and AngularJs 1.x components and services to share among different Iguazio repos.",
6
6
  "repository": {
@@ -37,6 +37,7 @@
37
37
  * @param {Object} queryParams - additional parameters
38
38
  * @param {string} queryParams.query - search query text
39
39
  * @param {string} queryParams.timeFrame - selected time period to show results for
40
+ * @param {string} queryParams.filterName - selected function name
40
41
  * @param {string} [queryParams.lastEntryTimestamp] - time stamp of the last item in a list, used with auto
41
42
  * @param {boolean} withReplicas - determines if replicas should be requested
42
43
  * update
@@ -94,6 +95,14 @@
94
95
  };
95
96
  }
96
97
 
98
+ if (queryParams.filterName) {
99
+ config.body.query.bool.should = [
100
+ { term: { name: queryParams.filterName } },
101
+ { term: { 'name.keyword': queryParams.filterName } }
102
+ ];
103
+ config.body.query.bool.minimum_should_match = 1;
104
+ }
105
+
97
106
  // If query text was set, add proper items to config
98
107
  if (!lodash.isEmpty(queryParams.query)) {
99
108
  config.body.query.bool.must.push({
@@ -306,6 +315,14 @@
306
315
  }
307
316
  };
308
317
 
318
+ if (queryParams.filterName) {
319
+ config.body.query.bool.should = [
320
+ { term: { name: queryParams.filterName } },
321
+ { term: { 'name.keyword': queryParams.filterName } }
322
+ ];
323
+ config.body.query.bool.minimum_should_match = 1;
324
+ }
325
+
309
326
  return ElasticsearchService.search(config);
310
327
  }
311
328
 
@@ -368,8 +368,7 @@ such restriction.
368
368
  if (ctrl.logs.length > 0) {
369
369
  ctrl.lastEntryTimestamp = ctrl.logs[0].time;
370
370
 
371
- if (ctrl.logs.replicas && (lodash.isEmpty(initialReplicas) ||
372
- initialReplicas.length !== ctrl.replicasList.length)) {
371
+ if (ctrl.logs.replicas) {
373
372
  ctrl.replicasList = ctrl.logs.replicas.map(function (replica) {
374
373
  return {
375
374
  label: replica,
@@ -392,11 +391,8 @@ such restriction.
392
391
  function generateFilterQuery() {
393
392
  var levels = lodash.chain(ctrl.filter.level).pickBy().keys().join(' OR ').value();
394
393
  var projectName = lodash.get(ctrl.version, ['metadata', 'labels', 'nuclio.io/project-name']);
395
- var queries = ['system-id:"' + ConfigService.systemId + '"', '_exists_:nuclio', 'nuclio.project_name.keyword:' + projectName];
396
-
397
- if (!lodash.isEmpty(ctrl.version.metadata.name)) {
398
- queries.push('name:' + ctrl.version.metadata.name);
399
- }
394
+ var projectFilter = '(nuclio.project_name.keyword:' + projectName + ' OR nuclio.project_name:' + projectName + ')';
395
+ var queries = ['system-id:"' + ConfigService.systemId + '"', '_exists_:nuclio', projectFilter];
400
396
 
401
397
  if (ctrl.selectedReplicas.length && ctrl.selectedReplicas.length !== initialReplicas.length) {
402
398
  var replicas = ctrl.selectedReplicas.join(' OR ');
@@ -416,6 +412,7 @@ such restriction.
416
412
  }
417
413
 
418
414
  ctrl.filterQuery = lodash.join(queries, ' AND ');
415
+ ctrl.filterName = ctrl.version.metadata.name;
419
416
  }
420
417
 
421
418
  /**
@@ -425,6 +422,7 @@ such restriction.
425
422
  function queryParams() {
426
423
  return {
427
424
  query: ctrl.filterQuery,
425
+ filterName: ctrl.filterName,
428
426
  timeFrame: ctrl.datePreset,
429
427
  customTimeFrame: ctrl.timeRange
430
428
  };