@c8y/ng1-modules 1023.53.0 → 1023.55.5

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1023.53.0",
3
+ "version": "1023.55.5",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -7,7 +7,6 @@
7
7
  "usersUi.provider.js",
8
8
  "userListView/userListView.component.js",
9
9
  "userDetailView/userDetailView.component.js",
10
- "userDetailView/userApplicationAccess.component.js",
11
10
  "userList/userList.component.js",
12
11
  "aclEditor/aclEditor.directive.js",
13
12
  "applicationAccess/applicationAccess.directive.js",
@@ -1 +1 @@
1
- function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){var t;if(e)return"string"==typeof e?_arrayLikeToArray(e,r):"Map"===(t="Object"===(t={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}(()=>{function e(e,r,t,S){l.$inject=["$q","$routeParams"],d.$inject=["$q","$location","$uibModal","c8yBase","c8yUser","c8yRoles","c8yUserRolesUi","c8yUserInventoryRoles","c8yUserUtil","c8yPermissions","c8yAlert","$injector","passwordStrengthCheckerFactory","gettextCatalog","c8yModal"];var n="c8y-user",o=["ROLE_USER_MANAGEMENT_READ","ROLE_USER_MANAGEMENT_ADMIN","ROLE_USER_MANAGEMENT_CREATE"],C=c(),L=c("/new"),O=c("/:userId"),a={template:"<c8y-user-list-view></c8y-user-list-view>"},i={priority:1e3,icon:n,name:S("Profile / Global roles"),template:'<c8y-user-detail-view user-id="$resolve.userId"></c8y-user-detail-view>',resolve:{userId:["$route",function(e){return e.current.params.userId}]}},u={priority:-1e3,icon:"c8y-atom",name:S("Application access"),template:'<c8y-user-application-access user="$resolve.user"></c8y-user-application-access>',resolve:{user:["$route","c8yUser","c8yBase",function(e,t,n){return t.detail(e.current.params.userId).then(n.getResData).then(function(r){return r.owner?t.detail(r.owner).then(n.getResData).then(function(e){return r._owner=e,r}).catch(function(){return r}):r})}]}},s={data:l};return{initUi:function(){e.addNavigation({parent:{name:S("Accounts"),icon:"c8y-accounts"},name:S("Users"),path:c().replace(/^\//,""),icon:n,priority:5e3,routerLinkExact:!1,showIfPermissions:{anyRole:o}}),r.when(C,a),r.when(L,i),r.when(O,i),r.when(O,u),t.addTitle(O,s)},$get:d};function c(e){return"/users".concat(e||"")}function l(e,r){return e.when({title:r.userId})}function d(a,r,t,i,u,n,e,o,s,c,l,d,g,f,y){var p,g=g();return u.current().then(function(e){p=e.id}),{ROUTE_NEW_USER:L,fullName:function(e){return"".concat(e.firstName||""," ").concat(e.lastName||"")},toggleExpanded:function(e){var t=!e._expanded;(e._expanded=t)||!function r(e){_.forEach(e,function(e){e._expanded=t,r(e._owns)})}(e._owns);return e},createUserFlatTree:s.createUserFlatTree,visibleInList:function(e){return!_.get(e,"owner")||_.get(e,"_owner._expanded")},expandAll:function(e){_.forEach(e,function(e){e._expanded=!0})},collapseAll:function(e){_.forEach(e,function(e){delete e._expanded})},detailLink:h,editUser:function(e){r.path(h(e))},search:s.search,changeUser:function(e,r){var t={changeGlobalRoles:v,copyInventoryRoles:A,enable:E,disable:m,remove:b,delegate:I,removeDelegate:N},n="string"==typeof r?r:_.get(r,"name");return _.get(t,n,a.reject)(e,_.get(r,"data"))},getPasswordStrength:g.getStrengthForColor,getPasswordColor:g.getHexColorForColor,getPasswordIcon:g.getIconForColor,isTfaAvailable:u.isTfaAvailable,gotoList:function(){r.path(C)},userHierarchyActive:s.userHierarchyActive,hasAppManagement:function(e){return c.hasAnyRole(["ROLE_APPLICATION_MANAGEMENT_READ","ROLE_APPLICATION_MANAGEMENT_ADMIN"],e)},isUndeletable:function(e){return p?U(e)||c.hasRole(e,"ROLE_TENANT_ADMIN"):void 0},isCurrent:U,warnAboutUserLogOutIfNeeded:function(e,r){var t=r.rolesChanged,r=r.passwordChanged||t,n="OAUTH2_INTERNAL"===d.get("c8yAuthBridgeService").getPreferredLoginOption().type;return e.id&&(!U(e)||t)&&n&&r?(t=U(e)?S("Updating global roles will force you to log out. Do you want to proceed?"):f.getString('Updating password or global roles will force user "{{userName}}" to log out. Do you want to proceed?',e),y({title:S("Force user to log out"),body:t,status:"warning",size:"sm",labels:{ok:S("Update and log out user")}})):a.resolve()},EXTERNAL_ORIGIN_TEXT:S("You cannot edit the user since it is managed via your authorization server."),EXTERNAL_ORIGIN_TEXT_FOR_USERS_LIST_VIEW:S("You cannot edit global roles for user with external origin, since it is managed via your authorization server."),EXTERNAL_ORIGIN_DYNAMIC_ACCESS_MAPPING_EXCEPTION_TEXT:S("You cannot edit the user since it is managed via your authorization server, but the configuration allows for changing global roles."),LOCAL_USER_TEXT:S("You are about to create a local user which will not be able to log in via single sign-on.")};function h(e){return O.replace(/:userId/,e.id)}function v(e,r){r=_.map(r.roles,"id");return n.global.updateGroups(e,r)}function A(n){return a.all({copy:e.copyFromUserDialog(n),assignedRoles:u.listInventoryRoles(n)}).then(function(e){var r="replace"===e.copy.process,t=e.copy.roles,e=_.keyBy(e.assignedRoles.data.inventoryAssignments,"managedObject");return o.copyUserRoles(t,e,n,r)})}function m(e){return u.disable(e)}function E(e){return u.enable(e)}function b(r){var e=0<r.subusersCount;return t.open({component:"c8yUserRemovalModal",resolve:{user:function(){return r}}}).result.then(function(e){var t;return e.deleteAll?w(r,{deep:!0}).then(function(e){return e.reduce(function(e,r){return e.then(function(){return u.remove(r)})},a.resolve())}):_.isUndefined(e.newOwner)?a.resolve():(t=e.newOwner,w(r,{deep:!1}).then(function(e){return e.reduce(function(e,r){return e.then(function(){return u.save({id:r.id,owner:t})})},a.resolve())}))}).then(function(){return u.remove(r)}).then(function(){return l.success(f.getString('User "{{userName}}" deleted.',r))}).then(function(){return{removeUser:!e,refresh:e}})}function w(e,r){var t,n,o=1<arguments.length&&void 0!==r?r:{};return 0===e.subusersCount?a.resolve([]):(t=[],n=function(e){t.push.apply(t,_toConsumableArray(e));var r=e.statistics.pageSize,r=e.paging.next&&r<=e.length?e.paging.next().then(n):a.resolve(t);return r},u.list({owner:e.id,withSubusersCount:!0,pageSize:i.MAX_PAGESIZE}).then(n).then(function(e){var r;return o.deep?(r=e.map(function(e){return w(e,o)}),a.all([].concat(_toConsumableArray(e),_toConsumableArray(r))).then(_.flattenDeep)):e}))}function I(e){return u.delegateTo(e).then(_.partial(T,e))}function T(e){return l.success(f.getString('You delegated to user "{{userName}}".',e))}function N(e){var r={id:e.id,delegatedBy:null};return u.save(r).then(_.partial(R,e))}function R(e){return l.success(f.getString('You removed delegation from user "{{userName}}".',e))}function U(e){return p&&p===e.id}}}e.$inject=["c8yNavigatorProvider","c8yViewsProvider","c8yTitleProvider","gettext"],angular.module("c8y.users").provider("c8yUsersUi",e)})();
1
+ function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,r){var t;if(e)return"string"==typeof e?_arrayLikeToArray(e,r):"Map"===(t="Object"===(t={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}(()=>{function e(e,r,t,S){l.$inject=["$q","$routeParams"],c.$inject=["$q","$location","$uibModal","c8yBase","c8yUser","c8yRoles","c8yUserRolesUi","c8yUserInventoryRoles","c8yUserUtil","c8yPermissions","c8yAlert","$injector","passwordStrengthCheckerFactory","gettextCatalog","c8yModal"];var n="c8y-user",o=["ROLE_USER_MANAGEMENT_READ","ROLE_USER_MANAGEMENT_ADMIN","ROLE_USER_MANAGEMENT_CREATE"],C=s(),L=s("/new"),O=s("/:userId"),a={template:"<c8y-user-list-view></c8y-user-list-view>"},i={priority:1e3,icon:n,name:S("Profile / Global roles"),template:'<c8y-user-detail-view user-id="$resolve.userId"></c8y-user-detail-view>',resolve:{userId:["$route",function(e){return e.current.params.userId}]}},u={data:l};return{initUi:function(){e.addNavigation({parent:{name:S("Accounts"),icon:"c8y-accounts"},name:S("Users"),path:s().replace(/^\//,""),icon:n,priority:5e3,routerLinkExact:!1,showIfPermissions:{anyRole:o}}),r.when(C,a),r.when(L,i),r.when(O,i),t.addTitle(O,u)},$get:c};function s(e){return"/users".concat(e||"")}function l(e,r){return e.when({title:r.userId})}function c(a,r,t,i,u,n,e,o,s,l,c,d,g,f,y){var p,g=g();return u.current().then(function(e){p=e.id}),{ROUTE_NEW_USER:L,fullName:function(e){return"".concat(e.firstName||""," ").concat(e.lastName||"")},toggleExpanded:function(e){var t=!e._expanded;(e._expanded=t)||!function r(e){_.forEach(e,function(e){e._expanded=t,r(e._owns)})}(e._owns);return e},createUserFlatTree:s.createUserFlatTree,visibleInList:function(e){return!_.get(e,"owner")||_.get(e,"_owner._expanded")},expandAll:function(e){_.forEach(e,function(e){e._expanded=!0})},collapseAll:function(e){_.forEach(e,function(e){delete e._expanded})},detailLink:h,editUser:function(e){r.path(h(e))},search:s.search,changeUser:function(e,r){var t={changeGlobalRoles:A,copyInventoryRoles:v,enable:E,disable:m,remove:b,delegate:I,removeDelegate:N},n="string"==typeof r?r:_.get(r,"name");return _.get(t,n,a.reject)(e,_.get(r,"data"))},getPasswordStrength:g.getStrengthForColor,getPasswordColor:g.getHexColorForColor,getPasswordIcon:g.getIconForColor,isTfaAvailable:u.isTfaAvailable,gotoList:function(){r.path(C)},userHierarchyActive:s.userHierarchyActive,hasAppManagement:function(e){return l.hasAnyRole(["ROLE_APPLICATION_MANAGEMENT_READ","ROLE_APPLICATION_MANAGEMENT_ADMIN"],e)},isUndeletable:function(e){return p?U(e)||l.hasRole(e,"ROLE_TENANT_ADMIN"):void 0},isCurrent:U,warnAboutUserLogOutIfNeeded:function(e,r){var t=r.rolesChanged,r=r.passwordChanged||t,n="OAUTH2_INTERNAL"===d.get("c8yAuthBridgeService").getPreferredLoginOption().type;return e.id&&(!U(e)||t)&&n&&r?(t=U(e)?S("Updating global roles will force you to log out. Do you want to proceed?"):f.getString('Updating password or global roles will force user "{{userName}}" to log out. Do you want to proceed?',e),y({title:S("Force user to log out"),body:t,status:"warning",size:"sm",labels:{ok:S("Update and log out user")}})):a.resolve()},EXTERNAL_ORIGIN_TEXT:S("You cannot edit the user since it is managed via your authorization server."),EXTERNAL_ORIGIN_TEXT_FOR_USERS_LIST_VIEW:S("You cannot edit global roles for user with external origin, since it is managed via your authorization server."),EXTERNAL_ORIGIN_DYNAMIC_ACCESS_MAPPING_EXCEPTION_TEXT:S("You cannot edit the user since it is managed via your authorization server, but the configuration allows for changing global roles."),LOCAL_USER_TEXT:S("You are about to create a local user which will not be able to log in via single sign-on.")};function h(e){return O.replace(/:userId/,e.id)}function A(e,r){r=_.map(r.roles,"id");return n.global.updateGroups(e,r)}function v(n){return a.all({copy:e.copyFromUserDialog(n),assignedRoles:u.listInventoryRoles(n)}).then(function(e){var r="replace"===e.copy.process,t=e.copy.roles,e=_.keyBy(e.assignedRoles.data.inventoryAssignments,"managedObject");return o.copyUserRoles(t,e,n,r)})}function m(e){return u.disable(e)}function E(e){return u.enable(e)}function b(r){var e=0<r.subusersCount;return t.open({component:"c8yUserRemovalModal",resolve:{user:function(){return r}}}).result.then(function(e){var t;return e.deleteAll?T(r,{deep:!0}).then(function(e){return e.reduce(function(e,r){return e.then(function(){return u.remove(r)})},a.resolve())}):_.isUndefined(e.newOwner)?a.resolve():(t=e.newOwner,T(r,{deep:!1}).then(function(e){return e.reduce(function(e,r){return e.then(function(){return u.save({id:r.id,owner:t})})},a.resolve())}))}).then(function(){return u.remove(r)}).then(function(){return c.success(f.getString('User "{{userName}}" deleted.',r))}).then(function(){return{removeUser:!e,refresh:e}})}function T(e,r){var t,n,o=1<arguments.length&&void 0!==r?r:{};return 0===e.subusersCount?a.resolve([]):(t=[],n=function(e){t.push.apply(t,_toConsumableArray(e));var r=e.statistics.pageSize,r=e.paging.next&&r<=e.length?e.paging.next().then(n):a.resolve(t);return r},u.list({owner:e.id,withSubusersCount:!0,pageSize:i.MAX_PAGESIZE}).then(n).then(function(e){var r;return o.deep?(r=e.map(function(e){return T(e,o)}),a.all([].concat(_toConsumableArray(e),_toConsumableArray(r))).then(_.flattenDeep)):e}))}function I(e){return u.delegateTo(e).then(_.partial(w,e))}function w(e){return c.success(f.getString('You delegated to user "{{userName}}".',e))}function N(e){var r={id:e.id,delegatedBy:null};return u.save(r).then(_.partial(R,e))}function R(e){return c.success(f.getString('You removed delegation from user "{{userName}}".',e))}function U(e){return p&&p===e.id}}}e.$inject=["c8yNavigatorProvider","c8yViewsProvider","c8yTitleProvider","gettext"],angular.module("c8y.users").provider("c8yUsersUi",e)})();
@@ -1 +0,0 @@
1
- (()=>{function e(n,e,s,t,r){var a=this;function i(){var e=r("User's application access changed.");return t.success(e)}_.assign(a,{save:function(){var e=_.pick(a.user,["id","applications"]);return n.save(e).then(i)},cancel:s.gotoList,$onChanges:function(e){e.user&&a.user&&(a.hasExternalOrigin=n.hasExternalOrigin(a.user),a.hasExternalOrigin&&t.warning(s.EXTERNAL_ORIGIN_TEXT),(e=>{s.hasAppManagement(e).then(function(e){a.hasAppManagement=e})})(a.user))},$onDestroy:function(){t.remove({text:s.EXTERNAL_ORIGIN_TEXT,type:"warning"})}})}e.$inject=["c8yUser","c8yApplication","c8yUsersUi","c8yAlert","gettext"],angular.module("c8y.users").component("c8yUserApplicationAccess",{templateUrl:":::PLUGIN_PATH:::/userDetailView/userApplicationAccess.html",bindings:{user:"<"},controller:e,controllerAs:"vm"})})();
@@ -1,57 +0,0 @@
1
- <c8y-breadcrumbs-set>
2
- <c8y-breadcrumbs-item
3
- path="#users"
4
- label="{{ 'Users' | translate }}"
5
- icon="c8y-accounts"
6
- ></c8y-breadcrumbs-item>
7
- <c8y-breadcrumbs-item
8
- label="{{ 'Accounts' | translate }}"
9
- icon="c8y-accounts"
10
- ></c8y-breadcrumbs-item>
11
- </c8y-breadcrumbs-set>
12
-
13
- <div class="row">
14
- <div class="col-md-8">
15
- <div class="card card--fullpage">
16
- <div class="card-header separator" >
17
- <div class="card-title">{{'Application access' | translate}}</div>
18
- </div>
19
- <div class="inner-scroll">
20
- <div class="card-block">
21
- <div class="alert alert-info" translate ng-show="vm.hasAppManagement">
22
- This user is assigned a global role with "Application management" permission. Therefore all
23
- applications are accessible.
24
- </div>
25
- <c8y-application-access
26
- user="vm.user"
27
- all-selected="vm.hasAppManagement"
28
- allowed-applications="vm.user.applications"
29
- disabled-edit="vm.hasAppManagement || vm.hasExternalOrigin"
30
- >
31
- </c8y-application-access>
32
- </div>
33
- </div>
34
- <div class="card-footer separator">
35
- <button
36
- title="{{ 'Cancel' | translate }}"
37
- type="button"
38
- class="btn btn-default"
39
- ng-click="vm.cancel()"
40
- translate
41
- >
42
- Cancel
43
- </button>
44
- <button
45
- title="{{ 'Save' | translate }}"
46
- type="button"
47
- class="btn btn-primary"
48
- ng-click="vm.save()"
49
- ng-disabled="vm.hasAppManagement || vm.hasExternalOrigin"
50
- translate
51
- >
52
- Save
53
- </button>
54
- </div>
55
- </div>
56
- </div>
57
- </div>