+
@@ -18,6 +18,11 @@
+
+
+ save_alt
+
diff --git a/UI/web-src/ngMango/components/pointBrowser/pointBrowser.js b/UI/web-src/ngMango/components/pointBrowser/pointBrowser.js
index 212f9a43c..085ad439d 100644
--- a/UI/web-src/ngMango/components/pointBrowser/pointBrowser.js
+++ b/UI/web-src/ngMango/components/pointBrowser/pointBrowser.js
@@ -9,10 +9,27 @@ import pointBrowserTemplate from './pointBrowser.html';
const types = ['watchList', 'deviceName', 'dataSource', 'tags'];
class PointBrowserController {
- static get $$ngIsClass() { return true; }
-
- static get $inject() { return ['maTranslate', 'maRqlBuilder', 'maWatchList', 'maDataSource', '$timeout']; }
- constructor(maTranslate, maRqlBuilder, maWatchList, maDataSource, $timeout) {
+ static get $$ngIsClass() {
+ return true;
+ }
+
+ static get $inject() {
+ return [
+ 'maTranslate',
+ 'maRqlBuilder',
+ 'maWatchList',
+ 'maDataSource',
+ '$timeout',
+ ];
+ }
+
+ constructor(
+ maTranslate,
+ maRqlBuilder,
+ maWatchList,
+ maDataSource,
+ $timeout
+ ) {
this.maTranslate = maTranslate;
this.maRqlBuilder = maRqlBuilder;
this.maWatchList = maWatchList;
@@ -26,78 +43,104 @@ class PointBrowserController {
this.ngModelCtrl.$render = () => {
if (this.ngModelCtrl.$viewValue !== undefined) {
this.selected = this.ngModelCtrl.$viewValue;
-
- types.forEach(name => {
+
+ types.forEach((name) => {
delete this[name];
});
if (!this.selected) return;
-
+
if (!this.selected.isNew()) {
this.listType = 'watchList';
this.watchList = this.selected;
- } else if (this.selected.type === 'tags' && this.selected.tags) {
+ } else if (
+ this.selected.type === 'tags' &&
+ this.selected.tags
+ ) {
this.listType = 'tags';
this.tags = this.selected.tags;
- } else if (this.selected.type === 'query' && this.selected.deviceName) {
+ } else if (
+ this.selected.type === 'query' &&
+ this.selected.deviceName
+ ) {
this.listType = 'deviceName';
this.deviceName = this.selected.deviceName;
- } else if (this.selected.type === 'query' && this.selected.dataSource) {
+ } else if (
+ this.selected.type === 'query' &&
+ this.selected.dataSource
+ ) {
this.listType = 'dataSource';
this.dataSource = this.selected.dataSource;
}
}
};
-
+
if (this.loadItem) {
// setting the view value from $onInit doesn't seem to work, only affects the device name
// watch list type as its the only type that doesn't do http request before setting view value
- this.$timeout(() => {
- this.createWatchListFromItem(this.loadItem);
- }, 0, false);
+ this.$timeout(
+ () => {
+ this.createWatchListFromItem(this.loadItem);
+ },
+ 0,
+ false
+ );
} else {
this.listType = 'watchList';
}
}
-
+
$onChanges(changes) {
- if (changes.loadItem && !changes.loadItem.isFirstChange() && this.loadItem) {
+ if (
+ changes.loadItem &&
+ !changes.loadItem.isFirstChange() &&
+ this.loadItem
+ ) {
this.createWatchListFromItem(this.loadItem);
}
}
filterChanged() {
- this.nameQuery = this.filter ? {name: this.filter} : null;
+ this.nameQuery = this.filter ? { name: this.filter } : null;
+ this.filter
+ ? (this.downloadQuery = `match(name,*${this.filter}*)&sort(name)`)
+ : (this.downloadQuery = '');
}
-
+
setViewValue() {
this.ngModelCtrl.$setViewValue(this.selected);
}
-
+
createWatchListFromItem(item) {
if (item.firstWatchList) {
this.listType = 'watchList';
- this.maWatchList.objQuery({
- limit: 1,
- sort: 'name'
- }).$promise.then(lists => {
- if (lists.length) {
- this.watchList = lists[0];
- this.itemSelected('watchList');
- }
- });
+ this.maWatchList
+ .objQuery({
+ limit: 1,
+ sort: 'name',
+ })
+ .$promise.then((lists) => {
+ if (lists.length) {
+ this.watchList = lists[0];
+ this.itemSelected('watchList');
+ }
+ });
} else if (item.watchListXid) {
this.listType = 'watchList';
- this.maWatchList.get({xid: item.watchListXid}).$promise.then(wl => {
- this.watchList = wl;
- this.itemSelected('watchList');
- }, angular.noop);
+ this.maWatchList
+ .get({ xid: item.watchListXid })
+ .$promise.then((wl) => {
+ this.watchList = wl;
+ this.itemSelected('watchList');
+ }, angular.noop);
} else if (item.dataSourceXid) {
this.listType = 'dataSource';
- this.maDataSource.get({xid: item.dataSourceXid}).$promise.then(ds => {
- this.dataSource = ds;
- this.itemSelected('dataSource');
- }, angular.noop);
+ this.maDataSource
+ .get({ xid: item.dataSourceXid })
+ .$promise.then((ds) => {
+ this.dataSource = ds;
+ this.itemSelected('dataSource');
+ }, angular.noop);
} else if (item.deviceName) {
this.deviceName = item.deviceName;
this.listType = 'deviceName';
@@ -110,28 +153,32 @@ class PointBrowserController {
this.listType = 'watchList';
}
}
-
+
itemSelected(type) {
// de-select other types
- types.filter(prop => prop !== type).forEach(name => {
- delete this[name];
- });
-
- switch(type) {
- case 'watchList':
- this.selected = this.watchList;
- break;
- case 'deviceName':
- this.createDeviceNameWatchList();
- break;
- case 'dataSource':
- this.createDataSourceWatchList();
- break;
- case 'tags':
- this.createTagsWatchList();
- break;
+ types
+ .filter((prop) => prop !== type)
+ .forEach((name) => {
+ delete this[name];
+ });
+
+ switch (type) {
+ case 'watchList':
+ this.selected = this.watchList;
+ break;
+ case 'deviceName':
+ this.createDeviceNameWatchList();
+ break;
+ case 'dataSource':
+ this.createDataSourceWatchList();
+ break;
+ case 'tags':
+ this.createTagsWatchList();
+ break;
+ default:
+ break;
}
-
+
this.setViewValue();
}
@@ -144,12 +191,14 @@ class PointBrowserController {
this.selected = new this.maWatchList({
type: 'query',
- name: this.maTranslate.trSync('ui.app.deviceNameX', [this.deviceName]),
+ name: this.maTranslate.trSync('ui.app.deviceNameX', [
+ this.deviceName,
+ ]),
query,
- deviceName: this.deviceName
+ deviceName: this.deviceName,
});
}
-
+
createDataSourceWatchList() {
const query = new this.maRqlBuilder()
.eq('dataSourceXid', this.dataSource.xid)
@@ -159,34 +208,38 @@ class PointBrowserController {
this.selected = new this.maWatchList({
type: 'query',
- name: this.maTranslate.trSync('ui.app.dataSourceX', [this.dataSource.name]),
+ name: this.maTranslate.trSync('ui.app.dataSourceX', [
+ this.dataSource.name,
+ ]),
query,
- dataSource: this.dataSource
+ dataSource: this.dataSource,
});
}
-
+
createTagsWatchList() {
- const params = Object.keys(this.tags).map(tagKey => {
- const tagValues = this.tags[tagKey];
- if (Array.isArray(tagValues) && tagValues.length) {
- return {
- name: tagKey,
- type: 'tagValue',
- options: {
- multiple: true,
- fixedValue: tagValues,
- restrictions: {},
- tagKey
- }
- };
- }
- }).filter(p => p != null);
-
+ const params = Object.keys(this.tags)
+ .map((tagKey) => {
+ const tagValues = this.tags[tagKey];
+ if (Array.isArray(tagValues) && tagValues.length) {
+ return {
+ name: tagKey,
+ type: 'tagValue',
+ options: {
+ multiple: true,
+ fixedValue: tagValues,
+ restrictions: {},
+ tagKey,
+ },
+ };
+ }
+ })
+ .filter((p) => p != null);
+
this.selected = new this.maWatchList({
type: 'tags',
name: this.maTranslate.trSync('ui.app.newTagWatchList'),
params,
- tags: this.tags
+ tags: this.tags,
});
}
@@ -201,11 +254,9 @@ export default {
controller: PointBrowserController,
bindings: {
listType: '@?',
- loadItem: ''
+ loadItem: '',
},
require: {
- ngModelCtrl: 'ngModel'
- }
+ ngModelCtrl: 'ngModel',
+ },
};
-
-
From 26999f7163d1b7da31dbd460762c685396d44506 Mon Sep 17 00:00:00 2001
From: pierpuccini <46226655+pierpuccini@users.noreply.github.com>
Date: Thu, 7 May 2020 15:34:32 -0500
Subject: [PATCH 7/8] Showing export button
---
.../components/mailingListPage/mailingList.html | 3 +--
.../components/mailingListPage/mailingList.js | 17 +++++++++++------
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/UI/web-src/ui/components/mailingListPage/mailingList.html b/UI/web-src/ui/components/mailingListPage/mailingList.html
index b4a8e9119..84f7a5f38 100644
--- a/UI/web-src/ui/components/mailingListPage/mailingList.html
+++ b/UI/web-src/ui/components/mailingListPage/mailingList.html
@@ -6,8 +6,7 @@
-
+
save_alt
diff --git a/UI/web-src/ui/components/mailingListPage/mailingList.js b/UI/web-src/ui/components/mailingListPage/mailingList.js
index e13dc14c7..767a94151 100644
--- a/UI/web-src/ui/components/mailingListPage/mailingList.js
+++ b/UI/web-src/ui/components/mailingListPage/mailingList.js
@@ -16,9 +16,14 @@ import './mailingList.css';
const $inject = Object.freeze(['$scope', '$mdMedia', 'maMailingList']);
class MailingLists {
- static get $inject() { return $inject; }
- static get $$ngIsClass() { return true; }
-
+ static get $inject() {
+ return $inject;
+ }
+
+ static get $$ngIsClass() {
+ return true;
+ }
+
constructor($scope, $mdMedia, maMailingList) {
this.$scope = $scope;
this.$mdMedia = $mdMedia;
@@ -32,7 +37,7 @@ class MailingLists {
this.$scope.$broadcast('addNewMailingList', true);
});
}
-
+
$onInit() {
this.getMailingList();
}
@@ -51,5 +56,5 @@ export default {
template: componentTemplate,
controller: MailingLists,
bindings: {},
- require: {}
-};
\ No newline at end of file
+ require: {},
+};
From 21f971d55b7d1d309fe8d056fd3b158873e4a1b4 Mon Sep 17 00:00:00 2001
From: pierpuccini <46226655+pierpuccini@users.noreply.github.com>
Date: Thu, 7 May 2020 15:39:13 -0500
Subject: [PATCH 8/8] Changed watchlist export translation
---
UI/web-src/ngMango/components/pointBrowser/pointBrowser.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/UI/web-src/ngMango/components/pointBrowser/pointBrowser.html b/UI/web-src/ngMango/components/pointBrowser/pointBrowser.html
index ffad24ba6..40e196dd5 100644
--- a/UI/web-src/ngMango/components/pointBrowser/pointBrowser.html
+++ b/UI/web-src/ngMango/components/pointBrowser/pointBrowser.html
@@ -20,7 +20,7 @@
-
+
save_alt