@c8y/ng1-modules 1021.81.0 → 1022.3.2

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 (112) hide show
  1. package/alarmsEventsExplorer/alarmsEventsTimelinesConfig/alarmsEventsTimelinesConfig.html +1 -1
  2. package/assetPropertyWidget/img/asset-properties-widget-pr.png +0 -0
  3. package/assetPropertyWidget/views/config.html +1 -1
  4. package/assetTable/assetTable2/img/asset-table-widget-pr.png +0 -0
  5. package/assetTable/img/asset-table-widget-pr.png +0 -0
  6. package/core/core/services/audits.js +1 -1
  7. package/core/core/services/retentions.js +1 -1
  8. package/core/core/services/tenant.js +1 -1
  9. package/core/core/services/user.js +1 -1
  10. package/core/cumulocity.json +0 -1
  11. package/core/locales/de.po +472 -720
  12. package/core/locales/es.po +422 -671
  13. package/core/locales/fr.po +501 -751
  14. package/core/locales/ja_JP.po +494 -740
  15. package/core/locales/ko.po +421 -671
  16. package/core/locales/nl.po +424 -672
  17. package/core/locales/pl.po +422 -672
  18. package/core/locales/pt_BR.po +519 -768
  19. package/core/locales/zh_CN.po +421 -671
  20. package/core/locales/zh_TW.po +422 -671
  21. package/core/ui/properties/propertySelector.html +156 -109
  22. package/core/ui/views/auditList.html +2 -2
  23. package/core/ui/views/eventList.html +2 -2
  24. package/core/ui/views/filePicker.html +1 -1
  25. package/dataBroker/connectors/connectors.service.js +1 -1
  26. package/dataPointExplorer/img/data-points-graph-widget-pr.png +0 -0
  27. package/dataPointExplorer/views/widgetConfig.html +92 -94
  28. package/device-protocols/object-mapping.component.js +1 -1
  29. package/device-protocols/object-mapping.html +1 -1
  30. package/deviceDatabase4/modals/configure-discrete-io.html +1 -1
  31. package/deviceDatabase4/modals/configure-register.html +1 -1
  32. package/deviceDetail/cumulocity.json +1 -2
  33. package/deviceStatusWidget/ownerStatus.html +2 -2
  34. package/deviceStatusWidget/requiredAvailabilityIntervalSetting.html +4 -4
  35. package/devicemanagement-eventList/index.js +1 -1
  36. package/enterpriseEdition/cumulocity.json +0 -13
  37. package/enterpriseEdition/enterpriseEdition.module.js +1 -1
  38. package/eventList/img/events-list-widget-pr.png +0 -0
  39. package/eventList/views/eventListConfig.html +39 -32
  40. package/export/cumulocity.json +0 -1
  41. package/export/index.js +1 -1
  42. package/export/services/config.js +1 -1
  43. package/htmlWidget/index.js +1 -1
  44. package/kpi/img/data-points-list-widget-pr.png +0 -0
  45. package/kpi/views/gaugeConfig.html +28 -34
  46. package/kpi/views/listConfig.html +14 -18
  47. package/kpi/views/pieChartConfig.html +30 -36
  48. package/modbusConfiguration4/fieldbus-device-list.component.js +1 -1
  49. package/modbusWidget4/widget-config.html +74 -84
  50. package/package.json +11 -13
  51. package/propertiesLibrary/index.js +1 -1
  52. package/roles/list/rolesList.html +0 -2
  53. package/scada/views/componentConfig.html +23 -23
  54. package/scada/views/mapping.html +41 -39
  55. package/smartRules/controllers/add.js +1 -1
  56. package/smartRules/controllers/list.js +1 -1
  57. package/smartRules/list/smartRulesList.component.js +1 -1
  58. package/smartRules/list/smartRulesList.html +2 -2
  59. package/smartRules/services/smartRules.js +1 -1
  60. package/smartRules/views/add.html +32 -10
  61. package/smartRules/views/list.html +4 -3
  62. package/trafficLightWidget/states-mapping.html +82 -69
  63. package/administration-config/administration-config.module.js +0 -1
  64. package/administration-config/cumulocity.json +0 -13
  65. package/asset-notes/assetNotes.component.js +0 -1
  66. package/asset-notes/assetNotes.html +0 -93
  67. package/asset-notes/assetNotes.module.js +0 -1
  68. package/asset-notes/assetNotes.service.js +0 -1
  69. package/asset-notes/cumulocity.json +0 -13
  70. package/core/ui/forms/ssh-key-input.html +0 -33
  71. package/core/ui/forms/ssh-key-input.js +0 -1
  72. package/devicemanagement-deviceListMap/controllers/deviceListMap.js +0 -1
  73. package/devicemanagement-deviceListMap/cumulocity.json +0 -19
  74. package/devicemanagement-deviceListMap/index.js +0 -1
  75. package/devicemanagement-deviceListMap/views/index.html +0 -21
  76. package/enterpriseEdition/customBranding/brandingConfiguration.constants.js +0 -1
  77. package/enterpriseEdition/customBranding/brandingConfiguration.service.js +0 -1
  78. package/enterpriseEdition/customBranding/brandingConfigurationForm.component.js +0 -1
  79. package/enterpriseEdition/customBranding/brandingConfigurationForm.html +0 -141
  80. package/enterpriseEdition/customBranding/brandingConfigurationUi.provider.js +0 -1
  81. package/enterpriseEdition/customBranding/brandingDeploy.service.js +0 -1
  82. package/enterpriseEdition/customBranding/brandingProcessExecution.component.js +0 -1
  83. package/enterpriseEdition/customBranding/brandingProcessExecution.html +0 -120
  84. package/enterpriseEdition/customBranding/custom-branding.module.js +0 -1
  85. package/enterpriseEdition/customBranding/microservice.value.js +0 -1
  86. package/enterpriseEdition/ui-assets/index.js +0 -1
  87. package/enterpriseEdition/ui-assets/public-options.service.js +0 -1
  88. package/enterpriseEdition/ui-assets/static-assets.service.js +0 -1
  89. package/enterpriseEdition/ui-assets/ui-assets.service.js +0 -1
  90. package/export/controllers/list.js +0 -1
  91. package/export/views/list.html +0 -298
  92. package/remoteAccess/clients/remoteAccessClients.service.js +0 -1
  93. package/remoteAccess/clients/terminal/index.html +0 -30
  94. package/remoteAccess/clients/terminal/index.js +0 -1
  95. package/remoteAccess/clients/terminal/shell-adapter.js +0 -1
  96. package/remoteAccess/clients/terminal/style.css +0 -25
  97. package/remoteAccess/clients/terminal/telnet-negotiator.js +0 -1
  98. package/remoteAccess/clients/vnc/vncClient.html +0 -60
  99. package/remoteAccess/clients/vnc/vncClient.js +0 -1
  100. package/remoteAccess/cumulocity.json +0 -69
  101. package/remoteAccess/remoteAccess.module.js +0 -1
  102. package/remoteAccess/remoteAccess.service.js +0 -1
  103. package/remoteAccess/remoteAccessEndpointCard/remoteAccessEndpointCard.component.js +0 -1
  104. package/remoteAccess/remoteAccessEndpointCard/remoteAccessEndpointCard.html +0 -89
  105. package/remoteAccess/remoteAccessEndpointModal/remoteAccessEndpointModal.component.js +0 -1
  106. package/remoteAccess/remoteAccessEndpointModal/remoteAccessEndpointModal.html +0 -484
  107. package/remoteAccess/remoteAccessEndpointModal/suggestedIPAddressTemplate.html +0 -8
  108. package/remoteAccess/remoteAccessEndpointsList/remoteAccessEndpointsList.component.js +0 -1
  109. package/remoteAccess/remoteAccessEndpointsList/remoteAccessEndpointsList.html +0 -75
  110. package/remoteAccess/remoteAccessSettings/remoteAccessSettings.component.js +0 -1
  111. package/remoteAccess/remoteAccessSettings/remoteAccessSettings.html +0 -37
  112. package/remoteAccess/remoteAccessUI.provider.js +0 -1
@@ -2,94 +2,84 @@
2
2
  <div ng-if="vm.categoriesConfig.length === 0" class="alert alert-warning" translate>
3
3
  No categories available.
4
4
  </div>
5
-
6
- <div ui-sortable="{handle: '.handle-category'}" ng-model="vm.categoriesConfig">
7
- <div class="panel panel-default" ng-repeat="category in vm.categoriesConfig">
8
- <div class="panel-heading">
9
- <div class="d-flex">
10
- <div class="handle-category">
11
- <i c8y-icon="bars" style="cursor:move;"></i>
12
- </div>
13
-
14
- <div class="ui-sortable-title">
15
- <label class="editable" ng-if="category.name">
16
- <input
17
- class="form-control"
18
- style="max-width:calc({{ category.label.length || 10 }} * 1ch + 14px)"
19
- ng-model="category.label"
20
- />
21
- <span>{{ category.label }}</span>
22
- </label>
23
- <label class="editable text-muted" ng-if="!category.name">
24
- <span>{{ category.label | translate }}</span>
25
- </label>
26
- </div>
27
-
28
- <div class="ui-sortable-actions text-right">
29
- <button class="btn btn-link" ng-click="category.isCollapsed = !category.isCollapsed">
30
- <i c8y-icon="chevron-down" ng-if="category.isCollapsed"></i>
31
- <i c8y-icon="chevron-up" ng-if="!category.isCollapsed"></i>
32
- </button>
33
- </div>
34
- </div>
35
- </div>
36
- <div class="panel-body" uib-collapse="category.isCollapsed">
37
- <table class="table table-vertical-middle form-group">
38
- <thead>
39
- <th style="width:5%;"></th>
40
- <th style="width:5%;">
41
- <label>{{ 'Show' | translate }}</label>
42
- </th>
43
- <th style="width:34%;">
44
- <label>{{ 'Label' | translate }}</label>
45
- </th>
46
- <th style="width:28%;">
47
- <label>{{ 'Name' | translate }}</label>
48
- </th>
49
- <th style="width:28%;">
50
- <label>{{ 'Type' | translate }}</label>
51
- </th>
52
- </thead>
53
- <tbody ui-sortable="{handle: '.handle-property'}" ng-model="category.elements">
54
- <tr class="property" ng-repeat="element in category.elements">
55
- <td class="handle-property" style="width:5%;">
56
- <i c8y-icon="bars" style="cursor:move;"></i>
57
- </td>
58
- <td style="width:5%; vertical-align:middle;">
59
- <label class="c8y-checkbox input-sm" style="line-height:30px;">
60
- <input type="checkbox" ng-model="element.show" />
61
- <span></span>
62
- </label>
63
- </td>
64
- <td style="width:34%;">
65
- <label class="editable">
66
- <input
67
- class="form-control"
68
- style="max-width:calc({{ element.label.length || 10 }} * 1ch + 14px)"
69
- ng-model="element.label"
70
- />
71
- <span>{{ element.label }}</span>
72
- </label>
73
- </td>
74
- <td style="width:28%;">
75
- {{ element.name }}
76
- </td>
77
- <td style="width:28%;">
78
- {{ element.typeLabel | translate }}
79
- </td>
80
- </tr>
81
- </tbody>
82
- </table>
83
- </div>
84
- </div>
85
- </div>
86
-
87
- <input type="hidden" name="modbusWidgetValidation" ng-model="vm.modbusWidgetValidation" />
88
-
89
5
  <div
90
6
  ng-if="vm.categoriesConfig.length > 0 && !vm.atLeastOneElementSelected"
91
7
  class="alert alert-warning"
92
8
  >
93
9
  <span translate>At least one field needs to be selected.</span>
94
10
  </div>
11
+ <div ui-sortable="{handle: '.handle-category'}" ng-model="vm.categoriesConfig">
12
+ <fieldset class="c8y-fieldset" ng-repeat="category in vm.categoriesConfig">
13
+ <legend>
14
+ <label class="editable" ng-if="category.name">
15
+ <input
16
+ class="form-control input-sm"
17
+ style="width:calc({{ category.label.length || 10 }} * 1ch);"
18
+ ng-model="category.label"
19
+ />
20
+ <span>{{ category.label }}</span>
21
+ </label>
22
+ <label class="editable text-muted" ng-if="!category.name">
23
+ <span>{{ category.label | translate }}</span>
24
+ </label>
25
+ </legend>
26
+
27
+ <table class="table table-vertical-middle table-condensed bg-inherit" style="table-layout: fixed;">
28
+ <colgroup>
29
+ <col style="width:5%;" />
30
+ <col style="width:7%;" />
31
+ <col style="width:34%;" />
32
+ <col style="width:28%;" />
33
+ <col style="width:26%;" />
34
+ </colgroup>
35
+ <thead>
36
+ <th></th>
37
+ <th>
38
+ <span>{{ 'Show' | translate }}</span>
39
+ </th>
40
+ <th>
41
+ <span>{{ 'Label' | translate }}</sp>
42
+ </th>
43
+ <th>
44
+ <span>{{ 'Name' | translate }}</span>
45
+ </th>
46
+ <th>
47
+ <span>{{ 'Type' | translate }}</spa>
48
+ </th>
49
+ </thead>
50
+ <tbody ui-sortable="{handle: '.handle-property'}" ng-model="category.elements">
51
+ <tr class="property" ng-repeat="element in category.elements">
52
+ <td class="handle-property">
53
+ <i c8y-icon="bars" style="cursor:move;"></i>
54
+ </td>
55
+ <td style="vertical-align:middle;">
56
+ <label class="c8y-checkbox input-sm" style="line-height:30px;">
57
+ <input type="checkbox" ng-model="element.show" />
58
+ <span></span>
59
+ </label>
60
+ </td>
61
+ <td>
62
+ <label class="editable">
63
+ <input
64
+ class="form-control input-sm"
65
+ style="max-width:calc({{ element.label.length || 10 }} * 1ch + 14px)"
66
+ ng-model="element.label"
67
+ />
68
+ <span>{{ element.label }}</span>
69
+ </label>
70
+ </td>
71
+ <td>
72
+ {{ element.name }}
73
+ </td>
74
+ <td>
75
+ {{ element.typeLabel | translate }}
76
+ </td>
77
+ </tr>
78
+ </tbody>
79
+ </table>
80
+ </fieldset>
81
+ </div>
82
+
83
+ <input type="hidden" name="modbusWidgetValidation" ng-model="vm.modbusWidgetValidation" />
84
+
95
85
  </ng-form>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1021.81.0",
3
+ "version": "1022.3.2",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -17,44 +17,42 @@
17
17
  "angular-i18n": "1.8.3",
18
18
  "angular-leaflet-directive": "0.10.0",
19
19
  "angular-messages": "1.8.3",
20
+ "angular-qrcode": "7.2.0",
20
21
  "angular-route": "1.8.3",
21
22
  "angular-sanitize": "1.8.3",
22
23
  "angular-schema-form": "0.8.14",
23
24
  "angular-ui-ace": "0.2.3",
24
25
  "angular-ui-bootstrap": "2.5.6",
25
26
  "angular-ui-sortable": "0.15.1",
26
- "angular-qrcode": "7.2.0",
27
27
  "angularjs-nvd3-directives": "0.0.8",
28
28
  "bootstrap": "3.4.1",
29
29
  "cometd": "4.0.8",
30
- "ip.js": "1.2.2",
31
30
  "d3": "3.5.5",
31
+ "dompurify": "3.2.5",
32
32
  "fast-text-encoding": "1.0.6",
33
33
  "file-saver": "2.0.5",
34
34
  "ini": "5.0.0",
35
+ "ip.js": "1.2.2",
35
36
  "jquery": "3.6.0",
36
37
  "jquery-ui": "1.13.0",
37
38
  "leaflet": "1.9.4",
38
- "libphonenumber-js": "1.11.9",
39
+ "libphonenumber-js": "1.11.19",
39
40
  "lodash": "4.17.21",
40
41
  "moment": "2.30.1",
41
42
  "ng-csv": "0.3.6",
42
- "noVNC": "https://github.com/novnc/noVNC/archive/v0.6.2.tar.gz",
43
43
  "nvd3": "1.1.15",
44
44
  "objectpath": "1.1.0",
45
- "payment": "2.4.6",
45
+ "payment": "2.4.7",
46
46
  "tv4": "1.3.0",
47
47
  "ui-select": "0.19.8",
48
- "xterm": "5.3.0",
49
- "xterm-addon-fit": "0.8.0",
50
- "zip-js": "0.0.3",
51
- "dompurify": "3.1.3"
48
+ "zip-js": "0.0.3"
52
49
  },
53
50
  "devDependencies": {
54
- "jest-junit": "16.0.0",
55
- "fs-extra": "^11.2.0",
56
- "npm-packlist": "1.1.11",
57
51
  "@babel/plugin-syntax-dynamic-import": "7.8.3",
52
+ "@types/angular": "1.8.9",
53
+ "fs-extra": "^11.3.0",
54
+ "jest-junit": "16.0.0",
55
+ "npm-packlist": "10.0.0",
58
56
  "uglify-js": "3.19.3"
59
57
  },
60
58
  "peerDependencies": {
@@ -1 +1 @@
1
- (()=>{function e(e,t,r,i){var o="properties-library",n=i("Properties library"),a={parent:i("Settings"),name:n,routerLinkExact:!1,path:o,icon:"book-shelf",priority:1100},c="/".concat(o),o='<c8y-json-schema-objects-list filters="filters"></c8y-json-schema-objects-list>',i=[{name:i("Inventory"),icon:"cubes",template:o,controller:l({MANAGED_OBJECTS:!0}),priority:4e3},{name:i("Alarm"),icon:"bell",template:o,controller:l({ALARMS:!0}),priority:3e3},{name:i("Event"),icon:"c8y-events",template:o,controller:l({EVENTS:!0}),priority:2e3},{name:i("Tenant"),icon:"c8y-sub-tenants",template:o,controller:l({TENANTS:!0}),priority:1e3,showIfPermissions:{anyRole:["ROLE_TENANT_MANAGEMENT_READ"]}}];function l(t){function e(e){e.filters={appliesTo:t}}return e.$inject=["$scope"],e}e.addNavigation(a),t.addTitle(c,{data:_.constant({title:n})}),_.forEach(i,function(e){r.when(c,e)})}e.$inject=["c8yNavigatorProvider","c8yTitleProvider","c8yViewsProvider","gettext"],angular.module("c8y.propertiesLibrary",[]).config(e)})();
1
+ (()=>{function e(e,t,r,i){var o="properties-library",n=i("Properties library"),a={parent:i("Settings"),name:n,routerLinkExact:!1,path:o,icon:"book-shelf",priority:1100},c="/".concat(o),o='<c8y-json-schema-objects-list filters="filters"></c8y-json-schema-objects-list>',i=[{name:i("Inventory"),icon:"cubes",template:o,controller:l({MANAGED_OBJECTS:!0}),priority:4e3},{name:i("Alarm"),icon:"bell",template:o,controller:l({ALARMS:!0}),priority:3e3},{name:i("Event"),icon:"online1",template:o,controller:l({EVENTS:!0}),priority:2e3},{name:i("Tenant"),icon:"c8y-sub-tenants",template:o,controller:l({TENANTS:!0}),priority:1e3,showIfPermissions:{anyRole:["ROLE_TENANT_MANAGEMENT_READ"]}}];function l(t){function e(e){e.filters={appliesTo:t}}return e.$inject=["$scope"],e}e.addNavigation(a),t.addTitle(c,{data:_.constant({title:n})}),_.forEach(i,function(e){r.when(c,e)})}e.$inject=["c8yNavigatorProvider","c8yTitleProvider","c8yViewsProvider","gettext"],angular.module("c8y.propertiesLibrary",[]).config(e)})();
@@ -214,12 +214,10 @@
214
214
  <div class="card-header separator">
215
215
  <div class="card-icon">
216
216
  <i
217
- class="text-gray-darker"
218
217
  c8y-icon="connected-people"
219
218
  ng-if="role.customProperties"
220
219
  ></i>
221
220
  <i
222
- class="text-gray-darker"
223
221
  c8y-icon="insurance-agent"
224
222
  ng-if="!role.customProperties"
225
223
  ></i>
@@ -1,9 +1,8 @@
1
1
  <div
2
- class="p-t-8"
3
2
  ng-controller="ScadaWidgetConfigCtrl as ctrl"
4
3
  >
5
- <div>
6
- <label>
4
+ <fieldset class="c8y-fieldset">
5
+ <legend class="d-flex a-i-center">
7
6
  <span translate>SVG</span>
8
7
  <button
9
8
  class="btn-help btn-help--sm"
@@ -15,7 +14,7 @@
15
14
  popover-append-to-body="true"
16
15
  ng-click="svgTooltipVisible = !svgTooltipVisible"
17
16
  ></button>
18
- </label>
17
+ </legend>
19
18
 
20
19
  <div
21
20
  class="alert alert-info text-left"
@@ -24,33 +23,33 @@
24
23
  <p translate>
25
24
  For placeholder to be recognized it needs to be used at least once in curly braces with no
26
25
  other expression, for example,
27
- <var ng-bind-html="'\{\{&nbsp;placeholderName`KEEP_ORIGINAL`&nbsp;\}\}'"></var>
26
+ <code ng-bind-html="'\{\{&nbsp;placeholderName`KEEP_ORIGINAL`&nbsp;\}\}'"></code>
28
27
  . Then you can use this placeholderName`KEEP_ORIGINAL` in bindings handled by Angular. There
29
28
  are also predefined functions available:
30
29
  </p>
31
- <ul>
30
+ <ul class="p-l-16">
32
31
  <li>
33
- <var ng-non-bindable>goToGroupDetails(groupId)</var>
32
+ <code ng-non-bindable>goToGroupDetails(groupId)</code>
34
33
  &ndash;
35
34
  <translate>
36
35
  takes the group ID and redirects the user to the group details view, for example:
37
36
  </translate>
38
37
  <br />
39
- <var ng-non-bindable>&lt;… ng-click="goToGroupDetails(groupId)"&gt;</var>
38
+ <code ng-non-bindable>&lt;… ng-click="goToGroupDetails(groupId)"&gt;</code>
40
39
  ,
41
40
  </li>
42
41
  <li>
43
- <var ng-non-bindable>goToDeviceDetails(deviceId)</var>
42
+ <code ng-non-bindable>goToDeviceDetails(deviceId)</code>
44
43
  &ndash;
45
44
  <translate>
46
45
  takes the device ID and redirects the user to the device details view, for example:
47
46
  </translate>
48
47
  <br />
49
- <var ng-non-bindable>&lt;… ng-click="goToDeviceDetails(deviceId)"&gt;</var>
48
+ <code ng-non-bindable>&lt;… ng-click="goToDeviceDetails(deviceId)"&gt;</code>
50
49
  ,
51
50
  </li>
52
51
  <li>
53
- <var ng-non-bindable>getActiveAlarmsStatusClass(alarmsStatus)</var>
52
+ <code ng-non-bindable>getActiveAlarmsStatusClass(alarmsStatus)</code>
54
53
  &ndash;
55
54
  <translate>
56
55
  takes the alarm status object and returns a CSS class that can be used for styling:
@@ -58,13 +57,21 @@
58
57
  critical`KEEP_ORIGINAL`, for example:
59
58
  </translate>
60
59
  <br />
61
- <var ng-non-bindable>&lt;… ng-class="getActiveAlarmsStatusClass(alarmsStatus)"&gt;</var>
60
+ <code ng-non-bindable>&lt;… ng-class="getActiveAlarmsStatusClass(alarmsStatus)"&gt;</code>
62
61
  .
63
62
  </li>
64
63
  </ul>
65
64
  </div>
66
-
67
65
  <div class="form-group">
66
+ <file-picker
67
+ files="ctrl.files"
68
+ multiple="false"
69
+ display-drop-zone="false"
70
+ on-file-selected="ctrl.onSelectFile(ctrl.files[0].file)"
71
+ ></file-picker>
72
+ <input type="hidden" />
73
+ </div>
74
+ <div class="form-group form-group-sm">
68
75
  <label
69
76
  for="sanitization"
70
77
  translate
@@ -100,16 +107,8 @@
100
107
  </select>
101
108
  </div>
102
109
  </div>
103
- <div class="form-group">
104
- <file-picker
105
- files="ctrl.files"
106
- multiple="false"
107
- display-drop-zone="false"
108
- on-file-selected="ctrl.onSelectFile(ctrl.files[0].file)"
109
- ></file-picker>
110
- <input type="hidden" />
111
- </div>
112
- </div>
110
+ </fieldset>
111
+
113
112
  <div class="form-group p-t-16">
114
113
  <label class="input-group">{{ 'Preview' | translate }}</label>
115
114
  <span
@@ -149,6 +148,7 @@
149
148
  </div>
150
149
  </div>
151
150
  </div>
151
+
152
152
  <div
153
153
  name="mapping"
154
154
  c8y-scada-mapping
@@ -1,5 +1,5 @@
1
- <div class="svg-mappings">
2
- <label>{{ 'Mappings' | translate }}</label>
1
+ <fieldset class="c8y-fieldset svg-mappings">
2
+ <legend>{{ 'Mappings' | translate }}</legend>
3
3
  <ul class="c8y-list__group c8y-list__group--strip">
4
4
  <li class="c8y-list__item" ng-repeat="mapping in mappings | orderBy:'placeholder'">
5
5
  <div class="c8y-list__item__block d-block">
@@ -60,7 +60,7 @@
60
60
  </span>
61
61
  </div>
62
62
  </div>
63
- <div class="col-md-4">
63
+ <div class="col-md-8">
64
64
  <label class="text-label-small d-block" translate>Current value</label>
65
65
  <div class="form-control-static" title="{{ propertyValueFor(mapping) }}">
66
66
  <span class="text-truncate text-monospace">
@@ -68,46 +68,48 @@
68
68
  </span>
69
69
  </div>
70
70
  </div>
71
- <div class="col-md-4">
71
+ <div class="col-xs-12">
72
72
  <label class="text-label-small d-block" translate>Actions</label>
73
- <button
74
- class="btn btn-default btn-sm"
75
- type="button"
76
- uib-tooltip="{{ 'Clear mapping' | translate }}"
77
- tooltip-append-to-body="true"
78
- tooltip-popup-delay="500"
79
- aria-label="{{ 'Clear mapping' | translate }}"
80
- ng-click="clearMapping(mapping)"
81
- ng-disabled="!mapping.config"
82
- >
83
- <i c8y-icon="delete-document"></i>
84
- </button>
85
- <button
86
- class="btn btn-default btn-sm"
87
- type="button"
88
- uib-tooltip="{{ 'Assign fieldbus property' | translate }}"
89
- tooltip-append-to-body="true"
90
- tooltip-popup-delay="500"
91
- aria-label="{{ 'Assign fieldbus property' | translate }}"
92
- ng-click="setFieldbusMapping(mapping)"
93
- >
94
- <i c8y-icon="tasks"></i>
95
- </button>
96
- <button
97
- class="btn btn-default btn-sm"
98
- type="button"
99
- uib-tooltip="{{ 'Assign device property' | translate }}"
100
- tooltip-append-to-body="true"
101
- tooltip-popup-delay="500"
102
- aria-label="{{ 'Assign device property' | translate }}"
103
- ng-click="setMapping(mapping)"
104
- >
105
- <i c8y-icon="edit"></i>
106
- </button>
73
+ <div class="btn-group">
74
+ <button
75
+ class="btn btn-default btn-sm"
76
+ type="button"
77
+ uib-tooltip="{{ 'Clear mapping' | translate }}"
78
+ tooltip-append-to-body="true"
79
+ tooltip-popup-delay="500"
80
+ aria-label="{{ 'Clear mapping' | translate }}"
81
+ ng-click="clearMapping(mapping)"
82
+ ng-disabled="!mapping.config"
83
+ >
84
+ <i c8y-icon="delete-document"></i>
85
+ </button>
86
+ <button
87
+ class="btn btn-default btn-sm"
88
+ type="button"
89
+ uib-tooltip="{{ 'Assign fieldbus property' | translate }}"
90
+ tooltip-append-to-body="true"
91
+ tooltip-popup-delay="500"
92
+ aria-label="{{ 'Assign fieldbus property' | translate }}"
93
+ ng-click="setFieldbusMapping(mapping)"
94
+ >
95
+ <i c8y-icon="tasks"></i>
96
+ </button>
97
+ <button
98
+ class="btn btn-default btn-sm"
99
+ type="button"
100
+ uib-tooltip="{{ 'Assign device property' | translate }}"
101
+ tooltip-append-to-body="true"
102
+ tooltip-popup-delay="500"
103
+ aria-label="{{ 'Assign device property' | translate }}"
104
+ ng-click="setMapping(mapping)"
105
+ >
106
+ <i c8y-icon="edit"></i>
107
+ </button>
108
+ </div>
107
109
  </div>
108
110
  </div>
109
111
  </div>
110
112
  </div>
111
113
  </li>
112
114
  </ul>
113
- </div>
115
+ </fieldset>
@@ -1 +1 @@
1
- (()=>{function n(n,e,o,c,t,l,r,u){var i=[],a={loading:!0};function s(){a.loading=!1}function f(n){return _.filter(n,function(n){return!n.hideFromList})}function h(n){var t,e=_.keys(l);return 0===e.length?n:_.filter(n,function(n){return!!(n.contexts&&(t=_.keys(n.contexts),0<_.intersection(e,t).length))})}function m(n){return _.filter(n,function(n){return!r||r(n)})}function d(n){n.forEach(function(n){i.push(n)})}function g(){1===i.length&&i[0]._active&&v(i[0])}function v(n){var t,r,i;return t=n._active?c.createInstanceWithUI(n,(i={},n=(r=n).contexts&&_.intersection(_.keys(l),_.keys(r.contexts))||[],_.forEach(n,function(n){var e={obj:l[n]},c={rule:i};_.forEach(r.contexts[n],function(n,t){t=o("obj.".concat(t)),n=o("rule.".concat(n)),t=t(e);null!=t&&n.assign(c,t)})}),_.assign(i,u))).then(e.close):t}n.ruleTemplates=i,n.cancel=function(){e.dismiss()},n.createInstance=v,n.loading=a,t.list().then(f).then(h).then(m).then(d).then(g).finally(s)}n.$inject=["$scope","$uibModalInstance","$parse","smartRulesSvc","smartRuleTemplatesSvc","context","ruleTemplatesFilterFn","ruleInitialObj"],angular.module("c8y.smartRules").controller("SmartRuleAddCtrl",n)})();
1
+ (()=>{function n(n,e,o,c,t,l,r,u){var i=[],a={loading:!0};function s(){a.loading=!1}function f(n){return _.filter(n,function(n){return!n.hideFromList})}function h(n){var t,e=_.keys(l);return 0===e.length?n:_.filter(n,function(n){return!!(n.contexts&&(t=_.keys(n.contexts),0<_.intersection(e,t).length))})}function g(n){return _.filter(n,function(n){return!r||r(n)})}function m(n){n.forEach(function(n){i.push(n)})}function d(){1===i.length&&i[0]._active&&v(i[0])}function v(n){var t,r,i;return t=n._active?c.createInstanceWithUI(n,(i={},n=(r=n).contexts&&_.intersection(_.keys(l),_.keys(r.contexts))||[],_.forEach(n,function(n){var e={obj:l[n]},c={rule:i};_.forEach(r.contexts[n],function(n,t){t=o("obj.".concat(t)),n=o("rule.".concat(n)),t=t(e);null!=t&&n.assign(c,t)})}),_.assign(i,u))).then(e.close):t}n.ruleTemplates=i,n.cancel=function(){e.dismiss()},n.createInstance=v,n.loading=a,n.icon=c.getRuleIcon(),t.list().then(f).then(h).then(g).then(m).then(d).finally(s)}n.$inject=["$scope","$uibModalInstance","$parse","smartRulesSvc","smartRuleTemplatesSvc","context","ruleTemplatesFilterFn","ruleInitialObj"],angular.module("c8y.smartRules").controller("SmartRuleAddCtrl",n)})();
@@ -1 +1 @@
1
- (()=>{function e(i,r,e,o,t,n,a,P,c,u,l,s,d,f,h,g,m,v){var p,S=r.deviceId||r.groupId,C={},A={},R={done:!1,inProgress:!1},y={true:{text:m("Enabled`rule`"),icon:"check-circle",cls:"text-success"},false:{text:m("Disabled`rule`"),icon:"ban",cls:"text-danger"}},x=s.getContext(),E=m("Global smart rules");function b(){return o.when().then(T).then(k).then(D).then(w).then(I).catch(j)}function T(){R.inProgress=!0}function I(){R.inProgress=!1,R.done=!0,R.error=!1}function j(e){e.data&&e.data.message&&l.danger(e.data.message),R.inProgress=!1,R.done=!0,R.error=!0}function k(){return h.list().then($)}function $(e){_.forEach(e||[],function(e){C[e.name]=e})}function D(){var e=S?g.listByContext(S):o.resolve([]),t=f.hasPermissions().then(function(e){return e?g.list():o.when([])});return o.all({listByContext:e,list:t}).then(function(e){i.rules=(e=>{var t=e;return t=S?_.reject(e,(e=>{var n=new RegExp("".concat(e,"/dashboard"));return function(e){var t=_.get(e,"config.url","");return N(e)&&!n.test(t)}})(S)):t})(_.concat(e.listByContext,e.list))})}function N(e){return"sendDashboardsViaEmail"===e.ruleTemplateName}function O(e){return g.hasSource(e,S)}function w(){var e,t;return!(Array.isArray(i.rules)&&0<i.rules.length)||null===(t=s.getContext()).context?o.resolve():(e=a.childAssets(t.id,{skipDetail:!0,params:{pageSize:2e3,withChildren:!1}}),t=a.childDevices(t.id,{params:{pageSize:2e3,withChildren:!1}}),o.all([e,t]).then(_.flatten).then(function(e){i.children=e}).then(function(){i.ruleChildren={},_.forEach(i.rules,function(e){i.ruleChildren[e.id]=M(e)})}))}function M(t){return _.filter(i.children,function(e){return g.hasSource(t,e)})}function U(e){var t=_.get(C,"".concat(_.get(e,"ruleTemplateName"),"._active")),n=A.canAddRules;return e&&!t&&(n=!1),_.isUndefined(n)&&(e=i.context?c.isAllowed({adminMOs:[i.context.id]}):o.all({isAllowedInventory:c.isAllowed({anyRole:["ROLE_INVENTORY_ADMIN","ROLE_MANAGED_OBJECT_ADMIN"]}),isAllowedSmartRules:c.isAllowed({anyRole:["ROLE_SMARTRULE_ADMIN","ROLE_CEP_MANAGEMENT_ADMIN"]})}).then(function(e){return e.isAllowedInventory&&e.isAllowedSmartRules}),A.canAddRules=e.then(function(e){return A.canAddRules=e,A.canAddRules}),n=!1),n}function G(t){A.rules=A.rules||{};var n=A.rules,e=n[t.id];return _.isUndefined(e)&&(n[t.id]=c.isAllowed({adminMOs:[t.id]}).then(function(e){return n[t.id]=e,n[t.id]}),e=!1),e}function L(e){var t=!0;return t=x.context!==s.CONTEXT.DEVICE&&x.context!==s.CONTEXT.GROUP?t:t&&e&&"c8y_SmartRule"!==e.type}_.assign(i,{isOpen:{},moId:S,loadingStatus:R,refresh:b,paging:{refresh:b},ruleTemplates:C,getLinkToDM:function(){var e={deviceId:S};return t(p||"")(e)},add:function(){g.addNewWithUI().then(b)},edit:function(e){g.editWithUI(e).then(b)},clone:function(e){var t=e&&e.c8y_Context&&e.c8y_Context.id;(t?g.cloneWithUI(e,t,!0):g.cloneWithUI(e)).then(b)},remove:function(e){u({title:m("Delete smart rule"),body:v.getString('You are about to delete smart rule "{{name}}". Do you want to proceed?',e),labels:{ok:m("Delete")},status:"danger"}).then(angular.bind(g,g.remove,e)).then(function(){return _.pull(i.rules,e)}).then(function(){return l.success(m("Smart rule deleted."))})},hasSource:O,getChildrenEnabledForSmartRule:M,toggleRuleActivationForContextMO:function(e){if(O(e))return g.deactivate(e,S,!1).then(function(){l.success(v.getString('Smart rule "{{name}}" deactivated.',e))});return g.activate(e,S,!1).then(function(){l.success(v.getString('Smart rule "{{name}}" activated.',e))})},toggleRuleActivationForChildrenMOs:function(e,n){var t=_.filter(n,function(t){return!_.find(i.ruleChildren[e.id],function(e){return e.id===t.id})}),r=_.filter(i.ruleChildren[e.id],function(t){return!_.find(n,function(e){return t.id===e.id})});return g.updateSources(e,t,r,!1).then(D).then(w).then(function(){l.success(v.getString('Smart rule "{{name}}" activated/deactivated for children.',e))})},tooltip:function(e){var t={activate:{"for group":m("Activate for this group"),"for device":m("Activate for this device"),"for object":m("Activate for this object")},deactivate:{"for group":m("Deactivate for this group"),"for device":m("Deactivate for this device"),"for object":m("Deactivate for this object")}},e=e.enabled&&O(e)?"deactivate":"activate",n=r.groupId?s.CONTEXT.GROUP:"object";return n=r.deviceId?s.CONTEXT.DEVICE:n,t[e]["for ".concat(n)]},type:function(e){var t,e=C[e.ruleTemplateName];e&&(t=e.label.full?v.getString(e.label.full):"".concat(v.getString(e.label.input)," ").concat(v.getString(e.label.output)));return t},status:function(e){return y[e.enabled].text},statusIcon:function(e){return y[e.enabled].icon},statusClass:function(e){return y[e.enabled].cls},showTitle:function(){return null!==s.getContext().context},title:E,context:x,inputIcon:function(e){var t,e=C[e.ruleTemplateName];e&&(t=e.paramGroups.input.icon);return t},outputIcon:function(e){var t,e=C[e.ruleTemplateName];e&&(t=e.paramGroups.output.icon);return t},canAddRules:U,canDuplicate:function(e){return U(e)&&L(e)},canEdit:function(e){return G(e)&&L(e)},canRemove:G,canModify:G,canApplyOnChildren:function(e){return!N(e)},canSeeSection:function(){var e=A.canSeeSection;_.isUndefined(e)&&(A.canSeeSection=(n.checkIfModulesExist(["c8y.cockpit.config"])?f.shouldShowLocalSmartRules():o.when(!1)).then(function(e){return A.canSeeSection=e,A.canSeeSection}),e=!1);return e},isConfigurationGlobalSmartRulesContext:void 0,getRuleCardTitle:function(e){return"c8y_SmartRule"===e.type?m("Global smart rule"):m("Local smart rule")}}),i.isConfigurationGlobalSmartRulesContext=e.path().includes("/rules"),b(),null===s.getContext().context&&d.changeTitle({title:E}),x.context===s.CONTEXT.DEVICE&&n.getStaticLinkTemplate("devicemanagementDeviceDetails").then(function(e){p=e})}e.$inject=["$scope","$routeParams","$location","$q","$interpolate","c8yBase","c8yInventory","c8yApplication","c8yPermissions","c8yModal","c8yAlert","c8yUiUtil","c8yTitle","c8ySmartRulesAvailability","smartRuleTemplatesSvc","smartRulesSvc","gettext","gettextCatalog"],angular.module("c8y.smartRules").controller("SmartRulesListCtrl",e)})();
1
+ (()=>{function e(i,r,e,o,t,n,a,P,c,u,l,s,d,f,h,g,m,v){var p,S=r.deviceId||r.groupId,C={},R={},A={done:!1,inProgress:!1},y={true:{text:m("Enabled`rule`"),icon:"check-circle",cls:"text-success"},false:{text:m("Disabled`rule`"),icon:"ban",cls:"text-danger"}},x=s.getContext(),E=m("Global smart rules");function b(){return o.when().then(I).then(k).then(D).then(w).then(T).catch(j)}function I(){A.inProgress=!0}function T(){A.inProgress=!1,A.done=!0,A.error=!1}function j(e){e.data&&e.data.message&&l.danger(e.data.message),A.inProgress=!1,A.done=!0,A.error=!0}function k(){return h.list().then($)}function $(e){_.forEach(e||[],function(e){C[e.name]=e})}function D(){var e=S?g.listByContext(S):o.resolve([]),t=f.hasPermissions().then(function(e){return e?g.list():o.when([])});return o.all({listByContext:e,list:t}).then(function(e){i.rules=(e=>{var t=e;return t=S?_.reject(e,(e=>{var n=new RegExp("".concat(e,"/dashboard"));return function(e){var t=_.get(e,"config.url","");return N(e)&&!n.test(t)}})(S)):t})(_.concat(e.listByContext,e.list))})}function N(e){return"sendDashboardsViaEmail"===e.ruleTemplateName}function O(e){return g.hasSource(e,S)}function w(){var e,t;return!(Array.isArray(i.rules)&&0<i.rules.length)||null===(t=s.getContext()).context?o.resolve():(e=a.childAssets(t.id,{skipDetail:!0,params:{pageSize:2e3,withChildren:!1}}),t=a.childDevices(t.id,{params:{pageSize:2e3,withChildren:!1}}),o.all([e,t]).then(_.flatten).then(function(e){i.children=e}).then(function(){i.ruleChildren={},_.forEach(i.rules,function(e){i.ruleChildren[e.id]=M(e)})}))}function M(t){return _.filter(i.children,function(e){return g.hasSource(t,e)})}function U(e){var t=_.get(C,"".concat(_.get(e,"ruleTemplateName"),"._active")),n=R.canAddRules;return e&&!t&&(n=!1),_.isUndefined(n)&&(e=i.context?c.isAllowed({adminMOs:[i.context.id]}):o.all({isAllowedInventory:c.isAllowed({anyRole:["ROLE_INVENTORY_ADMIN","ROLE_MANAGED_OBJECT_ADMIN"]}),isAllowedSmartRules:c.isAllowed({anyRole:["ROLE_SMARTRULE_ADMIN","ROLE_CEP_MANAGEMENT_ADMIN"]})}).then(function(e){return e.isAllowedInventory&&e.isAllowedSmartRules}),R.canAddRules=e.then(function(e){return R.canAddRules=e,R.canAddRules}),n=!1),n}function G(t){R.rules=R.rules||{};var n=R.rules,e=n[t.id];return _.isUndefined(e)&&(n[t.id]=c.isAllowed({adminMOs:[t.id]}).then(function(e){return n[t.id]=e,n[t.id]}),e=!1),e}function L(e){var t=!0;return t=x.context!==s.CONTEXT.DEVICE&&x.context!==s.CONTEXT.GROUP?t:t&&e&&"c8y_SmartRule"!==e.type}_.assign(i,{isOpen:{},moId:S,loadingStatus:A,refresh:b,paging:{refresh:b},ruleTemplates:C,getLinkToDM:function(){var e={deviceId:S};return t(p||"")(e)},add:function(){g.addNewWithUI().then(b)},edit:function(e){g.editWithUI(e).then(b)},clone:function(e){var t=e&&e.c8y_Context&&e.c8y_Context.id;(t?g.cloneWithUI(e,t,!0):g.cloneWithUI(e)).then(b)},remove:function(e){u({title:m("Delete smart rule"),body:v.getString('You are about to delete smart rule "{{name}}". Do you want to proceed?',e),labels:{ok:m("Delete")},status:"danger"}).then(angular.bind(g,g.remove,e)).then(function(){return _.pull(i.rules,e)}).then(function(){return l.success(m("Smart rule deleted."))})},hasSource:O,getChildrenEnabledForSmartRule:M,toggleRuleActivationForContextMO:function(e){if(O(e))return g.deactivate(e,S,!1).then(function(){l.success(v.getString('Smart rule "{{name}}" deactivated.',e))});return g.activate(e,S,!1).then(function(){l.success(v.getString('Smart rule "{{name}}" activated.',e))})},toggleRuleActivationForChildrenMOs:function(e,n){var t=_.filter(n,function(t){return!_.find(i.ruleChildren[e.id],function(e){return e.id===t.id})}),r=_.filter(i.ruleChildren[e.id],function(t){return!_.find(n,function(e){return t.id===e.id})});return g.updateSources(e,t,r,!1).then(D).then(w).then(function(){l.success(v.getString('Smart rule "{{name}}" activated/deactivated for children.',e))})},tooltip:function(e){var t={activate:{"for group":m("Activate for this group"),"for device":m("Activate for this device"),"for object":m("Activate for this object")},deactivate:{"for group":m("Deactivate for this group"),"for device":m("Deactivate for this device"),"for object":m("Deactivate for this object")}},e=e.enabled&&O(e)?"deactivate":"activate",n=r.groupId?s.CONTEXT.GROUP:"object";return n=r.deviceId?s.CONTEXT.DEVICE:n,t[e]["for ".concat(n)]},type:function(e){var t,e=C[e.ruleTemplateName];e&&(t=e.label.full?v.getString(e.label.full):"".concat(v.getString(e.label.input)," ").concat(v.getString(e.label.output)));return t},status:function(e){return y[e.enabled].text},statusIcon:function(e){return y[e.enabled].icon},statusClass:function(e){return y[e.enabled].cls},showTitle:function(){return null!==s.getContext().context},title:E,context:x,inputIcon:function(e){var t,e=C[e.ruleTemplateName];e&&(t=e.paramGroups.input.icon);return t},outputIcon:function(e){var t,e=C[e.ruleTemplateName];e&&(t=e.paramGroups.output.icon);return t},canAddRules:U,canDuplicate:function(e){return U(e)&&L(e)},canEdit:function(e){return G(e)&&L(e)},canRemove:G,canModify:G,canApplyOnChildren:function(e){return!N(e)},canSeeSection:function(){var e=R.canSeeSection;_.isUndefined(e)&&(R.canSeeSection=(n.checkIfModulesExist(["c8y.cockpit.config"])?f.shouldShowLocalSmartRules():o.when(!1)).then(function(e){return R.canSeeSection=e,R.canSeeSection}),e=!1);return e},isConfigurationGlobalSmartRulesContext:void 0,getRuleCardTitle:function(e){return"c8y_SmartRule"===e.type?m("Global smart rule"):m("Local smart rule")},getRuleIcon:function(e){return g.getRuleIcon(e)}}),i.isConfigurationGlobalSmartRulesContext=e.path().includes("/rules"),b(),null===s.getContext().context&&d.changeTitle({title:E}),x.context===s.CONTEXT.DEVICE&&n.getStaticLinkTemplate("devicemanagementDeviceDetails").then(function(e){p=e})}e.$inject=["$scope","$routeParams","$location","$q","$interpolate","c8yBase","c8yInventory","c8yApplication","c8yPermissions","c8yModal","c8yAlert","c8yUiUtil","c8yTitle","c8ySmartRulesAvailability","smartRuleTemplatesSvc","smartRulesSvc","gettext","gettextCatalog"],angular.module("c8y.smartRules").controller("SmartRulesListCtrl",e)})();
@@ -1 +1 @@
1
- (()=>{function e(e,r,i,t,n,o,c,a,u,l,s,d,f,h){var m=this,v={},g={},p={done:!1,inProgress:!1},A={true:{text:f("Active`rule`"),icon:"check-circle",cls:"text-success"},false:{text:f("Inactive`rule`"),icon:"ban",cls:"text-warning"}};function R(){return i.when().then(S).then(x).then(b).then(N).then(C).catch(E)}function S(){p.inProgress=!0}function C(){p.inProgress=!1,p.done=!0,p.error=!1}function E(e){e.data&&e.data.message&&a.danger(e.data.message),p.inProgress=!1,p.done=!0,p.error=!0}function x(){return s.list().then(y)}function y(e){_.forEach(e,function(e){v[e.name]=e})}function b(){var e=m.mo?d.listByContext(m.mo):i.resolve([]),t=l.hasPermissions().then(function(e){return e?d.list():i.when([])});return i.all({listByContext:e,list:t}).then(function(e){m.rules=(e=>(m.mo&&(e=_.reject(e,(e=>{var n=new RegExp("".concat(e,"/dashboard"));return function(e){var t=_.get(e,"config.url","");return I(e)&&!n.test(t)}})(m.mo))),e=m.filter?_.filter(e,m.filter):e))(_.concat(e.listByContext,e.list)),"function"==typeof m.onRules&&m.onRules()(m.rules)})}function I(e){return"sendDashboardsViaEmail"===e.ruleTemplateName}function T(e){return d.hasSource(e,m.mo)}function N(){var e,t;return Array.isArray(m.rules)&&0<m.rules.length&&(e=u.getContext(),t=(e=>(e=e.id,m.mo?_.get(m,"mo.id")||m.mo:e))(e),null!==e.context)?n.childAssets(t,{skipDetail:!0,params:{pageSize:2e3,withChildren:!1}}).then(function(e){m.children=e}).then(function(){m.ruleChildren={},_.forEach(m.rules,function(e){m.ruleChildren[e.id]=O(e)})}):i.resolve()}function O(t){return _.filter(m.children,function(e){return t.enabled&&d.hasSource(t,e)})}function w(){var e,t=g.canAddRules;return _.isUndefined(t)&&(e=m.context?c.isAllowed({adminMOs:[m.context.id]}):i.all({isAllowedInventory:c.isAllowed({anyRole:["ROLE_INVENTORY_ADMIN","ROLE_MANAGED_OBJECT_ADMIN"]}),isAllowedSmartRules:c.isAllowed({anyRole:["ROLE_SMARTRULE_ADMIN","ROLE_CEP_MANAGEMENT_ADMIN"]})}).then(function(e){return e.isAllowedInventory&&e.isAllowedSmartRules}),g.canAddRules=e.then(function(e){return g.canAddRules=e,g.canAddRules}),t=!1),t}function D(t){g.rules=g.rules||{};var n=g.rules,e=n[t.id];return _.isUndefined(e)&&(n[t.id]=c.isAllowed({adminMOs:[t.id]}).then(function(e){return n[t.id]=e,n[t.id]}),e=!1),e}function M(e){var t=!0;return t=m.context.context!==u.CONTEXT.DEVICE&&m.context.context!==u.CONTEXT.GROUP&&m.context.context!==u.CONTEXT.APPLICATION&&"ecosystem/microservice/microservices"!==m.context.context?t:t&&e&&"c8y_SmartRule"!==e.type}_.assign(m,{ruleTemplates:v,loadingStatus:p,isOpen:{},listClass:"interact-list",$onInit:function(){m.context=u.getContext(),e.$on("smartRulesListReload",R),R()},add:function(){d.addNewWithUI().then(R)},edit:function(e){d.editWithUI(e,m.mo).then(R)},clone:function(e){d.cloneWithUI(e,m.mo).then(R)},remove:function(e){t({title:f("Delete smart rule"),body:h.getString('You are about to delete smart rule "{{name}}". Do you want to proceed?',e),status:"danger",labels:{ok:f("Delete")}}).then(d.remove.bind(d,e)).then(function(){return _.pull(m.rules,e)}).then(function(){return a.success(f("Smart rule deleted."))})},hasSource:T,getChildrenEnabledForSmartRule:O,toggleRuleActivationForContextMO:function(e){if(e.enabled&&T(e))return d.deactivate(e,m.mo,!1).then(function(){a.success(h.getString('Smart rule "{{name}}" deactivated.',e))});return d.activate(e,m.mo,!1).then(function(){a.success(h.getString('Smart rule "{{name}}" activated.',e))})},toggleRuleActivationForChildrenMOs:function(t,n){var r=[];return _.forEach(n,function(e){_.find(m.ruleChildren[t.id],{id:e.id})||r.push(d.activate(t,e,!1))}),_.forEach(m.ruleChildren[t.id],function(e){_.find(n,{id:e.id})||r.push(d.deactivate(t,e,!1))}),i.all(r).then(b).then(N).then(function(){a.success(h.getString('Smart rule "{{name}}" activated/deactivated for children.',t))})},tooltip:function(e){var t,n={activate:{"for group":f("Activate for this group."),"for device":f("Activate for this device."),"for object":f("Activate for this object.")},deactivate:{"for group":f("Deactivate for this group."),"for device":f("Deactivate for this device."),"for object":f("Deactivate for this object.")}},e=e.enabled&&T(e)?"deactivate":"activate";t=r.deviceId?u.CONTEXT.DEVICE:r.groupId?u.CONTEXT.GROUP:"object";return n[e]["for ".concat(t)]},type:function(e){var t,e=v[e.ruleTemplateName];e&&(t=e.label.full?h.getString(e.label.full):"".concat(h.getString(e.label.input)," ").concat(h.getString(e.label.output)));return t},status:function(e){e=e.enabled&&T(e);return A[e].text},statusIcon:function(e){e=e.enabled&&T(e);return A[e].icon},statusClass:function(e){e=e.enabled&&T(e);return A[e].cls},context:u.getContext(),inputIcon:function(e){var t,e=v[e.ruleTemplateName];e&&(t=e.paramGroups.input.icon);return t},outputIcon:function(e){var t,e=v[e.ruleTemplateName];e&&(t=e.paramGroups.output.icon);return t},canDuplicate:function(e){return w()&&M(e)},canEdit:function(e){return D(e)&&M(e)},canRemove:D,canAddRules:w,canModify:D,canApplyOnChildren:function(e){return!I(e)},canSeeSection:function(){var e=g.canSeeSection;_.isUndefined(e)&&(g.canSeeSection=l.shouldShowLocalSmartRules().then(function(e){return g.canSeeSection=e,g.canSeeSection}),e=!1);return e}}),_.assign(e,{refresh:R,paging:{refresh:R}})}e.$inject=["$scope","$routeParams","$q","c8yModal","c8yInventory","c8yApplication","c8yPermissions","c8yAlert","c8yUiUtil","c8ySmartRulesAvailability","smartRuleTemplatesSvc","smartRulesSvc","gettext","gettextCatalog"],angular.module("c8y.smartRules").component("smartRulesList",{bindings:{mo:"<?",filter:"<?",disableEditAndCreate:"<?",onRules:"&?"},templateUrl:":::PLUGIN_PATH:::/list/smartRulesList.html",controller:e,controllerAs:"vm"})})();
1
+ (()=>{function e(e,r,i,t,n,o,c,a,u,l,s,d,f,h){var m=this,v={},g={},p={done:!1,inProgress:!1},A={true:{text:f("Active`rule`"),icon:"check-circle",cls:"text-success"},false:{text:f("Inactive`rule`"),icon:"ban",cls:"text-warning"}};function R(){return i.when().then(S).then(x).then(b).then(N).then(C).catch(E)}function S(){p.inProgress=!0}function C(){p.inProgress=!1,p.done=!0,p.error=!1}function E(e){e.data&&e.data.message&&a.danger(e.data.message),p.inProgress=!1,p.done=!0,p.error=!0}function x(){return s.list().then(y)}function y(e){_.forEach(e,function(e){v[e.name]=e})}function b(){var e=m.mo?d.listByContext(m.mo):i.resolve([]),t=l.hasPermissions().then(function(e){return e?d.list():i.when([])});return i.all({listByContext:e,list:t}).then(function(e){m.rules=(e=>(m.mo&&(e=_.reject(e,(e=>{var n=new RegExp("".concat(e,"/dashboard"));return function(e){var t=_.get(e,"config.url","");return I(e)&&!n.test(t)}})(m.mo))),e=m.filter?_.filter(e,m.filter):e))(_.concat(e.listByContext,e.list)),"function"==typeof m.onRules&&m.onRules()(m.rules)})}function I(e){return"sendDashboardsViaEmail"===e.ruleTemplateName}function T(e){return d.hasSource(e,m.mo)}function N(){var e,t;return Array.isArray(m.rules)&&0<m.rules.length&&(e=u.getContext(),t=(e=>(e=e.id,m.mo?_.get(m,"mo.id")||m.mo:e))(e),null!==e.context)?n.childAssets(t,{skipDetail:!0,params:{pageSize:2e3,withChildren:!1}}).then(function(e){m.children=e}).then(function(){m.ruleChildren={},_.forEach(m.rules,function(e){m.ruleChildren[e.id]=O(e)})}):i.resolve()}function O(t){return _.filter(m.children,function(e){return t.enabled&&d.hasSource(t,e)})}function w(){var e,t=g.canAddRules;return _.isUndefined(t)&&(e=m.context?c.isAllowed({adminMOs:[m.context.id]}):i.all({isAllowedInventory:c.isAllowed({anyRole:["ROLE_INVENTORY_ADMIN","ROLE_MANAGED_OBJECT_ADMIN"]}),isAllowedSmartRules:c.isAllowed({anyRole:["ROLE_SMARTRULE_ADMIN","ROLE_CEP_MANAGEMENT_ADMIN"]})}).then(function(e){return e.isAllowedInventory&&e.isAllowedSmartRules}),g.canAddRules=e.then(function(e){return g.canAddRules=e,g.canAddRules}),t=!1),t}function D(t){g.rules=g.rules||{};var n=g.rules,e=n[t.id];return _.isUndefined(e)&&(n[t.id]=c.isAllowed({adminMOs:[t.id]}).then(function(e){return n[t.id]=e,n[t.id]}),e=!1),e}function M(e){var t=!0;return t=m.context.context!==u.CONTEXT.DEVICE&&m.context.context!==u.CONTEXT.GROUP&&m.context.context!==u.CONTEXT.APPLICATION&&"ecosystem/microservice/microservices"!==m.context.context?t:t&&e&&"c8y_SmartRule"!==e.type}_.assign(m,{ruleTemplates:v,loadingStatus:p,isOpen:{},listClass:"interact-list",$onInit:function(){m.context=u.getContext(),e.$on("smartRulesListReload",R),R()},add:function(){d.addNewWithUI().then(R)},edit:function(e){d.editWithUI(e,m.mo).then(R)},clone:function(e){d.cloneWithUI(e,m.mo).then(R)},remove:function(e){t({title:f("Delete smart rule"),body:h.getString('You are about to delete smart rule "{{name}}". Do you want to proceed?',e),status:"danger",labels:{ok:f("Delete")}}).then(d.remove.bind(d,e)).then(function(){return _.pull(m.rules,e)}).then(function(){return a.success(f("Smart rule deleted."))})},hasSource:T,getChildrenEnabledForSmartRule:O,toggleRuleActivationForContextMO:function(e){if(e.enabled&&T(e))return d.deactivate(e,m.mo,!1).then(function(){a.success(h.getString('Smart rule "{{name}}" deactivated.',e))});return d.activate(e,m.mo,!1).then(function(){a.success(h.getString('Smart rule "{{name}}" activated.',e))})},toggleRuleActivationForChildrenMOs:function(t,n){var r=[];return _.forEach(n,function(e){_.find(m.ruleChildren[t.id],{id:e.id})||r.push(d.activate(t,e,!1))}),_.forEach(m.ruleChildren[t.id],function(e){_.find(n,{id:e.id})||r.push(d.deactivate(t,e,!1))}),i.all(r).then(b).then(N).then(function(){a.success(h.getString('Smart rule "{{name}}" activated/deactivated for children.',t))})},tooltip:function(e){var t,n={activate:{"for group":f("Activate for this group."),"for device":f("Activate for this device."),"for object":f("Activate for this object.")},deactivate:{"for group":f("Deactivate for this group."),"for device":f("Deactivate for this device."),"for object":f("Deactivate for this object.")}},e=e.enabled&&T(e)?"deactivate":"activate";t=r.deviceId?u.CONTEXT.DEVICE:r.groupId?u.CONTEXT.GROUP:"object";return n[e]["for ".concat(t)]},type:function(e){var t,e=v[e.ruleTemplateName];e&&(t=e.label.full?h.getString(e.label.full):"".concat(h.getString(e.label.input)," ").concat(h.getString(e.label.output)));return t},status:function(e){e=e.enabled&&T(e);return A[e].text},statusIcon:function(e){e=e.enabled&&T(e);return A[e].icon},statusClass:function(e){e=e.enabled&&T(e);return A[e].cls},context:u.getContext(),inputIcon:function(e){var t,e=v[e.ruleTemplateName];e&&(t=e.paramGroups.input.icon);return t},outputIcon:function(e){var t,e=v[e.ruleTemplateName];e&&(t=e.paramGroups.output.icon);return t},canDuplicate:function(e){return w()&&M(e)},canEdit:function(e){return D(e)&&M(e)},canRemove:D,canAddRules:w,canModify:D,canApplyOnChildren:function(e){return!I(e)},canSeeSection:function(){var e=g.canSeeSection;_.isUndefined(e)&&(g.canSeeSection=l.shouldShowLocalSmartRules().then(function(e){return g.canSeeSection=e,g.canSeeSection}),e=!1);return e},getRuleIcon:function(e){return d.getRuleIcon(e)}}),_.assign(e,{refresh:R,paging:{refresh:R}})}e.$inject=["$scope","$routeParams","$q","c8yModal","c8yInventory","c8yApplication","c8yPermissions","c8yAlert","c8yUiUtil","c8ySmartRulesAvailability","smartRuleTemplatesSvc","smartRulesSvc","gettext","gettextCatalog"],angular.module("c8y.smartRules").component("smartRulesList",{bindings:{mo:"<?",filter:"<?",disableEditAndCreate:"<?",onRules:"&?"},templateUrl:":::PLUGIN_PATH:::/list/smartRulesList.html",controller:e,controllerAs:"vm"})})();
@@ -239,7 +239,7 @@
239
239
  ng-if="rule.type !== 'c8y_SmartRule'"
240
240
  >
241
241
  <i
242
- c8y-icon="user-account"
242
+ c8y-icon="{{::vm.getRuleIcon(rule)}}"
243
243
  uib-tooltip="{{ 'Local smart rule' | translate }}"
244
244
  tooltip-append-to-body="true"
245
245
  ></i>
@@ -249,7 +249,7 @@
249
249
  ng-if="rule.type === 'c8y_SmartRule'"
250
250
  >
251
251
  <i
252
- c8y-icon="people"
252
+ c8y-icon="{{::vm.getRuleIcon(rule)}}"
253
253
  uib-tooltip="{{ 'Global smart rule' | translate }}"
254
254
  tooltip-append-to-body="true"
255
255
  ></i>
@@ -1 +1 @@
1
- (()=>{function e(o,r,u,i,n,a,c,l,t,d,s){var f=u.url("service/smartrule"),h="".concat(f,"/smartrules"),m=["id","self","cepModuleId","lastUpdated","creationTime"],p=["type","cepModuleId","creationTime","lastUpdated"];return{permissionsCfgs:{create:[{anyRole:["ROLE_INVENTORY_ADMIN","ROLE_INVENTORY_CREATE","ROLE_MANAGED_OBJECT_ADMIN","ROLE_MANAGED_OBJECT_CREATE"]},{anyRole:["ROLE_CEP_MANAGEMENT_ADMIN","ROLE_SMARTRULE_ADMIN"]}]},getEmpty:function(e){var e=e||n.getContext(),t={type:"c8y_SmartRule",name:"",enabled:!0,config:{}};e.context&&e.id&&(t.c8y_Context=e,t.type="c8y_PrivateSmartRule");return t},list:function(){return r.get(h).then(u.getResData).then(_.property("rules")).then(v)},listByContext:function(e){return r.get(g({moId:e})).then(u.getResData).then(_.property("rules")).then(v)},detail:function(e){e=y({id:e});return r.get(e).then(u.getResData)},save:function(e,t,n){e=e.id?S(e):((e,t,n)=>((e,t,n)=>{n.useMoAsContext&&(e.c8y_Context={id:n.mo.id,context:n.mo.isDevice?"device":"group"}),e.ruleTemplateName=t.name,T(e);t=e,e=n,n=o.when(t);return t.c8y_Context||e.mo?(t.enabledSources=[],t.disabledSources=void 0,n=b(t,e.mo,e.withChildren)):(t.enabledSources=void 0,t.disabledSources=[]),n})(e,t,n).then(_.partial(r.post,y(e,!0))).then(u.getResData))(e,t,n);return e},remove:function(e){e=y(e,!0);return r.delete(e)},hasSource:function(e,t){t=t&&t.id||t;if(!t)return!1;if(e.disabledSources)return!A(e.disabledSources,t);if(e.enabledSources)return A(e.enabledSources,t);return!0},activate:function(e,t,n){return b(e,t,n).then(S)},deactivate:function(e,t,n){return R(e,t,n).then(S)},updateSources:function(e,t,r,u){return((e,t,n)=>t.reduce(function(e,t){return e.then(function(e){return b(e,t,n)})},o.resolve(e)))(e,t,u).then(function(e){return n=u,r.reduce(function(e,t){return e.then(function(e){return R(e,t,n)})},o.resolve(e));var n}).then(S)},addNewWithUI:D,addNewForInputAlarmAndOutputUserWithUI:function(e,t){return D({inputAlarm:e,outputUser:t})},addNewForInputDataPointWithUI:function(e){return D({inputDataPoint:e})},addNewForOutputOperationWithUI:function(e){return D({outputOperation:{template:(e=>u.cleanFields(e,["id","self","status","deviceId","creationTime","failureReason"]))(e)}})},createInstanceWithUI:C,createInstanceWithUIByName:function(e,t){return l.getTemplateByName(e).then(function(e){return C(e,t)})},editWithUI:function(e,t){return U(e,void 0,t)},cloneWithUI:function(e,t,n){return c.current().then(_.partial(N,e)).then(function(e){return U(e,void 0,t,n)})},getRuleModalTitle:E};function v(e){return o.all(_.map(e,function(t){return l.getTemplateForRule(t).then(function(e){return _.isUndefined(e)?null:t})})).then(_.flatten).then(_.filter)}function y(e,t){var n=_.get(e,"c8y_Context.id"),t=t&&n?g({moId:n}):h;return e.id&&(t+="/".concat(e.id)),t}function g(e){return"".concat(f,"/managedObjects/").concat(e.moId,"/smartrules")}function S(e){T(e);var t=y(e,!0),e=u.cleanFields(e,p);return r.put(t,e)}function b(n,e,t){return I(e,t).then(function(e){return _.forEach(e,function(t){_.isArray(n.enabledSources)&&!A(n.enabledSources,t)&&n.enabledSources.push(t),_.isArray(n.disabledSources)&&A(n.disabledSources,t)&&_.remove(n.disabledSources,function(e){return _.toString(e)===_.toString(t)})}),n})}function R(n,e,t){return I(e,t).then(function(e){return _.forEach(e,function(t){_.isArray(n.enabledSources)&&A(n.enabledSources,t)&&_.remove(n.enabledSources,function(e){return _.toString(e)===_.toString(t)}),_.isArray(n.disabledSources)&&!A(n.disabledSources,t)&&n.disabledSources.push(t)}),n})}function I(e,t){var e=e&&e.id||e,n=[];return e&&(n.push(o.when(e)),n.push(((e,t)=>{var n=[];return!0!==t&&!0!==t.assets||n.push(i.childAssets(e)),!0!==t&&!0!==t.devices||n.push(i.childDevices(e)),o.all(n).then(_.flattenDeep).then(_.partialRight(_.map,"id"))})(e,t))),o.all(n).then(_.flattenDeep)}function A(e,t){var n=t.id||t;return _.some(e,function(e){return _.toString(e)===_.toString(n)})}function E(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=e.id?"c8y_SmartRule"===e.type?t("Edit global smart rule"):t("Edit local smart rule"):"/rules"===s.path()?t("Add global smart rule"):t("Add local smart rule");return e}function D(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length?arguments[1]:void 0,n=2<arguments.length?arguments[2]:void 0;return a({title:E(),templateUrl:":::PLUGIN_PATH:::/views/add.html",controller:"SmartRuleAddCtrl",ariaLabelledBy:"modal-title",ariaDescribedBy:"modal-body",size:"lg",keyboard:!1,resolve:{context:function(){return _.cloneDeep(e)},ruleInitialObj:function(){return _.cloneDeep(n)},ruleTemplatesFilterFn:function(){return t}}})}function C(e,t){return U(t,e)}function N(e,t){e=_.cloneDeep(e);return(e=u.cleanFields(e,m)).name=d.getString("Duplicate of {{name}}",e),t&&(e.owner=t.id),e}function U(e,t,n,r){return a({templateUrl:":::PLUGIN_PATH:::/views/edit.html",controller:"SmartRuleEditCtrl",size:"sm",keyboard:!1,resolve:{ruleTemplate:function(){return _.cloneDeep(t)},rule:function(){return _.cloneDeep(e)},contextMoId:function(){return _.clone(n)},isCloned:function(){return _.clone(r)}}})}function T(e){e.c8y_Context&&e.c8y_Context.contextData&&delete e.c8y_Context.contextData}}e.$inject=["$q","$http","c8yBase","c8yInventory","c8yUiUtil","c8yModal","c8yUser","smartRuleTemplatesSvc","gettext","gettextCatalog","$location"],angular.module("c8y.smartRules").factory("smartRulesSvc",e)})();
1
+ (()=>{function e(o,r,u,i,n,a,c,l,t,d,s){var f=u.url("service/smartrule"),p="".concat(f,"/smartrules"),m=["id","self","cepModuleId","lastUpdated","creationTime"],h=["type","cepModuleId","creationTime","lastUpdated"];return{permissionsCfgs:{create:[{anyRole:["ROLE_INVENTORY_ADMIN","ROLE_INVENTORY_CREATE","ROLE_MANAGED_OBJECT_ADMIN","ROLE_MANAGED_OBJECT_CREATE"]},{anyRole:["ROLE_CEP_MANAGEMENT_ADMIN","ROLE_SMARTRULE_ADMIN"]}]},getEmpty:function(e){var e=e||n.getContext(),t={type:"c8y_SmartRule",name:"",enabled:!0,config:{}};e.context&&e.id&&(t.c8y_Context=e,t.type="c8y_PrivateSmartRule");return t},list:function(){return r.get(p).then(u.getResData).then(_.property("rules")).then(y)},listByContext:function(e){return r.get(g({moId:e})).then(u.getResData).then(_.property("rules")).then(y)},detail:function(e){e=v({id:e});return r.get(e).then(u.getResData)},save:function(e,t,n){e=e.id?S(e):((e,t,n)=>((e,t,n)=>{n.useMoAsContext&&(e.c8y_Context={id:n.mo.id,context:n.mo.isDevice?"device":"group"}),e.ruleTemplateName=t.name,T(e);t=e,e=n,n=o.when(t);return t.c8y_Context||e.mo?(t.enabledSources=[],t.disabledSources=void 0,n=R(t,e.mo,e.withChildren)):(t.enabledSources=void 0,t.disabledSources=[]),n})(e,t,n).then(_.partial(r.post,v(e,!0))).then(u.getResData))(e,t,n);return e},remove:function(e){e=v(e,!0);return r.delete(e)},hasSource:function(e,t){t=t&&t.id||t;if(!t)return!1;if(e.disabledSources)return!A(e.disabledSources,t);if(e.enabledSources)return A(e.enabledSources,t);return!0},activate:function(e,t,n){return R(e,t,n).then(S)},deactivate:function(e,t,n){return b(e,t,n).then(S)},updateSources:function(e,t,r,u){return((e,t,n)=>t.reduce(function(e,t){return e.then(function(e){return R(e,t,n)})},o.resolve(e)))(e,t,u).then(function(e){return n=u,r.reduce(function(e,t){return e.then(function(e){return b(e,t,n)})},o.resolve(e));var n}).then(S)},addNewWithUI:D,addNewForInputAlarmAndOutputUserWithUI:function(e,t){return D({inputAlarm:e,outputUser:t})},addNewForInputDataPointWithUI:function(e){return D({inputDataPoint:e})},addNewForOutputOperationWithUI:function(e){return D({outputOperation:{template:(e=>u.cleanFields(e,["id","self","status","deviceId","creationTime","failureReason"]))(e)}})},createInstanceWithUI:C,createInstanceWithUIByName:function(e,t){return l.getTemplateByName(e).then(function(e){return C(e,t)})},editWithUI:function(e,t){return U(e,void 0,t)},cloneWithUI:function(e,t,n){return c.current().then(_.partial(N,e)).then(function(e){return U(e,void 0,t,n)})},getRuleModalTitle:E,getRuleIcon:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};e=e.id?"c8y_SmartRule"===e.type?"c8y-smart-rules":"installing-updates":"/rules"===s.path()?"c8y-smart-rules":"installing-updates";return e}};function y(e){return o.all(_.map(e,function(t){return l.getTemplateForRule(t).then(function(e){return _.isUndefined(e)?null:t})})).then(_.flatten).then(_.filter)}function v(e,t){var n=_.get(e,"c8y_Context.id"),t=t&&n?g({moId:n}):p;return e.id&&(t+="/".concat(e.id)),t}function g(e){return"".concat(f,"/managedObjects/").concat(e.moId,"/smartrules")}function S(e){T(e);var t=v(e,!0),e=u.cleanFields(e,h);return r.put(t,e)}function R(n,e,t){return I(e,t).then(function(e){return _.forEach(e,function(t){_.isArray(n.enabledSources)&&!A(n.enabledSources,t)&&n.enabledSources.push(t),_.isArray(n.disabledSources)&&A(n.disabledSources,t)&&_.remove(n.disabledSources,function(e){return _.toString(e)===_.toString(t)})}),n})}function b(n,e,t){return I(e,t).then(function(e){return _.forEach(e,function(t){_.isArray(n.enabledSources)&&A(n.enabledSources,t)&&_.remove(n.enabledSources,function(e){return _.toString(e)===_.toString(t)}),_.isArray(n.disabledSources)&&!A(n.disabledSources,t)&&n.disabledSources.push(t)}),n})}function I(e,t){var e=e&&e.id||e,n=[];return e&&(n.push(o.when(e)),n.push(((e,t)=>{var n=[];return!0!==t&&!0!==t.assets||n.push(i.childAssets(e)),!0!==t&&!0!==t.devices||n.push(i.childDevices(e)),o.all(n).then(_.flattenDeep).then(_.partialRight(_.map,"id"))})(e,t))),o.all(n).then(_.flattenDeep)}function A(e,t){var n=t.id||t;return _.some(e,function(e){return _.toString(e)===_.toString(n)})}function E(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=e.id?"c8y_SmartRule"===e.type?t("Edit global smart rule"):t("Edit local smart rule"):"/rules"===s.path()?t("Add global smart rule"):t("Add local smart rule");return e}function D(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length?arguments[1]:void 0,n=2<arguments.length?arguments[2]:void 0;return a({title:E(),templateUrl:":::PLUGIN_PATH:::/views/add.html",controller:"SmartRuleAddCtrl",ariaLabelledBy:"modal-title",ariaDescribedBy:"modal-body",size:"lg",keyboard:!1,resolve:{context:function(){return _.cloneDeep(e)},ruleInitialObj:function(){return _.cloneDeep(n)},ruleTemplatesFilterFn:function(){return t}}})}function C(e,t){return U(t,e)}function N(e,t){e=_.cloneDeep(e);return(e=u.cleanFields(e,m)).name=d.getString("Duplicate of {{name}}",e),t&&(e.owner=t.id),e}function U(e,t,n,r){return a({templateUrl:":::PLUGIN_PATH:::/views/edit.html",controller:"SmartRuleEditCtrl",size:"sm",keyboard:!1,resolve:{ruleTemplate:function(){return _.cloneDeep(t)},rule:function(){return _.cloneDeep(e)},contextMoId:function(){return _.clone(n)},isCloned:function(){return _.clone(r)}}})}function T(e){e.c8y_Context&&e.c8y_Context.contextData&&delete e.c8y_Context.contextData}}e.$inject=["$q","$http","c8yBase","c8yInventory","c8yUiUtil","c8yModal","c8yUser","smartRuleTemplatesSvc","gettext","gettextCatalog","$location"],angular.module("c8y.smartRules").factory("smartRulesSvc",e)})();