@c8y/ng1-modules 1018.155.0 → 1018.158.0

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.
@@ -1,4 +1,8 @@
1
- <form name="requestTemplateForm" class="d-contents" novalidate>
1
+ <form
2
+ class="d-contents"
3
+ name="requestTemplateForm"
4
+ novalidate
5
+ >
2
6
  <div class="d-flex d-col flex-grow">
3
7
  <div class="card-block">
4
8
  <div class="tight-grid">
@@ -8,8 +12,8 @@
8
12
  <span translate>Message ID</span>
9
13
  <button
10
14
  class="btn-help btn-help--sm"
11
- type="button"
12
15
  aria-label="{{ 'Help' | translate }}"
16
+ type="button"
13
17
  uib-popover="{{
14
18
  'Message template identifier. It must be unique among all message and response templates.'
15
19
  | translate
@@ -20,19 +24,22 @@
20
24
  ></button>
21
25
  </label>
22
26
  <input
27
+ class="form-control"
23
28
  id="msgId"
24
- data-cy="requestEditor--input-msgId"
29
+ placeholder="{{ 'e.g.' | translate }} 10"
25
30
  name="msgId"
26
31
  type="text"
27
- class="form-control"
32
+ required
33
+ data-cy="requestEditor--input-msgId"
28
34
  ng-model="vm.requestTemplate.msgId"
29
35
  c8y-smart-rest-validate-unique-msg-id-in-template="vm.template"
30
36
  original-msg-id="vm.originalMsgId"
31
- placeholder="{{ 'e.g.' | translate }} 10"
32
- required
33
37
  />
34
38
  <c8y-error-feedback field="requestTemplateForm.msgId">
35
- <span ng-message="uniqueMsgIdInTemplate" translate>
39
+ <span
40
+ ng-message="uniqueMsgIdInTemplate"
41
+ translate
42
+ >
36
43
  Message ID must be unique among all message and response templates.
37
44
  </span>
38
45
  </c8y-error-feedback>
@@ -44,8 +51,8 @@
44
51
  <span translate>Name</span>
45
52
  <button
46
53
  class="btn-help"
47
- type="button"
48
54
  aria-label="{{ 'Help' | translate }}"
55
+ type="button"
49
56
  uib-popover="{{
50
57
  'Name is mandatory but has no restricted format or semantics.' | translate
51
58
  }}"
@@ -55,14 +62,14 @@
55
62
  ></button>
56
63
  </label>
57
64
  <input
65
+ class="form-control"
58
66
  id="name"
59
- data-cy="requestEditor--input-name"
67
+ placeholder="{{ 'e.g. My request template' | translate }}"
60
68
  name="name"
61
69
  type="text"
62
- class="form-control"
63
- ng-model="vm.requestTemplate.name"
64
- placeholder="{{ 'e.g. My request template' | translate }}"
65
70
  required
71
+ data-cy="requestEditor--input-name"
72
+ ng-model="vm.requestTemplate.name"
66
73
  />
67
74
  <c8y-error-feedback field="requestTemplateForm.name"></c8y-error-feedback>
68
75
  </div>
@@ -71,17 +78,22 @@
71
78
  <div class="tight-grid">
72
79
  <div class="col-md-6">
73
80
  <div class="form-group">
74
- <label id="target" translate>Target REST API</label>
81
+ <label
82
+ id="target"
83
+ translate
84
+ >
85
+ Target REST API
86
+ </label>
75
87
  <div class="c8y-select-wrapper">
76
88
  <select
77
- name="Target REST API"
78
- aria-labelledby="target"
79
89
  class="form-control"
90
+ aria-labelledby="target"
91
+ name="Target REST API"
92
+ required
80
93
  ng-model="vm.requestTemplate.api"
81
94
  data-cy="requestEditor--rest-api-options"
82
95
  ng-options="api.value as (api.name | translate) for api in vm.apis | orderBy:'name'"
83
96
  ng-change="vm.setupRequestTemplateDefaults(vm.requestTemplate)"
84
- required
85
97
  ></select>
86
98
  <span></span>
87
99
  </div>
@@ -93,17 +105,22 @@
93
105
  </div>
94
106
  <div class="col-md-6">
95
107
  <div class="form-group">
96
- <label id="method" translate>Method</label>
108
+ <label
109
+ id="method"
110
+ translate
111
+ >
112
+ Method
113
+ </label>
97
114
  <div class="c8y-select-wrapper">
98
115
  <select
99
- name="method"
100
- aria-labelledby="method"
101
116
  class="form-control"
117
+ aria-labelledby="method"
118
+ name="method"
119
+ required
102
120
  ng-model="vm.requestTemplate.method"
103
121
  data-cy="requestEditor--method-options"
104
122
  ng-options="method.value as (method.name | translate) for method in vm.getMethodsForAPI(vm.requestTemplate.api)"
105
123
  ng-change="vm.setupRequestTemplateDefaults(vm.requestTemplate)"
106
- required
107
124
  ></select>
108
125
  <span></span>
109
126
  </div>
@@ -116,13 +133,16 @@
116
133
  </div>
117
134
  <div class="form-group">
118
135
  <label class="c8y-checkbox">
119
- <input type="checkbox" ng-model="vm.requestTemplate.response" />
136
+ <input
137
+ type="checkbox"
138
+ ng-model="vm.requestTemplate.response"
139
+ />
120
140
  <span></span>
121
141
  <span>{{ 'Includes response' | translate }}</span>
122
142
  <button
123
143
  class="btn-help"
124
- type="button"
125
144
  aria-label="{{ 'Help' | translate }}"
145
+ type="button"
126
146
  uib-popover="{{
127
147
  'If selected, it will process the result of the request using response templates.'
128
148
  | translate
@@ -138,8 +158,8 @@
138
158
  <span>{{ 'REST API built-in fields' | translate }}</span>
139
159
  <button
140
160
  class="btn-help"
141
- type="button"
142
161
  aria-label="{{ 'Help' | translate }}"
162
+ type="button"
143
163
  uib-popover="{{
144
164
  'In case no value is provided, a device will be able to set it when sending an actual message.'
145
165
  | translate
@@ -149,25 +169,50 @@
149
169
  popover-append-to-body="true"
150
170
  ></button>
151
171
  </div>
152
- <div class="alert alert-warning" ng-if="!vm.apiAndMethodSelected()" translate>
172
+ <div
173
+ class="alert alert-warning"
174
+ ng-if="!vm.apiAndMethodSelected()"
175
+ translate
176
+ >
153
177
  Select API and method above to see required API values.
154
178
  </div>
155
- <div class="alert alert-info" ng-if="vm.noRequiredApiValues()" translate>
179
+ <div
180
+ class="alert alert-info"
181
+ ng-if="vm.noRequiredApiValues()"
182
+ translate
183
+ >
156
184
  No required API values.
157
185
  </div>
158
- <div class="tight-grid" ng-show="vm.shouldShowByIdOrByExternalId()">
186
+ <div
187
+ class="tight-grid"
188
+ ng-show="vm.shouldShowByIdOrByExternalId()"
189
+ >
159
190
  <div class="col-xs-12 form-inline">
160
191
  <div class="form-group">
161
- <label title="{{ 'ID' | translate }}" class="c8y-radio">
162
- <input type="radio" ng-model="vm.requestTemplate.byId" ng-value="true" />
192
+ <label
193
+ class="c8y-radio"
194
+ title="{{ 'ID' | translate }}"
195
+ >
196
+ <input
197
+ type="radio"
198
+ ng-model="vm.requestTemplate.byId"
199
+ ng-value="true"
200
+ />
163
201
  <span></span>
164
202
  <span>{{ 'ID' | translate }}</span>
165
203
  </label>
166
204
  </div>
167
205
 
168
206
  <div class="form-group">
169
- <label title="{{ 'External ID' | translate }}" class="c8y-radio">
170
- <input type="radio" ng-model="vm.requestTemplate.byId" ng-value="false" />
207
+ <label
208
+ class="c8y-radio"
209
+ title="{{ 'External ID' | translate }}"
210
+ >
211
+ <input
212
+ type="radio"
213
+ ng-model="vm.requestTemplate.byId"
214
+ ng-value="false"
215
+ />
171
216
  <span></span>
172
217
  <span>{{ 'External ID' | translate }}</span>
173
218
  </label>
@@ -185,9 +230,9 @@
185
230
  <div class="form-group col-md-6">
186
231
  <label translate>External ID type</label>
187
232
  <input
233
+ class="form-control"
188
234
  name="externalIdType"
189
235
  type="text"
190
- class="form-control"
191
236
  ng-model="vm.requestTemplate.externalIdType"
192
237
  />
193
238
  <c8y-error-feedback field="externalIdTypeForm.externalIdType"></c8y-error-feedback>
@@ -219,8 +264,8 @@
219
264
  <span>{{ 'REST API custom fields' | translate }}</span>
220
265
  <button
221
266
  class="btn-help"
222
- type="button"
223
267
  aria-label="{{ 'Help' | translate }}"
268
+ type="button"
224
269
  uib-popover="{{
225
270
  'A custom fragment can be added to the message. For example, for the measurement API, we could have c8y_Temperature.T.unit - STRING - °C'
226
271
  | translate
@@ -237,7 +282,10 @@
237
282
  >
238
283
  No REST API custom fields. Click below to add the first one.
239
284
  </div>
240
- <div class="tight-grid hidden-sm hidden-xs" ng-show="vm.requestTemplate.customValues > 0">
285
+ <div
286
+ class="tight-grid hidden-sm hidden-xs"
287
+ ng-show="vm.requestTemplate.customValues > 0"
288
+ >
241
289
  <div class="form-group col-md-3">
242
290
  <label translate>Key</label>
243
291
  </div>
@@ -248,27 +296,38 @@
248
296
  <label translate>Value</label>
249
297
  </div>
250
298
  </div>
251
- <div class="tight-grid" ng-repeat="customValue in vm.requestTemplate.customValues">
299
+ <div
300
+ class="tight-grid"
301
+ ng-repeat="customValue in vm.requestTemplate.customValues"
302
+ >
252
303
  <ng-form name="customValueForm">
253
304
  <div class="col-md-5">
254
305
  <div class="form-group">
255
- <label class="visible-sm visible-xs" translate>Key</label>
306
+ <label
307
+ class="visible-sm visible-xs"
308
+ translate
309
+ >
310
+ Key
311
+ </label>
256
312
  <input
313
+ class="form-control"
314
+ placeholder="{{ 'Key' | translate }}"
257
315
  name="path"
258
316
  type="text"
259
- class="form-control"
317
+ required
260
318
  ng-model="customValue.path"
261
- placeholder="{{ 'Key' | translate }}"
262
319
  ng-pattern="vm.validation.jsonPath.pattern"
263
320
  c8y-smart-rest-validate-custom-field-key-in-request-template="vm.requestTemplate"
264
- required
265
321
  />
266
322
  <c8y-error-feedback field="customValueForm.path">
267
323
  <span
268
324
  ng-message="pattern"
269
325
  ng-bind="vm.validation.jsonPath.message | translate"
270
326
  ></span>
271
- <span ng-message="customFieldKey" translate>
327
+ <span
328
+ ng-message="customFieldKey"
329
+ translate
330
+ >
272
331
  Custom key must be different than built-in ones.
273
332
  </span>
274
333
  </c8y-error-feedback>
@@ -276,7 +335,12 @@
276
335
  </div>
277
336
  <div class="col-md-2">
278
337
  <div class="form-group">
279
- <label class="visible-sm visible-xs" translate>Type</label>
338
+ <label
339
+ class="visible-sm visible-xs"
340
+ translate
341
+ >
342
+ Type
343
+ </label>
280
344
  <div class="c8y-select-wrapper">
281
345
  <select
282
346
  class="form-control"
@@ -290,12 +354,17 @@
290
354
  </div>
291
355
  <div class="col-md-4">
292
356
  <div class="form-group">
293
- <label class="visible-sm visible-xs" translate>Value</label>
357
+ <label
358
+ class="visible-sm visible-xs"
359
+ translate
360
+ >
361
+ Value
362
+ </label>
294
363
  <c8y-smart-rest-value-input
295
364
  aria-label="{{ 'Value' | translate }}"
365
+ placeholder="'Value' | translate"
296
366
  name="'customValueInput' + $index"
297
367
  type="customValue.type"
298
- placeholder="'Value' | translate"
299
368
  value="customValue.value"
300
369
  data-required="false"
301
370
  ></c8y-smart-rest-value-input>
@@ -306,19 +375,19 @@
306
375
  <div class="form-group">
307
376
  <button
308
377
  class="btn-dot btn-dot--danger btn hidden-xs hidden-sm"
309
- type="button"
310
378
  aria-label="{{ 'Remove' | translate }}"
311
379
  uib-tooltip="{{ 'Remove' | translate }}"
312
380
  tooltip-trigger="'focus'"
313
381
  tooltip-popup-delay="500"
382
+ type="button"
314
383
  ng-click="vm.removeCustomValue(vm.requestTemplate, customValue); requestTemplateForm.$setDirty()"
315
384
  >
316
385
  <i c8y-icon="minus-circle"></i>
317
386
  </button>
318
387
  <button
319
388
  class="btn btn-danger btn-block btn-sm visible-xs visible-sm"
320
- type="button"
321
389
  title="{{ 'Remove' | translate }}"
390
+ type="button"
322
391
  ng-click="vm.removeCustomValue(vm.requestTemplate, customValue); requestTemplateForm.$setDirty()"
323
392
  >
324
393
  <i c8y-icon="minus-circle"></i>
@@ -330,8 +399,8 @@
330
399
  </div>
331
400
  <button
332
401
  class="btn btn-default m-t-8"
333
- type="button"
334
402
  title="{{ 'Add field' | translate }}"
403
+ type="button"
335
404
  data-cy="requestEditor--add-field-btn"
336
405
  ng-click="vm.addCustomValue(vm.requestTemplate); requestTemplateForm.$setDirty()"
337
406
  >
@@ -340,7 +409,12 @@
340
409
  </button>
341
410
  </fieldset>
342
411
  <fieldset>
343
- <div class="legend form-block" translate>Preview</div>
412
+ <div
413
+ class="legend form-block"
414
+ translate
415
+ >
416
+ Preview
417
+ </div>
344
418
  <code>{{ vm.getPreviews(vm.requestTemplate) }}</code>
345
419
  </fieldset>
346
420
  </div>
@@ -349,16 +423,16 @@
349
423
  <div class="card-footer separator sticky-bottom">
350
424
  <button
351
425
  class="btn btn-default"
352
- type="button"
353
426
  title="{{ 'Cancel' | translate }}"
427
+ type="button"
354
428
  ng-click="vm.cancel()"
355
429
  >
356
430
  {{ 'Cancel' | translate }}
357
431
  </button>
358
432
  <button
359
433
  class="btn btn-danger"
360
- type="button"
361
434
  title="{{ 'Remove' | translate }}"
435
+ type="button"
362
436
  ng-if="vm.originalMsgId"
363
437
  ng-click="vm.remove()"
364
438
  data-cy="requestEditor--remove-msg-btn"
@@ -367,8 +441,8 @@
367
441
  </button>
368
442
  <button
369
443
  class="btn btn-primary"
370
- type="submit"
371
444
  title="{{ 'Save' | translate }}"
445
+ type="submit"
372
446
  ng-click="vm.save()"
373
447
  data-cy="save-message"
374
448
  ng-disabled="requestTemplateForm.$invalid || requestTemplateForm.$pristine"
@@ -1,8 +1,8 @@
1
1
  <div
2
2
  class="panel-default"
3
+ ng-class="{ expanded: vm.isOpen }"
3
4
  uib-accordion-group
4
5
  is-open="vm.isOpen"
5
- ng-class="{ expanded: vm.isOpen }"
6
6
  template-url=":::PLUGIN_PATH:::/tenantPolicyDetail/accordion.html"
7
7
  >
8
8
  <uib-accordion-heading>
@@ -11,9 +11,7 @@
11
11
  <div class="text-label-small">{{ 'Data type' | translate }}</div>
12
12
  <div class="text-truncate">
13
13
  <i c8y-icon="{{ vm.dataTypes[vm.rule.dataType].icon }}"></i>
14
- <span
15
- title="{{ vm.dataTypes[vm.rule.dataType].label | translate }}"
16
- >
14
+ <span title="{{ vm.dataTypes[vm.rule.dataType].label | translate }}">
17
15
  {{ vm.dataTypes[vm.rule.dataType].label | translate }}
18
16
  </span>
19
17
  </div>
@@ -22,7 +20,10 @@
22
20
  <div class="text-label-small">
23
21
  {{ 'Fragment type' | translate }}
24
22
  </div>
25
- <div class="text-truncate" title="{{ vm.rule.fragmentType }}">
23
+ <div
24
+ class="text-truncate"
25
+ title="{{ vm.rule.fragmentType }}"
26
+ >
26
27
  {{ vm.rule.fragmentType }}
27
28
  </div>
28
29
  </div>
@@ -30,7 +31,10 @@
30
31
  <div class="text-label-small">
31
32
  {{ 'Type' | translate }}
32
33
  </div>
33
- <div class="text-truncate" title="{{ vm.rule.type }}">
34
+ <div
35
+ class="text-truncate"
36
+ title="{{ vm.rule.type }}"
37
+ >
34
38
  {{ vm.rule.type }}
35
39
  </div>
36
40
  </div>
@@ -56,29 +60,42 @@
56
60
  <div class="col-md-2 col-xs-4 flex-no-shrink text-right p-t-4 p-b-4">
57
61
  <button
58
62
  class="showOnHover btn btn-dot btn-dot--danger"
59
- type="button"
63
+ ng-class="{ open: popoverIsOpen }"
60
64
  aria-label="{{ 'Remove' | translate }}"
65
+ type="button"
61
66
  data-cy="c8yRetentionRuleRow--remove-button"
62
67
  uib-popover-template="'confirmDeleteRetentionRule.html'"
63
68
  popover-trigger="'focus'"
64
69
  popover-placement="left"
65
70
  popover-is-open="popoverIsOpen"
66
- ng-class="{ open: popoverIsOpen }"
67
71
  ng-click="$event.stopPropagation();"
68
72
  >
69
73
  <i c8y-icon="minus-circle"></i>
70
74
  </button>
71
- <button class="collapse-btn btn-dot" type="button" title="{{ 'Expand' | translate }}">
75
+ <button
76
+ class="collapse-btn btn-dot"
77
+ title="{{ 'Expand' | translate }}"
78
+ type="button"
79
+ >
72
80
  <i c8y-icon="chevron-down"></i>
73
81
  </button>
74
82
  </div>
75
83
  </uib-accordion-heading>
76
84
 
77
- <form name="retentionForm" novalidate>
78
- <c8y-edit-retention-rule hide-source="true" ng-model="vm.rule"></c8y-edit-retention-rule>
85
+ <form
86
+ name="retentionForm"
87
+ novalidate
88
+ >
89
+ <c8y-edit-retention-rule
90
+ hide-source="true"
91
+ ng-model="vm.rule"
92
+ ></c8y-edit-retention-rule>
79
93
 
80
94
  <div class="form-horizontal">
81
- <div class="form-group" ng-show="vm.canDisableEdit">
95
+ <div
96
+ class="form-group"
97
+ ng-show="vm.canDisableEdit"
98
+ >
82
99
  <div class="col-sm-12">
83
100
  <label
84
101
  class="c8y-checkbox"
@@ -1,8 +1,8 @@
1
1
  <div
2
2
  class="panel-default"
3
+ ng-class="{ expanded: vm.isOpen }"
3
4
  uib-accordion-group
4
5
  is-open="vm.isOpen"
5
- ng-class="{ expanded: vm.isOpen }"
6
6
  template-url=":::PLUGIN_PATH:::/tenantPolicyDetail/accordion.html"
7
7
  >
8
8
  <uib-accordion-heading>
@@ -11,13 +11,21 @@
11
11
  <div class="text-label-small">
12
12
  {{ 'Category' | translate }}
13
13
  </div>
14
- <div class="text-truncate" title="{{ vm.option.category }}">{{ vm.option.category }}</div>
14
+ <div
15
+ class="text-truncate"
16
+ title="{{ vm.option.category }}"
17
+ >
18
+ {{ vm.option.category }}
19
+ </div>
15
20
  </div>
16
21
  <div class="col-sm-3 col-xs-6 p-t-4 p-b-4">
17
22
  <div class="text-label-small">
18
23
  {{ 'Key' | translate }}
19
24
  </div>
20
- <div class="text-truncate" title="{{ vm.option.key }}">
25
+ <div
26
+ class="text-truncate"
27
+ title="{{ vm.option.key }}"
28
+ >
21
29
  {{ vm.option.key }}
22
30
  </div>
23
31
  </div>
@@ -25,7 +33,10 @@
25
33
  <div class="text-label-small">
26
34
  {{ 'Value' | translate }}
27
35
  </div>
28
- <div class="text-truncate" title="{{ vm.option.value }}">
36
+ <div
37
+ class="text-truncate"
38
+ title="{{ vm.option.value }}"
39
+ >
29
40
  {{ vm.option.value }}
30
41
  </div>
31
42
  </div>
@@ -35,8 +46,8 @@
35
46
  <button
36
47
  class="showOnHover btn btn-dot btn-dot--danger"
37
48
  ng-class="{ open: popoverIsOpen }"
38
- type="button"
39
49
  aria-label="{{ 'Remove' | translate }}"
50
+ type="button"
40
51
  data-cy="c8yTenantOptionsRow--remove-button"
41
52
  uib-popover-template="'confirmDelete.html'"
42
53
  popover-trigger="'focus'"
@@ -46,21 +57,31 @@
46
57
  >
47
58
  <i c8y-icon="minus-circle"></i>
48
59
  </button>
49
- <button class="collapse-btn" type="button" title="{{ 'Expand' | translate }}">
60
+ <button
61
+ class="collapse-btn"
62
+ title="{{ 'Expand' | translate }}"
63
+ type="button"
64
+ >
50
65
  <i c8y-icon="chevron-down"></i>
51
66
  </button>
52
67
  </div>
53
68
  </uib-accordion-heading>
54
69
 
55
- <form name="tenantOptionsForm" novalidate>
70
+ <form
71
+ name="tenantOptionsForm"
72
+ novalidate
73
+ >
56
74
  <c8y-edit-tenant-option option="vm.option"></c8y-edit-tenant-option>
57
75
 
58
76
  <div class="form-horizontal">
59
- <div class="form-group" ng-show="vm.canDisableEdit">
77
+ <div
78
+ class="form-group"
79
+ ng-show="vm.canDisableEdit"
80
+ >
60
81
  <div class="col-sm-12">
61
82
  <label
62
- title="{{ 'Allow subtenants to edit this tenant option' | translate }}"
63
83
  class="c8y-checkbox"
84
+ title="{{ 'Allow subtenants to edit this tenant option' | translate }}"
64
85
  >
65
86
  <input
66
87
  type="checkbox"
@@ -1,14 +1,24 @@
1
1
  <div
2
- tabindex="0"
3
2
  class="accordion-toggle interact"
3
+ tabindex="0"
4
4
  ng-click="toggleOpen()"
5
5
  uib-accordion-transclude="heading"
6
6
  >
7
- <div uib-accordion-header class="row d-flex" ng-class="{ 'text-muted': isDisabled }">
7
+ <div
8
+ class="row d-flex"
9
+ ng-class="{ 'text-muted': isDisabled }"
10
+ uib-accordion-header
11
+ >
8
12
  {{ heading }}
9
13
  </div>
10
14
  </div>
11
15
 
12
- <div class="panel-collapse collapse" uib-collapse="!isOpen">
13
- <div class="panel-body" ng-transclude></div>
16
+ <div
17
+ class="panel-collapse collapse"
18
+ uib-collapse="!isOpen"
19
+ >
20
+ <div
21
+ class="panel-body"
22
+ ng-transclude
23
+ ></div>
14
24
  </div>