@c8y/ng1-modules 1018.166.0 → 1018.168.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.
package/package.json
CHANGED
|
@@ -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 _objectSpread(
|
|
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 _objectSpread(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?Object(arguments[e]):{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.forEach(function(e){_defineProperty(n,e,t[e])})}return n}function _defineProperty(e,n,t){return(n=_toPropertyKey(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function _toPropertyKey(e){var n=_toPrimitive(e,"string");return"symbol"===_typeof(n)?n:String(n)}function _toPrimitive(e,n){if("object"!==_typeof(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);var o=t.call(e,n||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(e,n,t,r,s,o,i,l){var c=this;function u(){n.listInventoryRoles(c.userId).then(t.getResData).then(function(e){c.assignedRoles=_.keyBy(e.inventoryAssignments,"managedObject")}),n.detail(c.userId).then(t.getResData).then(function(e){c.user=e,c.user.owner?n.listInventoryRoles(c.user.owner).then(t.getResData).then(function(e){c.ownerAssignedRoles=_.keyBy(e.inventoryAssignments,"managedObject"),_.isEmpty(c.ownerAssignedRoles)&&(c.displayNoOwnerRolesAlert=!0),c.failedToFetchOwnerInventoryRoles=!1}).catch(function(){c.failedToFetchOwnerInventoryRoles=!0}):c.failedToFetchOwnerInventoryRoles=!1})}function a(){u(),i.success(l.getPlural(y(),"Inventory role updated","Inventory roles updated",{}))}function y(){return _.filter(c.assignedRoles,"isModified").length}function f(e){var n="replace"===e.process,t=e.roles,o=_.map(c.assignedRoles);return r.copyUserRoles(t,o,c.userId,n).then(u).then(s.successUserRolesCopy)}_.assign(c,{$onChange:function(e){e.user&&u()},onChangeRoles:function(e,n){c.assignedRoles[n]=c.assignedRoles[n]||{},_.assign(c.assignedRoles[n],{managedObject:n,roles:e,isModified:!0}),c.assignedRoles=_objectSpread({},c.assignedRoles)},onSaveInventoryRoles:function(){r.onSaveInventoryRoles(c.userId,c.assignedRoles).then(a)},copyRoles:function(){s.copyFromUserDialog(c.userId).then(f)},loadAssignedRoles:u,isUnchanged:function(){return 0===y()},helpLink:o.getUserGuideLink(_.get(s.STRINGS,"LINKS.ROLES_INVENTORY")),displayNoOwnerRolesAlert:!1,failedToFetchOwnerInventoryRoles:null}),u()}e.$inject=["$q","c8yUser","c8yBase","c8yUserInventoryRoles","c8yUserRolesUi","c8yDocs","c8yAlert","gettextCatalog"],angular.module("c8y.userRoles").component("c8yUserInventoryRolesTab",{templateUrl:":::PLUGIN_PATH:::/inventoryRolesTab/inventoryRolesTab.html",controllerAs:"vm",controller:e,bindings:{userId:"<"}})}();
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
popover-placement="bottom"
|
|
32
32
|
></button>
|
|
33
33
|
</div>
|
|
34
|
-
<div class="inner-scroll"
|
|
34
|
+
<div class="inner-scroll">
|
|
35
35
|
<div class="card-block sticky-top overflow-visible p-b-0">
|
|
36
36
|
<div class="alert alert-info" ng-show="vm.displayNoOwnerRolesAlert" translate>
|
|
37
37
|
No device groups available due to the device owner permissions. The device owner must be
|
|
@@ -48,8 +48,6 @@
|
|
|
48
48
|
class="form-control"
|
|
49
49
|
placeholder="{{ 'Filter device groups…' | translate }}"
|
|
50
50
|
ng-model="searchTearm"
|
|
51
|
-
ng-model-options="{ allowInvalid: true, debounce: 1000 }"
|
|
52
|
-
ng-change="vm.currentPage = 1; vm.scrollToTop()"
|
|
53
51
|
/>
|
|
54
52
|
<span class="input-group-addon">
|
|
55
53
|
<i
|
|
@@ -123,20 +121,17 @@
|
|
|
123
121
|
</div>
|
|
124
122
|
</div>
|
|
125
123
|
<div class="card-block p-t-0 p-b-0">
|
|
126
|
-
<c8y-roles-asset-tree
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
(on-change-roles)="vm.onChangeRoles($event)"
|
|
135
|
-
(on-change-item-count)="vm.totalItemsCount = $event"
|
|
136
|
-
></c8y-roles-asset-tree-downgraded>
|
|
124
|
+
<c8y-roles-asset-tree
|
|
125
|
+
user="vm.user"
|
|
126
|
+
expand-groups="vm.expandGroups"
|
|
127
|
+
owner-assigned-roles="vm.ownerAssignedRoles"
|
|
128
|
+
search-filter="searchTearm"
|
|
129
|
+
assigned-roles="vm.assignedRoles"
|
|
130
|
+
on-change-roles="vm.onChangeRoles(roles, managedObjectId)"
|
|
131
|
+
></c8y-roles-asset-tree>
|
|
137
132
|
</div>
|
|
138
133
|
</div>
|
|
139
|
-
<div class="
|
|
134
|
+
<div class="card-footer separator sticky-bottom">
|
|
140
135
|
<button
|
|
141
136
|
title="{{ 'Clear changes' | translate }}"
|
|
142
137
|
ng-click="vm.loadAssignedRoles()"
|
|
@@ -155,17 +150,6 @@
|
|
|
155
150
|
>
|
|
156
151
|
{{ 'Save' | translate }}
|
|
157
152
|
</button>
|
|
158
|
-
|
|
159
|
-
<div class="m-l-auto">
|
|
160
|
-
<pagination
|
|
161
|
-
[total-items]="vm.totalItemsCount"
|
|
162
|
-
[items-per-page]="vm.pageSize"
|
|
163
|
-
[max-size]="10"
|
|
164
|
-
rotate="{{ true }}"
|
|
165
|
-
ng-model="vm.currentPage"
|
|
166
|
-
ng-change="vm.scrollToTop()"
|
|
167
|
-
></pagination>
|
|
168
|
-
</div>
|
|
169
153
|
</div>
|
|
170
154
|
</div>
|
|
171
155
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function e(n,e,o){var s,t=this;_.assign(t,{filterAsset:function(e){return!t.ownerAllAssignedRoles||_.get(t.ownerAllAssignedRoles,[e.id,"length"])},onApply:function(e,n){return t.onChangeRoles({managedObjectId:n,roles:e})},$onChanges:function(e){(e.assignedRoles||e.ownerAssignedRoles)&&l.then(u);e.expandGroups&&t.expandGroups&&n.expandAll(s,i)},loadChildren:function(e){e.isOpened?(e._subGroups=[],e.isOpened=!1,i()):(n.loadChildren(e).then(i),e.isOpened=!0)},title:function(e){var n=e._subGroups,s=o.getString("Click to fetch subgroups");Array.isArray(n)&&e.isOpened&&(s=0<n.length?o.getPlural(n.length,"1 subgroup","{{$count}} subgroups",{}):o.getString("No subgroups"));return s}});var r,l=(r=t.user.owner,n.listRootGroups({onlyRootsUser:r}).then(function(e){s=e,i()}));function i(){t.flatAssetTree=n.flatTree(s),u()}function u(){if(t.assignedRoles&&(t.inheritedRoles=a(t.flatAssetTree,t.assignedRoles)),t.ownerAssignedRoles){var e=a(t.flatAssetTree,t.ownerAssignedRoles);t.ownerAllAssignedRoles=_.mergeWith(e,t.ownerAssignedRoles,function(e,n){return n?e?_.uniqBy(e.concat(n.roles),"id"):n.roles:e})}}function a(e,s){return _.reduce(e,function(e,n){return e[n.id]=_(n._parentGroups).map(function(e){return _.get(s,e.id)}).filter(_.identity).map(_.property("roles")).flatten().uniqBy("id").value(),e},{})}e.list().then(function(e){t.inventoryRoles=e})}e.$inject=["c8yUserInventoryRoles","c8yRoles","gettextCatalog"],angular.module("c8y.userRoles").component("c8yRolesAssetTree",{templateUrl:":::PLUGIN_PATH:::/rolesAssetTree/rolesAssetTree.html",controllerAs:"vm",controller:e,bindings:{user:"<",searchFilter:"<",assignedRoles:"<",ownerAssignedRoles:"<",expandGroups:"<",
|
|
1
|
+
"use strict";!function(){function e(n,e,o){var s,t=this;_.assign(t,{filterAsset:function(e){return!t.ownerAllAssignedRoles||_.get(t.ownerAllAssignedRoles,[e.id,"length"])},onApply:function(e,n){return t.onChangeRoles({managedObjectId:n,roles:e})},$onChanges:function(e){(e.assignedRoles||e.ownerAssignedRoles)&&l.then(u);e.expandGroups&&t.expandGroups&&n.expandAll(s,i)},loadChildren:function(e){e.isOpened?(e._subGroups=[],e.isOpened=!1,i()):(n.loadChildren(e).then(i),e.isOpened=!0)},title:function(e){var n=e._subGroups,s=o.getString("Click to fetch subgroups");Array.isArray(n)&&e.isOpened&&(s=0<n.length?o.getPlural(n.length,"1 subgroup","{{$count}} subgroups",{}):o.getString("No subgroups"));return s}});var r,l=(r=t.user.owner,n.listRootGroups({onlyRootsUser:r}).then(function(e){s=e,i()}));function i(){t.flatAssetTree=n.flatTree(s),u()}function u(){if(t.assignedRoles&&(t.inheritedRoles=a(t.flatAssetTree,t.assignedRoles)),t.ownerAssignedRoles){var e=a(t.flatAssetTree,t.ownerAssignedRoles);t.ownerAllAssignedRoles=_.mergeWith(e,t.ownerAssignedRoles,function(e,n){return n?e?_.uniqBy(e.concat(n.roles),"id"):n.roles:e})}}function a(e,s){return _.reduce(e,function(e,n){return e[n.id]=_(n._parentGroups).map(function(e){return _.get(s,e.id)}).filter(_.identity).map(_.property("roles")).flatten().uniqBy("id").value(),e},{})}e.list().then(function(e){t.inventoryRoles=e})}e.$inject=["c8yUserInventoryRoles","c8yRoles","gettextCatalog"],angular.module("c8y.userRoles").component("c8yRolesAssetTree",{templateUrl:":::PLUGIN_PATH:::/rolesAssetTree/rolesAssetTree.html",controllerAs:"vm",controller:e,bindings:{user:"<",searchFilter:"<",assignedRoles:"<",ownerAssignedRoles:"<",expandGroups:"<",onChangeRoles:"&"}})}();
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
<!-- @Deprecated: Component migrated to angular.-->
|
|
2
|
-
<!--packages/ngx-components/user-roles/roles-asset-tree/roles-asset-tree.component.ts-->
|
|
3
|
-
|
|
4
|
-
<div hidden="true">
|
|
5
|
-
{{
|
|
6
|
-
vm.onChangeItemCount({
|
|
7
|
-
count: (vm.flatAssetTree | filter: vm.filterAsset | filter: { name: vm.searchFilter }).length
|
|
8
|
-
})
|
|
9
|
-
}}
|
|
10
|
-
</div>
|
|
11
1
|
<div class="c8y-list__group m-b-0 no-border-last">
|
|
12
2
|
<div
|
|
13
|
-
ng-repeat="asset in vm.flatAssetTree | filter:vm.filterAsset | filter:{name:vm.searchFilter}
|
|
3
|
+
ng-repeat="asset in vm.flatAssetTree | filter:vm.filterAsset | filter:{name:vm.searchFilter}"
|
|
14
4
|
class="c8y-list__item"
|
|
15
5
|
>
|
|
16
6
|
<div
|
|
@@ -19,36 +9,26 @@
|
|
|
19
9
|
>
|
|
20
10
|
<div ng-style="::{'padding-left': asset._depth * 8}"></div>
|
|
21
11
|
<div class="c8y-list__item__icon m-t-4 p-l-0">
|
|
22
|
-
<button
|
|
23
|
-
class="btn-clean"
|
|
12
|
+
<button class="btn-clean"
|
|
24
13
|
ng-click="vm.loadChildren(asset)"
|
|
25
14
|
type="button"
|
|
26
15
|
aria-label="{{ 'Open' | translate }}"
|
|
27
16
|
>
|
|
28
|
-
<i
|
|
29
|
-
|
|
30
|
-
class="c8y-icon-duocolor"
|
|
31
|
-
ng-if="!asset.isOpened"
|
|
32
|
-
></i>
|
|
33
|
-
<i
|
|
34
|
-
c8y-icon="c8y-group-open"
|
|
35
|
-
class="c8y-icon-duocolor"
|
|
36
|
-
ng-if="asset.isOpened"
|
|
37
|
-
></i>
|
|
17
|
+
<i c8y-icon="c8y-group" class="c8y-icon-duocolor" ng-if="!asset.isOpened"></i>
|
|
18
|
+
<i c8y-icon="c8y-group-open" class="c8y-icon-duocolor" ng-if="asset.isOpened"></i>
|
|
38
19
|
</button>
|
|
39
20
|
</div>
|
|
40
21
|
<div class="c8y-list__item__body">
|
|
41
22
|
<div class="d-flex a-i-center">
|
|
42
23
|
<div class="col-sm-7 p-l-0 col-xs-12">
|
|
43
|
-
<button
|
|
44
|
-
class="btn-clean"
|
|
24
|
+
<button class="btn-clean"
|
|
45
25
|
type="button"
|
|
46
26
|
ng-click="vm.loadChildren(asset)"
|
|
47
27
|
>
|
|
48
28
|
<span
|
|
49
29
|
class="text-truncate"
|
|
50
30
|
title="{{::asset.name}}"
|
|
51
|
-
ng-style="{
|
|
31
|
+
ng-style="{cursor: asset._subGroups === undefined ? 'pointer' : 'default'}"
|
|
52
32
|
>
|
|
53
33
|
{{::asset.name}}
|
|
54
34
|
</span>
|
|
@@ -65,7 +45,8 @@
|
|
|
65
45
|
inventory-roles="::vm.inventoryRoles"
|
|
66
46
|
on-apply="::vm.onApply(roles, asset.id)"
|
|
67
47
|
ng-click="$event.stopPropagation()"
|
|
68
|
-
|
|
48
|
+
>
|
|
49
|
+
</c8y-inventory-role-selector>
|
|
69
50
|
</div>
|
|
70
51
|
</div>
|
|
71
52
|
</div>
|