@c8y/ng1-modules 1023.14.76 → 1023.14.94

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(o,e,t,a,n,i){o.onRealtimeAlarmFn=function(e){o.onAlarm=e},o.onRealtimeEventFn=function(e){o.onEvent=e};var c,d=200,l=!0;function h(e,t,i){!1!==o.child.config.updateDates&&(o.child.config.dateFrom=e,!o.child.config.widgetInstanceGlobalTimeContext&&o.viewRealtime&&i===n.onDragEnd&&(o.viewRealtime=!1),o.child.config.dateTo=t)}function s(){var e,t,i,n;o.child&&o.child.config&&(e=(i=o.child.config).interval,i=i.realtime,e)&&(e!==a.custom.id||i)&&(e===a.custom.id&&i?(i=new Date(o.child.config.dateFrom),i=new Date(o.child.config.dateTo)-i,n=moment(),o.child.config.dateTo=n.toDate(),o.child.config.dateFrom=n.subtract(i,"milliseconds").toDate()):(t=e,(n=_.find(a.intervals,function(e){return e.id===t})||{}).qty&&(o.child.config.dateFrom=moment().subtract(n.qty,n.unit).toDate(),o.child.config.dateTo=moment().toDate())))}function r(){var e=t.height();_.isUndefined(_.get(c,"height"))||(e-=c.height),o.dataPointsGraphHeight=_.max([d,e])}function g(){e(function(){o.$broadcast("dashboardResize")},500)}function f(e,t){o.alarmsEventsTimeline=o.alarmsEventsTimeline||{},o.alarmsEventsTimeline.displayedDateFrom=e,o.alarmsEventsTimeline.displayedDateTo=t}function m(e){return _(e).map(function(e){return e.__target.id}).uniq().value().join(",")}o.isLoading=!1,o.widgetControls={supports:["dateTimeContext","isAutoRefreshEnabled","displayMode","refreshInterval","refreshOption","aggregation"],configSettings:{dashboard:{live:{},history:{}},config:{live:{showAutoRefresh:!0,showRefreshInterval:!0,showTimeContext:!0},history:{showAggregation:!0,showTimeContext:!0}},view_and_config:{live:{showAutoRefresh:!0,showRefreshInterval:!0,showTimeContext:!0},history:{showAggregation:!0,showTimeContext:!0}}},settings:{dashboard:{live:{showAutoRefresh:!0,showTimeContext:!0,showRefreshInterval:!0},history:{showTimeContext:!0,showAggregation:!0}},config:{live:{showAutoRefresh:!0},history:{showTimeContext:!0}},view_and_config:{live:{showAutoRefresh:!0,showRefresh:!1,showRefreshInterval:!0,showTimeContext:!0},history:{showTimeContext:!0,showAggregation:!0}}},defaultLinks:{dashboard:{live:{dateTimeContext:!0,isAutoRefreshEnabled:!0},history:{dateTimeContext:!0,aggregation:!0}},config:{},view_and_config:{}},stateHandlers:{}},o.onUpdateDates=h,o.onUpdateDisplayedDates=f,o.onLoading=function(e){o.isLoading=e},o.onGlobalContextChange=function(e){o.child.config.realtime="live"===e.context.refreshOption&&e.context.isAutoRefreshEnabled&&5e3===e.context.refreshInterval,o.child.config.widgetInstanceGlobalTimeContext&&l||o.child.config.realtime&&o.child.config.widgetInstanceGlobalTimeContext&&!l&&e.diff.dateTimeContext.interval?(l=!1,Object.assign(o.child.config,e.context),e.context.dateTimeContext&&(o.child.config.dateFrom=e.context.dateTimeContext.dateFrom,o.child.config.dateTo=e.context.dateTimeContext.dateTo,o.child.config.interval=e.context.dateTimeContext.interval)):o.child.config.realtime||(Object.assign(o.child.config,e.context),e.context.dateTimeContext&&(o.child.config.dateFrom=e.context.dateTimeContext.dateFrom,o.child.config.dateTo=e.context.dateTimeContext.dateTo,o.child.config.interval=e.context.dateTimeContext.interval))},o.onBoxChanged=function(e){o.chartBox=e},o.onTimelinesChartSizeChanged=function(e){c=e,r(),g()},o.dataPointsGraphHeight=t.height(),o.viewRealtime=o.child&&o.child.config&&o.child.config.realtime,o.child&&o.child.config&&(i=i.migrateWidgetConfig(o.child.config),Object.assign(o.child.config,i)),o.dashboardChild=o.dashboardChildForLegacy,o.onRealtimeToggle=function(){o.viewRealtime=!o.viewRealtime},o.recalculate=s,s(),o.$watch("child.config.datapoints",function(e){e=m(e);o.channel=e?"/measurements/".concat(e):""}),o.$watch("child.config.alarmsEventsConfigs",function(e){e=m(e);o.alarmsChannel=e?"/alarms/".concat(e):"",o.eventsChannel=e?"/events/".concat(e):""}),o.$watchCollection(["child.config.dateFrom","child.config.dateTo"],function(){f(o.child.config.dateFrom,o.child.config.dateTo)}),o.$watch("child.config.dateTimeContext",function(e){o.child.config.widgetInstanceGlobalTimeContext&&e&&e.dateFrom&&e.dateTo&&h(new Date(e.dateFrom),new Date(e.dateTo))},!0),o.$watch("child.config.realtime",function(){o.viewRealtime=o.child&&o.child.config&&o.child.config.realtime}),o.$on("dashboardResize",function(e){(e.targetScope!==o?g:r)()})}e.$inject=["$scope","$timeout","$element","INTERVAL_CONSTANTS","X_AXIS_CONSTANTS","c8yWidgetConfigMigrationService"],angular.module("c8y.cockpit.dataPointExplorer").controller("DataPointWidgetCtrl",e)})();
1
+ (()=>{function e(c,e,i,a,d,t){c.onRealtimeAlarmFn=function(e){c.onAlarm=e},c.onRealtimeEventFn=function(e){c.onEvent=e};var n,o=200;function l(){var e,i,t,n;c.child&&c.child.config&&(e=(t=c.child.config).interval,t=t.realtime,e)&&(e!==a.custom.id||t)&&(e===a.custom.id&&t?(t=new Date(c.child.config.dateFrom),t=new Date(c.child.config.dateTo)-t,n=moment(),c.child.config.dateTo=n.toDate(),c.child.config.dateFrom=n.subtract(t,"milliseconds").toDate()):(i=e,(n=_.find(a.intervals,function(e){return e.id===i})||{}).qty&&(c.child.config.dateFrom=moment().subtract(n.qty,n.unit).toDate(),c.child.config.dateTo=moment().toDate())))}function r(){var e=i.height();_.isUndefined(_.get(n,"height"))||(e-=n.height),c.dataPointsGraphHeight=_.max([o,e])}function g(){e(function(){c.$broadcast("dashboardResize")},500)}function s(e,i){c.alarmsEventsTimeline=c.alarmsEventsTimeline||{},c.alarmsEventsTimeline.displayedDateFrom=e,c.alarmsEventsTimeline.displayedDateTo=i}function h(e){return _(e).map(function(e){return e.__target.id}).uniq().value().join(",")}c.isLoading=!1,c.widgetControlsPreset={dashboard:["liveTime","historyTime","autoRefresh","aggregation"],config:["autoRefresh"],view_and_config:["liveTime","historyTime","autoRefresh","aggregation"]},c.onUpdateDates=function(e,i,t){var n,a,o;!1===c.child.config.updateDates||(n=t===d.onDragEnd,a="dashboard"===c.child.config.displayMode,!t&&a&&c.viewRealtime)||(a&&n?(t=e instanceof Date?e.toISOString():e,a=i instanceof Date?i.toISOString():i,o={dateFrom:t,dateTo:a,interval:"custom"},window.dispatchEvent(new CustomEvent("UPDATE_GLOBAL_CONTEXT_HISTORY",{detail:{type:"UPDATE_GLOBAL_CONTEXT_HISTORY",payload:{dateTimeContext:o,isAutoRefreshEnabled:!1,aggregation:c.child.config.aggregation||null,source:"widget"},timestamp:Date.now()}})),c.viewRealtime=!1,c.child.config=Object.assign({},c.child.config,{dateFrom:t,dateTo:a,dateTimeContext:o,isAutoRefreshEnabled:!1,interval:"custom",realtime:!1,refreshOption:"history"})):c.viewRealtime&&n?(c.viewRealtime=!1,c.child.config=Object.assign({},c.child.config,{dateFrom:e,dateTo:i,isAutoRefreshEnabled:!1,realtime:!1})):(c.child.config.dateFrom=e,c.child.config.dateTo=i))},c.onUpdateDisplayedDates=s,c.onLoading=function(e){c.isLoading=e},c.onConfigChange=function(e){var e=e.context,e={dateTimeContext:e.dateTimeContext,refreshOption:e.refreshOption,isAutoRefreshEnabled:e.isAutoRefreshEnabled,refreshInterval:e.refreshInterval,aggregation:e.aggregation},i=Object.assign({},c.child.config,e);e.dateTimeContext&&(i.dateFrom=e.dateTimeContext.dateFrom,i.dateTo=e.dateTimeContext.dateTo,i.interval=e.dateTimeContext.interval);var e="live"===i.refreshOption,t=!1!==i.isAutoRefreshEnabled;i.realtime=e&&t,c.child.config=i,c.viewRealtime=i.realtime},c.onRefresh=function(){l()},c.onLinkedChange=function(){g()},c.onBoxChanged=function(e){c.chartBox=e},c.onTimelinesChartSizeChanged=function(e){n=e,r(),g()},c.dataPointsGraphHeight=i.height(),c.viewRealtime=c.child&&c.child.config&&c.child.config.realtime,c.child&&c.child.config&&(t=t.migrateWidgetConfig(c.child.config),Object.assign(c.child.config,t)),c.dashboardChild=c.dashboardChildForLegacy,c.onRealtimeToggle=function(){c.viewRealtime=!c.viewRealtime},c.recalculate=l,l(),c.$watch("child.config.datapoints",function(e){e=h(e);c.channel=e?"/measurements/".concat(e):""}),c.$watch("child.config.alarmsEventsConfigs",function(e){e=h(e);c.alarmsChannel=e?"/alarms/".concat(e):"",c.eventsChannel=e?"/events/".concat(e):""}),c.$watchCollection(["child.config.dateFrom","child.config.dateTo"],function(){s(c.child.config.dateFrom,c.child.config.dateTo)}),c.$watch("child.config.realtime",function(){c.viewRealtime=c.child&&c.child.config&&c.child.config.realtime}),c.$on("dashboardResize",function(e){(e.targetScope!==c?g:r)()})}e.$inject=["$scope","$timeout","$element","INTERVAL_CONSTANTS","X_AXIS_CONSTANTS","c8yWidgetConfigMigrationService"],angular.module("c8y.cockpit.dataPointExplorer").controller("DataPointWidgetCtrl",e)})();
@@ -3,16 +3,27 @@
3
3
  ng-controller="DataPointWidgetCtrl"
4
4
  ng-init="disableLocalStorage = true"
5
5
  >
6
- <c8y-global-context-widget-wrapper
6
+ <c8y-global-context-connector
7
7
  ng-style="{ 'z-index': 11 }"
8
- ng-if="child.config.datapoints.length > 0 && widgetControls"
9
- [display-mode]="'inline'"
10
- (global-context-change)="onGlobalContextChange($event)"
11
- [widget-controls]="widgetControls"
8
+ ng-if="child.config.datapoints.length > 0 && child.config.displayMode === 'dashboard'"
9
+ [controls]="widgetControlsPreset"
12
10
  [config]="child.config"
13
11
  [is-loading]="isLoading"
14
- [dashboard-child-for-legacy]="dashboardChild"
15
- ></c8y-global-context-widget-wrapper>
12
+ [dashboard-child]="dashboardChild"
13
+ [emit-refresh]="false"
14
+ (config-change)="onConfigChange($event)"
15
+ (refresh)="onRefresh()"
16
+ (linked-change)="onLinkedChange($event)"
17
+ ></c8y-global-context-connector>
18
+ <c8y-local-controls
19
+ ng-if="child.config.datapoints.length > 0 && (child.config.displayMode === 'config' || child.config.displayMode === 'view_and_config')"
20
+ [controls]="widgetControlsPreset"
21
+ [display-mode]="child.config.displayMode"
22
+ [config]="child.config"
23
+ [is-loading]="isLoading"
24
+ (config-change)="onConfigChange($event)"
25
+ (refresh)="onRefresh()"
26
+ ></c8y-local-controls>
16
27
  <c8y-realtime-button
17
28
  ng-show="false"
18
29
  channel="{{ channel }}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1023.14.76",
3
+ "version": "1023.14.94",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -1 +1 @@
1
- (()=>{function n(t,n,e,i,a,o,r,l){var n=n.tenantId,c=[],u=null,p={};function s(n){p=n,t.tenant=p}function f(){return t.tenant.applications.references.map(function(n){return n.application})}function h(n){_.forEach(n,function(n){return c.push(n)}),t.owners=_(c).map("owner.tenant.id").uniq().map(function(n){return{value:n,label:n}}).concat({value:null,label:"- ".concat(l.getString("Show all"))}).value(),t.applications=c}t.filterOwner=function(n){return null===t.filter.owner||n.owner.tenant.id===t.filter.owner},t.applications=c,t.associate=function(n){return a.addApplication(p,n).then(function(){t.associatedApplications.push(n)})},t.dissociate=function(n){return a.removeApplication(p,n).then(function(){return r.removeFromList(t.associatedApplications,n)})},t.openItem=function(n){u=u!==n?n:null},t.isOpen=function(n){return u===n},t.filter={owner:null,text:{}},t.popoverTemplateUrl=":::PLUGIN_PATH:::/views/popover.html",n&&"new"!==n&&a.detail(n).then(r.getResData).then(s).then(f).then(i.sortApps).then(function(n){t.associatedApplications=n}),i.listByTenant({pageSize:2e3}).then(function(n){return _.uniqBy(n,"id")}).then(h)}n.$inject=["$scope","$routeParams","$uibModal","c8yApplication","c8yTenant","c8yAlert","c8yBase","gettextCatalog"],angular.module("c8y.tenantApplications").controller("tenantAppAssignmentCtrl",n)})();
1
+ (()=>{function n(t,n,e,i,a,o,r,l,c){var n=n.tenantId,u=[],p=null,s={},f=c("humanizeAppName");function m(n){s=n,t.tenant=s}function h(){return t.tenant.applications.references.map(function(n){return n.application})}function d(n){_.forEach(n,function(n){return u.push(n)}),t.owners=_(u).map("owner.tenant.id").uniq().map(function(n){return{value:n,label:n}}).concat({value:null,label:"- ".concat(l.getString("Show all"))}).value(),u.forEach(function(n){n.humanizedAppName=f(n)}),t.applications=u}t.filterOwner=function(n){return null===t.filter.owner||n.owner.tenant.id===t.filter.owner},t.filterText=function(n){return!t.filter.text||!t.filter.text.$||!!n.humanizedAppName&&n.humanizedAppName.toLowerCase().includes(t.filter.text.$.toLowerCase())},t.applications=u,t.associate=function(n){return a.addApplication(s,n).then(function(){t.associatedApplications.push(n)})},t.dissociate=function(n){return a.removeApplication(s,n).then(function(){return r.removeFromList(t.associatedApplications,n)})},t.openItem=function(n){p=p!==n?n:null},t.isOpen=function(n){return p===n},t.filter={owner:null,text:{}},t.popoverTemplateUrl=":::PLUGIN_PATH:::/views/popover.html",n&&"new"!==n&&a.detail(n).then(r.getResData).then(m).then(h).then(i.sortApps).then(function(n){t.associatedApplications=n}),i.listByTenant({pageSize:2e3}).then(function(n){return _.uniqBy(n,"id")}).then(d)}n.$inject=["$scope","$routeParams","$uibModal","c8yApplication","c8yTenant","c8yAlert","c8yBase","gettextCatalog","$filter"],angular.module("c8y.tenantApplications").controller("tenantAppAssignmentCtrl",n)})();
@@ -76,7 +76,7 @@
76
76
  <li
77
77
  class="c8y-list__item collapsible bg-inherit"
78
78
  ng-class="{ expanded: isOpen(a) }"
79
- ng-repeat="a in applications |filter:filterOwner|filter:filter.text"
79
+ ng-repeat="a in applications |filter:filterOwner|filter:filterText"
80
80
  >
81
81
  <div class="c8y-list__item__block">
82
82
  <div class="c8y-list__item__appicon p-l-0">
@@ -87,10 +87,10 @@
87
87
  <button
88
88
  class="btn-clean text-truncate"
89
89
  type="button"
90
- title="{{ a | humanizeAppName }}"
90
+ title="{{ a.humanizedAppName }}"
91
91
  ng-click="openItem(a)"
92
92
  >
93
- {{ a | humanizeAppName }}
93
+ {{ a.humanizedAppName }}
94
94
  </button>
95
95
 
96
96
  <button