@c8y/ng1-modules 1020.1.0 → 1020.2.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.
@@ -1 +1 @@
1
- "use strict";!function(){function e(s,e,r,n,a,i,t,o,c,u,d,l,p,g){var f=e.userId,h={PATTERN:{type:"pattern",text:l.validation.password.message},PASSWORD_MISSMATCH:{type:"password_missmatch",text:u("Password confirmation does not match.")},REQUIRED:{type:"required",text:u("This field is required.")},EMAIL:{type:"email",text:u("Invalid email address.")}};function m(e){a.checkIfCurrent(e).then(function(e){s.isCurrent=e}),s.user=e,s._groups={},(e.groups&&e.groups.references||[]).forEach(function(e){e=e.group.id;s._groups[e]=!0}),s.showPassword=!e.id,s.changePasswordBtn=!s.showPassword,delete s.confirmPassword}function v(e){s.groups=e}function w(){f?a.detail(f).then(function(e){return e.data}).then(m):m({enabled:s.isNew=!0})}s.saving=!1,s.passwordRegex=l.validation.password.pattern,s.cancel=function(){r.path("/deviceusers")},s.save=function(e){if(s.saving=!0,s.userForm.$valid){var r=_.keys(s._groups).filter(function(e){return s._groups[e]}).map(function(e){return parseInt(e,10)});try{var t=a.save(e,s.password.currentPassword).then(function(e){e=e.data;return f=e.userName,e.id=f,e}).then(function(e){return i.updateGroups(e,r)}).then(p.triggerEvent("dmCredentialManagement",{action:"assignRole",name:"role"})).then(angular.bind({},w)).then(_.partial(o.success,u("Device updated.")));t.finally(function(){s.saving=!1}),t.then(function(){n.history.back()})}catch(e){o.danger(e.message),s.saving=!1}}},s.confirmPassword="",s.password={},s.invalid=angular.bind(t,t.invalid,s,"userForm"),s.changePasswordConfirm=function(e){s.userForm.confirmPassword.$setValidity(h.PASSWORD_MISSMATCH.type,e===s.user.password)},s.$watch("user.userName",function(e){e&&c.changeTitle({title:e},{skipTitleTranslation:!0})}),s.getErrorFeedback=function(e){var t=s.userForm[e]||{},n=[];return _.forEach(t.$error||{},function(e,r){e&&!t.$pristine&&n.push(d.getString(h[r.toUpperCase()].text))}),n.join(" ")},s.getGroupName=g.getName,w(),i.list(void 0).then(v)}e.$inject=["$scope","$routeParams","$location","$window","c8yUser","c8yUserGroup","c8yBase","c8yAlert","c8yTitle","gettext","gettextCatalog","c8yConfig","c8yGainsightService","c8yPropertyValueTransformService"],angular.module("c8y.parts.deviceUsers").controller("deviceUserDetailCtrl",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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1020.1.0",
3
+ "version": "1020.2.2",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",