@c8y/ng1-modules 1022.16.2 → 1022.26.1

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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,p=[],s=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(p.push(n.value),p.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return p}}function _toArray(e){return _arrayWithHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayWithHoles(e){if(Array.isArray(e))return e}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,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):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,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}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 e(e,o,c,u,h,f,y,m,d){return new function r(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=n.tenantId,l=this,a="x-show-if-any-available",p="title";function i(e){var t=_.cloneDeep(e),e=u.when(t),r=_.find(l.ENTITIES.values(),{staticSchemaPath:l.propertiesCfg.static.path});return e=r?y.list().then(function(e){var t={appliesTo:{}};return t.appliesTo[r.value]=!0,_.filter(e,t)}).then(function(e){return _.map(e,function(e){return _.get(e,"c8y_JsonSchema")})}).then(function(e){return _.forEach(e,function(e){r===l.ENTITIES.TENANTS?_.merge(t.properties.customProperties.properties,e.properties):_.merge(t.properties,e.properties)}),t}):e}function s(e,t,r,n,i){if(r===p&&(r=_.has(i,"type"),i=!_.isUndefined(e),r)&&i)return e}this.ENTITIES=h.createEnum([{name:"MANAGED_OBJECTS",value:"MANAGED_OBJECTS",staticSchemaPath:h.dataFilePath("properties/managed-objects.json")},{name:"MEASUREMENTS",value:"MEASUREMENTS",staticSchemaPath:h.dataFilePath("properties/measurements.json")},{name:"ALARMS",value:"ALARMS",staticSchemaPath:h.dataFilePath("properties/alarms.json")},{name:"EVENTS",value:"EVENTS",staticSchemaPath:h.dataFilePath("properties/events.json")},{name:"TENANTS",value:"TENANTS",staticSchemaPath:h.dataFilePath("properties/tenants.json")}]),this.properties={},this.propertiesCfg={static:{path:e}},this.list=function(){return l.loadProperties().then(_.bind(l.getSimplifiedProperties,l))},this.getProperties=function(){return l.loadProperties().then(_.bind(l.getFullProperties,l))},this.getTenantDetails=function(){return t?d.detail(t).then(h.getResData):d.current()},this.removeKeysDependingOnAppsAvailability=function(t){return function e(t){for(var r=Object.keys(t),n=!1,i=0;i<r.length;i++){var o=r[i];_typeof(t[o])===_typeof({})&&null!==t[o]&&(n=o===a||n||e(t[o]))}return n}(t)?l.getTenantDetails().then(function(e){return e=_.flatMap(e.applications.references,"application"),function t(r,n){var e=Object.keys(r);return _.forEach(e,function(e){void 0===r[e][a]||_.some(r[e][a],function(e){return f.isAppOnTheList(n,e)})?_typeof(r[e])===_typeof({})&&null!==r[e]&&e!==a&&t(r[e],n):delete r[e]}),r}(t,e)}):t},this.loadProperties=_.throttle(function(){return l.loadStaticPropertiesSchema().then(i).then(l.removeKeysDependingOnAppsAvailability).then(_.bind(l.getPropertiesFromSchema,l)).then(_.bind(l.addProperties,l))},1e3,{leading:!0,trailing:!1}),this.loadStaticPropertiesSchema=function(){var e=l.propertiesCfg.static.path;return l.loadStaticPropertiesSchemaFromMemory()||o.get(e).then(h.getResData)},this.pathToKey=function(){var e=l.propertiesCfg.static.path;return _.last(e.split("/")).replace(/\.json$/,"")},this.loadStaticPropertiesSchemaFromMemory=function(){var e=l.pathToKey();return(e=(window.c8y&&window.c8y.collections&&window.c8y.collections.properties||{})[e])&&u.when(e)},this.getPropertiesFromSchema=function(e,t,r){var o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:["properties"],a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:[],p=5<arguments.length&&void 0!==arguments[5]?arguments[5]:[],s=t||e.id||"c8yDefaultSchema",t=_.cloneDeep(r||{type:"object",properties:{}}),c=l.setObjValue(t,o,{});return _.has(e,"properties")&&_.forEach(e.properties,function(e,t){var r=_.cloneDeep(c),n=_.flattenDeep([o,t,"properties"]),i=_.flattenDeep([a,t]),r=l.setObjValue(r,o,_.cloneDeep(e),t),t=l.getNewPropertyObj(s,i,r,e);p.push(t),l.getPropertiesFromSchema(e,s,r,n,i,p)}),p},this.getNewPropertyObj=function(e,t,r,n){var i=t.join("."),e={id:"".concat(e,"!!").concat(i),keyPath:t,type:n.type,printFormat:n.printFormat,label:l.getDefaultPropertyLabel(t,n),schema:r};return n.config&&(e.configSchema=n.config),n.computed&&(e.computed=n.computed),e},this.getFragmentName=function(e){var e=e[e.length-1],t=/_\d{9,}$/;return e=t.test(e)?e.replace(t,""):e},this.getDefaultPropertyLabel=function(e,t){return t=(t=t.title)||(t=(t=l.getFragmentName(e)).replace(/^c8y_/i,"").replace(/([A-Z][a-z])/g," $1").replace(/([^0-9])([0-9])/g,"$1 $2").replace("_"," ").replace(/^\s*/,"").replace(/\s*$/,"")).charAt(0).toUpperCase()+t.slice(1)},this.setObjValue=function(e,t,r,n){for(var i=e,o=0;o<t.length-1;o++)i[t[o]]||(i[t[o]]={}),i=i[t[o]];return n?i[t[o]][n]=r:i[t[o]]=r,e},this.addProperties=function(e){_.forEach(e,function(e){l.properties[e.id]=e})},this.getSimplifiedProperties=function(){return _.map(l.properties,_.bind(l.simplifyProperty,l))},this.simplifyProperty=function(e){return _.pick(e,["id","keyPath","type","label","configSchema","computed","printFormat"])},this.getFullProperties=function(){return _.cloneDeep(l.properties)},this.getSchema=function(e){return l.loadProperties().then(_.bind(l.getSchemaForProperties,l,e)).catch(c.error)},this.getSchemaForProperties=function(o){var a={type:"object",properties:{}};return _.forEach(o,function(e){l.isCustomProperty(e)&&l.addCustomProperty(e),_.mergeWith(a.properties,l.properties[e.id].schema.properties,s);var t,r,n,i=l.findInSchema(a,e);i&&(i.id=e.id,i.title=e.label||l.properties[e.id].label,n=i,t=e,r=o,l.isComplexProperty(t)&&0<l.getChildren(t,r).length&&(n.properties={}),_.forEach(_.get(i,"properties"),function(e){_.set(e,p,m.getString(e.title))}),t=a,r=e,n=_.last(r.id.split("!!")),i=_.last(r.keyPath),r.computed)&&r.configSchema&&(n!==i&&(t.properties[i]=t.properties[n],delete t.properties[n]),r.config&&4===r.config.resultType&&(t.properties[i].type="object",t.properties[i].properties={value:{title:m.getString("Value"),type:"number"},unit:{title:m.getString("Unit"),type:"string"}}),r.config)&&1===r.config.resultType&&(t.properties[i].type="number")}),function r(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];e.properties&&_.forEach(e.properties,function(e,t){n(e,t,[].concat(_toConsumableArray(i),[t])),r(e,n,[].concat(_toConsumableArray(i),[t]))})}(a,function(e,t,r){_.isUndefined(e.title)&&(e.title=l.getDefaultPropertyLabel(r,e))}),a},this.findInSchema=function(e,t){var r=t.keyPath;return t.computed&&(r=[l.getFragmentName(r)]),l.findInSchemaByKeyPath(e,r)},this.findInSchemaById=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];return _.isObjectLike(e)&&_.forOwn(e,function(e){_.isObjectLike(e)&&e.id===t?r.push(e):l.findInSchemaById(e,t,r)}),r},this.findInSchemaByKeyPath=function(e,t){if(!t.length)return e;if(e.properties){var r=(t=_toArray(t))[0],t=t.slice(1);if(_.has(e.properties,r))return this.findInSchemaByKeyPath(e.properties[r],t)}},this.getForm=function(e,t){return l.loadProperties().then(_.bind(l.getFormForProperties,l,e,t))},this.getFormForProperties=function(e,n){var t=_(e).map(function(e){var t;return e.computed?e:(t=_slicedToArray(e.id.match(/^(.+)!!/),2)[1],t="".concat(t,"!!").concat(e.keyPath[0]),e=l.properties[t],_.pick(e,["id","keyPath"]))}).uniqBy("keyPath").value(),i=l.getSchemaForProperties(e);return t.map(function(e){return t=n,r=i,r=l.findInSchemaByKeyPath(r,e.keyPath),r=((e,t)=>(t.computed&&t.configSchema&&(e.key=_.last(t.keyPath)),e))(r={key:ObjectPath.stringify(l.properties[e.id].keyPath),title:r.title||e.label||l.properties[e.id].label},e),_.assign(r,t),r;var t,r})},this.isComplexProperty=function(e){return"object"===e.type||"array"===e.type},this.isCustomProperty=function(e){return"c8yCustom"===e.id.split("!!")[0]},this.getChildren=function(t,e){return _.filter(e||l.properties,function(e){return t.id!==e.id&&_.isEqual(_.take(e.keyPath,t.keyPath.length),t.keyPath)})},this.changeActiveProperty=function(e,t){return _.map(e,function(e){return _.assign(e,{__active:t})})},this.removeDuplication=function(e){var t,r=e;return _.map(e,function(e){l.isComplexProperty(e)&&(t=_.map(l.getChildren(e),"id"),r=_.reject(r,function(e){return _.includes(t,e.id)}))}),r},this.getParent=function(t){return _.filter(l.properties,function(e){return t.keyPath.length>e.keyPath.length&&_.isEqual(_.take(t.keyPath,e.keyPath.length),e.keyPath)})},this.addCustomProperty=function(e){l.properties[e.id]||(l.properties[e.id]={}),_.merge(l.properties[e.id],e)},this.another=function(e,t){return new r(e,void 0===t?n:t)},this.paths=_.reduce(this.ENTITIES.values(),function(e,t){return e[_.startCase(_.camelCase(t.value)).replace(" ","")]=t.staticSchemaPath,e},{})}(h.dataFilePath("properties/managed-objects.json"))}e.$inject=["$filter","$http","$log","$q","c8yBase","c8yApplication","c8yJsonSchemas","gettextCatalog","c8yTenant"],angular.module("c8y.ui").provider("c8yPropertiesLibrary",function(){return{$get:e}})})();
1
+ function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,p=[],s=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(p.push(n.value),p.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return p}}function _toArray(e){return _arrayWithHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayWithHoles(e){if(Array.isArray(e))return e}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,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):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,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}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 e(e,o,c,l,h,f,y,m,d){return new function r(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=n.tenantId,u=this,a="x-show-if-any-available",p="title";function i(e){var t=_.cloneDeep(e),e=l.when(t),r=_.find(u.ENTITIES.values(),{staticSchemaPath:u.propertiesCfg.static.path});return e=r?y.list().then(function(e){var t={appliesTo:{}};return t.appliesTo[r.value]=!0,_.filter(e,t)}).then(function(e){return _.map(e,function(e){return _.get(e,"c8y_JsonSchema")})}).then(function(e){return _.forEach(e,function(e){r===u.ENTITIES.TENANTS?_.merge(t.properties.customProperties.properties,e.properties):_.merge(t.properties,e.properties)}),t}):e}function s(e,t,r,n,i){if(r===p&&(r=_.has(i,"type"),i=!_.isUndefined(e),r)&&i)return e}this.ENTITIES=h.createEnum([{name:"MANAGED_OBJECTS",value:"MANAGED_OBJECTS",staticSchemaPath:h.dataFilePath("properties/managed-objects.json")},{name:"MEASUREMENTS",value:"MEASUREMENTS",staticSchemaPath:h.dataFilePath("properties/measurements.json")},{name:"ALARMS",value:"ALARMS",staticSchemaPath:h.dataFilePath("properties/alarms.json")},{name:"EVENTS",value:"EVENTS",staticSchemaPath:h.dataFilePath("properties/events.json")},{name:"TENANTS",value:"TENANTS",staticSchemaPath:h.dataFilePath("properties/tenants.json")}]),this.properties={},this.propertiesCfg={static:{path:e}},this.list=function(){return u.loadProperties().then(_.bind(u.getSimplifiedProperties,u))},this.getProperties=function(){return u.loadProperties().then(_.bind(u.getFullProperties,u))},this.getTenantDetails=function(){return t?d.detail(t).then(h.getResData):d.current()},this.removeKeysDependingOnAppsAvailability=function(t){return function e(t){for(var r=Object.keys(t),n=!1,i=0;i<r.length;i++){var o=r[i];_typeof(t[o])===_typeof({})&&null!==t[o]&&(n=o===a||n||e(t[o]))}return n}(t)?u.getTenantDetails().then(function(e){return e=_.flatMap(e.applications.references,"application"),function t(r,n){var e=Object.keys(r);return _.forEach(e,function(e){void 0===r[e][a]||_.some(r[e][a],function(e){return f.isAppOnTheList(n,e)})?_typeof(r[e])===_typeof({})&&null!==r[e]&&e!==a&&t(r[e],n):delete r[e]}),r}(t,e)}):t},this.loadProperties=_.throttle(function(){return u.loadStaticPropertiesSchema().then(i).then(u.removeKeysDependingOnAppsAvailability).then(_.bind(u.getPropertiesFromSchema,u)).then(_.bind(u.addProperties,u))},1e3,{leading:!0,trailing:!1}),this.loadStaticPropertiesSchema=function(){var e=u.propertiesCfg.static.path;return u.loadStaticPropertiesSchemaFromMemory()||o.get(e).then(h.getResData)},this.pathToKey=function(){var e=u.propertiesCfg.static.path;return _.last(e.split("/")).replace(/\.json$/,"")},this.loadStaticPropertiesSchemaFromMemory=function(){var e=u.pathToKey();return(e=(window.c8y&&window.c8y.collections&&window.c8y.collections.properties||{})[e])&&l.when(e)},this.getPropertiesFromSchema=function(e,t,r){var o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:["properties"],a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:[],p=5<arguments.length&&void 0!==arguments[5]?arguments[5]:[],s=t||e.id||"c8yDefaultSchema",t=_.cloneDeep(r||{type:"object",properties:{}}),c=u.setObjValue(t,o,{});return _.has(e,"properties")&&_.forEach(e.properties,function(e,t){var r=_.cloneDeep(c),n=_.flattenDeep([o,t,"properties"]),i=_.flattenDeep([a,t]),r=u.setObjValue(r,o,_.cloneDeep(e),t),t=u.getNewPropertyObj(s,i,r,e);p.push(t),u.getPropertiesFromSchema(e,s,r,n,i,p)}),p},this.getNewPropertyObj=function(e,t,r,n){var i=t.join("."),e={id:"".concat(e,"!!").concat(i),keyPath:t,type:n.type,printFormat:n.printFormat,label:u.getDefaultPropertyLabel(t,n),schema:r};return n.config&&(e.configSchema=n.config),n.computed&&(e.computed=n.computed),e},this.getFragmentName=function(e){var e=e[e.length-1],t=/_\d{9,}$/;return e=t.test(e)?e.replace(t,""):e},this.getDefaultPropertyLabel=function(e,t){return t=(t=t.title)||(t=(t=u.getFragmentName(e)).replace(/^c8y_/i,"").replace(/([A-Z][a-z])/g," $1").replace(/([^0-9])([0-9])/g,"$1 $2").replace("_"," ").replace(/^\s*/,"").replace(/\s*$/,"")).charAt(0).toUpperCase()+t.slice(1)},this.setObjValue=function(e,t,r,n){for(var i=e,o=0;o<t.length-1;o++)i[t[o]]||(i[t[o]]={}),i=i[t[o]];return n?i[t[o]][n]=r:i[t[o]]=r,e},this.addProperties=function(e){_.forEach(e,function(e){u.properties[e.id]=e})},this.getSimplifiedProperties=function(){return _.map(u.properties,_.bind(u.simplifyProperty,u))},this.simplifyProperty=function(e){return _.pick(e,["id","keyPath","type","label","configSchema","computed","printFormat"])},this.getFullProperties=function(){return _.cloneDeep(u.properties)},this.getSchema=function(e){return u.loadProperties().then(_.bind(u.getSchemaForProperties,u,e)).catch(c.error)},this.getSchemaForProperties=function(o){var a={type:"object",properties:{}};return _.forEach(o,function(e){u.isCustomProperty(e)&&u.addCustomProperty(e),_.mergeWith(a.properties,u.properties[e.id].schema.properties,s);var t,r,n,i=u.findInSchema(a,e);i&&(i.id=e.id,i.title=e.label||u.properties[e.id].label,n=i,t=e,r=o,u.isComplexProperty(t)&&0<u.getChildren(t,r).length&&(n.properties={}),_.forEach(_.get(i,"properties"),function(e){_.set(e,p,m.getString(e.title))}),t=a,r=e,n=_.last(r.id.split("!!")),i=_.last(r.keyPath),r.computed)&&r.configSchema&&(n!==i&&(t.properties[i]=t.properties[n],delete t.properties[n]),r.config&&4===r.config.resultType&&(t.properties[i].type="object",t.properties[i].properties={value:{title:m.getString("Value"),type:"number"},unit:{title:m.getString("Unit"),type:"string"}}),r.config)&&1===r.config.resultType&&(t.properties[i].type="number")}),function r(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];e.properties&&_.forEach(e.properties,function(e,t){n(e,t,[].concat(_toConsumableArray(i),[t])),r(e,n,[].concat(_toConsumableArray(i),[t]))})}(a,function(e,t,r){_.isUndefined(e.title)&&(e.title=u.getDefaultPropertyLabel(r,e))}),a},this.findInSchema=function(e,t){var r=t.keyPath;return t.computed&&(r=[u.getFragmentName(r)]),u.findInSchemaByKeyPath(e,r)},this.findInSchemaById=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];return _.isObjectLike(e)&&_.forOwn(e,function(e){_.isObjectLike(e)&&e.id===t?r.push(e):u.findInSchemaById(e,t,r)}),r},this.findInSchemaByKeyPath=function(e,t){if(!t.length)return e;if(e.properties){var r=(t=_toArray(t))[0],t=t.slice(1);if(_.has(e.properties,r))return this.findInSchemaByKeyPath(e.properties[r],t)}},this.getForm=function(e,t){return u.loadProperties().then(_.bind(u.getFormForProperties,u,e,t))},this.getFormForProperties=function(e,n){var t=_(e).map(function(e){if(e.computed)return e;for(var t=_slicedToArray(e.id.match(/^(.+)!!/),2)[1],r=[],n=0;n<e.keyPath.length;n++){r.push(e.keyPath[n]);var i="".concat(t,"!!").concat(r.join("."));if(i=u.properties[i])return _.pick(i,["id","keyPath"])}return{}}).uniqBy("keyPath").value(),i=u.getSchemaForProperties(e);return t.map(function(e){return t=n,r=i,r=u.findInSchemaByKeyPath(r,e.keyPath),r=((e,t)=>(t.computed&&t.configSchema&&(e.key=_.last(t.keyPath)),e))(r={key:ObjectPath.stringify(u.properties[e.id].keyPath),title:r.title||e.label||u.properties[e.id].label},e),_.assign(r,t),r;var t,r})},this.isComplexProperty=function(e){return"object"===e.type||"array"===e.type},this.isCustomProperty=function(e){return"c8yCustom"===e.id.split("!!")[0]},this.getChildren=function(t,e){return _.filter(e||u.properties,function(e){return t.id!==e.id&&_.isEqual(_.take(e.keyPath,t.keyPath.length),t.keyPath)})},this.changeActiveProperty=function(e,t){return _.map(e,function(e){return _.assign(e,{__active:t})})},this.removeDuplication=function(e){var t,r=e;return _.map(e,function(e){u.isComplexProperty(e)&&(t=_.map(u.getChildren(e),"id"),r=_.reject(r,function(e){return _.includes(t,e.id)}))}),r},this.getParent=function(t){return _.filter(u.properties,function(e){return t.keyPath.length>e.keyPath.length&&_.isEqual(_.take(t.keyPath,e.keyPath.length),e.keyPath)})},this.addCustomProperty=function(e){u.properties[e.id]||(u.properties[e.id]={}),_.merge(u.properties[e.id],e)},this.another=function(e,t){return new r(e,void 0===t?n:t)},this.paths=_.reduce(this.ENTITIES.values(),function(e,t){return e[_.startCase(_.camelCase(t.value)).replace(" ","")]=t.staticSchemaPath,e},{})}(h.dataFilePath("properties/managed-objects.json"))}e.$inject=["$filter","$http","$log","$q","c8yBase","c8yApplication","c8yJsonSchemas","gettextCatalog","c8yTenant"],angular.module("c8y.ui").provider("c8yPropertiesLibrary",function(){return{$get:e}})})();
@@ -547,6 +547,20 @@
547
547
  </div>
548
548
  </div>
549
549
 
550
+ <div name="changePassword" class="m-t-16" ng-show="isChangePasswordVisible()">
551
+ <label>{{ 'Password' | translate }}</label>
552
+ <button class="btn btn-default" ng-click="changePassword()">{{ 'Change password' | translate }}</button>
553
+ </div>
554
+
555
+ <div
556
+ class="m-t-16"
557
+ ng-hide="isChangePasswordVisible() || !user.id || !user.email || vm.userHasExternalOrigin"
558
+ >
559
+ <label>{{ 'Reset password' | translate }}</label>
560
+ <button class="btn btn-default" ng-disabled="!user.enabled" ng-click="sendPasswordResetEmailToUser()">{{ 'Send link to
561
+ user' | translate }}</button>
562
+ </div>
563
+
550
564
  <div
551
565
  class="m-t-16"
552
566
  ng-hide="user.id"
@@ -599,7 +613,6 @@
599
613
  </div>
600
614
  </div>
601
615
 
602
-
603
616
  <div ng-hide="hideCustomProperties || noCustomPropertiesToDisplay">
604
617
  <div class="p-t-8 p-b-8">
605
618
  <button ng-click="customPropertiesCollapsed = !customPropertiesCollapsed" class="btn-clean d-block text-medium fit-w p-t-8 p-b-8">
@@ -643,36 +656,7 @@
643
656
  user="user"
644
657
  ></c8y-measurement-unit-preference>
645
658
 
646
-
647
659
  <div class="form-group m-t-16">
648
- <button
649
- class="btn-clean fit-w text-medium p-b-8 p-t-8"
650
- name="changePassword"
651
- type="button"
652
- ng-show="
653
- !disabledEdit &&
654
- changePasswordBtn &&
655
- !hideChangePassword &&
656
- !user.sendPasswordResetEmail &&
657
- userCanChangePasswordAndEmail
658
- "
659
- ng-click="resetPasswords(user)"
660
- >
661
- <i c8y-icon="{{!password.showPassword ? 'forward' : 'expand-arrow'}}" class="m-r-4"></i>
662
- <span
663
- title="{{ 'Change password' | translate }}"
664
- ng-show="!password.showPassword"
665
- >
666
- {{ 'Change password' | translate }}
667
- </span>
668
- <span
669
- title="{{ 'Cancel password change' | translate }}"
670
- ng-show="password.showPassword"
671
- >
672
- {{ 'Cancel password change' | translate }}
673
- </span>
674
- </button>
675
-
676
660
  <c8y-user-totp-revoke
677
661
  ng-if="vm.shouldEnableRevokeTOTPSecretButton()"
678
662
  [user]="user"
@@ -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 e(g,m,w,f,p,h,E,P,A,y,S,v,T){return e.$inject=["$scope","$q"],{restrict:"EA",scope:{user:"=",forms:"=",password:"=",hideUsername:"=?",hideActive:"=?",hideFirstName:"=?",hideLastName:"=?",hideEmail:"=?",hideTelephone:"=?",hideCustomProperties:"=?",hideTfaOption:"=?",hidePasswordReset:"=?",hideChangePassword:"=?",hideOwner:"=?",hideDelegate:"=?",disabledEdit:"=?",hideLanguage:"=?",userTfaEnforced:"=?",topLevelTfaEnforced:"=?"},templateUrl:":::PLUGIN_PATH:::/ui/user/editUser.directive.html",controller:e,controllerAs:"vm",link:function(e,t){$(t).find("input[name=email]").bind("blur",function(){e.emailWarning=!(e.user&&e.user.email)})}};function e(o,r){var e="maxlength",n=v("Messaging application is not subscribed."),s=["userOrigin"],i={NEWUSERNAME:{type:"validation",text:v('Username "new" is not allowed.')},PATTERN:{type:"pattern",text:v("Invalid pattern.")},PATTERN_PASSWORD:{type:"pattern",text:T.getString(A.validation.password.message)},PATTERN_USERNAME:{type:"pattern",text:T.getString(A.validation.user.message)},PATTERN_DISPLAYNAME:{type:"pattern",text:T.getString(A.validation.loginAlias.message)},SAME_AS_CURRENT_PASSWORD:{type:"same_as_current",text:v("New password can't be the same as current one.")},PASSWORD_MISSMATCH:{type:"password_missmatch",text:v("Passwords do not match.")},REQUIRED:{type:"required",text:v("This field is required.")},EMAIL:{type:"email",text:v("Invalid email address.")},PASSWORD_STRENGTH:{type:"password_strength",text:A.validation.passwordStrengthChecklist.message},INTERNATIONALPHONENUMBER_PHONE:{type:"internationalPhoneNumber",text:T.getString(A.validation.internationalPhoneNumber.message)},MAXLENGTH_FIRSTNAME:{type:e,text:"".concat(T.getString("Max length:")," 50")},MAXLENGTH_LASTNAME:{type:e,text:"".concat(T.getString("Max length:")," 50")},MAXLENGTH_USERNAME:{type:e,text:"".concat(T.getString("Max length:")," 254")},MAXLENGTH_DISPLAYNAME:{type:e,text:"".concat(T.getString("Max length:")," 254")},MAXLENGTH_PHONE:{type:e,text:"".concat(T.getString("Max length:")," 254")},MAXLENGTH_EMAIL:{type:e,text:"".concat(T.getString("Max length:")," 254")}},d=this,u=(_.assign(o,{confirmPassword:"",invalid:angular.bind(g,g.invalid,o.forms,"userForm"),isInvalidConfirmPassword:function(){var e=o.forms.userForm,t=e.password.$pristine,e=e.confirmPassword.$touched&&e.confirmPassword.$invalid;return!t&&e},changePasswordConfirm:function(){o.forms.userForm.confirmPassword&&o.forms.userForm.confirmPassword.$setValidity(i.PASSWORD_MISSMATCH.type,o.forms.userForm.confirmPassword.$viewValue===o.user.password)},getErrorFeedback:function(s){var n=o.forms.userForm[s]||{},a=[];return _.forEach(n.$error||{},function(e,t){var r;"parse"===t?o.forms.userForm.phone.$setValidity(t,!0):(t=t.toUpperCase(),r="".concat(t,"_").concat(s.toUpperCase()),e&&n.$touched&&(e=i[r]||i[t],a.push(T.getString(e.text))))}),a.join("<br>")},getUserCustomProperties:l,humanize:g.humanizeFragment,passwordRegex:A.validation.password.pattern,resetPasswords:function(e){var t=T.getString("A user managed via your authorization server cannot change the password of the user.");m.current().then(function(e){e=m.hasExternalOrigin(e);o.password.showPassword&&e&&S.add({text:t,type:"warning"})}),o.password.showPassword=!o.password.showPassword,e.passwordStrength=o.password.strength,e.password=null,o.confirmPassword=""},tfaAvailable:!1,delegateTo:function(){m.current().then(function(e){o.user.delegatedBy=e.id}),a()},undelegate:function(){o.user.delegatedBy=null,a()},setOwner:function(e){o.user.owner=e,d.isParentDropDownOpen=!1,d.ownerHiddenForm.$setDirty()},userCanChangePasswordAndEmail:!1,requirementsFulfilled:!0,onRequirementsFulfilledChange:function(e){e=o.requirementsFulfilled=e;e||o.forms.userForm.password.$setValidity(i.PATTERN_PASSWORD.type,!0),o.forms.userForm.password.$setValidity(i.PASSWORD_STRENGTH.type,e)}}),_.assign(d,{onToggleDropdown:function(e){e&&(d.ownerDropDownInitialized=!0)},twoFactorAuthenticationCheckboxDisabled:function(){return o.topLevelTfaEnforced||o.disabledEdit||"TOTP"===d.tfaStrategy||!o.smsMicroserviceAvailable||!o.notCurrentUser&&"SMS"===d.tfaStrategy},enforceTfaCheckboxDisbaled:function(){return o.topLevelTfaEnforced||o.disabledEdit||!o.notCurrentUser||c()},messagingWarningVisible:function(){return!o.smsMicroserviceAvailable&&"SMS"===d.tfaStrategy},shouldEnableRevokeTOTPSecretButton:c}),p.getStrongPasswordSettings().then(t),o.$watch("user",function(e,t){var s,a;e&&e!==t&&(a=!(s=e).id,o.password.strength=s.passwordStrength,o.changePasswordBtn=!o.password.showPassword,o.emailWarning=!s.email,o.smsWarningPopover=n,a&&(o.userPasswordAction="sendPasswordByEmail"),delete o.confirmPassword,o.notCurrentUser=null,t=/.*/,(e=s)&&!e.id&&(t=A.validation.user.pattern),o.userNamePattern=t,o.loginAliasPattern=A.validation.loginAlias.pattern,o.hideLanguage||w.get("language").then(function(e){e&&(o.user.language={name:P.getLanguageNativeName(e),code:e}),o.languages=_.map(h.getSupportedLanguages(),function(e){return Object.assign({name:P.getLanguageNativeName(e),code:e},{})})}),y.isActivatedFor("units-conversion")&&(o.unitsConversionActive=!0),r.all({tfaAvailable:m.isTfaAvailable(),smsMicroserviceAvailable:E.isAvailable({contextPath:"messaging"}),twoFactorAuthenticationEnabled:m.isTfaActive(s),tfaStrategy:m.getTfaStrategy(),isCurrentUser:m.checkIfCurrent(s)}).then(function(e){var t=e.tfaAvailable,r=e.smsMicroserviceAvailable,s=e.twoFactorAuthenticationEnabled,n=e.tfaStrategy,e=e.isCurrentUser;o.notCurrentUser=!e,o.tfaAvailable=t,o.smsMicroserviceAvailable=!!r,d.tfaStrategy=n,o.user.twoFactorAuthenticationEnabled=!a&&s,o.userCanChangePasswordAndEmail=a||!m.hasExternalOrigin(o.user)&&e}),o.hideOwner||(o.ownerEditDisabled=!1,m.current().then(function(e){var t=f.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN"),r=f.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE");!t&&r&&(d.rootOwner=[e],d.currentOwner=e.id,d.defaultOwner=e,a)&&(o.ownerEditDisabled=!0,s.owner=d.currentOwner)})),o.noCustomPropertiesToDisplay=_.isEmpty(l(o.user)),u())}));function l(e){var r={};return e&&e.customProperties&&_.forEach(e.customProperties,function(e,t){s.includes(t)||(r[t]="object"===_typeof(e)?angular.toJson(e,!0):e)}),r}function t(e){var t=e.enforceStrength;o.passwordStrengthEnforced=t||e.strengthValidity}function a(){o.delegationHiddenForm.$setDirty()}function c(){return"TOTP"===d.tfaStrategy&&o.user.twoFactorAuthenticationEnabled}o.$watch("user.password",function(){o.forms.userForm&&o.forms.userForm.password&&o.forms.userForm.password.$setValidity(i.SAME_AS_CURRENT_PASSWORD.type,!o.notCurrentUser&&!m.isCurrentPassword(o.forms.userForm.password.$viewValue)||o.notCurrentUser)}),o.$watch("userPasswordAction",function(e,t){e!==t&&(t={setUserPasswordAndForceToReset:{sendPasswordResetEmail:!1,shouldResetPassword:!0,showPassword:!0},setUserPassword:{sendPasswordResetEmail:!1,shouldResetPassword:!1,showPassword:!0},sendPasswordByEmail:{sendPasswordResetEmail:!0,shouldResetPassword:!1,showPassword:!1}}[e])&&(o.user.sendPasswordResetEmail=t.sendPasswordResetEmail,o.user.shouldResetPassword=t.shouldResetPassword,o.password.showPassword=t.showPassword)})}}e.$inject=["c8yBase","c8yUser","c8yUserPreferences","c8yPermissions","c8yLoginOptions","c8yLocales","c8yApplication","LocalesUtil","c8yConfig","c8yBeta","c8yAlert","gettext","gettextCatalog"],angular.module("c8y.ui").directive("c8yEditUser",e).directive("c8yUiEditUser",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 e(g,m,f,w,p,h,E,P,A,y,S,v,T,R){return e.$inject=["$scope","$q"],{restrict:"EA",scope:{user:"=",forms:"=",password:"=",hideUsername:"=?",hideActive:"=?",hideFirstName:"=?",hideLastName:"=?",hideEmail:"=?",hideTelephone:"=?",hideCustomProperties:"=?",hideTfaOption:"=?",hidePasswordReset:"=?",hideChangePassword:"=?",hideOwner:"=?",hideDelegate:"=?",disabledEdit:"=?",hideLanguage:"=?",userTfaEnforced:"=?",topLevelTfaEnforced:"=?"},templateUrl:":::PLUGIN_PATH:::/ui/user/editUser.directive.html",controller:e,controllerAs:"vm",link:function(e,t){$(t).find("input[name=email]").bind("blur",function(){e.emailWarning=!(e.user&&e.user.email)})}};function e(o,s){var e="maxlength",n=v("Messaging application is not subscribed."),r=["userOrigin"],i={NEWUSERNAME:{type:"validation",text:v('Username "new" is not allowed.')},PATTERN:{type:"pattern",text:v("Invalid pattern.")},PATTERN_PASSWORD:{type:"pattern",text:T.getString(A.validation.password.message)},PATTERN_USERNAME:{type:"pattern",text:T.getString(A.validation.user.message)},PATTERN_DISPLAYNAME:{type:"pattern",text:T.getString(A.validation.loginAlias.message)},SAME_AS_CURRENT_PASSWORD:{type:"same_as_current",text:v("New password can't be the same as current one.")},PASSWORD_MISSMATCH:{type:"password_missmatch",text:v("Passwords do not match.")},REQUIRED:{type:"required",text:v("This field is required.")},EMAIL:{type:"email",text:v("Invalid email address.")},PASSWORD_STRENGTH:{type:"password_strength",text:A.validation.passwordStrengthChecklist.message},INTERNATIONALPHONENUMBER_PHONE:{type:"internationalPhoneNumber",text:T.getString(A.validation.internationalPhoneNumber.message)},MAXLENGTH_FIRSTNAME:{type:e,text:"".concat(T.getString("Max length:")," 50")},MAXLENGTH_LASTNAME:{type:e,text:"".concat(T.getString("Max length:")," 50")},MAXLENGTH_USERNAME:{type:e,text:"".concat(T.getString("Max length:")," 254")},MAXLENGTH_DISPLAYNAME:{type:e,text:"".concat(T.getString("Max length:")," 254")},MAXLENGTH_PHONE:{type:e,text:"".concat(T.getString("Max length:")," 254")},MAXLENGTH_EMAIL:{type:e,text:"".concat(T.getString("Max length:")," 254")}},d=this,u=(_.assign(o,{confirmPassword:"",invalid:angular.bind(g,g.invalid,o.forms,"userForm"),isInvalidConfirmPassword:function(){var e=o.forms.userForm,t=e.password.$pristine,e=e.confirmPassword.$touched&&e.confirmPassword.$invalid;return!t&&e},changePasswordConfirm:function(){o.forms.userForm.confirmPassword&&o.forms.userForm.confirmPassword.$setValidity(i.PASSWORD_MISSMATCH.type,o.forms.userForm.confirmPassword.$viewValue===o.user.password)},getErrorFeedback:function(r){var n=o.forms.userForm[r]||{},a=[];return _.forEach(n.$error||{},function(e,t){var s;"parse"===t?o.forms.userForm.phone.$setValidity(t,!0):(t=t.toUpperCase(),s="".concat(t,"_").concat(r.toUpperCase()),e&&n.$touched&&(e=i[s]||i[t],a.push(T.getString(e.text))))}),a.join("<br>")},getUserCustomProperties:l,humanize:g.humanizeFragment,changePassword:function(){R.changeCurrentUserPassword()},isChangePasswordVisible:function(){return!o.disabledEdit&&o.changePasswordBtn&&!o.hideChangePassword&&o.user&&!o.user.sendPasswordResetEmail&&o.userCanChangePasswordAndEmail},passwordRegex:A.validation.password.pattern,tfaAvailable:!1,delegateTo:function(){m.current().then(function(e){o.user.delegatedBy=e.id}),a()},undelegate:function(){o.user.delegatedBy=null,a()},setOwner:function(e){o.user.owner=e,d.isParentDropDownOpen=!1,d.ownerHiddenForm.$setDirty()},userCanChangePasswordAndEmail:!1,requirementsFulfilled:!0,onRequirementsFulfilledChange:function(e){e=o.requirementsFulfilled=e;e||o.forms.userForm.password.$setValidity(i.PATTERN_PASSWORD.type,!0),o.forms.userForm.password.$setValidity(i.PASSWORD_STRENGTH.type,e)}}),_.assign(d,{onToggleDropdown:function(e){e&&(d.ownerDropDownInitialized=!0)},twoFactorAuthenticationCheckboxDisabled:function(){return o.topLevelTfaEnforced||o.disabledEdit||"TOTP"===d.tfaStrategy||!o.smsMicroserviceAvailable||!o.notCurrentUser&&"SMS"===d.tfaStrategy},enforceTfaCheckboxDisbaled:function(){return o.topLevelTfaEnforced||o.disabledEdit||!o.notCurrentUser||c()},messagingWarningVisible:function(){return!o.smsMicroserviceAvailable&&"SMS"===d.tfaStrategy},shouldEnableRevokeTOTPSecretButton:c}),p.getStrongPasswordSettings().then(t),o.$watch("user",function(e,t){var r,a;e&&e!==t&&(a=!(r=e).id,o.password.strength=r.passwordStrength,o.changePasswordBtn=!o.password.showPassword,o.emailWarning=!r.email,o.smsWarningPopover=n,a&&(o.userPasswordAction="sendPasswordByEmail"),delete o.confirmPassword,o.notCurrentUser=null,t=/.*/,(e=r)&&!e.id&&(t=A.validation.user.pattern),o.userNamePattern=t,o.loginAliasPattern=A.validation.loginAlias.pattern,o.hideLanguage||f.get("language").then(function(e){e&&(o.user.language={name:P.getLanguageNativeName(e),code:e}),o.languages=_.map(h.getSupportedLanguages(),function(e){return Object.assign({name:P.getLanguageNativeName(e),code:e},{})})}),y.isActivatedFor("units-conversion")&&(o.unitsConversionActive=!0),s.all({tfaAvailable:m.isTfaAvailable(),smsMicroserviceAvailable:E.isAvailable({contextPath:"messaging"}),twoFactorAuthenticationEnabled:m.isTfaActive(r),tfaStrategy:m.getTfaStrategy(),isCurrentUser:m.checkIfCurrent(r)}).then(function(e){var t=e.tfaAvailable,s=e.smsMicroserviceAvailable,r=e.twoFactorAuthenticationEnabled,n=e.tfaStrategy,e=e.isCurrentUser;o.notCurrentUser=!e,o.tfaAvailable=t,o.smsMicroserviceAvailable=!!s,d.tfaStrategy=n,o.user.twoFactorAuthenticationEnabled=!a&&r,o.userCanChangePasswordAndEmail=a||!m.hasExternalOrigin(o.user)&&e,d.userHasExternalOrigin=m.hasExternalOrigin(o.user)}),o.hideOwner||(o.ownerEditDisabled=!1,m.current().then(function(e){var t=w.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN"),s=w.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE");!t&&s&&(d.rootOwner=[e],d.currentOwner=e.id,d.defaultOwner=e,a)&&(o.ownerEditDisabled=!0,r.owner=d.currentOwner)})),o.noCustomPropertiesToDisplay=_.isEmpty(l(o.user)),u())}));function l(e){var s={};return e&&e.customProperties&&_.forEach(e.customProperties,function(e,t){r.includes(t)||(s[t]="object"===_typeof(e)?angular.toJson(e,!0):e)}),s}function t(e){var t=e.enforceStrength;o.passwordStrengthEnforced=t||e.strengthValidity}function a(){o.delegationHiddenForm.$setDirty()}function c(){return"TOTP"===d.tfaStrategy&&o.user.twoFactorAuthenticationEnabled}o.$watch("user.password",function(){o.forms.userForm&&o.forms.userForm.password&&o.forms.userForm.password.$setValidity(i.SAME_AS_CURRENT_PASSWORD.type,!o.notCurrentUser&&!m.isCurrentPassword(o.forms.userForm.password.$viewValue)||o.notCurrentUser)}),o.$watch("userPasswordAction",function(e,t){e!==t&&(t={setUserPasswordAndForceToReset:{sendPasswordResetEmail:!1,shouldResetPassword:!0,showPassword:!0},setUserPassword:{sendPasswordResetEmail:!1,shouldResetPassword:!1,showPassword:!0},sendPasswordByEmail:{sendPasswordResetEmail:!0,shouldResetPassword:!1,showPassword:!1}}[e])&&(o.user.sendPasswordResetEmail=t.sendPasswordResetEmail,o.user.shouldResetPassword=t.shouldResetPassword,o.password.showPassword=t.showPassword)}),o.sendPasswordResetEmailToUser=_.debounce(function(){o.user&&o.user.email&&m.sendPasswordResetMail(o.user.email,o.user.tenantId).then(function(){S.success(v("Password reset link sent."))}).catch(function(){S.danger(v("Failed to send password reset link."))})},300)}}e.$inject=["c8yBase","c8yUser","c8yUserPreferences","c8yPermissions","c8yLoginOptions","c8yLocales","c8yApplication","LocalesUtil","c8yConfig","c8yBeta","c8yAlert","gettext","gettextCatalog","c8yModalService"],angular.module("c8y.ui").directive("c8yEditUser",e).directive("c8yUiEditUser",e)})();
@@ -32,6 +32,7 @@
32
32
  tooltip-append-to-body="true"
33
33
  type="button"
34
34
  ng-hide="!!vm.status.maintenanceStatus"
35
+ data-cy="requiredAvailabilityIntervalSetting--editButton"
35
36
  ng-click="vm.toggleEdit()"
36
37
  >
37
38
  <i c8y-icon="pencil"></i>
@@ -69,6 +70,7 @@
69
70
  aria-label="{{ 'Save' | translate }}"
70
71
  type="button"
71
72
  ng-disabled="vm.saveInProgress || vm.availabilityForm.$invalid || !!vm.status.maintenanceStatus"
73
+ data-cy="requiredAvailabilityIntervalSetting--saveButton"
72
74
  ng-click="vm.save()"
73
75
  >
74
76
  <span
@@ -1 +1 @@
1
- (()=>{function e(e,i){e.when("/device/:deviceId",{templateUrl:":::PLUGIN_PATH:::/views/index.html",priority:900,name:i("Measurements"),icon:"line-chart",controller:t}),e.when("/service/:deviceId",{templateUrl:":::PLUGIN_PATH:::/views/index.html",priority:900,name:i("Measurements"),icon:"line-chart",controller:t})}function t(i,e,t){i.device={},t.detailCached(e.deviceId).then(function(e){e=e.data;i.device=e})}t.$inject=["$scope","$routeParams","c8yDevices"],e.$inject=["c8yViewsProvider","gettext"],angular.module("c8y.parts.measurements",[]).config(e)})();
1
+ (()=>{function e(e,t){e.when("/device/:deviceId",{templateUrl:":::PLUGIN_PATH:::/views/index.html",priority:900,name:t("Measurements"),icon:"line-chart",controller:i,showIf:n}),e.when("/service/:deviceId",{templateUrl:":::PLUGIN_PATH:::/views/index.html",priority:900,name:t("Measurements"),icon:"line-chart",controller:i})}function i(t,e,i){t.device={},i.detailCached(e.deviceId).then(function(e){e=e.data;t.device=e})}function n(e){return e.getFeatureStatePromise("ui.datapoint-explorer.v2").then(function(e){return!e})}n.$inject=["c8yFeatureCacheService"],i.$inject=["$scope","$routeParams","c8yDevices"],e.$inject=["c8yViewsProvider","gettext"],angular.module("c8y.parts.measurements",[]).config(e)})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1022.16.2",
3
+ "version": "1022.26.1",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",