@c8y/ng1-modules 1020.1.0 → 1020.2.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function e(
|
|
1
|
+
"use strict";!function(){function e(i,e,t,r,a,s,n,u,o,c,l,g,d,f){var p=e.userId,v={REQUIRED:{type:"required",text:c("This field is required.")},EMAIL:{type:"email",text:c("Invalid email address.")}};function h(e){a.checkIfCurrent(e).then(function(e){i.isCurrent=e}),i.user=e,i._groups={},(e.groups&&e.groups.references||[]).forEach(function(e){e=e.group.id;i._groups[e]=!0})}function m(e){i.groups=e}function y(){p?a.detail(p).then(function(e){return e.data}).then(h):h({enabled:i.isNew=!0})}i.saving=!1,i.cancel=function(){t.path("/deviceusers")},i.save=function(e){if(i.saving=!0,i.userForm.$valid){var t=_.keys(i._groups).filter(function(e){return i._groups[e]}).map(function(e){return parseInt(e,10)});try{var n=a.save(e,i.isCurrent).then(function(e){e=e.data;return p=e.userName,e.id=p,e}).then(function(e){return s.updateGroups(e,t)}).then(d.triggerEvent("dmCredentialManagement",{action:"assignRole",name:"role"})).then(angular.bind({},y)).then(_.partial(u.success,c("Device updated.")));n.finally(function(){i.saving=!1}),n.then(function(){r.history.back()})}catch(e){u.danger(e.message),i.saving=!1}}},i.invalid=angular.bind(n,n.invalid,i,"userForm"),i.$watch("user.userName",function(e){e&&o.changeTitle({title:e},{skipTitleTranslation:!0})}),i.getErrorFeedback=function(e){var n=i.userForm[e]||{},r=[];return _.forEach(n.$error||{},function(e,t){e&&!n.$pristine&&r.push(l.getString(v[t.toUpperCase()].text))}),r.join(" ")},i.getGroupName=f.getName,y(),s.list(void 0).then(m)}e.$inject=["$scope","$routeParams","$location","$window","c8yUser","c8yUserGroup","c8yBase","c8yAlert","c8yTitle","gettext","gettextCatalog","c8yConfig","c8yGainsightService","c8yPropertyValueTransformService"],angular.module("c8y.parts.deviceUsers").controller("deviceUserDetailCtrl",e)}();
|
|
@@ -58,78 +58,9 @@
|
|
|
58
58
|
</button>
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
61
|
-
|
|
62
|
-
<div class="form-group" ng-show="changePasswordBtn">
|
|
63
|
-
<button type="button" class="btn btn-default" ng-click="showPassword=!showPassword">
|
|
64
|
-
<span title="{{ 'Change password' | translate }}" ng-show="!showPassword">
|
|
65
|
-
{{ 'Change password' | translate }}
|
|
66
|
-
</span>
|
|
67
|
-
<span title="{{ 'Cancel password change' | translate }}" ng-show="showPassword">
|
|
68
|
-
{{ 'Cancel password change' | translate }}
|
|
69
|
-
</span>
|
|
70
|
-
</button>
|
|
71
|
-
</div>
|
|
72
|
-
|
|
73
|
-
<div class="form-group" ng-if="showPassword && isCurrent">
|
|
74
|
-
<label>{{ 'Current password' | translate }}</label>
|
|
75
|
-
<input
|
|
76
|
-
type="password"
|
|
77
|
-
name="currentPassword"
|
|
78
|
-
class="form-control"
|
|
79
|
-
ng-model="password.currentPassword"
|
|
80
|
-
placeholder="{{ 'e.g. my_current_password' | translate }}"
|
|
81
|
-
required
|
|
82
|
-
ng-pattern="passwordRegex"
|
|
83
|
-
c8y-autocomplete="off"
|
|
84
|
-
/>
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
<div
|
|
88
|
-
class="form-group"
|
|
89
|
-
ng-if="showPassword"
|
|
90
|
-
ng-class="{ 'has-error': invalid('password') }"
|
|
91
|
-
>
|
|
92
|
-
<label>{{ 'Password' | translate }}</label>
|
|
93
|
-
<input
|
|
94
|
-
type="password"
|
|
95
|
-
name="password"
|
|
96
|
-
class="form-control"
|
|
97
|
-
ng-model="user.password"
|
|
98
|
-
placeholder="{{ 'e.g. my_new_password' | translate }}"
|
|
99
|
-
required
|
|
100
|
-
ng-pattern="passwordRegex"
|
|
101
|
-
c8y-autocomplete="off"
|
|
102
|
-
/>
|
|
103
|
-
<div class="c8y-messages">
|
|
104
|
-
<div class="form-control-feedback-message">
|
|
105
|
-
{{ getErrorFeedback('password') }}
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
<div
|
|
110
|
-
class="form-group"
|
|
111
|
-
ng-if="showPassword"
|
|
112
|
-
ng-class="{ 'has-error': invalid('confirmPassword') }"
|
|
113
|
-
>
|
|
114
|
-
<label>{{ 'Confirm password' | translate }}</label>
|
|
115
|
-
<input
|
|
116
|
-
type="password"
|
|
117
|
-
name="confirmPassword"
|
|
118
|
-
class="form-control"
|
|
119
|
-
ng-model="$parent.confirmPassword"
|
|
120
|
-
placeholder="{{ 'e.g. my_new_password' | translate }}"
|
|
121
|
-
required
|
|
122
|
-
ng-change="changePasswordConfirm($parent.confirmPassword)"
|
|
123
|
-
c8y-autocomplete="off"
|
|
124
|
-
/>
|
|
125
|
-
<div class="c8y-messages">
|
|
126
|
-
<div class="form-control-feedback-message">
|
|
127
|
-
{{ getErrorFeedback('confirmPassword') }}
|
|
128
|
-
</div>
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
61
|
</div>
|
|
132
62
|
</div>
|
|
63
|
+
|
|
133
64
|
<div class="bg-level-1 inner-scroll">
|
|
134
65
|
<div class="card-header large-padding sticky-top separator">
|
|
135
66
|
<div class="card-title" translate>Global roles</div>
|