@c8y/ng1-modules 1019.5.6 → 1019.6.3
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.
- package/core/core/config.js +1 -1
- package/core/locales/de.po +12 -15
- package/core/locales/es.po +12 -15
- package/core/locales/fr.po +12 -15
- package/core/locales/nl.po +12 -15
- package/core/locales/pl.po +12 -15
- package/core/locales/pt_BR.po +12 -15
- package/core/ui/components/passwordStrengthChecklist.html +47 -5
- package/core/ui/components/passwordStrengthChecklist.js +1 -1
- package/core/ui/schemaForm/schemaForm.config.js +1 -1
- package/core/ui/services/loginService.js +1 -1
- package/core/ui/user/editUser.directive.html +45 -46
- package/core/ui/user/editUser.directive.js +1 -1
- package/device-protocol-deviceDatabase4/device-type-create-step.html +3 -0
- package/device-protocols/deviceProtocolList.html +1 -1
- package/device-protocols/deviceProtocolView.html +1 -0
- package/deviceDatabase4/detail/holding-registers.html +1 -1
- package/deviceDatabase4/modals/configure-register.html +11 -1
- package/devicemanagement-tracking/views/index.html +1 -0
- package/measurements/views/timeInterval.html +4 -1
- package/modbusConfiguration4/fieldbus-device-list.html +3 -0
- package/package.json +1 -1
- package/smartRules/controllers/edit.js +1 -1
- package/smartRules/controllers/list.js +1 -1
- package/smartRules/services/smartRules.js +1 -1
- package/smartRules/views/list.html +1 -1
- package/tenants/controllers/detail.js +1 -1
- package/tenants/views/detail.html +7 -17
- package/users/userList/userList.html +0 -24
|
@@ -26,9 +26,10 @@
|
|
|
26
26
|
class="c8y-messages"
|
|
27
27
|
ng-if="invalid('username')"
|
|
28
28
|
>
|
|
29
|
-
<small
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
<small
|
|
30
|
+
class="form-control-feedback-message small"
|
|
31
|
+
ng-bind-html="getErrorFeedback('username') | translate"
|
|
32
|
+
></small>
|
|
32
33
|
</div>
|
|
33
34
|
</div>
|
|
34
35
|
|
|
@@ -96,9 +97,10 @@
|
|
|
96
97
|
class="c8y-messages"
|
|
97
98
|
ng-if="invalid('displayName')"
|
|
98
99
|
>
|
|
99
|
-
<small
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
<small
|
|
101
|
+
class="form-control-feedback-message small"
|
|
102
|
+
ng-bind-html="getErrorFeedback('displayName') | translate"
|
|
103
|
+
></small>
|
|
102
104
|
</div>
|
|
103
105
|
</div>
|
|
104
106
|
</div>
|
|
@@ -143,9 +145,10 @@
|
|
|
143
145
|
ng-show="invalid('email')"
|
|
144
146
|
data-cy="c8y-messages--invalid-email"
|
|
145
147
|
>
|
|
146
|
-
<small
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
<small
|
|
149
|
+
class="form-control-feedback-message small"
|
|
150
|
+
ng-bind-html="getErrorFeedback('email') | translate"
|
|
151
|
+
></small>
|
|
149
152
|
</div>
|
|
150
153
|
</div>
|
|
151
154
|
|
|
@@ -170,9 +173,10 @@
|
|
|
170
173
|
class="c8y-messages"
|
|
171
174
|
ng-if="invalid('firstName')"
|
|
172
175
|
>
|
|
173
|
-
<small
|
|
174
|
-
|
|
175
|
-
|
|
176
|
+
<small
|
|
177
|
+
class="form-control-feedback-message small"
|
|
178
|
+
ng-bind-html="getErrorFeedback('firstName') | translate"
|
|
179
|
+
></small>
|
|
176
180
|
</div>
|
|
177
181
|
</div>
|
|
178
182
|
|
|
@@ -196,9 +200,10 @@
|
|
|
196
200
|
class="c8y-messages"
|
|
197
201
|
ng-if="invalid('lastName')"
|
|
198
202
|
>
|
|
199
|
-
<small
|
|
200
|
-
|
|
201
|
-
|
|
203
|
+
<small
|
|
204
|
+
class="form-control-feedback-message small"
|
|
205
|
+
ng-bind-html="getErrorFeedback('lastName') | translate"
|
|
206
|
+
></small>
|
|
202
207
|
</div>
|
|
203
208
|
</div>
|
|
204
209
|
</div>
|
|
@@ -224,9 +229,10 @@
|
|
|
224
229
|
c8y-phone-number
|
|
225
230
|
/>
|
|
226
231
|
<div class="c8y-messages">
|
|
227
|
-
<small
|
|
228
|
-
|
|
229
|
-
|
|
232
|
+
<small
|
|
233
|
+
class="form-control-feedback-message small"
|
|
234
|
+
ng-bind-html="getErrorFeedback('phone') | translate"
|
|
235
|
+
></small>
|
|
230
236
|
</div>
|
|
231
237
|
</div>
|
|
232
238
|
|
|
@@ -436,13 +442,14 @@
|
|
|
436
442
|
<span></span>
|
|
437
443
|
<span>
|
|
438
444
|
{{ 'Two-factor authentication' | translate }}
|
|
445
|
+
<small
|
|
446
|
+
class="text-muted"
|
|
447
|
+
title="{{ vm.tfaStrategy || 'SMS' }}"
|
|
448
|
+
>
|
|
449
|
+
({{ vm.tfaStrategy || 'SMS' }})
|
|
450
|
+
</small>
|
|
439
451
|
</span>
|
|
440
|
-
|
|
441
|
-
class="text-muted"
|
|
442
|
-
title="{{ vm.tfaStrategy || 'SMS' }}"
|
|
443
|
-
>
|
|
444
|
-
({{ vm.tfaStrategy || 'SMS' }})
|
|
445
|
-
</small>
|
|
452
|
+
|
|
446
453
|
<button
|
|
447
454
|
class="btn-help btn-help--sm"
|
|
448
455
|
aria-label="{{ 'Help' | translate }}"
|
|
@@ -632,7 +639,7 @@
|
|
|
632
639
|
userCanChangePasswordAndEmail
|
|
633
640
|
"
|
|
634
641
|
>
|
|
635
|
-
<div class="col-
|
|
642
|
+
<div class="col-6">
|
|
636
643
|
<div
|
|
637
644
|
class="form-group"
|
|
638
645
|
ng-class="{ 'has-error': invalid('password') }"
|
|
@@ -651,15 +658,15 @@
|
|
|
651
658
|
class="c8y-messages"
|
|
652
659
|
ng-if="invalid('password')"
|
|
653
660
|
>
|
|
654
|
-
<div
|
|
655
|
-
|
|
656
|
-
|
|
661
|
+
<div
|
|
662
|
+
class="form-control-feedback-message small"
|
|
663
|
+
ng-bind-html="getErrorFeedback('password') | translate"
|
|
664
|
+
></div>
|
|
657
665
|
</div>
|
|
658
666
|
</div>
|
|
659
667
|
<div
|
|
660
668
|
class="form-group"
|
|
661
669
|
ng-class="{ 'has-error': isInvalidConfirmPassword() }"
|
|
662
|
-
ng-if="user.password"
|
|
663
670
|
>
|
|
664
671
|
<label for="confirmPassword">{{ 'Confirm password' | translate }}</label>
|
|
665
672
|
<c8y-password-input
|
|
@@ -674,27 +681,19 @@
|
|
|
674
681
|
class="c8y-messages"
|
|
675
682
|
ng-if="isInvalidConfirmPassword()"
|
|
676
683
|
>
|
|
677
|
-
<div
|
|
678
|
-
|
|
679
|
-
|
|
684
|
+
<div
|
|
685
|
+
class="form-control-feedback-message small"
|
|
686
|
+
ng-bind-html="getErrorFeedback('confirmPassword') | translate"
|
|
687
|
+
></div>
|
|
680
688
|
</div>
|
|
681
689
|
</div>
|
|
682
690
|
</div>
|
|
683
691
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
c8y-password-strength
|
|
688
|
-
user="user"
|
|
692
|
+
<div class="col-6">
|
|
693
|
+
<c8y-password-strength-checklist
|
|
694
|
+
strength-enforced="passwordStrengthEnforced"
|
|
689
695
|
password="$parent.forms.userForm.password.$viewValue"
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
class="m-t-32"
|
|
693
|
-
ng-show="passwordStrengthEnforced"
|
|
694
|
-
>
|
|
695
|
-
<c8y-password-strength-checklist
|
|
696
|
-
password="$parent.forms.userForm.password.$viewValue"
|
|
697
|
-
></c8y-password-strength-checklist>
|
|
698
|
-
</div>
|
|
696
|
+
requirements-fulfilled="onRequirementsFulfilledChange(value)"
|
|
697
|
+
></c8y-password-strength-checklist>
|
|
699
698
|
</div>
|
|
700
699
|
</div>
|
|
@@ -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(){function e(u,l,g,f,p,
|
|
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(){function e(u,l,g,f,m,p,h,w,A,E,S,y,v){return e.$inject=["$scope","$q"],{restrict:"EA",scope:{user:"=",forms:"=",password:"=",hideUsername:"=?",hideActive:"=?",hideFirstName:"=?",hideLastName:"=?",hideEmail:"=?",hideTelephone:"=?",hideCustomProperties:"=?",hideTfaOption:"=?",hidePasswordReset:"=?",hideChangePassword:"=?",hideOwner:"=?",hideDelegate:"=?",disabledEdit:"=?",hideLanguage:"=?",userTfaEnforced:"=?",topLevelTfaEnforced:"=?"},templateUrl:":::PLUGIN_PATH:::/ui/user/editUser.directive.html",controller:e,controllerAs:"vm",link:function(e,t){$(t).find("input[name=email]").bind("blur",function(){e.emailWarning=!(e.user&&e.user.email)})}};function e(o,r){var e="maxlength",a=y("Messaging application is not subscribed."),i={NEWUSERNAME:{type:"validation",text:y('Username "new" is not allowed.')},PATTERN:{type:"pattern",text:y("Invalid pattern.")},PATTERN_PASSWORD:{type:"pattern",text:v.getString(A.validation.password.message)},PATTERN_USERNAME:{type:"pattern",text:v.getString(A.validation.user.message)},PATTERN_DISPLAYNAME:{type:"pattern",text:v.getString(A.validation.loginAlias.message)},SAME_AS_CURRENT_PASSWORD:{type:"same_as_current",text:y("New password can't be the same as current one.")},PASSWORD_MISSMATCH:{type:"password_missmatch",text:y("Passwords do not match.")},REQUIRED:{type:"required",text:y("This field is required.")},EMAIL:{type:"email",text:y("Invalid email address.")},PASSWORD_STRENGTH:{type:"password_strength",text:A.validation.passwordStrengthChecklist.message},INTERNATIONALPHONENUMBER_PHONE:{type:"internationalPhoneNumber",text:v.getString(A.validation.internationalPhoneNumber.message)},MAXLENGTH_FIRSTNAME:{type:e,text:"".concat(v.getString("Max length:")," 50")},MAXLENGTH_LASTNAME:{type:e,text:"".concat(v.getString("Max length:")," 50")},MAXLENGTH_USERNAME:{type:e,text:"".concat(v.getString("Max length:")," 254")},MAXLENGTH_DISPLAYNAME:{type:e,text:"".concat(v.getString("Max length:")," 254")},MAXLENGTH_PHONE:{type:e,text:"".concat(v.getString("Max length:")," 254")},MAXLENGTH_EMAIL:{type:e,text:"".concat(v.getString("Max length:")," 254")}},d=this,c=(_.assign(o,{confirmPassword:"",invalid:angular.bind(u,u.invalid,o.forms,"userForm"),isInvalidConfirmPassword:function(){var e=o.forms.userForm,t=e.password.$pristine,e=e.confirmPassword.$touched&&e.confirmPassword.$invalid;return!t&&e},changePasswordConfirm:function(){o.forms.userForm.confirmPassword&&o.forms.userForm.confirmPassword.$setValidity(i.PASSWORD_MISSMATCH.type,o.forms.userForm.confirmPassword.$viewValue===o.user.password)},getErrorFeedback:function(n){var a=o.forms.userForm[n]||{},s=[];return _.forEach(a.$error||{},function(e,t){var r;"parse"===t?o.forms.userForm.phone.$setValidity(t,!0):(t=t.toUpperCase(),r="".concat(t,"_").concat(n.toUpperCase()),e&&a.$touched&&(e=i[r]||i[t],s.push(v.getString(e.text))))}),s.join("<br>")},getUserCustomProperties:function(e){var r={};e&&e.customProperties&&_.forEach(e.customProperties,function(e,t){"userOrigin"!==t&&(r[t]="object"===_typeof(e)?angular.toJson(e):e)});return r},humanize:u.humanizeFragment,passwordRegex:A.validation.password.pattern,resetPasswords:function(e){var t=v.getString("A user managed via your authorization server cannot change the password of the user.");l.current().then(function(e){e=l.hasExternalOrigin(e);o.password.showPassword&&e&&S.add({text:t,type:"warning"})}),o.password.showPassword=!o.password.showPassword,e.passwordStrength=o.password.strength,e.password=null,o.confirmPassword=""},tfaAvailable:!1,delegateTo:function(){l.current().then(function(e){o.user.delegatedBy=e.id}),n()},undelegate:function(){o.user.delegatedBy=null,n()},setOwner:function(e){o.user.owner=e,d.isParentDropDownOpen=!1,d.ownerHiddenForm.$setDirty()},userCanChangePasswordAndEmail:!1,requirementsFulfilled:!0,onRequirementsFulfilledChange:function(e){e=o.requirementsFulfilled=e;e||o.forms.userForm.password.$setValidity(i.PATTERN_PASSWORD.type,!0),o.forms.userForm.password.$setValidity(i.PASSWORD_STRENGTH.type,e)}}),_.assign(d,{onToggleDropdown:function(e){e&&(d.ownerDropDownInitialized=!0)},twoFactorAuthenticationCheckboxDisabled:function(){return o.topLevelTfaEnforced||o.disabledEdit||"TOTP"===d.tfaStrategy||!o.smsMicroserviceAvailable||!o.notCurrentUser&&"SMS"===d.tfaStrategy},enforceTfaCheckboxDisbaled:function(){return o.topLevelTfaEnforced||o.disabledEdit||!o.notCurrentUser||s()},messagingWarningVisible:function(){return!o.smsMicroserviceAvailable&&"SMS"===d.tfaStrategy},shouldEnableRevokeTOTPSecretButton:s}),m.getStrongPasswordSettings().then(t),o.$watch("user",function(e,t){var n,s;e&&e!==t&&(s=!(n=e).id,o.password.strength=n.passwordStrength,o.changePasswordBtn=!o.password.showPassword,o.emailWarning=!n.email,o.smsWarningPopover=a,s&&(n.sendPasswordResetEmail=!0),delete o.confirmPassword,o.notCurrentUser=null,t=/.*/,(e=n)&&!e.id&&(t=A.validation.user.pattern),o.userNamePattern=t,o.loginAliasPattern=A.validation.loginAlias.pattern,o.hideLanguage||g.get("language").then(function(e){e&&(o.user.language={name:w.getLanguageNativeName(e),code:e}),o.languages=_.map(p.getSupportedLanguages(),function(e){return Object.assign({name:w.getLanguageNativeName(e),code:e},{})})}),E.isActivatedFor("units-conversion")&&(o.unitsConversionActive=!0),r.all({tfaAvailable:l.isTfaAvailable(),smsMicroserviceAvailable:h.isAvailable({contextPath:"messaging"}),twoFactorAuthenticationEnabled:l.isTfaActive(n),tfaStrategy:l.getTfaStrategy(),isCurrentUser:l.checkIfCurrent(n)}).then(function(e){var t=e.tfaAvailable,r=e.smsMicroserviceAvailable,n=e.twoFactorAuthenticationEnabled,a=e.tfaStrategy,e=e.isCurrentUser;o.notCurrentUser=!e,o.tfaAvailable=t,o.smsMicroserviceAvailable=!!r,d.tfaStrategy=a,o.user.twoFactorAuthenticationEnabled=!s&&n,o.userCanChangePasswordAndEmail=s||!l.hasExternalOrigin(o.user)&&e}),o.hideOwner||(o.ownerEditDisabled=!1,l.current().then(function(e){var t=f.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN"),r=f.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE");!t&&r&&(d.rootOwner=[e],d.currentOwner=e.id,d.defaultOwner=e,s)&&(o.ownerEditDisabled=!0,n.owner=d.currentOwner)})),c())}));function t(e){var t=e.enforceStrength,e=e.strengthValidity;o.passwordStrengthEnforced=t||e}function n(){o.delegationHiddenForm.$setDirty()}function s(){return"TOTP"===d.tfaStrategy&&o.user.twoFactorAuthenticationEnabled}o.$watch("user.password",function(){o.forms.userForm&&o.forms.userForm.password&&o.forms.userForm.password.$setValidity(i.SAME_AS_CURRENT_PASSWORD.type,!o.notCurrentUser&&!l.isCurrentPassword(o.forms.userForm.password.$viewValue)||o.notCurrentUser)})}}e.$inject=["c8yBase","c8yUser","c8yUserPreferences","c8yPermissions","c8yLoginOptions","c8yLocales","c8yApplication","LocalesUtil","c8yConfig","c8yBeta","c8yAlert","gettext","gettextCatalog"],angular.module("c8y.ui").directive("c8yEditUser",e).directive("c8yUiEditUser",e)}();
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
name="name"
|
|
14
14
|
class="form-control"
|
|
15
15
|
ng-model="vm.model.name"
|
|
16
|
+
data-cy="device-type-create-step--name"
|
|
16
17
|
ng-max="100"
|
|
17
18
|
placeholder="{{ 'e.g. My protocol' | translate }}"
|
|
18
19
|
required
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
rows="7"
|
|
28
29
|
class="form-control"
|
|
29
30
|
ng-model="vm.model.description"
|
|
31
|
+
data-cy="device-type-create-step--description"
|
|
30
32
|
ng-disabled="vm.pending"
|
|
31
33
|
></textarea>
|
|
32
34
|
</div>
|
|
@@ -52,6 +54,7 @@
|
|
|
52
54
|
title="{{ 'Create' | translate }}"
|
|
53
55
|
class="btn btn-primary"
|
|
54
56
|
ng-click="vm.create(vm.model)"
|
|
57
|
+
data-cy="device-type-create-step--create-button"
|
|
55
58
|
ng-disabled="modelForm.$invalid || vm.pending"
|
|
56
59
|
>
|
|
57
60
|
{{ 'Create' | translate }}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
|
-
<div class="c8y-list__item" ng-repeat="protocol in vm.protocols | orderBy:['name', vm.getTitle]">
|
|
32
|
+
<div class="c8y-list__item" ng-repeat="protocol in vm.protocols | orderBy:['name', vm.getTitle]" data-cy="deviceProtocolSelect--Protocol-select">
|
|
33
33
|
<div class="c8y-list__item__block">
|
|
34
34
|
<div class="c8y-list__item__icon">
|
|
35
35
|
<i c8y-icon="{{ vm.CONFIG.icon }}"></i>
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
</div>
|
|
162
162
|
</div>
|
|
163
163
|
<div class="card-footer">
|
|
164
|
-
<button class="btn btn-default m-t-8" type="button" ng-click="vm.addHoldingRegister()">
|
|
164
|
+
<button class="btn btn-default m-t-8" type="button" ng-click="vm.addHoldingRegister()" data-cy="holding-registers--add-holding-register-button">
|
|
165
165
|
<i c8y-icon="plus-circle"></i>
|
|
166
166
|
<span
|
|
167
167
|
title="{{ vm.features.holdingRegisters.addRegisterButtonLabel | translate }}"
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
id="name"
|
|
83
83
|
name="name"
|
|
84
84
|
ng-model="vm.element.name"
|
|
85
|
+
data-cy="configure-register--name"
|
|
85
86
|
c8y-autocomplete="off"
|
|
86
87
|
placeholder="{{ 'e.g. My element' | translate }}"
|
|
87
88
|
required
|
|
@@ -102,6 +103,7 @@
|
|
|
102
103
|
id="category"
|
|
103
104
|
name="category"
|
|
104
105
|
ng-model="vm.element.category"
|
|
106
|
+
data-cy="configure-register--category"
|
|
105
107
|
c8y-autocomplete="off"
|
|
106
108
|
uib-typeahead="category.name for category in vm.categories | filter:{name: $viewValue}"
|
|
107
109
|
typeahead-template-url=":::PLUGIN_PATH:::/modals/category-typeahead.html"
|
|
@@ -215,6 +217,7 @@
|
|
|
215
217
|
id="number"
|
|
216
218
|
name="number"
|
|
217
219
|
ng-model="vm.element.number"
|
|
220
|
+
data-cy="configure-register--number"
|
|
218
221
|
ng-min="vm.getNumberMin()"
|
|
219
222
|
ng-max="vm.getNumberMax()"
|
|
220
223
|
step="1"
|
|
@@ -269,6 +272,7 @@
|
|
|
269
272
|
id="startBit"
|
|
270
273
|
name="startBit"
|
|
271
274
|
ng-model="vm.element.startBit"
|
|
275
|
+
data-cy="configure-register--startBit"
|
|
272
276
|
ng-min="0"
|
|
273
277
|
ng-max="vm.startBitMax()"
|
|
274
278
|
step="1"
|
|
@@ -293,6 +297,7 @@
|
|
|
293
297
|
id="noBits"
|
|
294
298
|
name="noBits"
|
|
295
299
|
ng-model="vm.element.noBits"
|
|
300
|
+
data-cy="configure-register--noBits"
|
|
296
301
|
ng-min="1"
|
|
297
302
|
ng-max="vm.noBitsMax(vm.element.startBit)"
|
|
298
303
|
step="1"
|
|
@@ -486,6 +491,7 @@
|
|
|
486
491
|
id="multiplier"
|
|
487
492
|
name="multiplier"
|
|
488
493
|
ng-model="vm.element.multiplier"
|
|
494
|
+
data-cy="configure-register--multiplier"
|
|
489
495
|
ng-min="vm.features.multiplier.min"
|
|
490
496
|
step="{{ vm.features.multiplier.step }}"
|
|
491
497
|
placeholder="{{ 'e.g.' | translate }} {{ vm.features.multiplier.min }}"
|
|
@@ -509,6 +515,7 @@
|
|
|
509
515
|
id="divisor"
|
|
510
516
|
name="divisor"
|
|
511
517
|
ng-model="vm.element.divisor"
|
|
518
|
+
data-cy="configure-register--divisor"
|
|
512
519
|
ng-min="1"
|
|
513
520
|
step="1"
|
|
514
521
|
placeholder="{{ 'e.g.' | translate }} 1"
|
|
@@ -570,6 +577,7 @@
|
|
|
570
577
|
id="decimalPlaces"
|
|
571
578
|
name="decimalPlaces"
|
|
572
579
|
ng-model="vm.element.decimalPlaces"
|
|
580
|
+
data-cy="configure-register--decimal-places"
|
|
573
581
|
ng-min="0"
|
|
574
582
|
ng-max="5"
|
|
575
583
|
step="1"
|
|
@@ -594,6 +602,7 @@
|
|
|
594
602
|
id="unit"
|
|
595
603
|
name="unit"
|
|
596
604
|
ng-model="vm.element.unit"
|
|
605
|
+
data-cy="configure-register--unit"
|
|
597
606
|
placeholder="{{ 'e.g.' | translate }} u"
|
|
598
607
|
ng-required="vm.features.unit.requiredForSendMeasurement && vm.element.meta.sendMeasurement"
|
|
599
608
|
/>
|
|
@@ -671,7 +680,7 @@
|
|
|
671
680
|
<div class="form-group">
|
|
672
681
|
<div ng-if="vm.features.options.signed">
|
|
673
682
|
<label title="{{ 'Signed' | translate }}" class="c8y-checkbox input-sm">
|
|
674
|
-
<input type="checkbox" ng-model="vm.element.signed" />
|
|
683
|
+
<input type="checkbox" ng-model="vm.element.signed" data-cy="configure-register--signed"/>
|
|
675
684
|
<span></span>
|
|
676
685
|
<span>{{ 'Signed' | translate }}</span>
|
|
677
686
|
<i
|
|
@@ -1439,6 +1448,7 @@
|
|
|
1439
1448
|
type="button"
|
|
1440
1449
|
title="{{ 'Save' | translate }}"
|
|
1441
1450
|
ng-disabled="vm.elementForm.$invalid"
|
|
1451
|
+
data-cy="configure-register--save-button"
|
|
1442
1452
|
ng-click="vm.save()"
|
|
1443
1453
|
>
|
|
1444
1454
|
{{ 'Save' | translate }}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<form class="form-inline">
|
|
2
2
|
<div class="form-group">
|
|
3
|
-
<div class="c8y-select-wrapper">
|
|
3
|
+
<div class="c8y-select-wrapper" data-cy="timeInterval--select-wrapper">
|
|
4
4
|
<select
|
|
5
5
|
aria-label="{{ 'Time interval' | translate }}"
|
|
6
6
|
class="form-control"
|
|
7
7
|
ng-hide="hideSelector"
|
|
8
8
|
ng-options="(interval.txt | translate) for interval in timeIntervals"
|
|
9
9
|
ng-model="selInterval"
|
|
10
|
+
data-cy="timeInterval--selInterval"
|
|
10
11
|
ng-change="onChange()"
|
|
11
12
|
></select>
|
|
12
13
|
<span></span>
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
placeholder="{{ 'From`date`' | translate }}"
|
|
20
21
|
is-open="openFrom"
|
|
21
22
|
ng-model="dateFrom"
|
|
23
|
+
data-cy="timeInterval--dateFrom"
|
|
22
24
|
uib-datepicker-popup
|
|
23
25
|
datepicker-options="{ maxDate: dateTo, showWeeks: true }"
|
|
24
26
|
datepicker-append-to-body="true"
|
|
@@ -33,6 +35,7 @@
|
|
|
33
35
|
placeholder="{{ 'To`date`' | translate }}"
|
|
34
36
|
is-open="openTo"
|
|
35
37
|
ng-model="dateTo"
|
|
38
|
+
data-cy="timeInterval--dateTo"
|
|
36
39
|
uib-datepicker-popup
|
|
37
40
|
datepicker-options="{ minDate: dateFrom, showWeeks: true }"
|
|
38
41
|
datepicker-append-to-body="true"
|
|
@@ -131,6 +131,7 @@
|
|
|
131
131
|
name="name"
|
|
132
132
|
placeholder="{{ 'Name' | translate }}"
|
|
133
133
|
ng-model="vm.newDevice.name"
|
|
134
|
+
data-cy="fieldbus-device-list--name"
|
|
134
135
|
ng-disabled="vm.newDevice.adding"
|
|
135
136
|
required
|
|
136
137
|
/>
|
|
@@ -262,6 +263,7 @@
|
|
|
262
263
|
type="submit"
|
|
263
264
|
ng-class="{ 'btn-pending': vm.newDevice.adding }"
|
|
264
265
|
ng-click="vm.addNewDevice()"
|
|
266
|
+
data-cy="fieldbus-device-list--add-new-device"
|
|
265
267
|
ng-disabled="vm.isFormInvalid() || vm.newDevice.adding"
|
|
266
268
|
>
|
|
267
269
|
<span title="{{ 'Add' | translate }}" ng-if="!vm.newDevice.adding">
|
|
@@ -277,6 +279,7 @@
|
|
|
277
279
|
type="button"
|
|
278
280
|
title="{{ 'Add device' | translate }}"
|
|
279
281
|
ng-click="vm.startAddingNewDevice()"
|
|
282
|
+
data-cy="fieldbus-device-list--add-device"
|
|
280
283
|
>
|
|
281
284
|
<i c8y-icon="plus-circle"></i>
|
|
282
285
|
<span translate>Add {{ vm.mode }} device</span>
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function e(t,e,n,s,i,a,l,r,u,o,c,d
|
|
1
|
+
"use strict";!function(){function e(t,e,n,s,i,a,l,r,u,o,c,d){var m=_.isEmpty(c)?null:c,g="smartRuleForm",h={parent:null,mo:null,withChildren:{assets:!0,devices:!1}},y={inProgres:!1};function p(e){o=e,t.ruleTemplate=o,t.rule.name||(t.rule.name=d.getString(t.ruleTemplate.description))}function v(e){t.enabledSources=_.sortBy(e,"name")}function C(e){t.disabledSources=_.sortBy(e,"name")}function S(){return b(),n.reject()}function f(){y.inProgress=!0}function b(){y.inProgress=!1}t.hasChildAssets=angular.bind(i,i.hasChildAssets),t.getChildAssetsCount=angular.bind(i,i.getChildAssetsCount),t.ruleTemplate=o,t.rule=c,t.save=function(){o.noTarget&&(h.withChildren={assets:!1,devices:!1}),n.when().then(f).then(angular.bind(r,r.save,c,o,h)).then(e.close,S).then(_.partial(_.unary(l.success),d.getString('Smart rule "{{name}}" saved.',{name:c.name}))).then(b)},t.savingStatus=y,t.cancel=e.dismiss,t.invalid=angular.bind(s,s.invalid,t,g);var R,T=t.$watch(g,function(e){m&&e.$setDirty(),e&&T()});c&&c.id||(c=_.assign(r.getEmpty(),c||{})),t.rule=c,g=r.getRuleModalTitle(t.rule),t.title=g,o?p(o):u.getTemplateForRule(c).then(p),t.initialActivationCfg=h,g=_.get(c,"c8y_Context",a.getContext()),i.detail(g.id).then(s.getResData).then(function(e){h.mo=e}),c&&c.id&&(_.isEmpty(c.enabledSources)||(R=c.enabledSources.join(","),i.list({ids:R}).then(v)),_.isEmpty(c.disabledSources)||(R=c.disabledSources.join(","),i.list({ids:R}).then(C)))}e.$inject=["$scope","$uibModalInstance","$q","c8yBase","c8yInventory","c8yUiUtil","c8yAlert","smartRulesSvc","smartRuleTemplatesSvc","ruleTemplate","rule","gettextCatalog"],angular.module("c8y.smartRules").controller("SmartRuleEditCtrl",e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function e(i,r,e,o,t,n,a,
|
|
1
|
+
"use strict";!function(){function e(i,r,e,o,t,n,a,P,c,u,l,s,d,f,h,g,v,m){var p,S=r.deviceId||r.groupId,A={},R={},y={done:!1,inProgress:!1},b={true:{text:v("Enabled`rule`"),icon:"check-circle",cls:"text-success"},false:{text:v("Disabled`rule`"),icon:"ban",cls:"text-danger"}},x=s.getContext(),C=v("Global smart rules");function I(){return o.when().then(E).then(T).then(N).then(U).then(w).catch(D)}function E(){y.inProgress=!0}function w(){y.inProgress=!1,y.done=!0,y.error=!1}function D(e){e.data&&e.data.message&&l.danger(e.data.message),y.inProgress=!1,y.done=!0,y.error=!0}function T(){return h.list().then(M)}function M(e){_.forEach(e||[],function(e){A[e.name]=e})}function N(){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=function(e){var t=e;S&&(t=_.reject(e,function(e){var n=new RegExp("".concat(e,"/dashboard"));return function(e){var t=_.get(e,"config.url","");return O(e)&&!n.test(t)}}(S)));return t}(_.concat(e.listByContext,e.list))})}function O(e){return"sendDashboardsViaEmail"===e.ruleTemplateName}function L(e){return g.hasSource(e,S)}function U(){var e;return Array.isArray(i.rules)&&0<i.rules.length&&null!==(e=s.getContext()).context?a.childAssets(e.id,{skipDetail:!0,params:{pageSize:2e3,withChildren:!1}}).then(function(e){i.children=e}).then(function(){i.ruleChildren={},_.forEach(i.rules,function(e){i.ruleChildren[e.id]=G(e)})}):o.resolve()}function G(t){return _.filter(i.children,function(e){return g.hasSource(t,e)})}_.assign(i,{isOpen:{},moId:S,loadingStatus:y,refresh:I,paging:{refresh:I},ruleTemplates:A,getLinkToDM:function(){var e={deviceId:S};return t(p||"")(e)},add:function(){g.addNewWithUI().then(I)},edit:function(e){g.editWithUI(e).then(I)},clone:function(e){g.cloneWithUI(e).then(I)},remove:function(e){u({title:v("Delete smart rule"),body:m.getString('You are about to delete smart rule "{{name}}". Do you want to proceed?',e),labels:{ok:v("Delete")},status:"danger"}).then(angular.bind(g,g.remove,e)).then(function(){return _.pull(i.rules,e)}).then(function(){return l.success(v("Smart rule deleted."))})},hasSource:L,getChildrenEnabledForSmartRule:G,toggleRuleActivationForContextMO:function(e){if(L(e))return g.deactivate(e,S,!1).then(function(){l.success(m.getString('Smart rule "{{name}}" deactivated.',e))});return g.activate(e,S,!1).then(function(){l.success(m.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(N).then(U).then(function(){l.success(m.getString('Smart rule "{{name}}" activated/deactivated for children.',e))})},tooltip:function(e){var t={activate:{"for group":v("Activate for this group"),"for device":v("Activate for this device"),"for object":v("Activate for this object")},deactivate:{"for group":v("Deactivate for this group"),"for device":v("Deactivate for this device"),"for object":v("Deactivate for this object")}},e=e.enabled&&L(e)?"deactivate":"activate",n=r.groupId?"group":"object";return n=r.deviceId?"device":n,t[e]["for ".concat(n)]},type:function(e){var t,e=A[e.ruleTemplateName];e&&(t=e.label.full?m.getString(e.label.full):"".concat(m.getString(e.label.input)," ").concat(m.getString(e.label.output)));return t},status:function(e){return b[e.enabled].text},statusIcon:function(e){return b[e.enabled].icon},statusClass:function(e){return b[e.enabled].cls},showTitle:function(){return null!==s.getContext().context},title:C,context:x,inputIcon:function(e){var t,e=A[e.ruleTemplateName];e&&(t=e.paramGroups.input.icon);return t},outputIcon:function(e){var t,e=A[e.ruleTemplateName];e&&(t=e.paramGroups.output.icon);return t},canAddRules:function(e){var t=_.get(A,"".concat(_.get(e,"ruleTemplateName"),"._active")),n=R.canAddRules;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){var t=e.isAllowedInventory,e=e.isAllowedSmartRules;return t&&e}),R.canAddRules=e.then(function(e){return R.canAddRules=e,R.canAddRules}),n=!1);return n},canModify:function(t){R.rules=R.rules||{};var n=R.rules,e=n[t.id];_.isUndefined(e)&&(n[t.id]=c.isAllowed({adminMOs:[t.id]}).then(function(e){return n[t.id]=e,n[t.id]}),e=!1);return e},canApplyOnChildren:function(e){return!O(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?v("Global smart rule"):v("Local smart rule")}}),i.isConfigurationGlobalSmartRulesContext=e.path().includes("/rules"),I(),null===s.getContext().context&&d.changeTitle({title:C}),"device"===x.context&&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
|
-
"use strict";!function(){function e(i,u,o,r,n,a,t,c,l,s){var
|
|
1
|
+
"use strict";!function(){function e(i,u,o,r,n,a,t,c,l,d,s){var f=o.url("service/smartrule"),h="".concat(f,"/smartrules"),p=["id","self","cepModuleId","lastUpdated","creationTime"],m=["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 u.get(h).then(o.getResData).then(_.property("rules")).then(v)},listByContext:function(e){return u.get(g({moId:e})).then(o.getResData).then(_.property("rules")).then(v)},detail:function(e){e=S({id:e});return u.get(e).then(o.getResData)},save:function(e,t,n){e=e.id?y(e):function(e,t,n){var r=S(e,!0);return function(e,t,n){return e.ruleTemplateName=t.name,function(e,t){var n=i.when(e);e.c8y_Context||t.mo?(e.enabledSources=[],e.disabledSources=void 0,n=b(e,t.mo,t.withChildren)):(e.enabledSources=void 0,e.disabledSources=[]);return n}(e,n)}(e,t,n).then(_.partial(u.post,r)).then(o.getResData)}(e,t,n);return e},remove:function(e){e=S(e,!0);return u.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(y)},deactivate:function(e,t,n){return R(e,t,n).then(y)},updateSources:function(e,t,r,u){return function(e,t,n){return t.reduce(function(e,t){return e.then(function(e){return b(e,t,n)})},i.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)})},i.resolve(e));var n}).then(y)},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:function(e){return o.cleanFields(e,["id","self","status","deviceId","creationTime","failureReason"])}(e)}})},createInstanceWithUI:N,createInstanceWithUIByName:function(e,t){return c.getTemplateByName(e).then(function(e){return N(e,t)})},editWithUI:function(e){return T(e,void 0)},cloneWithUI:function(e){return t.current().then(_.partial(U,e)).then(T)},getRuleModalTitle:E};function v(e){return i.all(_.map(e,function(t){return c.getTemplateForRule(t).then(function(e){return _.isUndefined(e)?null:t})})).then(_.flatten).then(_.filter)}function S(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 y(e){var t=S(e,!0),e=o.cleanFields(e,m);return u.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(i.when(e)),n.push(function(e,t){var n=[];!0!==t&&!0!==t.assets||n.push(r.childAssets(e));!0!==t&&!0!==t.devices||n.push(r.childDevices(e));return i.all(n).then(_.flattenDeep).then(_.partialRight(_.map,"id"))}(e,t))),i.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?l("Edit global smart rule"):l("Edit local smart rule"):"/rules"===s.path()?l("Add global smart rule"):l("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 N(e,t){return T(t,e)}function U(e,t){e=_.cloneDeep(e);return(e=o.cleanFields(e,p)).name=d.getString("Duplicate of {{name}}",e),t&&(e.owner=t.id),e}function T(e,t){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)}}})}}e.$inject=["$q","$http","c8yBase","c8yInventory","c8yUiUtil","c8yModal","c8yUser","smartRuleTemplatesSvc","gettext","gettextCatalog","$location"],angular.module("c8y.smartRules").factory("smartRulesSvc",e)}();
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
<div class="card-header">
|
|
209
209
|
<label class="text-center text-muted m-b-16">
|
|
210
210
|
<i c8y-icon="c8y-smart-rules"></i>
|
|
211
|
-
{{
|
|
211
|
+
{{ getRuleCardTitle(rule) | translate }}
|
|
212
212
|
</label>
|
|
213
213
|
<div class="smart-rule-name card-title">
|
|
214
214
|
{{ rule.name }}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
"use strict";!function(){function e(a,i,s,e,n,o,t,r,c,l,d,u,m,g){var h,e=e.tenantId,f=d("May contain lowercase letters, digits, and hyphens. Must start with a letter; hyphens only allowed in the middle; minimum 2 characters. ");(_.assign(i,{validation:m.validation,tenantIdDomainHelpText:f,maxStorageLimitPerDevice:(m=Number.MAX_SAFE_INTEGER||9007199254740991,Math.round(m/1024/1024)),passwordStrengthUser:{},cancel:function(){s.path("tenants")},save:function(e,t){i.isNew&&i.host&&(e.domain=e.id+i.host);e=_.cloneDeep(e);i.storageLimitation.storageLimitPerDeviceEnabled?e.storageLimitPerDevice=1024*e.storageLimitPerDevice*1024:e.storageLimitPerDevice=0;v(!0),o.save(e).then(function(e){var e=e.data,n=t;i.isNew&&s.path("/tenants/".concat(e.id)),_.assign(i.tenant,e),c.success(d("Tenant saved.")),n.$setPristine()}).finally(function(){v(!1)})},shouldShowSubtenantCheckbox:function(){var e=i.tenant&&o.isParentTopTenant(i.tenant);return i.isTopTenant&&(e||i.isNew)},storageLimitation:{storageLimitPerDeviceEnabled:!1,storageLimitFeatureEnabled:t.appOption("storageLimitationFeatureEnabled")},humanize:t.humanizeFragment,saveInProgress:!1,changePasswordConfirm:function(){var e=i.tenantForm,n=e.confirmPassword,e=e.adminPass;{var t;n&&(t=n.$modelValue,e=e.$modelValue,n.$setValidity("password-mismatch",t===e))}},changePassword:!1,resetPassword:function(){i.changePassword=!i.changePassword,i.changePassword||(i.tenant.adminPass=null)},requirementsFulfilled:!0,onRequirementsFulfilledChange:function(e){e=i.requirementsFulfilled=e;!e&&i.tenantForm.adminPass.$viewValue&&i.tenantForm.adminPass.$setValidity("pattern",!0),i.tenantForm.adminPass.$viewValue&&i.tenantForm.adminPass.$setValidity("password-strength",e)}}),i.$watch("tenant.sendPasswordResetEmail",function(e){e&&(i.requirementsFulfilled=!0)}),i.$watch("tenant.tenantPolicyId",function(e){var n=l.getStrongPasswordSettings(),t=p(),e=_.find(i.tenantPolicies,{id:e});a.all({enforcedOnSystemLevel:n.then(function(e){return e.enforceStrength}),enforcedOnTenantLevel:n.then(function(e){return e.strengthValidity}),enforcedOnTenantPolicyLevel:t&&t.doesEnforceStrongPassword(e)}).then(function(e){var n=e.enforcedOnSystemLevel,t=e.enforcedOnTenantLevel,e=e.enforcedOnTenantPolicyLevel;i.isNew?i.passwordStrengthEnforced=n||e:i.passwordStrengthEnforced=n||t})}),o.current().then(function(e){e=e.domainName;return".".concat(e.split(".").slice(1).join("."))}).then(function(e){i.host=e}),o.isCurrentUserTopTenant().then(function(e){i.isTopTenant=e}),g.current(!1).then(function(e){(g.hasRole(e,"ROLE_SUPPORT_ADMIN")||g.hasRole(e,"ROLE_SUPPORT_READ"))&&(i.supportUser=encodeURIComponent("".concat(e.id,"$")))}),e&&"new"!==e)?o.detail(e).then(function(e){return e.data}).then(P):(P({sendPasswordResetEmail:i.isNew=!0}),r.changeTitle({title:d("New tenant")}),f=p(),m=!1,f&&(m=!0,f.list().then(w)),i.selectTenantPolicy=m);function P(e){var n,e=e||{};i.storageLimitation.storageLimitPerDeviceEnabled=(n=e,i.storageLimitation.storageLimitFeatureEnabled&&!!n.storageLimitPerDevice),e.storageLimitPerDevice=(e.storageLimitPerDevice||0)/1024/1024,i.tenant=e}function v(e){i.saveInProgress=e}function w(e){i.tenantPolicies=_.union([{name:u.getString("None")}],e)}function p(){var e="c8yTenantPolicies";return h=!h&&n.has(e)?n.get(e):h}o.isEnterpriseEditionTenant().then(function(e){i.isEnterpriseEditionTenant=e})}e.$inject=["$q","$scope","$location","$routeParams","$injector","c8yTenant","c8yBase","c8yTitle","c8yAlert","c8yLoginOptions","gettext","gettextCatalog","c8yConfig","c8yUser"],angular.module("c8y.tenants").controller("tenantDetailCtrl",e)}();
|
|
@@ -222,7 +222,6 @@
|
|
|
222
222
|
</div>
|
|
223
223
|
|
|
224
224
|
<div ng-if="!tenant.sendPasswordResetEmail">
|
|
225
|
-
|
|
226
225
|
<div
|
|
227
226
|
class="row content-flex-50"
|
|
228
227
|
ng-if="isNew"
|
|
@@ -249,15 +248,13 @@
|
|
|
249
248
|
ng-message="password-strength"
|
|
250
249
|
translate
|
|
251
250
|
>
|
|
252
|
-
Password not
|
|
251
|
+
Password is not strong enough, use a stronger password. Check the requirements
|
|
252
|
+
listed on the right.
|
|
253
253
|
</span>
|
|
254
254
|
</c8y-error-feedback>
|
|
255
255
|
</div>
|
|
256
256
|
|
|
257
|
-
<div
|
|
258
|
-
class="form-group"
|
|
259
|
-
ng-if="shouldDisplayConfirmPassword()"
|
|
260
|
-
>
|
|
257
|
+
<div class="form-group">
|
|
261
258
|
<label translate>Confirm password</label>
|
|
262
259
|
<input
|
|
263
260
|
class="form-control"
|
|
@@ -280,23 +277,16 @@
|
|
|
280
277
|
</div>
|
|
281
278
|
</div>
|
|
282
279
|
<div class="col-5">
|
|
283
|
-
<div
|
|
284
|
-
c8y-password-strength
|
|
285
|
-
user="passwordStrengthUser"
|
|
286
|
-
password="tenantForm.adminPass.$viewValue"
|
|
287
|
-
></div>
|
|
288
|
-
<div
|
|
289
|
-
class="m-t-32"
|
|
290
|
-
ng-if="passwordStrengthEnforced"
|
|
291
|
-
>
|
|
280
|
+
<div class="m-t-32">
|
|
292
281
|
<c8y-password-strength-checklist
|
|
293
282
|
password="tenantForm.adminPass.$viewValue"
|
|
283
|
+
strength-enforced="passwordStrengthEnforced"
|
|
284
|
+
requirements-fulfilled="onRequirementsFulfilledChange(value)"
|
|
294
285
|
></c8y-password-strength-checklist>
|
|
295
286
|
</div>
|
|
296
287
|
</div>
|
|
297
288
|
</div>
|
|
298
289
|
</div>
|
|
299
|
-
|
|
300
290
|
<div
|
|
301
291
|
class="form-group"
|
|
302
292
|
ng-if="storageLimitation.storageLimitFeatureEnabled"
|
|
@@ -480,7 +470,7 @@
|
|
|
480
470
|
type="submit"
|
|
481
471
|
ng-click="save(tenant, tenantForm)"
|
|
482
472
|
ng-show="tenant"
|
|
483
|
-
ng-disabled="tenantForm.$invalid || !tenantForm.$dirty || saveInProgress"
|
|
473
|
+
ng-disabled="tenantForm.$invalid || !tenantForm.$dirty || saveInProgress || !requirementsFulfilled"
|
|
484
474
|
>
|
|
485
475
|
{{ 'Save' | translate }}
|
|
486
476
|
</button>
|