@c8y/ng1-modules 1018.482.19 → 1018.482.30
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/kpi/views/list.html
CHANGED
|
@@ -47,16 +47,16 @@
|
|
|
47
47
|
<i c8y-icon="circle" ng-style="{ color: dp.color }"></i>
|
|
48
48
|
</td>
|
|
49
49
|
|
|
50
|
-
<td ng-if="columnVisible(child.config.options.kpi)">
|
|
50
|
+
<td ng-if="columnVisible(child.config.options.kpi)" data-cy="datapointlist-kpi">
|
|
51
51
|
{{ dp.label | translate }}
|
|
52
52
|
<small class="text-muted">{{ dp.unit }}</small>
|
|
53
53
|
</td>
|
|
54
54
|
|
|
55
|
-
<td class="text-right" ng-if="columnVisible(child.config.options.target)">
|
|
55
|
+
<td class="text-right" ng-if="columnVisible(child.config.options.target)" data-cy="datapointlist-target">
|
|
56
56
|
<span>{{ dp.target }}</span>
|
|
57
57
|
</td>
|
|
58
58
|
|
|
59
|
-
<td class="text-right" ng-if="columnVisible(child.config.options.current)">
|
|
59
|
+
<td class="text-right" ng-if="columnVisible(child.config.options.current)" data-cy="datapointlist-current">
|
|
60
60
|
<span
|
|
61
61
|
uib-tooltip="{{ times[dp.id] | absoluteDate }}"
|
|
62
62
|
tooltip-popup-delay="500"
|
|
@@ -66,15 +66,15 @@
|
|
|
66
66
|
</span>
|
|
67
67
|
</td>
|
|
68
68
|
|
|
69
|
-
<td class="text-right" ng-if="columnVisible(child.config.options.diff)">
|
|
69
|
+
<td class="text-right" ng-if="columnVisible(child.config.options.diff)" data-cy="datapointlist-diff">
|
|
70
70
|
<span>{{ diff(dp) | number: 2 }}</span>
|
|
71
71
|
</td>
|
|
72
72
|
|
|
73
|
-
<td class="text-right" ng-if="columnVisible(child.config.options.diffPercentage)">
|
|
73
|
+
<td class="text-right" ng-if="columnVisible(child.config.options.diffPercentage)" data-cy="datapointlist-diffPercentage">
|
|
74
74
|
<span>{{ diffPercent(dp) | number: 2 }}</span>
|
|
75
75
|
</td>
|
|
76
76
|
|
|
77
|
-
<td class="text-right word-break" ng-if="columnVisible(child.config.options.asset)"
|
|
77
|
+
<td class="text-right word-break" ng-if="columnVisible(child.config.options.asset)" data-cy="datapointlist-asset">>
|
|
78
78
|
<a class="text-muted" ng-href="#/device/{{ dp.__target.id }}">
|
|
79
79
|
<small>
|
|
80
80
|
<i c8y-icon="cog"></i>
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function e(a,
|
|
1
|
+
"use strict";!function(){function e(a,D,c,e,f,d,l,E,n,r,t,g,h,s,p,m){var o,i,u,w=this,R=(_.assign(w,{cancel:g.gotoList,shouldDisableGlobalRolesCheckbox:$,isUserAndRolesFormPristine:A,isUserFormInvalid:U,isRolesFormInvalid:I,canSave:function(){return!(c.saving||A()||U()||I())}}),e.userId),v=["business"];function N(){R?d.detail(R).then(function(e){return e.data}).then(T).then(function(){return d.getUserTfaSettings(c.user).then(f.getResData).then(function(e){c.userTfaEnforced=!!e.tfaEnforced})}):(T({enabled:c.isNew=!0}),G(m("New user"),!0))}function T(e){i=e.email,e.devicePermissions=e.devicePermissions||{},c.user=e,c._groups=O(e),c.password.showPassword=c.isNew,c.hasExternalOrigin=d.hasExternalOrigin(e),c.isNew&&(_.forEach(c.groups,function(e){_.includes(v,e.name)&&(c._groups[e.id]=!0)}),u)&&E.warning(g.LOCAL_USER_TEXT),c.hasExternalOrigin&&s.isSsoClearingUserRolesOnEveryLogin().then(function(e){return c.userCanEditRoles=!e,c.userCanEditRoles}).then(function(e){e?E.warning(g.EXTERNAL_ORIGIN_DYNAMIC_ACCESS_MAPPING_EXCEPTION_TEXT):E.warning(g.EXTERNAL_ORIGIN_TEXT)})}function A(){return c.forms.userForm.$pristine&&c.forms.rolesForm.$pristine}function U(){return!!(M(c.currentUser,c.user)&&!c.hasExternalOrigin)&&c.forms.userForm.$invalid}function I(){return!$()&&c.forms.rolesForm.$invalid}function O(e){return _.reduce(_.get(e,"groups.references"),function(e,n){return e[n.group.id]=!0,e},{})}function y(e){c.groups=e}function C(e){c.currentUser=e}function L(n,e){function r(){return E.success(m("User saved."))}var t=1<arguments.length&&void 0!==e?e:"",e=(c.saving=!0,g.gotoList),s=!(n.id&&!n.groups),o=_(c._groups).map(function(e,n){return e&&parseInt(n,10)}).filter().value(),i=s?function(){return l.updateGroups(0<arguments.length&&void 0!==arguments[0]?arguments[0]:n,o)}:function(){return a.resolve()},s=c.forms.rolesForm.$dirty,u=c.password.showPassword;try{(c.hasExternalOrigin?g.warnAboutUserLogOutIfNeeded(n,{rolesChanged:s,passwordChanged:u}).then(function(){return i()}):g.warnAboutUserLogOutIfNeeded(n,{rolesChanged:s,passwordChanged:u}).then(function(){return n.password&&!c.isNew?d.changePassword(n,n.password,t):a.resolve()}).then(function(){return d.current()}).then(function(e){return _.isEqual(e.userName,n.userName)}).then(function(e){p.isActivatedFor("units-conversion")&&(e&&(e=n,e=_.get(n,"measurementUnit.value"),h.set("unit",e)),_.unset(n,"measurementUnit"))}).then(function(e){return d.save(_.omit(n,c.isNew?["measurementUnit"]:["measurementUnit","password"]),e)}).then(f.getResData).then(function(e){return i(e)}).then(function(){return d.setUserTfaSettings(n,{tfaEnforced:!!c.userTfaEnforced})})).then(r).then(e).finally(function(){c.saving=!1})}catch(e){E.danger(e.message),c.saving=!1}}function G(){return n.changeTitle({title:0<arguments.length&&void 0!==arguments[0]?arguments[0]:""},{skipTitleTranslation:!(1<arguments.length&&void 0!==arguments[1]&&arguments[1])})}function P(e){return d.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")||d.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE")}function M(e,n){return!(!e||!n)&&(!n.id||(e.id===n.id?d.hasRole(e,"ROLE_USER_MANAGEMENT_OWN_ADMIN"):d.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")||d.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE")))}function S(e){return _.get(c.user,"owner")&&o&&!o[e.id]}function $(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,n=P(c.currentUser),e=!e||!S(e),r=!!c.userCanEditRoles||!c.hasExternalOrigin;return!(n&&e&&r)}c.checkPassword=function(n){var e=!c.isNew,r=c.password.showPassword||function(e){return e.email!==i}(n);return e&&r?t.currentPassword().then(function(e){return L(n,e)}).catch(function(e){e&&E.danger(f.getResErrorMessage(e)),N()}):L(n)},c.$watch("user.userName",G),c.$watch("user.owner",function(e){e?d.detail(e).then(f.getResData).then(function(e){o=O(e),_.forEach(c._groups,function(e,n){c._groups[n]=e&&o[n]})}):o=null}),c.$watch("_groups",function(e){c.enforcedGroup&&(c.topLevelTfaEnforced=e[c.enforcedGroup.id])},!0),c.canEditUser=M,c.canEditUserGroups=P,c.canActivateUser=function(e,n){return!(!e||!n)&&e.id!==n.id},c.forms={},c.password={},c.saving=!1,c.showAcl=function(){var e=_.get(c.user,"devicePermissions"),e=_.keys(e);return f.getFlag("deprecated")||e.length},c.restrictedByOwner=S,c.$on("$destroy",function(){E.remove({text:g.EXTERNAL_ORIGIN_TEXT,type:"warning"}),E.remove({text:g.EXTERNAL_ORIGIN_DYNAMIC_ACCESS_MAPPING_EXCEPTION_TEXT,type:"warning"}),E.remove({text:g.LOCAL_USER_TEXT,type:"warning"})}),l.list(void 0).then(y).then(s.isSsoEnabled).then(function(e){u=e}).then(N).then(function(){return r.current().then(function(e){return d.getTenantTfaSettings(c.user,e.name)}).then(function(e){c.enforcedGroup=_.find(c.groups,{name:e.enforcedUsersGroup}),c.topLevelTfaEnforced=d.isEnforcedForUser(c.user,e)||c._groups[c.enforcedGroup.id]})}),d.current().then(C),g.userHierarchyActive().then(function(e){w.FEATURE_USER_HIERARCHY=e})}e.$inject=["$q","$injector","$scope","$routeParams","c8yBase","c8yUser","c8yUserGroup","c8yAlert","c8yTitle","c8yTenant","c8yUserUtil","c8yUsersUi","c8yUserPreferences","c8yLoginOptions","c8yBeta","gettext"],angular.module("c8y.users").component("c8yUserDetailView",{templateUrl:":::PLUGIN_PATH:::/userDetailView/userDetailView.html",controller:e,controllerAs:"vm"})}();
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
<c8y-breadcrumbs-set>
|
|
2
2
|
<c8y-breadcrumbs-item
|
|
3
|
+
icon="c8y-accounts"
|
|
3
4
|
path="#users"
|
|
4
5
|
label="{{ 'Users' | translate }}"
|
|
5
|
-
icon="c8y-accounts"
|
|
6
6
|
></c8y-breadcrumbs-item>
|
|
7
7
|
<c8y-breadcrumbs-item
|
|
8
|
-
label="{{ 'Accounts' | translate }}"
|
|
9
8
|
icon="c8y-accounts"
|
|
9
|
+
label="{{ 'Accounts' | translate }}"
|
|
10
10
|
></c8y-breadcrumbs-item>
|
|
11
11
|
</c8y-breadcrumbs-set>
|
|
12
12
|
|
|
13
13
|
<div class="card content-fullpage d-grid grid__col--6-6--md grid__row--auto-min-content">
|
|
14
|
-
<form
|
|
14
|
+
<form
|
|
15
|
+
class="d-contents"
|
|
16
|
+
name="forms.userForm"
|
|
17
|
+
novalidate
|
|
18
|
+
>
|
|
15
19
|
<div class="inner-scroll bg-level-0">
|
|
16
20
|
<div class="card-header large-padding separator sticky-top">
|
|
17
|
-
<div
|
|
21
|
+
<div
|
|
22
|
+
class="card-title h4"
|
|
23
|
+
translate
|
|
24
|
+
>
|
|
25
|
+
Identification
|
|
26
|
+
</div>
|
|
18
27
|
</div>
|
|
19
28
|
<div class="card-block large-padding">
|
|
20
29
|
<c8y-ui-edit-user
|
|
@@ -33,13 +42,25 @@
|
|
|
33
42
|
</div>
|
|
34
43
|
</form>
|
|
35
44
|
|
|
36
|
-
<form
|
|
45
|
+
<form
|
|
46
|
+
class="d-contents"
|
|
47
|
+
name="forms.rolesForm"
|
|
48
|
+
novalidate
|
|
49
|
+
>
|
|
37
50
|
<div class="bg-level-1 inner-scroll">
|
|
38
51
|
<div class="card-header sticky-top separator">
|
|
39
|
-
<div
|
|
52
|
+
<div
|
|
53
|
+
class="h4 card-title"
|
|
54
|
+
translate
|
|
55
|
+
>
|
|
56
|
+
Global roles
|
|
57
|
+
</div>
|
|
40
58
|
</div>
|
|
41
59
|
<ul class="c8y-list__group p-l-16 p-r-16 no-border-last">
|
|
42
|
-
<li
|
|
60
|
+
<li
|
|
61
|
+
class="c8y-list__item bg-inherit"
|
|
62
|
+
ng-repeat="group in groups | orderBy: 'name'"
|
|
63
|
+
>
|
|
43
64
|
<div class="c8y-list__item__block">
|
|
44
65
|
<div class="c8y-list__item__body p-l-0">
|
|
45
66
|
<label
|
|
@@ -49,21 +70,24 @@
|
|
|
49
70
|
}"
|
|
50
71
|
>
|
|
51
72
|
<input
|
|
52
|
-
type="checkbox"
|
|
53
73
|
id="{{ 'groupcheckbox' + $index }}"
|
|
74
|
+
type="checkbox"
|
|
54
75
|
ng-model="_groups[group.id]"
|
|
55
76
|
ng-disabled="vm.shouldDisableGlobalRolesCheckbox(group)"
|
|
56
77
|
/>
|
|
57
78
|
<span></span>
|
|
58
|
-
<span
|
|
79
|
+
<span
|
|
80
|
+
class="text-normal d-flex"
|
|
81
|
+
title="{{ ::group.name | translate }}"
|
|
82
|
+
>
|
|
59
83
|
<div>
|
|
60
84
|
{{::group.name | translate}}
|
|
61
85
|
<p class="small text-muted">{{::group.description | translate}}</p>
|
|
62
86
|
</div>
|
|
63
87
|
<button
|
|
64
88
|
class="m-l-auto btn-clean"
|
|
65
|
-
type="button"
|
|
66
89
|
aria-label="{{ 'Global roles' | translate }}"
|
|
90
|
+
type="button"
|
|
67
91
|
uib-popover="{{
|
|
68
92
|
'Only global roles defined on the owner can be defined on the owned user.'
|
|
69
93
|
| translate
|
|
@@ -74,7 +98,10 @@
|
|
|
74
98
|
ng-click="$event.preventDefault()"
|
|
75
99
|
ng-show="restrictedByOwner(group)"
|
|
76
100
|
>
|
|
77
|
-
<i
|
|
101
|
+
<i
|
|
102
|
+
class="text-warning"
|
|
103
|
+
c8y-icon="exclamation-circle"
|
|
104
|
+
></i>
|
|
78
105
|
</button>
|
|
79
106
|
</span>
|
|
80
107
|
</label>
|
|
@@ -83,9 +110,17 @@
|
|
|
83
110
|
</li>
|
|
84
111
|
</ul>
|
|
85
112
|
|
|
86
|
-
<div
|
|
113
|
+
<div
|
|
114
|
+
class="bg-inherit card--grid__separator-top--white"
|
|
115
|
+
ng-if="showAcl()"
|
|
116
|
+
>
|
|
87
117
|
<div class="card-header large-padding sticky-top separator">
|
|
88
|
-
<div
|
|
118
|
+
<div
|
|
119
|
+
class="h4"
|
|
120
|
+
translate
|
|
121
|
+
>
|
|
122
|
+
User permissions
|
|
123
|
+
</div>
|
|
89
124
|
</div>
|
|
90
125
|
<div class="card-block large-padding">
|
|
91
126
|
<c8y-acl-editor acl="user.devicePermissions"></c8y-acl-editor>
|
|
@@ -96,21 +131,23 @@
|
|
|
96
131
|
|
|
97
132
|
<div class="card-footer large-padding separator grid__col--fullspan">
|
|
98
133
|
<button
|
|
134
|
+
class="btn btn-default"
|
|
99
135
|
title="{{ 'Cancel' | translate }}"
|
|
100
136
|
type="button"
|
|
101
|
-
class="btn btn-default"
|
|
102
137
|
ng-click="vm.cancel()"
|
|
138
|
+
c8y-key-shortcut="Escape"
|
|
103
139
|
>
|
|
104
140
|
{{ 'Cancel' | translate }}
|
|
105
141
|
</button>
|
|
106
142
|
<button
|
|
107
143
|
class="btn btn-primary"
|
|
108
|
-
type="button"
|
|
109
|
-
title="{{ 'Save' | translate }}"
|
|
110
144
|
ng-class="{ 'btn-save': showPassword }"
|
|
145
|
+
title="{{ 'Save' | translate }}"
|
|
146
|
+
type="button"
|
|
111
147
|
ng-if="canEditUser(currentUser, user)"
|
|
112
|
-
ng-disabled="
|
|
148
|
+
ng-disabled="!vm.canSave()"
|
|
113
149
|
ng-click="checkPassword(user)"
|
|
150
|
+
c8y-key-shortcut="Enter"
|
|
114
151
|
>
|
|
115
152
|
{{ 'Save' | translate }}
|
|
116
153
|
</button>
|