@c8y/ng1-modules 1024.16.21 → 1024.18.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.
@@ -1 +1 @@
1
- (()=>{function e(i,e,r,n,a,s,t,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(){r.path("/deviceusers")},i.save=function(e){if(i.saving=!0,i.userForm.$valid){var r=_.keys(i._groups).filter(function(e){return i._groups[e]}).map(function(e){return parseInt(e,10)});try{var t=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,r)}).then(d.triggerEvent("dmCredentialManagement",{action:"assignRole",name:"role"})).then(angular.bind({},y)).then(_.partial(u.success,c("Device updated.")));t.finally(function(){i.saving=!1}),t.then(function(){n.history.back()})}catch(e){u.danger(e.message),i.saving=!1}}},i.invalid=angular.bind(t,t.invalid,i,"userForm"),i.$watch("user.userName",function(e){e&&o.changeTitle({title:e},{skipTitleTranslation:!0})}),i.getErrorFeedback=function(e){var t=i.userForm[e]||{},n=[];return _.forEach(t.$error||{},function(e,r){e&&!t.$pristine&&n.push(l.getString(v[r.toUpperCase()].text))}),n.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)})();
1
+ 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 ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{function e(o,e,t,n,i,u,r,c,a,s,f,p,l,y){var g=e.userId,d={REQUIRED:{type:"required",text:s("This field is required.")},EMAIL:{type:"email",text:s("Invalid email address.")}};function b(e){i.checkIfCurrent(e).then(function(e){o.isCurrent=e}),o.user=e,o._groups={},(e.groups&&e.groups.references||[]).forEach(function(e){e=e.group.id;o._groups[e]=!0})}function m(e){o.groups=e}function v(){g?i.detail(g).then(function(e){return e.data}).then(b):b({enabled:o.isNew=!0})}o.saving=!1,o.cancel=function(){t.path("/deviceusers")},o.save=function(e){if(o.saving=!0,o.userForm.$valid){var t=_.keys(o._groups).filter(function(e){return o._groups[e]}).map(function(e){return parseInt(e,10)});try{var r=i.save(e,o.isCurrent).then(function(e){e=e.data;return g=e.userName,e.id=g,e}).then(function(e){return u.updateGroups(e,t)}).then(l.triggerEvent("dmCredentialManagement",{action:"assignRole",name:"role"})).then(angular.bind({},v)).then(_.partial(c.success,s("Device updated.")));r.finally(function(){o.saving=!1}),r.then(function(){n.history.back()})}catch(e){c.danger(e.message),o.saving=!1}}},o.invalid=angular.bind(r,r.invalid,o,"userForm"),o.$watch("user.userName",function(e){e&&a.changeTitle({title:e},{skipTitleTranslation:!0})}),o.getErrorFeedback=function(e){var r=o.userForm[e]||{},n=[];return _.forEach(r.$error||{},function(e,t){e&&!r.$pristine&&n.push(f.getString(d[t.toUpperCase()].text))}),n.join(" ")},o.getGroupName=y.getName,v(),u.list(_objectSpread({pageSize:1e3},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)})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1024.16.21",
3
+ "version": "1024.18.0",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -1 +1 @@
1
- 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 ownKeys(r,e){var n,t=Object.keys(r);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(r),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,n)),t}function _objectSpread(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(r,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))})}return r}function _defineProperty(e,r,n){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,r){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===r?String:Number)(e);n=n.call(e,r||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{function e(a,D,c,e,f,l,d,p,r,n,t,g,E,o,m,i,h){var s,u,y,v=this,w=(_.assign(v,{cancel:g.gotoList,shouldDisableGlobalRolesCheckbox:M,isUserAndRolesFormPristine:T,isUserFormInvalid:b,isRolesFormInvalid:U,canSave:function(){return!(c.saving||T()||b()||U())},getUserData:S,getRoleName:i.getName}),e.userId),N=["business"];function O(){w?l.detail(w).then(function(e){return e.data}).then(R).then(function(){return l.getUserTfaSettings(c.user).then(f.getResData).then(function(e){c.userTfaEnforced=!!e.tfaEnforced})}):(R({enabled:c.isNew=!0}),C(h("New user"),!0))}function R(e){u=e.email,e.devicePermissions=e.devicePermissions||{},c.user=e,c._groups=A(e),c.password.showPassword=c.isNew,c.hasExternalOrigin=l.hasExternalOrigin(e),c.isNew&&(_.forEach(c.groups,function(e){_.includes(N,e.name)&&(c._groups[e.id]=!0)}),y)&&p.warning(g.LOCAL_USER_TEXT),c.hasExternalOrigin&&o.isSsoClearingUserRolesOnEveryLogin().then(function(e){return c.userCanEditRoles=!e,c.userCanEditRoles}).then(function(e){e?p.warning(g.EXTERNAL_ORIGIN_DYNAMIC_ACCESS_MAPPING_EXCEPTION_TEXT):p.warning(g.EXTERNAL_ORIGIN_TEXT)})}function T(){return c.forms.userForm.$pristine&&c.forms.rolesForm.$pristine}function b(){return!!(G(c.currentUser,c.user)&&!c.hasExternalOrigin)&&c.forms.userForm.$invalid}function U(){return!M()&&c.forms.rolesForm.$invalid}function A(e){return _.reduce(_.get(e,"groups.references"),function(e,r){return e[r.group.id]=!0,e},{})}function P(e){c.groups=e}function $(e){c.currentUser=e}function S(e){return c.isNew?_.omitBy(_.omit(e,["measurementUnit"]),function(e,r){return"displayName"===r&&""===_.trim(e)}):_objectSpread(_objectSpread({},_.omit(e,["measurementUnit","password"])),{},{displayName:""===_.trim(e.displayName)?"":e.displayName})}function I(n,e){function r(){return p.success(h("User saved."))}var t=1<arguments.length&&void 0!==e?e:"",e=(c.saving=!0,g.gotoList),o=!(n.id&&!n.groups),i=_(c._groups).map(function(e,r){return e&&parseInt(r,10)}).filter().value(),s=o?function(){return d.updateGroups(0<arguments.length&&void 0!==arguments[0]?arguments[0]:n,i)}:function(){return a.resolve()},o=c.forms.rolesForm.$dirty,u=c.password.showPassword;try{(c.hasExternalOrigin?g.warnAboutUserLogOutIfNeeded(n,{rolesChanged:o,passwordChanged:u}).then(function(){return s()}):g.warnAboutUserLogOutIfNeeded(n,{rolesChanged:o,passwordChanged:u}).then(function(){return n.password&&!c.isNew?l.changePassword(n,n.password,t):a.resolve()}).then(function(){return l.current()}).then(function(e){return _.isEqual(e.userName,n.userName)}).then(function(e){var r;return m.isActivatedFor("units-conversion")&&(e&&(r=n,r=_.get(n,"measurementUnit.value"),E.set("unit",r)),_.unset(n,"measurementUnit")),e}).then(function(e){return l.save(S(n),e)}).then(f.getResData).then(function(e){return s(e)}).then(function(){return l.setUserTfaSettings(n,{tfaEnforced:!!c.userTfaEnforced})})).then(r).then(e).finally(function(){c.saving=!1})}catch(e){p.danger(e.message),c.saving=!1}}function C(){return r.changeTitle({title:0<arguments.length&&void 0!==arguments[0]?arguments[0]:""},{skipTitleTranslation:!(1<arguments.length&&void 0!==arguments[1]&&arguments[1])})}function L(e){return l.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")||l.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE")}function G(e,r){return!(!e||!r)&&(!r.id||(e.id===r.id?l.hasRole(e,"ROLE_USER_MANAGEMENT_OWN_ADMIN"):l.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")||l.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE")))}function j(e){return _.get(c.user,"owner")&&s&&!s[e.id]}function M(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,r=L(c.currentUser),e=!e||!j(e),n=!!c.userCanEditRoles||!c.hasExternalOrigin;return!(r&&e&&n)}c.checkPassword=function(r){var e=!c.isNew,n=c.password.showPassword||(e=>e.email!==u)(r);return e&&n?t.currentPassword().then(function(e){return I(r,e)}).catch(function(e){e&&p.danger(f.getResErrorMessage(e)),O()}):I(r)},c.$watch("user.userName",C),c.$watch("user.owner",function(e){e?l.detail(e).then(f.getResData).then(function(e){s=A(e),_.forEach(c._groups,function(e,r){c._groups[r]=e&&s[r]})}):s=null}),c.$watch("_groups",function(e){c.enforcedGroup&&(c.topLevelTfaEnforced=e[c.enforcedGroup.id])},!0),c.canEditUser=G,c.canEditUserGroups=L,c.canActivateUser=function(e,r){return!(!e||!r)&&e.id!==r.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=j,c.$on("$destroy",function(){p.remove({text:g.EXTERNAL_ORIGIN_TEXT,type:"warning"}),p.remove({text:g.EXTERNAL_ORIGIN_DYNAMIC_ACCESS_MAPPING_EXCEPTION_TEXT,type:"warning"}),p.remove({text:g.LOCAL_USER_TEXT,type:"warning"})}),d.list(void 0).then(P).then(o.isSsoEnabled).then(function(e){y=e}).then(O).then(function(){return n.current().then(function(e){return l.getTenantTfaSettings(c.user,e.name)}).then(function(e){c.enforcedGroup=_.find(c.groups,{name:e.enforcedUsersGroup}),c.topLevelTfaEnforced=l.isEnforcedForUser(c.user,e)||c._groups[c.enforcedGroup.id]})}),l.current().then($),g.userHierarchyActive().then(function(e){v.FEATURE_USER_HIERARCHY=e})}e.$inject=["$q","$injector","$scope","$routeParams","c8yBase","c8yUser","c8yUserGroup","c8yAlert","c8yTitle","c8yTenant","c8yUserUtil","c8yUsersUi","c8yUserPreferences","c8yLoginOptions","c8yBeta","c8yPropertyValueTransformService","gettext"],angular.module("c8y.users").component("c8yUserDetailView",{templateUrl:":::PLUGIN_PATH:::/userDetailView/userDetailView.html",controller:e,controllerAs:"vm"})})();
1
+ 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 ownKeys(r,e){var n,t=Object.keys(r);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(r),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,n)),t}function _objectSpread(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(r,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))})}return r}function _defineProperty(e,r,n){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,r){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===r?String:Number)(e);n=n.call(e,r||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{function e(a,D,c,e,f,l,d,p,r,n,t,g,E,o,m,i,h){var s,u,y,v=this,w=(_.assign(v,{cancel:g.gotoList,shouldDisableGlobalRolesCheckbox:M,isUserAndRolesFormPristine:b,isUserFormInvalid:T,isRolesFormInvalid:U,canSave:function(){return!(c.saving||b()||T()||U())},getUserData:S,getRoleName:i.getName}),e.userId),N=["business"];function O(){w?l.detail(w).then(function(e){return e.data}).then(R).then(function(){return l.getUserTfaSettings(c.user).then(f.getResData).then(function(e){c.userTfaEnforced=!!e.tfaEnforced})}):(R({enabled:c.isNew=!0}),C(h("New user"),!0))}function R(e){u=e.email,e.devicePermissions=e.devicePermissions||{},c.user=e,c._groups=A(e),c.password.showPassword=c.isNew,c.hasExternalOrigin=l.hasExternalOrigin(e),c.isNew&&(_.forEach(c.groups,function(e){_.includes(N,e.name)&&(c._groups[e.id]=!0)}),y)&&p.warning(g.LOCAL_USER_TEXT),c.hasExternalOrigin&&o.isSsoClearingUserRolesOnEveryLogin().then(function(e){return c.userCanEditRoles=!e,c.userCanEditRoles}).then(function(e){e?p.warning(g.EXTERNAL_ORIGIN_DYNAMIC_ACCESS_MAPPING_EXCEPTION_TEXT):p.warning(g.EXTERNAL_ORIGIN_TEXT)})}function b(){return c.forms.userForm.$pristine&&c.forms.rolesForm.$pristine}function T(){return!!(G(c.currentUser,c.user)&&!c.hasExternalOrigin)&&c.forms.userForm.$invalid}function U(){return!M()&&c.forms.rolesForm.$invalid}function A(e){return _.reduce(_.get(e,"groups.references"),function(e,r){return e[r.group.id]=!0,e},{})}function P(e){c.groups=e}function $(e){c.currentUser=e}function S(e){return c.isNew?_.omitBy(_.omit(e,["measurementUnit"]),function(e,r){return"displayName"===r&&""===_.trim(e)}):_objectSpread(_objectSpread({},_.omit(e,["measurementUnit","password"])),{},{displayName:""===_.trim(e.displayName)?"":e.displayName})}function I(n,e){function r(){return p.success(h("User saved."))}var t=1<arguments.length&&void 0!==e?e:"",e=(c.saving=!0,g.gotoList),o=!(n.id&&!n.groups),i=_(c._groups).map(function(e,r){return e&&parseInt(r,10)}).filter().value(),s=o?function(){return d.updateGroups(0<arguments.length&&void 0!==arguments[0]?arguments[0]:n,i)}:function(){return a.resolve()},o=c.forms.rolesForm.$dirty,u=c.password.showPassword;try{(c.hasExternalOrigin?g.warnAboutUserLogOutIfNeeded(n,{rolesChanged:o,passwordChanged:u}).then(function(){return s()}):g.warnAboutUserLogOutIfNeeded(n,{rolesChanged:o,passwordChanged:u}).then(function(){return n.password&&!c.isNew?l.changePassword(n,n.password,t):a.resolve()}).then(function(){return l.current()}).then(function(e){return _.isEqual(e.userName,n.userName)}).then(function(e){var r;return m.isActivatedFor("units-conversion")&&(e&&(r=n,r=_.get(n,"measurementUnit.value"),E.set("unit",r)),_.unset(n,"measurementUnit")),e}).then(function(e){return l.save(S(n),e)}).then(f.getResData).then(function(e){return s(e)}).then(function(){return l.setUserTfaSettings(n,{tfaEnforced:!!c.userTfaEnforced})})).then(r).then(e).finally(function(){c.saving=!1})}catch(e){p.danger(e.message),c.saving=!1}}function C(){return r.changeTitle({title:0<arguments.length&&void 0!==arguments[0]?arguments[0]:""},{skipTitleTranslation:!(1<arguments.length&&void 0!==arguments[1]&&arguments[1])})}function L(e){return l.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")||l.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE")}function G(e,r){return!(!e||!r)&&(!r.id||(e.id===r.id?l.hasRole(e,"ROLE_USER_MANAGEMENT_OWN_ADMIN"):l.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")||l.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE")))}function j(e){return _.get(c.user,"owner")&&s&&!s[e.id]}function M(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,r=L(c.currentUser),e=!e||!j(e),n=!!c.userCanEditRoles||!c.hasExternalOrigin;return!(r&&e&&n)}c.checkPassword=function(r){var e=!c.isNew,n=c.password.showPassword||(e=>e.email!==u)(r);return e&&n?t.currentPassword().then(function(e){return I(r,e)}).catch(function(e){e&&p.danger(f.getResErrorMessage(e)),O()}):I(r)},c.$watch("user.userName",C),c.$watch("user.owner",function(e){e?l.detail(e).then(f.getResData).then(function(e){s=A(e),_.forEach(c._groups,function(e,r){c._groups[r]=e&&s[r]})}):s=null}),c.$watch("_groups",function(e){c.enforcedGroup&&(c.topLevelTfaEnforced=e[c.enforcedGroup.id])},!0),c.canEditUser=G,c.canEditUserGroups=L,c.canActivateUser=function(e,r){return!(!e||!r)&&e.id!==r.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=j,c.$on("$destroy",function(){p.remove({text:g.EXTERNAL_ORIGIN_TEXT,type:"warning"}),p.remove({text:g.EXTERNAL_ORIGIN_DYNAMIC_ACCESS_MAPPING_EXCEPTION_TEXT,type:"warning"}),p.remove({text:g.LOCAL_USER_TEXT,type:"warning"})}),d.list(_objectSpread({pageSize:1e3},void 0)).then(P).then(o.isSsoEnabled).then(function(e){y=e}).then(O).then(function(){return n.current().then(function(e){return l.getTenantTfaSettings(c.user,e.name)}).then(function(e){c.enforcedGroup=_.find(c.groups,{name:e.enforcedUsersGroup}),c.topLevelTfaEnforced=l.isEnforcedForUser(c.user,e)||c._groups[c.enforcedGroup.id]})}),l.current().then($),g.userHierarchyActive().then(function(e){v.FEATURE_USER_HIERARCHY=e})}e.$inject=["$q","$injector","$scope","$routeParams","c8yBase","c8yUser","c8yUserGroup","c8yAlert","c8yTitle","c8yTenant","c8yUserUtil","c8yUsersUi","c8yUserPreferences","c8yLoginOptions","c8yBeta","c8yPropertyValueTransformService","gettext"],angular.module("c8y.users").component("c8yUserDetailView",{templateUrl:":::PLUGIN_PATH:::/userDetailView/userDetailView.html",controller:e,controllerAs:"vm"})})();