@c8y/ng1-modules 1018.0.222 → 1018.0.224

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.
@@ -23,6 +23,7 @@
23
23
  <button
24
24
  title="{{ labels.ok || defaultLabels.ok | translate }}"
25
25
  class="btn btn-primary"
26
+ data-cy="modal-confirm-btn"
26
27
  ng-click="checkboxes.length > 0 ? close(vals) : close(1)"
27
28
  >
28
29
  {{ labels.ok || defaultLabels.ok | translate }}
@@ -12,6 +12,7 @@
12
12
  class="dropdown-toggle c8y-dropdown"
13
13
  type="button"
14
14
  title="{{ 'Request log file' | translate }}"
15
+ data-cy="logViewer--request-log-file"
15
16
  uib-dropdown-toggle
16
17
  aria-haspopup="true"
17
18
  >
@@ -19,7 +20,7 @@
19
20
  <span translate>Request log file</span>
20
21
  <span c8y-icon="caret-down"></span>
21
22
  </button>
22
- <ul class="dropdown-menu dropdown-menu-right dropdown-menu-action-bar" uib-dropdown-menu>
23
+ <ul class="dropdown-menu dropdown-menu-right dropdown-menu-action-bar" data-cy="logViewer--dropdown-menu-action-bar" uib-dropdown-menu>
23
24
  <li class="dropdown-form">
24
25
  <form name="logRequestForm" class="form">
25
26
  <div class="form-group c8y-datetime-picker" data-cy="fromDatePicker">
@@ -47,6 +48,7 @@
47
48
  <ui-select
48
49
  ng-init="vm.logtypeSelect = $select"
49
50
  ng-model="vm.filters.logFile"
51
+ data-cy="logViewer--filters-log-type"
50
52
  required
51
53
  >
52
54
  <ui-select-match
@@ -69,6 +71,7 @@
69
71
  class="form-control"
70
72
  placeholder="{{ 'Filter by text' | translate }}"
71
73
  ng-model="vm.filters.searchText"
74
+ data-cy="logViewer--search-text"
72
75
  ng-trim="false"
73
76
  />
74
77
  </div>
@@ -79,6 +82,7 @@
79
82
  type="number"
80
83
  class="form-control"
81
84
  ng-model="vm.filters.maximumLines"
85
+ data-cy="logViewer--maximum-lines"
82
86
  placeholder="{{ 'e.g.' | translate }} 10"
83
87
  required
84
88
  />
@@ -89,6 +93,7 @@
89
93
  title="{{ 'Request log file' | translate }}"
90
94
  ng-disabled="logRequestForm.$invalid"
91
95
  ng-click="requestLogfile(vm.filters); isOpen = !isOpen"
96
+ data-cy="logViewer--request-log-file-button"
92
97
  c8yProductExperience
93
98
  [actionName]="PRODUCT_EXPERIENCE.EVENT"
94
99
  [actionData]="{
@@ -187,6 +192,7 @@
187
192
  popover-trigger="'mouseenter focus'"
188
193
  tooltip-placement="left"
189
194
  ng-click="cancel(op)"
195
+ data-cy="logViewer--cancel-operation"
190
196
  c8yProductExperience
191
197
  [actionName]="PRODUCT_EXPERIENCE.EVENT"
192
198
  [actionData]="{
@@ -211,6 +217,7 @@
211
217
  class="collapse-btn"
212
218
  type="button"
213
219
  title="{{ 'Expand' | translate }}"
220
+ data-cy="logViewer--Expand-button"
214
221
  ng-class="{ active: op === selectedLog }"
215
222
  ng-click="op===selectedLog ? selectLogfile({}) :selectLogfile(op);"
216
223
  ng-if="hasLogFile(op)"
@@ -232,9 +239,9 @@
232
239
  >
233
240
  <i c8y-icon="ellipsis-v"></i>
234
241
  </button>
235
- <ul class="dropdown-menu dropdown-menu-right" uib-dropdown-menu>
242
+ <ul class="dropdown-menu dropdown-menu-right" data-cy="index--dropdown-menu-right" uib-dropdown-menu>
236
243
  <li>
237
- <button title="{{ 'Delete log' | translate }}" type="button" ng-click="remove(op)">
244
+ <button title="{{ 'Delete log' | translate }}" type="button" data-cy="index--Delete-log-button" ng-click="remove(op)">
238
245
  <i c8y-icon="delete"></i>
239
246
  {{ 'Delete' | translate }}
240
247
  </button>
@@ -244,6 +251,7 @@
244
251
  title="{{ 'Download log' | translate }}"
245
252
  href
246
253
  ng-click="download(op)"
254
+ data-cy="index--Download-log-button"
247
255
  c8yProductExperience
248
256
  [actionName]="PRODUCT_EXPERIENCE.EVENT"
249
257
  [actionData]="{
@@ -284,9 +292,10 @@
284
292
  <dl
285
293
  class="dl-inline small text-muted m-b-0"
286
294
  ng-show="selectedLog.c8y_LogfileRequest.dateTo"
295
+ data-cy="logViewer--LogfileRequest.dateTo"
287
296
  >
288
297
  <dt translate>Date to</dt>
289
- <dd ng-bind="selectedLog.c8y_LogfileRequest.dateTo | absoluteDate"></dd>
298
+ <dd ng-bind="selectedLog.c8y_LogfileRequest.dateTo | absoluteDate" data-cy="logViewer--LogfileRequest.dateFrom"></dd>
290
299
  </dl>
291
300
 
292
301
  <dl
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1018.0.222",
3
+ "version": "1018.0.224",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -1 +1 @@
1
- "use strict";!function(){function e(c,t,a,o,i,n,r,d,f,s){var u=this,g="",e={c8y_Global:{}};function l(e){return u.svgFile.data=e,function(){if(!u.svgFile)return;var n=c.config.mapping||{},i=c.config.deviceIds||{},t=c.config.device&&c.config.device.id;c.config.mapping={},c.config.deviceIds={},_.forEach(function(e){var n=[],i=/{{\s*([$\w]+?)\s*}}/g,t=i.exec(e);for(;null!==t;)n.push(t[1]),t=i.exec(e);return n}(u.svgFile.data),function(e){c.config.mapping[e]=n[e]?n[e]:null,c.config.deviceIds[e]=i[e]?i[e]:t||null}),function(e,c){if(!e||!c)return;_.forOwn(e,function(e,i){var n=p(e),t=d.generatePaths(n);f.list().then(function(e){var n=_.sortBy(e,function(e){return e.keyPath.length}).reverse();null===c[i]&&(_.forEach(n,function(e){_.last(e.keyPath).toUpperCase()===i.toUpperCase()&&(c[i]=e)}),_.forEach(t,function(e){_.last(e).toUpperCase()===i.toUpperCase()&&(c[i]=d.createProperty(e))}))})})}(c.config.deviceIds,c.config.mapping)}(),e}function p(n){return _.find(u.devices,function(e){return n===e.id})}function v(e,n){u.device&&u.device.id!==n.id||_.assign(u.device,n)}function h(){var e=function(e){return _(e).values().uniq().value().sort(function(e,n){return e-n}).join(",")}(c.config.deviceIds);e!==g&&(g.length&&n.stop(c.$id,"/managedobjects/".concat(g)),e.length&&(n.addListener(c.$id,"/managedobjects/".concat(e),"UPDATE",v),n.start(c.$id,"/managedobjects/".concat(e)),c.$on("$destroy",_.partial(n.stop,c.$id,"/managedobjects/".concat(e)))),g=e)}this.deviceDetail=function(e,n){var i=!_.isEqual(e,n);e&&o.detail(e.id).then(function(e){u.device=e.data;var n=_.union([u.device.id],_.map(_.union(u.device.childAssets.references,u.device.childDevices.references),function(e){return e.managedObject.id}));_.remove(n,_.isUndefined),t.all(_.map(n,function(e){return o.detail(e)})).then(function(e){u.devices=_.map(e,function(e){var n=e.data;return _.assign({},n,{name:a("truncate")(n.name)})}),function(i){_.forOwn(c.config.mapping,function(e,n){(1===u.devices.length||i)&&(c.config.deviceIds[n]=c.config.device.id),c.config.deviceIds[n]=c.config.deviceIds[n]||c.config.device.id})}(i),u.updateComputedProperties(c.config.deviceIds,c.config.mapping)})})},this.onSelectFile=function(n){u.loading=!0,i.upload(n,e).then(function(e){u.binaryFile=e.data,c.config.binaryId=e.data.id,u.retrieveSvgData(n),c.forms.componentForm.$setDirty()}).finally(function(){u.loading=!1})},this.updateComputedProperties=function(e,c){_.isEmpty(e)||_.isEmpty(c)||_.forOwn(e,function(e,n){var i=[c[n]];if(c[n]){var t=p(e);r.attach(t,_.filter(i,function(e){return _.isObjectLike(e)}))}})},this.onMappingChange=function(){u.updateComputedProperties(c.config.deviceIds,c.config.mapping)},this.onDeviceIdsChange=function(){u.updateComputedProperties(c.config.deviceIds,c.config.mapping),h()},this.retrieveSvgData=function(n){u.svgFile={name:n.name,size:n.length},(n instanceof Blob?i.readDataUri(n):i.downloadAsDataUri(n)).then(i.decodeDataUri).then(function(e){return new File([e],n.name,{type:n.type})}).then(function(e){return s.sanitizeFileByLevel(e,c.config.sanitization)}).then(function(e){return i.readDataUri(e)}).then(i.decodeDataUri).then(l)},u.binaryFile={},c.config.mapping=c.config.mapping||{},c.config.deviceIds=c.config.deviceIds||{},c.config.devices&&delete c.config.devices,c.config.binaryId?(u.loading=!0,c.config.sanitization||(c.config.sanitization="none"),i.detail(c.config.binaryId).then(function(e){u.binaryFile=e.data,u.retrieveSvgData(u.binaryFile),u.loading=!1}).then(function(){var e=[];e.push({file:u.svgFile}),u.files=e})):t.when(),h(),c.$watch("config.device",this.deviceDetail,!0),c.$watch("config.mapping",this.onMappingChange,!0),c.$on("$destroy",function(){_.forEach(c.config.deviceIds,function(e){r.detach(p(e))})})}e.$inject=["$scope","$q","$filter","c8yDevices","c8yBinary","c8yRealtime","c8yComputedProperties","fieldbusPropertyGenerator","c8yPropertiesLibrary","c8ySanitizeHtml"],angular.module("c8y.parts.scadaWidget").controller("ScadaWidgetConfigCtrl",e)}();
1
+ "use strict";!function(){function e(c,t,a,o,i,n,r,d,f,s){var g=this,u="",e={c8y_Global:{}};function p(e){return g.svgFile.data=e,function(){if(!g.svgFile)return;var n=c.config.mapping||{},i=c.config.deviceIds||{},t=c.config.device&&c.config.device.id;c.config.mapping={},c.config.deviceIds={},_.forEach(function(e){var n=[],i=/{{\s*([$\w]+?)\s*}}/g,t=i.exec(e);for(;null!==t;)n.push(t[1]),t=i.exec(e);return n}(g.svgFile.data),function(e){c.config.mapping[e]=n[e]?n[e]:null,c.config.deviceIds[e]=i[e]?i[e]:t||null}),function(e,c){if(!e||!c)return;_.forOwn(e,function(e,i){var n=l(e),t=d.generatePaths(n);f.list().then(function(e){var n=_.sortBy(e,function(e){return e.keyPath.length}).reverse();null===c[i]&&(_.forEach(n,function(e){_.last(e.keyPath).toUpperCase()===i.toUpperCase()&&(c[i]=e)}),_.forEach(t,function(e){_.last(e).toUpperCase()===i.toUpperCase()&&(c[i]=d.createProperty(e))}))})})}(c.config.deviceIds,c.config.mapping)}(),e}function l(n){return _.find(g.devices,function(e){return n===e.id})}function v(e,n){g.device&&g.device.id!==n.id||_.assign(g.device,n)}function h(){var e=function(e){return _(e).values().uniq().value().sort(function(e,n){return e-n}).join(",")}(c.config.deviceIds);e!==u&&(u.length&&n.stop(c.$id,"/managedobjects/".concat(u)),e.length&&(n.addListener(c.$id,"/managedobjects/".concat(e),"UPDATE",v),n.start(c.$id,"/managedobjects/".concat(e)),c.$on("$destroy",_.partial(n.stop,c.$id,"/managedobjects/".concat(e)))),u=e)}this.deviceDetail=function(e,n){var i;e&&(i=!n||!(e.name===n.name&&e.id===n.id),o.detail(e.id).then(function(e){g.device=e.data;var n=_.union([g.device.id],_.map(_.union(g.device.childAssets.references,g.device.childDevices.references),function(e){return e.managedObject.id}));_.remove(n,_.isUndefined),t.all(_.map(n,function(e){return o.detail(e)})).then(function(e){g.devices=_.map(e,function(e){var n=e.data;return _.assign({},n,{name:a("truncate")(n.name)})}),function(i){_.forOwn(c.config.mapping,function(e,n){(1===g.devices.length||i)&&(c.config.deviceIds[n]=c.config.device.id),c.config.deviceIds[n]=c.config.deviceIds[n]||c.config.device.id})}(i),g.updateComputedProperties(c.config.deviceIds,c.config.mapping)})}))},this.onSelectFile=function(n){g.loading=!0,i.upload(n,e).then(function(e){g.binaryFile=e.data,c.config.binaryId=e.data.id,g.retrieveSvgData(n),c.forms.componentForm.$setDirty()}).finally(function(){g.loading=!1})},this.updateComputedProperties=function(e,c){_.isEmpty(e)||_.isEmpty(c)||_.forOwn(e,function(e,n){var i=[c[n]];if(c[n]){var t=l(e);r.attach(t,_.filter(i,function(e){return _.isObjectLike(e)}))}})},this.onMappingChange=function(){g.updateComputedProperties(c.config.deviceIds,c.config.mapping)},this.onDeviceIdsChange=function(){g.updateComputedProperties(c.config.deviceIds,c.config.mapping),h()},this.retrieveSvgData=function(n){g.svgFile={name:n.name,size:n.length},(n instanceof Blob?i.readDataUri(n):i.downloadAsDataUri(n)).then(i.decodeDataUri).then(function(e){return new File([e],n.name,{type:n.type})}).then(function(e){return s.sanitizeFileByLevel(e,c.config.sanitization)}).then(function(e){return i.readDataUri(e)}).then(i.decodeDataUri).then(p)},g.binaryFile={},c.config.mapping=c.config.mapping||{},c.config.deviceIds=c.config.deviceIds||{},c.config.devices&&delete c.config.devices,c.config.binaryId?(g.loading=!0,c.config.sanitization||(c.config.sanitization="none"),i.detail(c.config.binaryId).then(function(e){g.binaryFile=e.data,g.retrieveSvgData(g.binaryFile),g.loading=!1}).then(function(){var e=[];e.push({file:g.svgFile}),g.files=e})):t.when(),h(),c.$watch("config.device",this.deviceDetail,!0),c.$watch("config.mapping",this.onMappingChange,!0),c.$on("$destroy",function(){_.forEach(c.config.deviceIds,function(e){r.detach(l(e))})})}e.$inject=["$scope","$q","$filter","c8yDevices","c8yBinary","c8yRealtime","c8yComputedProperties","fieldbusPropertyGenerator","c8yPropertiesLibrary","c8ySanitizeHtml"],angular.module("c8y.parts.scadaWidget").controller("ScadaWidgetConfigCtrl",e)}();