@c8y/ng1-modules 1018.486.5 → 1018.496.6

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.
Files changed (90) hide show
  1. package/NOTICES +1 -1
  2. package/administration-alarmMapping/views/index.html +2 -2
  3. package/administration-auditLogs/views/list.html +8 -7
  4. package/administration-deviceUsers/views/list.html +55 -18
  5. package/app-logs/app-logs/app-logs.html +10 -9
  6. package/applicationLinks/index.js +1 -1
  7. package/binaryArtefactsManagement/views/list.html +63 -23
  8. package/core/core/services/measurements.js +1 -1
  9. package/core/locales/de.po +246 -102
  10. package/core/locales/en.po +34 -15
  11. package/core/locales/es.po +21 -103
  12. package/core/locales/fr.po +20 -102
  13. package/core/locales/ja_JP.po +20 -102
  14. package/core/locales/ko.po +20 -102
  15. package/core/locales/nl.po +20 -102
  16. package/core/locales/pl.po +21 -103
  17. package/core/locales/pt_BR.po +38 -120
  18. package/core/locales/ru.po +21 -103
  19. package/core/locales/zh_CN.po +21 -103
  20. package/core/locales/zh_TW.po +21 -103
  21. package/core/ui/directives/map2.js +1 -1
  22. package/core/ui/itemSelector/itemSelector.html +1 -1
  23. package/core/ui/services/measurementsReport.js +1 -1
  24. package/core/ui/user/editUser.directive.html +3 -3
  25. package/core/ui/user/rolesUiStrings.constant.js +1 -1
  26. package/core/ui/views/modal.html +1 -1
  27. package/dataBroker/connectors/connectors.html +87 -32
  28. package/dataPointExplorer/controllers/dataPointExplorer.js +1 -1
  29. package/dataPointExplorer/index.js +1 -1
  30. package/dataPointExplorer/views/explorer.html +6 -2
  31. package/dataPointExplorer/views/widgetConfig.html +1 -0
  32. package/dataPointTable/index.js +1 -1
  33. package/dataPointTable/views/widgetConfig.html +1 -3
  34. package/device-protocol-deviceDatabase4/device-type-protocol-base.provider.js +1 -1
  35. package/device-protocols/deviceProtocolList.html +4 -4
  36. package/device-protocols/deviceProtocolView.html +34 -14
  37. package/deviceDatabase4/cumulocity.json +4 -6
  38. package/deviceDatabase4/detail/device-type-detail.component.js +1 -1
  39. package/deviceDatabase4/detail/device-type-detail.html +1 -0
  40. package/deviceDatabase4/modals/configure-register.component.js +1 -1
  41. package/deviceDatabase4/modals/configure-register.html +2 -2
  42. package/deviceDatabase4/validate-measurement-fragment.directive.js +1 -0
  43. package/deviceList/views/index.html +4 -1
  44. package/devicemanagement-alarmList/views/index.html +57 -19
  45. package/devicemanagement-availability/controllers/availability.js +1 -1
  46. package/devicemanagement-availability/views/detail.html +19 -8
  47. package/devicemanagement-eventList/views/index.html +6 -2
  48. package/enterpriseEdition/enterpriseEdition.module.js +1 -1
  49. package/eventList/index.js +1 -1
  50. package/export/directives/timespan.js +1 -1
  51. package/export/services/filters.js +1 -1
  52. package/export/views/detail.html +1 -1
  53. package/export/views/list.html +21 -0
  54. package/export/views/properties.html +3 -3
  55. package/export/views/timespan.html +38 -9
  56. package/measurements/fragmentChart/fragmentChart.component.js +1 -1
  57. package/measurements/measurements2/series.service.js +1 -1
  58. package/modbusConfiguration4/fieldbus-config.html +2 -1
  59. package/modbusConfiguration4/fieldbus-device-list.html +3 -1
  60. package/package.json +1 -1
  61. package/platformConfiguration/cumulocity.json +1 -1
  62. package/platformConfiguration/platformConfiguration.component.js +1 -0
  63. package/platformConfiguration/platformConfiguration.html +22 -0
  64. package/platformConfiguration/platformConfigurationUi.provider.js +1 -1
  65. package/scada/config.controller.js +1 -1
  66. package/scada/views/componentConfig.html +28 -14
  67. package/scada/widget.controller.js +1 -1
  68. package/tenantPolicies/tenantPolicyList/tenantPolicyList.html +90 -25
  69. package/tenantStatistics/tenant-statistics.html +23 -14
  70. package/tenants/views/detail.html +1 -1
  71. package/userRoles/inventoryRolesTab/inventoryRolesTab.component.js +1 -1
  72. package/userRoles/inventoryRolesTab/inventoryRolesTab.html +16 -10
  73. package/users/userListView/userListView.html +47 -17
  74. package/users/usersUi.provider.js +1 -1
  75. package/deviceControlMessage/controllers/deviceControlMessageWidget.js +0 -1
  76. package/deviceControlMessage/cumulocity.json +0 -15
  77. package/deviceControlMessage/img/message-widget-pr.png +0 -0
  78. package/deviceControlMessage/index.js +0 -1
  79. package/deviceControlMessage/views/deviceControlMessageWidget.html +0 -26
  80. package/infoGauge/cumulocity.json +0 -20
  81. package/infoGauge/img/info-gauge-widget-pr.png +0 -0
  82. package/infoGauge/index.js +0 -1
  83. package/infoGauge/infoGauge.controller.js +0 -1
  84. package/infoGauge/infoGauge.service.js +0 -1
  85. package/infoGauge/infoGaugeConfig.controller.js +0 -1
  86. package/infoGauge/infoGaugeWidget.config.html +0 -58
  87. package/infoGauge/infoGaugeWidget.html +0 -32
  88. package/infoGauge/style.less +0 -0
  89. package/platformConfiguration/platformConfigurationForm.component.js +0 -1
  90. package/platformConfiguration/platformConfigurationForm.html +0 -50
@@ -2,43 +2,58 @@
2
2
 
3
3
  <c8y-breadcrumbs-set>
4
4
  <c8y-breadcrumbs-item
5
- label="{{ 'Data connectors' | translate }}"
6
5
  icon="c8y-data-broker"
6
+ label="{{ 'Data connectors' | translate }}"
7
7
  ></c8y-breadcrumbs-item>
8
8
  <c8y-breadcrumbs-item
9
- label="{{ 'Data broker' | translate }}"
10
9
  icon="c8y-data-broker"
10
+ label="{{ 'Data broker' | translate }}"
11
11
  ></c8y-breadcrumbs-item>
12
12
  </c8y-breadcrumbs-set>
13
13
 
14
14
  <c8y-ui-action-bar-set>
15
- <li class="navbar-form hidden-xs" action-bar-position="left">
15
+ <li
16
+ class="navbar-form hidden-xs"
17
+ action-bar-position="left"
18
+ >
16
19
  <c8y-list-display-control
17
20
  list-length="vm.connectors.length"
18
21
  on-list-class-change="vm.listClass = listClass"
19
22
  ></c8y-list-display-control>
20
23
  </li>
21
24
 
22
- <li class="navbar-form" action-bar-position="left">
25
+ <li
26
+ class="navbar-form"
27
+ action-bar-position="left"
28
+ >
23
29
  <div class="input-group input-group-search">
24
30
  <input
25
- id="filter"
26
31
  class="form-control"
27
32
  title="{{ 'Filter connectors' | translate }}"
28
- type="search"
33
+ id="filter"
29
34
  placeholder="{{ 'Filter' | translate }}…"
35
+ type="search"
30
36
  ng-model="vm.searchString"
31
37
  />
32
38
  <span class="input-group-addon">
33
- <i c8y-icon="search" ng-if="vm.searchString.length === 0 || !vm.searchString"></i>
34
39
  <i
35
- c8y-icon="times"
40
+ c8y-icon="search"
41
+ ng-if="vm.searchString.length === 0 || !vm.searchString"
42
+ ></i>
43
+ <i
36
44
  class="text-muted"
45
+ c8y-icon="times"
37
46
  ng-if="vm.searchString.length > 0"
38
47
  ng-click="vm.searchString = ''"
39
48
  ></i>
40
49
  </span>
41
- <span for="filter" class="sr-only" translate>Filter connectors</span>
50
+ <span
51
+ class="sr-only"
52
+ for="filter"
53
+ translate
54
+ >
55
+ Filter connectors
56
+ </span>
42
57
  </div>
43
58
  </li>
44
59
 
@@ -53,8 +68,8 @@
53
68
  </a>
54
69
  <button
55
70
  class="btn btn-link"
56
- type="button"
57
71
  title="{{ 'Reload' | translate }}"
72
+ type="button"
58
73
  ng-click="vm.reload()"
59
74
  >
60
75
  <i c8y-icon="refresh"></i>
@@ -66,10 +81,10 @@
66
81
 
67
82
  <!-- Empty state -->
68
83
  <c8y-ui-empty-state
69
- ng-if="vm.connectors.length === 0"
70
84
  [icon]="'c8y-connector-out'"
71
85
  [title]="'No data connectors to display.' | translate"
72
86
  [subtitle]="'Click below to add your first data connector.' | translate"
87
+ ng-if="vm.connectors.length === 0"
73
88
  >
74
89
  <a
75
90
  class="btn btn-primary"
@@ -81,8 +96,14 @@
81
96
  </c8y-ui-empty-state>
82
97
 
83
98
  <!-- list -->
84
- <div class="card-group" ng-class="vm.listClass">
85
- <div class="page-sticky-header hidden-xs" ng-if="vm.connectors.length > 0">
99
+ <div
100
+ class="card-group"
101
+ ng-class="vm.listClass"
102
+ >
103
+ <div
104
+ class="page-sticky-header hidden-xs"
105
+ ng-if="vm.connectors.length > 0"
106
+ >
86
107
  <div class="d-flex">
87
108
  <div class="card-header">
88
109
  <div class="card-icon"></div>
@@ -117,25 +138,34 @@
117
138
  ng-repeat="connector in vm.connectors | orderBy:'name' | filter:vm.searchString as filtered"
118
139
  >
119
140
  <div class="card card--d-col">
120
- <div class="card-actions" ng-click="$event.stopPropagation();">
121
- <div class="dropdown settings" uib-dropdown>
141
+ <div
142
+ class="card-actions"
143
+ ng-click="$event.stopPropagation();"
144
+ >
145
+ <div
146
+ class="dropdown settings"
147
+ uib-dropdown
148
+ >
122
149
  <button
123
150
  class="dropdown-toggle c8y-dropdown"
124
- type="button"
125
151
  title="{{ 'Actions' | translate }}"
152
+ aria-haspopup="true"
153
+ type="button"
126
154
  uib-dropdown-toggle
127
155
  ng-click="::$event.stopPropagation()"
128
- aria-haspopup="true"
129
156
  >
130
157
  <span>
131
158
  <i c8y-icon="ellipsis-v"></i>
132
159
  </span>
133
160
  </button>
134
- <ul class="dropdown-menu dropdown-menu-right" uib-dropdown-menu>
161
+ <ul
162
+ class="dropdown-menu dropdown-menu-right"
163
+ uib-dropdown-menu
164
+ >
135
165
  <li>
136
166
  <button
137
- type="button"
138
167
  title="{{ 'Edit' | translate }}"
168
+ type="button"
139
169
  ng-click="::$event.stopPropagation();vm.editConnector(connector.id)"
140
170
  >
141
171
  <i c8y-icon="edit"></i>
@@ -144,8 +174,8 @@
144
174
  </li>
145
175
  <li>
146
176
  <button
147
- type="button"
148
177
  title="{{ 'Duplicate' | translate }}"
178
+ type="button"
149
179
  ng-click="::$event.stopPropagation();vm.duplicateConnector(connector)"
150
180
  >
151
181
  <i c8y-icon="clone"></i>
@@ -154,8 +184,8 @@
154
184
  </li>
155
185
  <li>
156
186
  <button
157
- type="button"
158
187
  title="{{ 'Delete' | translate }}"
188
+ type="button"
159
189
  ng-click="::$event.stopPropagation();vm.deleteConnector(connector)"
160
190
  >
161
191
  <i c8y-icon="delete"></i>
@@ -174,14 +204,21 @@
174
204
  <div class="card-icon">
175
205
  <i c8y-icon="c8y-connector-out c8y-icon-duocolor"></i>
176
206
  </div>
177
- <div class="text-truncate card-title" title="{{ connector.name }}">
207
+ <div
208
+ class="text-truncate card-title"
209
+ title="{{ connector.name }}"
210
+ >
178
211
  {{ connector.name }}
179
212
  </div>
180
213
  </div>
181
214
 
182
215
  <div class="card-block card-column-70 m-r-0">
183
216
  <div class="card-column-40 text-truncate">
184
- <span class="text-label-small" title="{{ connector.instanceUrl }}" translate>
217
+ <span
218
+ class="text-label-small"
219
+ title="{{ connector.instanceUrl }}"
220
+ translate
221
+ >
185
222
  Target URL
186
223
  </span>
187
224
  <span>
@@ -191,12 +228,19 @@
191
228
  </span>
192
229
  </div>
193
230
  <div class="card-column-60 text-truncate-wrap">
194
- <span class="text-label-small" title="{{ connector.description }}" translate>
231
+ <span
232
+ class="text-label-small"
233
+ title="{{ connector.description }}"
234
+ translate
235
+ >
195
236
  Description
196
237
  </span>
197
238
  <span ng-if="!connector.description">
198
239
  <small>
199
- <em class="text-muted" title="{{ 'None' | translate }}">
240
+ <em
241
+ class="text-muted"
242
+ title="{{ 'None' | translate }}"
243
+ >
200
244
  {{ 'None' | translate }}
201
245
  </em>
202
246
  </small>
@@ -212,14 +256,17 @@
212
256
  <div class="d-flex flex-grow a-i-center">
213
257
  <div class="card-column-80 flex-grow">
214
258
  <div ng-if="connector.visibleStatus.value === waitingStatus.value">
215
- <i class="icon-spin text-warning" c8y-icon="circle-o-notch"></i>
259
+ <i
260
+ class="icon-spin text-warning"
261
+ c8y-icon="circle-o-notch"
262
+ ></i>
216
263
  <span>
217
264
  {{ waitingStatus.label | translate }}
218
265
  </span>
219
266
  <button
220
267
  class="btn-help btn-help--sm"
221
- type="button"
222
268
  aria-label="{{ 'Help' | translate }}"
269
+ type="button"
223
270
  uib-popover="{{ 'The target URL did not accept the connection yet.' | translate }}"
224
271
  popover-placement="right"
225
272
  popover-trigger="'focus'"
@@ -227,14 +274,17 @@
227
274
  ></button>
228
275
  </div>
229
276
  <div ng-if="connector.visibleStatus.value === activatingStatus.value">
230
- <i c8y-icon="circle-o-notch" class="icon-spin text-warning"></i>
277
+ <i
278
+ class="icon-spin text-warning"
279
+ c8y-icon="circle-o-notch"
280
+ ></i>
231
281
  <span class="text-warning">
232
282
  {{ activatingStatus.label | translate }}
233
283
  </span>
234
284
  <button
235
285
  class="btn-help btn-help--sm"
236
- type="button"
237
286
  aria-label="{{ 'Help' | translate }}"
287
+ type="button"
238
288
  uib-popover="{{ vm.getStatusTooltip(connector) | translate }}"
239
289
  popover-placement="right"
240
290
  popover-trigger="'focus'"
@@ -261,8 +311,8 @@
261
311
  </label>
262
312
  <button
263
313
  class="btn-help btn-help--sm"
264
- type="button"
265
314
  aria-label="{{ 'Help' | translate }}"
315
+ type="button"
266
316
  uib-popover="{{ vm.getStatusTooltip(connector) | translate }}"
267
317
  popover-placement="right"
268
318
  popover-trigger="'focus'"
@@ -273,7 +323,12 @@
273
323
  </div>
274
324
 
275
325
  <div class="card-column-20">
276
- <span class="text-label-small" translate>Filters</span>
326
+ <span
327
+ class="text-label-small"
328
+ translate
329
+ >
330
+ Filters
331
+ </span>
277
332
  <span
278
333
  class="badge badge-info"
279
334
  ng-bind="::(connector.filters && connector.filters.length || 0)"
@@ -286,8 +341,8 @@
286
341
  </div>
287
342
  <!-- no results empty state -->
288
343
  <c8y-ui-empty-state
289
- ng-if="filtered.length === 0 && vm.searchString.length > 0"
290
344
  [icon]="'search'"
291
345
  [title]="'No results to display.' | translate"
292
346
  [subtitle]="'Refine your search terms or check your spelling.' | translate"
347
+ ng-if="filtered.length === 0 && vm.searchString.length > 0"
293
348
  ></c8y-ui-empty-state>
@@ -1 +1 @@
1
- "use strict";function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,a){var e;if(t)return"string"==typeof t?_arrayLikeToArray(t,a):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?_arrayLikeToArray(t,a):void 0}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,a){(null==a||a>t.length)&&(a=t.length);for(var e=0,n=new Array(a);e<a;e++)n[e]=t[e];return n}!function(){function t(e,t,n,o,a,r,i,d,c,s,l,u,m,f){var g,p;function h(t,a){t&&a&&(e.data.datapoints.length=0,(a=e.data.datapoints).push.apply(a,_toConsumableArray(t))),e.data.graphDataPoints=t;a=v(_.filter(t,"__active"));e.channel=a?"/measurements/".concat(a):""}function y(t){e.data.graphAlarmsEventsConfigs=t;t=v(_.filter(t,"__active"));e.alarmsChannel=t?"/alarms/".concat(t):"",e.eventsChannel=t?"/events/".concat(t):""}function v(t){return _(t).map(function(t){return t.__target.id}).uniq().value().join(",")}function A(){var a,t=o.getContext();t.context&&(g="".concat(t.context,"_").concat(t.id)),e.disableLocalStorage||(a=_.throttle(function(t,a){t===a||e.dontSave||e.disableLocalStorage||(t=_.pick(e.data,["dateFrom","dateTo","interval","aggregation","realtime","alarmsEventsConfigs"]),r.setSavedFilters(t,g))},500,{leading:!1,trailing:!0}),r.getSavedFilters(g).then(function(t){_.assign(e.data,t),e.$watch("data.realtime",a),e.$watch("data.dateFrom",a),e.$watch("data.dateTo",a),e.$watch("data.interval",a),e.$watch("data.aggregation",a),e.$watch("data.alarmsEventsConfigs",a,!0)}))}function b(){var t,a=b._hasDashboard,e=a;if(_.isUndefined(a))try{2===(t=n.get("dashboardSvc")).VERSION&&(e=t)}catch(t){e=!1}return b._hasDashboard=e}function T(t){var a=b();a&&a[t]({name:"Data points graph",title:l.getString("Data points"),_width:12,_height:5,config:{datapoints:e.data.graphDataPoints,alarmsEventsConfigs:e.data.graphAlarmsEventsConfigs,dateTo:e.data.dateTo,dateFrom:e.data.dateFrom,aggregation:e.data.aggregation,realtime:e.data.realtime}}).then(S)}function S(){d.success(s("Widget created."))}function D(){T("addWidgetToSelectedDashboardInContext")}function w(){T("addWidgetToSelectedReport")}function F(t){e.chartBox=t}function C(){e.$watch("data.datapoints",function(){r.saveLocal(e.data.datapoints,g)},!0)}function x(t,a){i.addAction({text:t,action:function(){var t={dateFrom:moment(e.data.dateFrom).format(c.dateFullFormat),dateTo:moment(e.data.dateTo).format(c.dateFullFormat)};m.downloadReportForDatapoints(a,e.data.graphDataPoints,t).catch(function(t){t&&t.message&&d.warning(t.message)})}})}e.onRealtimeAlarmFn=function(t){e.onAlarm=t},e.onRealtimeEventFn=function(t){e.onEvent=t},!o.getContext().context&&t.path().match(/datapoint/)&&a.changeTitle({title:s("Data explorer")}),A(),t={text:s(g?"Send as widget to dashboard":"Send as widget to report"),action:g?D:w},b()&&!e.noActions&&i.addAction(t),_.get(e,"data.datapoints.length")||r.listLocal(g).then(function(t){t&&t.length&&h(t,!0)}).then(C),e.noActions||(x(s("Download as CSV"),u.format.csv),x(s("Download as Excel"),u.format.xlsx)),$(window).resize(function(){e.$broadcast("dashboardResize"),e.$apply()}),e.onBoxChanged=F,e.onUpdateDates=function(t,a){e.data.dateFrom=t;t=moment().diff(moment(a),"seconds")<10;e.data.realtime&&!t&&(e.data.realtime=!1),e.data.dateTo=a},e.onUpdateDisplayedDates=function(t,a){e.data.displayedDateFrom=t,e.data.displayedDateTo=a},e.savedFilter={config:{},datapoints:[]},e.data=e.data||_.cloneDeep(e.savedFilter),(p=e.data.interval)&&"custom"!==p&&(t=_.find(f.intervals,function(t){return t.id===p})||{}).qty&&(e.data.dateFrom=moment().subtract(t.qty,t.unit).toDate(),e.data.dateTo=moment().toDate()),e.$watch("data.datapoints",function(){return h(e.data.datapoints)},!0),e.$watch("data.alarmsEventsConfigs",y,!0)}t.$inject=["$scope","$location","$injector","c8yUiUtil","c8yTitle","c8yDataPointSvc","c8yActions","c8yAlert","c8yBase","gettext","gettextCatalog","c8yMeasurements","MeasurementsReportSvc","INTERVAL_CONSTANTS"],angular.module("c8y.cockpit.dataPointExplorer").controller("c8yDataPointExplorerCtrl",t)}();
1
+ "use strict";function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,a){var e;if(t)return"string"==typeof t?_arrayLikeToArray(t,a):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?_arrayLikeToArray(t,a):void 0}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,a){(null==a||a>t.length)&&(a=t.length);for(var e=0,n=new Array(a);e<a;e++)n[e]=t[e];return n}!function(){function t(e,t,n,o,a,r,i,d,c,s,l,u,m,f){var g,p;function h(t,a){t&&a&&(e.data.datapoints.length=0,(a=e.data.datapoints).push.apply(a,_toConsumableArray(t))),e.data.graphDataPoints=t;a=v(_.filter(t,"__active"));e.channel=a?"/measurements/".concat(a):""}function y(t){e.data.graphAlarmsEventsConfigs=t;t=v(_.filter(t,"__active"));e.alarmsChannel=t?"/alarms/".concat(t):"",e.eventsChannel=t?"/events/".concat(t):""}function v(t){return _(t).map(function(t){return t.__target.id}).uniq().value().join(",")}function A(){var a,t=o.getContext();t.context&&(g="".concat(t.context,"_").concat(t.id)),e.disableLocalStorage||(a=_.throttle(function(t,a){t===a||e.dontSave||e.disableLocalStorage||(t=_.pick(e.data,["dateFrom","dateTo","interval","aggregation","realtime","alarmsEventsConfigs"]),r.setSavedFilters(t,g))},500,{leading:!1,trailing:!0}),r.getSavedFilters(g).then(function(t){_.assign(e.data,t),e.$watch("data.realtime",a),e.$watch("data.dateFrom",a),e.$watch("data.dateTo",a),e.$watch("data.interval",a),e.$watch("data.aggregation",a),e.$watch("data.alarmsEventsConfigs",a,!0)}))}function b(){var t,a=b._hasDashboard,e=a;if(_.isUndefined(a))try{2===(t=n.get("dashboardSvc")).VERSION&&(e=t)}catch(t){e=!1}return b._hasDashboard=e}function T(t){var a=b();a&&a[t]({name:"Data points graph",title:l.getString("Data points"),_width:24,_height:5,config:{datapoints:e.data.graphDataPoints,alarmsEventsConfigs:e.data.graphAlarmsEventsConfigs,dateTo:e.data.dateTo,dateFrom:e.data.dateFrom,aggregation:e.data.aggregation,realtime:e.data.realtime}}).then(S)}function S(){d.success(s("Widget created."))}function D(){T("addWidgetToSelectedDashboardInContext")}function w(){T("addWidgetToSelectedReport")}function F(t){e.chartBox=t}function C(){e.$watch("data.datapoints",function(){r.saveLocal(e.data.datapoints,g)},!0)}function x(t,a){i.addAction({text:t,action:function(){var t={dateFrom:moment(e.data.dateFrom).format(c.dateFullFormat),dateTo:moment(e.data.dateTo).format(c.dateFullFormat)};m.downloadReportForDatapoints(a,e.data.graphDataPoints,t).catch(function(t){t&&t.message&&d.warning(t.message)})}})}e.onRealtimeAlarmFn=function(t){e.onAlarm=t},e.onRealtimeEventFn=function(t){e.onEvent=t},!o.getContext().context&&t.path().match(/datapoint/)&&a.changeTitle({title:s("Data explorer")}),A(),t={text:s(g?"Send as widget to dashboard":"Send as widget to report"),action:g?D:w},b()&&!e.noActions&&i.addAction(t),_.get(e,"data.datapoints.length")||r.listLocal(g).then(function(t){t&&t.length&&h(t,!0)}).then(C),e.noActions||(x(s("Download as CSV"),u.format.csv),x(s("Download as Excel"),u.format.xlsx)),$(window).resize(function(){e.$broadcast("dashboardResize"),e.$apply()}),e.onBoxChanged=F,e.onUpdateDates=function(t,a){e.data.dateFrom=t;t=moment().diff(moment(a),"seconds")<10;e.data.realtime&&!t&&(e.data.realtime=!1),e.data.dateTo=a},e.onUpdateDisplayedDates=function(t,a){e.data.displayedDateFrom=t,e.data.displayedDateTo=a},e.savedFilter={config:{},datapoints:[]},e.data=e.data||_.cloneDeep(e.savedFilter),(p=e.data.interval)&&"custom"!==p&&(t=_.find(f.intervals,function(t){return t.id===p})||{}).qty&&(e.data.dateFrom=moment().subtract(t.qty,t.unit).toDate(),e.data.dateTo=moment().toDate()),e.$watch("data.datapoints",function(){return h(e.data.datapoints)},!0),e.$watch("data.alarmsEventsConfigs",y,!0)}t.$inject=["$scope","$location","$injector","c8yUiUtil","c8yTitle","c8yDataPointSvc","c8yActions","c8yAlert","c8yBase","gettext","gettextCatalog","c8yMeasurements","MeasurementsReportSvc","INTERVAL_CONSTANTS"],angular.module("c8y.cockpit.dataPointExplorer").controller("c8yDataPointExplorerCtrl",t)}();
@@ -1 +1 @@
1
- "use strict";angular.module("c8y.cockpit.dataPointExplorer",["c8y.deviceSelector"]).constant("dataPointExplorerTemplateBasePath",":::PLUGIN_PATH:::/views/").config(["c8yComponentsProvider","gettext",function(t,e){t.add({name:"Data points graph",nameDisplay:e("Data points graph"),description:e("A graph display of a collection of data points"),templateUrl:":::PLUGIN_PATH:::/views/widget.html",configTemplateUrl:":::PLUGIN_PATH:::/views/widgetConfig.html",previewImage:":::PLUGIN_PATH:::/img/data-points-graph-widget-pr.png",options:{noDeviceTarget:!0,minCol:4,datapointAttributes:["datapoints"]},displaySettings:{globalTimeContext:!0}})}]);
1
+ "use strict";angular.module("c8y.cockpit.dataPointExplorer",["c8y.deviceSelector"]).constant("dataPointExplorerTemplateBasePath",":::PLUGIN_PATH:::/views/").config(["c8yComponentsProvider","gettext",function(t,e){t.add({name:"Data points graph",nameDisplay:e("Data points graph"),description:e("A graph display of a collection of data points"),templateUrl:":::PLUGIN_PATH:::/views/widget.html",configTemplateUrl:":::PLUGIN_PATH:::/views/widgetConfig.html",previewImage:":::PLUGIN_PATH:::/img/data-points-graph-widget-pr.png",options:{noDeviceTarget:!0,minCol:4,datapointAttributes:["datapoints"]},displaySettings:{globalTimeContext:!0,globalRealtimeContext:!0,globalAggregationContext:!0}})}]);
@@ -1,4 +1,4 @@
1
- <div class="data-point-explorer" >
1
+ <div class="data-point-explorer">
2
2
  <c8y-ui-action-bar-set>
3
3
  <li class="navbar-form">
4
4
  <label title="{{ 'Aggregation' | translate }}">{{ 'Aggregation' | translate }}</label>
@@ -76,7 +76,11 @@
76
76
 
77
77
  <div class="content-fullpage bg-level-1">
78
78
  <div class="inner-scroll bg-inherit">
79
- <c8y-data-point-list datapoints="data.datapoints" smartrules class="bg-inherit"></c8y-data-point-list>
79
+ <c8y-data-point-list
80
+ class="bg-inherit"
81
+ datapoints="data.datapoints"
82
+ smartrules
83
+ ></c8y-data-point-list>
80
84
  <c8y-alarms-events-timelines-config
81
85
  class="card--grid__separator-top--white d-block bg-inherit"
82
86
  configs="data.alarmsEventsConfigs"
@@ -95,6 +95,7 @@
95
95
  on-data="onEvent($data)"
96
96
  ></c8y-realtime-button>
97
97
  <c8y-aggregation
98
+ ng-show="!data.widgetInstanceGlobalTimeContext"
98
99
  class="top-right-control"
99
100
  date-from="data.dateFrom"
100
101
  date-to="data.dateTo"
@@ -1 +1 @@
1
- "use strict";!function(){function t(t,e){t.add({name:"Data points table",nameDisplay:e("Data points table"),description:e("A table display of a collection of data points"),templateUrl:":::PLUGIN_PATH:::/views/widget.html",configTemplateUrl:":::PLUGIN_PATH:::/views/widgetConfig.html",previewImage:":::PLUGIN_PATH:::/img/data-point-table-widget-pr.png",options:{noDeviceTarget:!0,minCol:6,datapointAttributes:["datapoints"]},displaySettings:{globalTimeContext:!0}})}t.$inject=["c8yComponentsProvider","gettext"],angular.module("c8y.cockpit.dataPointTable",[]).config(t)}();
1
+ "use strict";!function(){function t(t,e){t.add({name:"Data points table",nameDisplay:e("Data points table"),description:e("A table display of a collection of data points"),templateUrl:":::PLUGIN_PATH:::/views/widget.html",configTemplateUrl:":::PLUGIN_PATH:::/views/widgetConfig.html",previewImage:":::PLUGIN_PATH:::/img/data-point-table-widget-pr.png",options:{noDeviceTarget:!0,minCol:6,datapointAttributes:["datapoints"]},displaySettings:{globalTimeContext:!0,globalRealtimeContext:!0,globalAggregationContext:!0}})}t.$inject=["c8yComponentsProvider","gettext"],angular.module("c8y.cockpit.dataPointTable",[]).config(t)}();
@@ -64,9 +64,8 @@
64
64
  class="data-point-explorer d-flex d-col"
65
65
  ng-controller="c8yDataPointExplorerCtrl"
66
66
  >
67
- <div class="m-b-4 m-t-4 d-flex j-c-end gap-8">
67
+ <div ng-show="!data.widgetInstanceGlobalTimeContext" class="m-b-4 m-t-4 d-flex j-c-end gap-8">
68
68
  <c8y-realtime-button
69
- ng-show="!data.widgetInstanceGlobalTimeContext"
70
69
  class="top-right-control"
71
70
  channel="{{ channel }}"
72
71
  state="data.realtime"
@@ -81,7 +80,6 @@
81
80
  auto="true"
82
81
  ></c8y-aggregation>
83
82
  <c8y-interval
84
- ng-show="!data.widgetInstanceGlobalTimeContext"
85
83
  class="top-right-control"
86
84
  date-from="data.dateFrom"
87
85
  date-to="data.dateTo"
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(t,o,c){return{getDeviceTypeProtocolProvider:function(r,e){return{initUi:function(){(function(){var e={id:r.fieldbusType,name:r.label,service:r.serviceName};t.register(e)})(),function(){t.$inject=["$routeParams"];var e={path:u(r),template:'<c8y-device-type-detail id="vm.id"></c8y-device-type-detail>',controller:t,controllerAs:"vm"};function t(e){_.assign(this,e)}o.when(e.path,e)}()},$get:function(n,i){return["$injector","c8yBase","c8yInventory","c8yDeviceDatabase",function(e,t,r,o){return _objectSpread({flow:_.constant(["c8yDeviceTypeCreateStep"]),list:function(){return o.getAvailableDeviceTypes({fieldbusType:n.fieldbusType})},showIf:function(){return o.isDeviceTypeSupportedAsync({fieldbusType:n.fieldbusType})},detailPath:function(e){e=t.getId(e);return u(n).replace(/:id$/,e)},getName:function(e){return e.name},listRowInfoComponent:"c8yDeviceTypeRowInfo",getListActions:function(){return[{label:c("Export"),icon:"download",execute:function(e){return o.exportDeviceTypeAndSaveAs(e.data)}}]},remove:r.remove},e.invoke(i))}]}(r,e)}},$get:function(){}};function u(e){return"/deviceprotocols/".concat(e.fieldbusType,"/:id")}}e.$inject=["c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"],angular.module("c8y.deviceProtocolForDeviceDatabase4").provider("c8yDeviceTypeProtocolBase",e)}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(r,e,c){return{getDeviceTypeProtocolProvider:function(t,e){return{initUi:function(){!function(){var e={id:t.fieldbusType,name:t.label,service:t.serviceName};r.register(e)}()},$get:function(n,i){return["$injector","c8yBase","c8yInventory","c8yDeviceDatabase",function(e,t,r,o){return _objectSpread({flow:_.constant(["c8yDeviceTypeCreateStep"]),list:function(){return o.getAvailableDeviceTypes({fieldbusType:n.fieldbusType})},showIf:function(){return o.isDeviceTypeSupportedAsync({fieldbusType:n.fieldbusType})},detailPath:function(e){e=t.getId(e);return"/deviceprotocols/".concat(n.fieldbusType,"/:id").replace(/:id$/,e)},getName:function(e){return e.name},listRowInfoComponent:"c8yDeviceTypeRowInfo",getListActions:function(){return[{label:c("Export"),icon:"download",execute:function(e){return o.exportDeviceTypeAndSaveAs(e.data)}}]},remove:r.remove},e.invoke(i))}]}(t,e)}},$get:function(){}}}e.$inject=["c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"],angular.module("c8y.deviceProtocolForDeviceDatabase4").provider("c8yDeviceTypeProtocolBase",e)}();
@@ -9,16 +9,16 @@
9
9
  </div>
10
10
  <div class="c8y-list__item__body">
11
11
  <div class="content-flex-60">
12
- <div class="col-4">
12
+ <div class="col-4" data-cy="deviceProtocolList--Device-protocol-column-name">
13
13
  {{ 'Device protocol' | translate }}
14
14
  </div>
15
- <div class="col-4">
15
+ <div class="col-4" data-cy="deviceProtocolList--Description-column-name">
16
16
  {{ 'Description' | translate }}
17
17
  </div>
18
- <div class="col-2">
18
+ <div class="col-2" data-cy="deviceProtocolList--Type-column-name">
19
19
  {{ 'Type' | translate }}
20
20
  </div>
21
- <div class="col-2">
21
+ <div class="col-2" data-cy="deviceProtocolList--Resources-column-name">
22
22
  {{ 'Resources' | translate }}
23
23
  </div>
24
24
  </div>
@@ -1,33 +1,45 @@
1
- <c8y-ui-title-set title="'Device protocols' | translate"> </c8y-ui-title-set>
1
+ <c8y-ui-title-set title="'Device protocols' | translate"></c8y-ui-title-set>
2
2
  <c8y-breadcrumbs-set>
3
3
  <c8y-breadcrumbs-item
4
- label="{{ 'Device protocols' | translate }}"
5
4
  icon="c8y-device-protocols"
5
+ label="{{ 'Device protocols' | translate }}"
6
6
  ></c8y-breadcrumbs-item>
7
7
  <c8y-breadcrumbs-item
8
- label="{{ 'Device types' | translate }}"
9
8
  icon="c8y-device-protocols"
9
+ label="{{ 'Device types' | translate }}"
10
10
  ></c8y-breadcrumbs-item>
11
11
  </c8y-breadcrumbs-set>
12
12
 
13
13
  <c8y-ui-action-bar-set>
14
- <li class="navbar-form" action-bar-position="left" ng-show="!vm.showEmptyState()">
15
- <label for="dpFilter" class="sr-only">{{ 'Filter' | translate }}</label>
14
+ <li
15
+ class="navbar-form"
16
+ action-bar-position="left"
17
+ ng-show="!vm.showEmptyState()"
18
+ >
19
+ <label
20
+ class="sr-only"
21
+ for="dpFilter"
22
+ >
23
+ {{ 'Filter' | translate }}
24
+ </label>
16
25
  <div class="input-group input-group-search">
17
26
  <input
27
+ class="form-control ng-pristine ng-untouched ng-valid ng-empty"
18
28
  title="{{ 'Filter' | translate }}"
19
- type="search"
20
29
  id="dpFilter"
21
- class="form-control ng-pristine ng-untouched ng-valid ng-empty"
22
30
  placeholder="{{ 'Filter…' | translate }}"
31
+ type="search"
23
32
  ng-model="vm.searchString"
24
33
  ng-model-options="{ debounce: 500 }"
25
34
  />
26
35
  <span class="input-group-addon">
27
- <i c8y-icon="search" ng-show="vm.searchString.length === 0 || !vm.searchString"></i>
28
36
  <i
29
- c8y-icon="times"
37
+ c8y-icon="search"
38
+ ng-show="vm.searchString.length === 0 || !vm.searchString"
39
+ ></i>
40
+ <i
30
41
  class="text-muted"
42
+ c8y-icon="times"
31
43
  ng-show="vm.searchString.length > 0"
32
44
  ng-click="vm.searchString = ''"
33
45
  ></i>
@@ -35,18 +47,26 @@
35
47
  </div>
36
48
  </li>
37
49
 
38
- <button class="btn btn-link" title="{{ 'Add device protocol' | translate }}" ng-click="vm.add()">
50
+ <button
51
+ class="btn btn-link"
52
+ title="{{ 'Add device protocol' | translate }}"
53
+ ng-click="vm.add()"
54
+ >
39
55
  <i c8y-icon="plus-circle"></i>
40
56
  {{ 'Add device protocol' | translate }}
41
57
  </button>
42
58
  <c8y-device-protocol-import-button on-imported="vm.refresh()"></c8y-device-protocol-import-button>
43
59
  <button
44
- title="{{ 'Reload' | translate }}"
45
60
  class="btn btn-link"
61
+ title="{{ 'Reload' | translate }}"
62
+ data-cy="deviceProtocolView--Import-protocol"
46
63
  ng-click="vm.refresh()"
47
64
  ng-disabled="vm.isLoading"
48
65
  >
49
- <i c8y-icon="refresh" ng-class="{ 'icon-spin': vm.isLoading }"></i>
66
+ <i
67
+ ng-class="{ 'icon-spin': vm.isLoading }"
68
+ c8y-icon="refresh"
69
+ ></i>
50
70
  {{ 'Reload' | translate }}
51
71
  </button>
52
72
  </c8y-ui-action-bar-set>
@@ -54,14 +74,14 @@
54
74
  <c8y-help src="/users-guide/device-management/#managing-device-types"></c8y-help>
55
75
 
56
76
  <c8y-ui-empty-state
57
- ng-show="vm.showEmptyState()"
58
77
  [icon]="vm.CONFIG.icon"
59
78
  [title]="'No device protocols to display.' | translate"
60
79
  [subtitle]="'Click below to add your first device protocol.' | translate"
80
+ ng-show="vm.showEmptyState()"
61
81
  >
62
82
  <button
63
- title="{{ 'Add device protocol' | translate }}"
64
83
  class="btn btn-primary"
84
+ title="{{ 'Add device protocol' | translate }}"
65
85
  ng-click="vm.add()"
66
86
  >
67
87
  <i c8y-icon="{{ vm.CONFIG.icon }}"></i>
@@ -2,9 +2,7 @@
2
2
  "name": "Device type database",
3
3
  "description": "Allows for managing device types database",
4
4
  "category": "Device",
5
- "ngModules": [
6
- "c8y.deviceDatabase4"
7
- ],
5
+ "ngModules": ["c8y.deviceDatabase4"],
8
6
  "imports": [
9
7
  "core/device-protocols",
10
8
  "core/device-protocol-deviceDatabase4",
@@ -48,12 +46,11 @@
48
46
 
49
47
  "unique.directive.js",
50
48
  "validate-value-in-register-range.directive.js",
49
+ "validate-measurement-fragment.directive.js",
51
50
 
52
51
  "vendor/ini.js"
53
52
  ],
54
- "css": [
55
- "styles.css"
56
- ],
53
+ "css": ["styles.css"],
57
54
  "webpackOverride": {
58
55
  "js": [
59
56
  "device-database-4.module.js",
@@ -84,6 +81,7 @@
84
81
 
85
82
  "unique.directive.js",
86
83
  "validate-value-in-register-range.directive.js",
84
+ "validate-measurement-fragment.directive.js",
87
85
 
88
86
  "vendor/ini.js"
89
87
  ]
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},e=Object.prototype,u=e.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",o=t.toStringTag||"@@toStringTag";function i(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(e){i=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o,i,a,c,t=t&&t.prototype instanceof f?t:f,t=Object.create(t.prototype),n=new b(n||[]);return s(t,"_invoke",{value:(o=e,i=r,a=n,c="suspendedStart",function(e,t){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===e)throw t;return x()}for(a.method=e,a.arg=t;;){var r=a.delegate;if(r){r=function e(t,r){var n=r.method,o=t.iterator[n];if(void 0===o)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=void 0,e(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=p(o,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;o=n.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,l):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===c)throw c="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c="executing";r=p(o,i,a);if("normal"===r.type){if(c=a.done?"completed":"suspendedYield",r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c="completed",a.method="throw",a.arg=r.arg)}})}),t}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}a.wrap=c;var l={};function f(){}function y(){}function d(){}var t={},h=(i(t,n,function(){return this}),Object.getPrototypeOf),h=h&&h(h(T([]))),g=(h&&h!==e&&u.call(h,n)&&(t=h),d.prototype=f.prototype=Object.create(t));function v(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function m(a,c){var t;s(this,"_invoke",{value:function(r,n){function e(){return new c(function(e,t){!function t(e,r,n,o){var i,e=p(a[e],a,r);if("throw"!==e.type)return(r=(i=e.arg).value)&&"object"==_typeof(r)&&u.call(r,"__await")?c.resolve(r.__await).then(function(e){t("next",e,n,o)},function(e){t("throw",e,n,o)}):c.resolve(r).then(function(e){i.value=e,n(i)},function(e){return t("throw",e,n,o)});o(e.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}})}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function b(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function T(t){if(t){var r,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(u.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e}).next=e}return{next:x}}function x(){return{value:void 0,done:!0}}return s(g,"constructor",{value:y.prototype=d,configurable:!0}),s(d,"constructor",{value:y,configurable:!0}),y.displayName=i(d,o,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,i(e,o,"GeneratorFunction")),e.prototype=Object.create(g),e},a.awrap=function(e){return{__await:e}},v(m.prototype),i(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(e,t,r,n,o){void 0===o&&(o=Promise);var i=new m(c(e,t,r,n),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},v(g),i(g,o,"Generator"),i(g,n,function(){return this}),i(g,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,r=Object(e),n=[];for(t in r)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=T,b.prototype={constructor:b,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return i.type="throw",i.arg=r,n.next=e,t&&(n.method="next",n.arg=void 0),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=u.call(o,"catchLoc"),c=u.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&u.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc?null:o)?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,o=this.tryEntries[t];if(o.tryLoc===e)return"throw"===(r=o.completion).type&&(n=r.arg,_(o)),n}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:T(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},a}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=c.apply(e,a);function o(e){asyncGeneratorStep(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep(n,t,r,o,i,"throw",e)}o(void 0)})}}!function(){function e(s,e,n,o,i,p,t,a,l,c,u){var f=this,r=f.id,y=!0;function d(){return(d=_asyncToGenerator(_regeneratorRuntime().mark(function e(){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(){return h.apply(this,arguments)}();case 2:return e.next=4,function(){return g.apply(this,arguments)}(r);case 4:O(),f.deviceType.name?t.changeTitle({title:f.deviceType.name},{skipTitleTranslation:!0}):t.changeTitle({title:c("New device type")}),s.$apply();case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function h(){return(h=_asyncToGenerator(_regeneratorRuntime().mark(function e(){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.getFeaturesManifestsAsync();case 2:f.deviceTypesFeatures=e.sent,s.$apply();case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function g(){return(g=_asyncToGenerator(_regeneratorRuntime().mark(function e(r){var n,o;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t=r,v()?p.getEmptyDeviceType():p.getDeviceType(t);case 2:n=e.sent,o=n.fieldbusType,_.assign(f,{deviceType:n,formValue:{fieldbusType:o},features:_.find(f.deviceTypesFeatures,{fieldbusType:o})}),s.$apply();case 6:case"end":return e.stop()}var t},e)}))).apply(this,arguments)}function v(){return"new"===r}function m(e){return x(e,p.addElementId(p.getEmptyDiscreteOutput()),f.deviceType.c8y_Coils)}function w(e){return x(e,p.addElementId(p.getEmptyDiscreteInput()),f.deviceType.c8y_Coils)}function b(e){return R(e,p.addElementId(p.getEmptyHoldingRegister(f.deviceType)),f.deviceType.c8y_Registers)}function T(e){return R(e,p.addElementId(p.getEmptyInputRegister()),f.deviceType.c8y_Registers)}function x(e,t,r){return E("DiscreteIO",e,t,r)}function R(e,t,r){return E("Register",e,t,r)}function E(){return D.apply(this,arguments)}function D(){return(D=_asyncToGenerator(_regeneratorRuntime().mark(function e(o,i,a,c){var u;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p["edit".concat(o,"WithUI")](i||a,f.deviceType);case 3:u=e.sent,n=r=t=void 0;var t=i,r=c,n=u;_.get(f.features,"holdingRegisters.number.useHex",!1)&&!n.number.startsWith("0x")&&(n.number="0x".concat(n.number)),t?(t=_.indexOf(r,t),r[t]=n):r.push(n),O(),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),e.t0&&"escape key press"!==e.t0&&l.danger(e.t0);case 11:s.$apply();case 12:case"end":return e.stop()}},e,null,[[0,8]])}))).apply(this,arguments)}function L(){return I.apply(this,arguments)}function I(){return(I=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,r,n){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a({title:c("Delete item"),body:u.getString(n,t),labels:{ok:c("Delete")},status:"danger"});case 3:i.removeFromList(r,t),O(),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),e.t0&&l.danger(e.t0);case 10:s.$apply();case 11:case"end":return e.stop()}},e,null,[[0,7]])}))).apply(this,arguments)}function k(){return(k=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return _.get(t,"c8y_MessageIdConfiguration.source")||(r=_.get(f.features.configuration,"messageIdConfiguration[0].value"),_.set(t,"c8y_MessageIdConfiguration.source",r)),e.prev=1,e.next=4,p.save(t);case 4:l.success(c("Device type saved.")),y=!0,o.path("/deviceprotocols"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),l.danger(e.t0.errorMessage);case 12:s.$apply();case 13:case"end":return e.stop()}},e,null,[[1,9]])}))).apply(this,arguments)}function G(){return(G=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a({title:c("Confirm device type change?"),body:u.getString("By changing device type, all changes will be lost. Do you really want to proceed?")});case 3:return p.removeAllElements(f.deviceType),O(),t=f.formValue.fieldbusType,f.deviceType.fieldbusType=t,e.abrupt("return",t);case 10:return e.prev=10,e.t0=e.catch(0),t=f.deviceType.fieldbusType,f.formValue.fieldbusType=t,e.abrupt("return",t);case 15:case"end":return e.stop()}},e,null,[[0,10]])}))).apply(this,arguments)}function O(){var e=f.deviceType;_.assign(f,{discreteOutputsCategorized:p.getDiscreteOutputsCategorized(e),discreteInputsCategorized:p.getDiscreteInputsCategorized(e),holdingRegistersCategorized:p.getHoldingRegistersCategorized(e),inputRegistersCategorized:p.getInputRegistersCategorized(e)})}_.assign(f,{$onInit:function(){return d.apply(this,arguments)},isNew:v,isEmpty:_.isEmpty,editDiscreteOutput:m,editDiscreteInput:w,editHoldingRegister:b,editInputRegister:T,addDiscreteOutput:m,addDiscreteInput:w,addHoldingRegister:b,addInputRegister:T,removeDiscreteOutput:function(e){return L(e,f.deviceType.c8y_Coils,c('Do you really want to remove "{{name}}"?'))},removeDiscreteInput:function(e){return L(e,f.deviceType.c8y_Coils,c('Do you really want to remove "{{name}}"?'))},removeHoldingRegister:function(e){return L(e,f.deviceType.c8y_Registers,c('Do you really want to remove "{{name}}"?'))},removeInputRegister:function(e){return L(e,f.deviceType.c8y_Registers,c('Do you really want to remove "{{name}}"?'))},save:function(e){return k.apply(this,arguments)},saveDisabled:function(){var e=f.deviceType;return _.get(f,"deviceTypeForm.$invalid")||!e||_.isEmpty(e.c8y_Coils)&&_.isEmpty(e.c8y_Registers)},changeDeviceType:function(){{var e;f.deviceType.fieldbusType?_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(){return G.apply(this,arguments)}();case 2:t=e.sent,f.features=_.find(f.deviceTypesFeatures,{fieldbusType:t}),s.$apply();case 5:case"end":return e.stop()}},e)}))():(e=f.formValue.fieldbusType,f.deviceType.fieldbusType=e,f.features=_.find(f.deviceTypesFeatures,{fieldbusType:e}))}},messageIdSources:p.MessageIdSources,toggleMainEdit:function(){f.editingMain=!f.editingMain}}),e.$watch("vm.deviceType",function(e,t){t&&e!==t&&(y=!1)},!0),e.$on("$locationChangeStart",function(){var r=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,r){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(y){e.next=13;break}return t.preventDefault(),e.prev=2,e.next=5,a({title:c("Discard changes"),body:c("You are about to leave this page and discard the changes made. Do you want to proceed?"),status:"warning",labels:{ok:c("Discard")}});case 5:y=!0,n.location.href=r,s.$apply(),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),e.t0&&l.danger(e.t0);case 13:case"end":return e.stop()}},e,null,[[2,10]])}));return function(e,t){return r.apply(this,arguments)}}())}e.$inject=["$rootScope","$scope","$window","$location","c8yBase","c8yDeviceDatabase","c8yTitle","c8yModal","c8yAlert","gettext","gettextCatalog"],angular.module("c8y.deviceDatabase4").component("c8yDeviceTypeDetail",{templateUrl:":::PLUGIN_PATH:::/detail/device-type-detail.html",bindings:{id:"<"},controllerAs:"vm",controller:e})}();
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},e=Object.prototype,u=e.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",i=t.toStringTag||"@@toStringTag";function o(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i,o,a,c,t=t&&t.prototype instanceof f?t:f,t=Object.create(t.prototype),n=new T(n||[]);return s(t,"_invoke",{value:(i=e,o=r,a=n,c="suspendedStart",function(e,t){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===e)throw t;return x()}for(a.method=e,a.arg=t;;){var r=a.delegate;if(r){r=function e(t,r){var n=r.method,i=t.iterator[n];if(void 0===i)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=void 0,e(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=p(i,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;i=n.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,l):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===c)throw c="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c="executing";r=p(i,o,a);if("normal"===r.type){if(c=a.done?"completed":"suspendedYield",r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c="completed",a.method="throw",a.arg=r.arg)}})}),t}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}a.wrap=c;var l={};function f(){}function y(){}function d(){}var t={},h=(o(t,n,function(){return this}),Object.getPrototypeOf),h=h&&h(h(b([]))),g=(h&&h!==e&&u.call(h,n)&&(t=h),d.prototype=f.prototype=Object.create(t));function v(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function m(a,c){var t;s(this,"_invoke",{value:function(r,n){function e(){return new c(function(e,t){!function t(e,r,n,i){var o,e=p(a[e],a,r);if("throw"!==e.type)return(r=(o=e.arg).value)&&"object"==_typeof(r)&&u.call(r,"__await")?c.resolve(r.__await).then(function(e){t("next",e,n,i)},function(e){t("throw",e,n,i)}):c.resolve(r).then(function(e){o.value=e,n(o)},function(e){return t("throw",e,n,i)});i(e.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}})}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function b(t){if(t){var r,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(u.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e}).next=e}return{next:x}}function x(){return{value:void 0,done:!0}}return s(g,"constructor",{value:y.prototype=d,configurable:!0}),s(d,"constructor",{value:y,configurable:!0}),y.displayName=o(d,i,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,i,"GeneratorFunction")),e.prototype=Object.create(g),e},a.awrap=function(e){return{__await:e}},v(m.prototype),o(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(e,t,r,n,i){void 0===i&&(i=Promise);var o=new m(c(e,t,r,n),i);return a.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},v(g),o(g,i,"Generator"),o(g,n,function(){return this}),o(g,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,r=Object(e),n=[];for(t in r)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=b,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return o.type="throw",o.arg=r,n.next=e,t&&(n.method="next",n.arg=void 0),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=u.call(i,"catchLoc"),c=u.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&u.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}var o=(i=i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc?null:i)?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),w(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,i=this.tryEntries[t];if(i.tryLoc===e)return"throw"===(r=i.completion).type&&(n=r.arg,w(i)),n}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:b(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},a}function asyncGeneratorStep(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=c.apply(e,a);function i(e){asyncGeneratorStep(n,t,r,i,o,"next",e)}function o(e){asyncGeneratorStep(n,t,r,i,o,"throw",e)}i(void 0)})}}!function(){function e(s,e,n,i,o,p,t,a,l,c,u){var f=this;function r(){return(r=_asyncToGenerator(_regeneratorRuntime().mark(function e(){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(){return y.apply(this,arguments)}();case 2:return e.next=4,function(){return d.apply(this,arguments)}(f.id);case 4:k(),f.deviceType.name?t.changeTitle({title:f.deviceType.name},{skipTitleTranslation:!0}):t.changeTitle({title:c("New device type")}),s.$apply();case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function y(){return(y=_asyncToGenerator(_regeneratorRuntime().mark(function e(){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.getFeaturesManifestsAsync();case 2:f.deviceTypesFeatures=e.sent,s.$apply();case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function d(){return(d=_asyncToGenerator(_regeneratorRuntime().mark(function e(r){var n,i;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t=r,h()?p.getEmptyDeviceType():p.getDeviceType(t);case 2:n=e.sent,i=n.fieldbusType,_.assign(f,{deviceType:n,formValue:{fieldbusType:i},features:_.find(f.deviceTypesFeatures,{fieldbusType:i})}),s.$apply();case 6:case"end":return e.stop()}var t},e)}))).apply(this,arguments)}function h(){return"new"===f.id}function g(e){return T(e,p.addElementId(p.getEmptyDiscreteOutput()),f.deviceType.c8y_Coils)}function v(e){return T(e,p.addElementId(p.getEmptyDiscreteInput()),f.deviceType.c8y_Coils)}function m(e){return b(e,p.addElementId(p.getEmptyHoldingRegister(f.deviceType)),f.deviceType.c8y_Registers)}function w(e){return b(e,p.addElementId(p.getEmptyInputRegister()),f.deviceType.c8y_Registers)}function T(e,t,r){return x("DiscreteIO",e,t,r)}function b(e,t,r){return x("Register",e,t,r)}function x(){return E.apply(this,arguments)}function E(){return(E=_asyncToGenerator(_regeneratorRuntime().mark(function e(i,o,a,c){var u;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p["edit".concat(i,"WithUI")](o||a,f.deviceType);case 3:u=e.sent,n=r=t=void 0;var t=o,r=c,n=u;_.get(f.features,"holdingRegisters.number.useHex",!1)&&!n.number.startsWith("0x")&&(n.number="0x".concat(n.number)),t?(t=_.indexOf(r,t),r[t]=n):r.push(n),k(),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),e.t0&&"escape key press"!==e.t0&&l.danger(e.t0);case 11:s.$apply();case 12:case"end":return e.stop()}},e,null,[[0,8]])}))).apply(this,arguments)}function R(){return D.apply(this,arguments)}function D(){return(D=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,r,n){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a({title:c("Delete item"),body:u.getString(n,t),labels:{ok:c("Delete")},status:"danger"});case 3:i.removeFromList(r,t),k(),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),e.t0&&l.danger(e.t0);case 10:s.$apply();case 11:case"end":return e.stop()}},e,null,[[0,7]])}))).apply(this,arguments)}function L(){return(L=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return _.get(t,"c8y_MessageIdConfiguration.source")||(r=_.get(f.features.configuration,"messageIdConfiguration[0].value"),_.set(t,"c8y_MessageIdConfiguration.source",r)),e.prev=1,e.next=4,p.save(t);case 4:l.success(c("Device type saved.")),o.setIsDetailEdited(!1),n.path("/deviceprotocols"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),l.danger(e.t0.errorMessage);case 12:s.$apply();case 13:case"end":return e.stop()}},e,null,[[1,9]])}))).apply(this,arguments)}function I(){return(I=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a({title:c("Confirm device type change?"),body:u.getString("By changing device type, all changes will be lost. Do you really want to proceed?")});case 3:return p.removeAllElements(f.deviceType),k(),t=f.formValue.fieldbusType,f.deviceType.fieldbusType=t,e.abrupt("return",t);case 10:return e.prev=10,e.t0=e.catch(0),t=f.deviceType.fieldbusType,f.formValue.fieldbusType=t,e.abrupt("return",t);case 15:case"end":return e.stop()}},e,null,[[0,10]])}))).apply(this,arguments)}function k(){var e=f.deviceType;_.assign(f,{discreteOutputsCategorized:p.getDiscreteOutputsCategorized(e),discreteInputsCategorized:p.getDiscreteInputsCategorized(e),holdingRegistersCategorized:p.getHoldingRegistersCategorized(e),inputRegistersCategorized:p.getInputRegistersCategorized(e)})}_.assign(f,{$onInit:function(){return r.apply(this,arguments)},isNew:h,isEmpty:_.isEmpty,editDiscreteOutput:g,editDiscreteInput:v,editHoldingRegister:m,editInputRegister:w,addDiscreteOutput:g,addDiscreteInput:v,addHoldingRegister:m,addInputRegister:w,removeDiscreteOutput:function(e){return R(e,f.deviceType.c8y_Coils,c('Do you really want to remove "{{name}}"?'))},removeDiscreteInput:function(e){return R(e,f.deviceType.c8y_Coils,c('Do you really want to remove "{{name}}"?'))},removeHoldingRegister:function(e){return R(e,f.deviceType.c8y_Registers,c('Do you really want to remove "{{name}}"?'))},removeInputRegister:function(e){return R(e,f.deviceType.c8y_Registers,c('Do you really want to remove "{{name}}"?'))},save:function(e){return L.apply(this,arguments)},saveDisabled:function(){var e=f.deviceType;return _.get(f,"deviceTypeForm.$invalid")||!e||_.isEmpty(e.c8y_Coils)&&_.isEmpty(e.c8y_Registers)},changeDeviceType:function(){{var e;f.deviceType.fieldbusType?_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(){return I.apply(this,arguments)}();case 2:t=e.sent,f.features=_.find(f.deviceTypesFeatures,{fieldbusType:t}),s.$apply();case 5:case"end":return e.stop()}},e)}))():(e=f.formValue.fieldbusType,f.deviceType.fieldbusType=e,f.features=_.find(f.deviceTypesFeatures,{fieldbusType:e}))}},messageIdSources:p.MessageIdSources,toggleMainEdit:function(){f.editingMain=!f.editingMain}}),e.$watch("vm.deviceType",function(e,t){t&&e!==t&&o.setIsDetailEdited(!0)},!0)}e.$inject=["$rootScope","$scope","$location","c8yBase","c8yDeviceTypeDetailEdited","c8yDeviceDatabase","c8yTitle","c8yModal","c8yAlert","gettext","gettextCatalog"],angular.module("c8y.deviceDatabase4").component("c8yDeviceTypeDetail",{templateUrl:":::PLUGIN_PATH:::/detail/device-type-detail.html",bindings:{id:"<"},controllerAs:"vm",controller:e})}();
@@ -116,6 +116,7 @@
116
116
  title="{{ 'Save' | translate }}"
117
117
  class="btn btn-primary"
118
118
  ng-click="vm.save(vm.deviceType)"
119
+ data-cy="sigfox-settings--Save-button"
119
120
  ng-disabled="vm.saveDisabled()"
120
121
  translate
121
122
  >