@c8y/ng1-modules 1018.206.0 → 1018.207.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1018.206.0",
3
+ "version": "1018.207.0",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -1 +1 @@
1
- "use strict";!function(){function e(u,n,i,t,r,e,s,o,a,l,c){var f,g=this;function d(e){return f=e?[]:g.users,g.users=[],i.list(function(){var e=_.get(g.filters,"text"),n=_.map(_.get(g.filters,"globalRoles"),"id"),t=n.length?n.join(","):void 0;return{withSubusersCount:!0,username:e,groups:t,withApps:!1,withGroups:!1,withRoles:!1,onlyRoots:_.isEmpty(e)}}()).then(h)}function h(e){p(e),g.users.paging=e.paging}function p(e){var n=g.users,t=n.paging,s=i.getTfaStrategy(),o=[];return _.forEach(e,function(r){var e=_.find(f,{id:r.id});r.twoFactorAuthenticationEnabled||u.all({enforced:i.isTfaActive(r),strategy:s}).then(function(e){var n=e.enforced,t=e.strategy;"SMS"!==t&&t||n&&(r.twoFactorAuthenticationEnabled=n)}),e&&(r._expanded=e._expanded,o.push(r)),_.some(n,{id:r.id})||(n=n.concat([r]))}),n.paging=t,g.users=n,o.reduce(function(e,n){return e.then(function(){return v(n)})},u.resolve())}function E(e){g.globalRoles=e}function R(e){return e._globalRoles=_.map(_.get(e,"groups.references"),function(e){return _.find(g.globalRoles,{id:e.group.id})}),e}function A(){i.current().then(function(e){g.canAddUser=i.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")||g.FEATURE_USER_HIERARCHY&&i.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE"),g.canRevokeTokens=i.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")})}function v(e){return f=g.users,i.listAll({owner:e.id,withSubusersCount:!0}).then(p)}_.assign(g,{ROUTE_NEW_USER:r.ROUTE_NEW_USER,$onInit:function(){u.all([d(),e.global.list({pageSize:1e4}).then(E)]).then(function(){return _.forEach(g.users,R)}),r.userHierarchyActive().then(function(e){g.FEATURE_USER_HIERARCHY=e}).then(A)},loadMore:function(){g.users.paging.loading=!0,g.users.paging.next().then(h).finally(function(){g.users.paging.loading=!1})},loadUsers:d,loadSubusers:v,changeUser:function(n,e){var t="changeGlobalRoles"===e.name;return r.warnAboutUserLogOutIfNeeded(n,{rolesChanged:t}).then(function(){return r.changeUser(n,e)}).then(function(e){return function(e,n){var t,r=n||{};if(r.removeUser){g.users=_.reject(g.users,{id:e.id});var s=_.get(e,"_owner.id");g.users=_.map(g.users,function(e){return s&&s===e.id?(e.subusersCount--,angular.copy(e)):e})}r.refresh||r.removeUser||(t=i.list({username:e.id,withSubusersCount:!0}).then(_.first).then(function(t){var r=t.id,e=_.map(g.users,function(e){var n=r===e.id;return n&&(t._expanded=e._expanded),n?R(t):e});_.assign(e,_.pick(g.users,["statistics","paging"])),g.users=e}));r.refresh&&(t=d());return t}(n,e)})},showExpandCollapse:function(){return g.FEATURE_USER_HIERARCHY&&_.some(g.users,function(e){return 0<e.subusersCount||_.get(e,"_owns.length")})},collapseAll:function(){r.collapseAll(g.users)},expandAll:function(){r.expandAll(g.users),u.all(_.map(g.users,function(e){return e.subusersCount>e._owns.length?v(e).then(function(){return!0}):u.resolve(!1)})).then(function(e){_.some(e)&&n(g.expandAll)})},filters:{},applyFilters:function(){d(!0)},clearFilters:function(){g.filters={},d(!0)},isAnyFilterSelected:function(){return _.some(g.filters,_.identity)},refresh:function(){return d(!0).then(function(){return _.forEach(g.users,R)})},revokeTokens:function(){var n=c.get("c8yAuthBridgeService").getPreferredLoginOption(),e=function(){return i.current().then(function(e){return function(e){return!(!i.hasExternalOrigin(e)&&"BASIC"===n.type)}(e)})};s({title:l("Confirm log out all users?"),body:l('You are about to log out all users currently logged with "OAI-Secure" or "Single sign-on redirect". The JWT tokens retrieved by all devices in the current tenant will also be invalidated. Do you want to proceed?'),status:"warning",size:"sm",labels:{ok:l("Revoke tokens and log out users")}}).then(function(){return i.revokeTokens()}).then(function(){return e().then(function(e){return e?t.logoutAndReloadPage():u.resolve()})}).then(function(){return o.success(l("User tokens revoked."))}).catch(function(e){e&&o.danger(a.getResErrorMessage(e))})}})}e.$inject=["$q","$timeout","c8yUser","c8yUserUtil","c8yUsersUi","c8yRoles","c8yModal","c8yAlert","c8yBase","gettext","$injector"],angular.module("c8y.users").component("c8yUserListView",{templateUrl:":::PLUGIN_PATH:::/userListView/userListView.html",controller:e,controllerAs:"vm"})}();
1
+ "use strict";!function(){function e(u,n,i,t,r,e,s,o,a,l,c){var f,g=this;function d(e){return f=e?[]:g.users,g.users=[],i.list(function(){var e=_.get(g.filters,"text"),n=_.map(_.get(g.filters,"globalRoles"),"id"),t=n.length?n.join(","):void 0;return{withSubusersCount:!0,username:e,groups:t,withApps:!1,withGroups:!1,withRoles:!1,onlyRoots:_.isEmpty(e)}}()).then(h)}function h(e){p(e),g.users.paging=e.paging}function p(e){var n=g.users,t=n.paging,s=i.getTfaStrategy(),o=[];return _.forEach(e,function(r){var e=_.find(f,{id:r.id});r.twoFactorAuthenticationEnabled||u.all({enforced:i.isTfaActive(r),strategy:s}).then(function(e){var n=e.enforced,t=e.strategy;"SMS"!==t&&t||n&&(r.twoFactorAuthenticationEnabled=n)}),e&&(r._expanded=e._expanded,o.push(r)),_.some(n,{id:r.id})||(n=n.concat([r]))}),n.paging=t,g.users=n,o.reduce(function(e,n){return e.then(function(){return v(n)})},u.resolve())}function E(e){g.globalRoles=e}function R(e){return e._globalRoles=_.map(_.get(e,"groups.references"),function(e){return _.find(g.globalRoles,{id:e.group.id})}),e}function A(){i.current().then(function(e){g.canAddUser=i.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")||g.FEATURE_USER_HIERARCHY&&i.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE"),g.canRevokeTokens=i.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")})}function v(e){return f=g.users,i.listAll({owner:e.id,withSubusersCount:!0}).then(p)}_.assign(g,{ROUTE_NEW_USER:r.ROUTE_NEW_USER,$onInit:function(){u.all([d(),e.global.list({pageSize:1e4}).then(E)]).then(function(){return _.forEach(g.users,R)}),r.userHierarchyActive().then(function(e){g.FEATURE_USER_HIERARCHY=e}).then(A)},loadMore:function(){g.users.paging.loading=!0,g.users.paging.next().then(h).finally(function(){g.users.paging.loading=!1})},loadUsers:d,loadSubusers:v,changeUser:function(n,e){var t="changeGlobalRoles"===e.name;return r.warnAboutUserLogOutIfNeeded(n,{rolesChanged:t}).then(function(){return r.changeUser(n,e)}).then(function(e){return function(e,n){var t,r=n||{};if(r.removeUser){g.users=_.reject(g.users,{id:e.id});var s=_.get(e,"_owner.id");g.users=_.map(g.users,function(e){return s&&s===e.id?(e.subusersCount--,angular.copy(e)):e})}r.refresh||r.removeUser||(t=i.list({username:e.id,withSubusersCount:!0}).then(_.first).then(function(t){var r=t.id,e=_.map(g.users,function(e){var n=r===e.id;return n&&(t._expanded=e._expanded),n?R(t):e});_.assign(e,_.pick(g.users,["statistics","paging"])),g.users=e}));r.refresh&&(t=d());return t}(n,e)})},showExpandCollapse:function(){return g.FEATURE_USER_HIERARCHY&&_.some(g.users,function(e){return 0<e.subusersCount||_.get(e,"_owns.length")})},collapseAll:function(){r.collapseAll(g.users)},expandAll:function(){r.expandAll(g.users),u.all(_.map(g.users,function(e){return e.subusersCount>e._owns.length?v(e).then(function(){return!0}):u.resolve(!1)})).then(function(e){_.some(e)&&n(g.expandAll)})},filters:{},applyFilters:function(){d(!0)},clearFilters:function(){g.filters={},d(!0)},isAnyFilterSelected:function(){return _.some(g.filters,_.identity)},refresh:function(){return d(!0).then(function(){return _.forEach(g.users,R)})},revokeTokens:function(){var n=c.get("c8yAuthBridgeService").getPreferredLoginOption(),e=function(){return i.current().then(function(e){return function(e){return!(!i.hasExternalOrigin(e)&&"BASIC"===n.type)}(e)})};s({title:l("Confirm log out all users?"),body:l('You are about to log out all users currently logged with "OAI-Secure" or "Single sign-on redirect". The JWT tokens retrieved by all devices in the current tenant will also be invalidated. Do you want to proceed?'),status:"warning",size:"sm",labels:{ok:l("Log out all users and invalidate tokens")}}).then(function(){return i.revokeTokens()}).then(function(){return e().then(function(e){return e?t.logoutAndReloadPage():u.resolve()})}).then(function(){return o.success(l("User tokens revoked."))}).catch(function(e){e&&o.danger(a.getResErrorMessage(e))})}})}e.$inject=["$q","$timeout","c8yUser","c8yUserUtil","c8yUsersUi","c8yRoles","c8yModal","c8yAlert","c8yBase","gettext","$injector"],angular.module("c8y.users").component("c8yUserListView",{templateUrl:":::PLUGIN_PATH:::/userListView/userListView.html",controller:e,controllerAs:"vm"})}();