@c8y/ngx-components 1021.50.0 → 1021.51.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.
- package/core/aggregation/aggregation.model.d.ts.map +1 -0
- package/core/aggregation/aggregation.service.d.ts +44 -0
- package/core/aggregation/aggregation.service.d.ts.map +1 -0
- package/core/aggregation/index.d.ts +3 -0
- package/core/aggregation/index.d.ts.map +1 -0
- package/core/common/index.d.ts +0 -2
- package/core/common/index.d.ts.map +1 -1
- package/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.d.ts +2 -2
- package/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.d.ts.map +1 -1
- package/core/dashboard/wiget-time-context/widget-time-context-icon-bar/widget-time-context-icon-bar.component.d.ts +1 -1
- package/core/dashboard/wiget-time-context/widget-time-context-icon-bar/widget-time-context-icon-bar.component.d.ts.map +1 -1
- package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts +1 -1
- package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts.map +1 -1
- package/core/index.d.ts +1 -0
- package/core/index.d.ts.map +1 -1
- package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.d.ts +54 -42
- package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.d.ts.map +1 -1
- package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component.d.ts +28 -8
- package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component.d.ts.map +1 -1
- package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.service.d.ts +3 -52
- package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.service.d.ts.map +1 -1
- package/datapoints-export-selector/datapoints-export-selector.model.d.ts +5 -14
- package/datapoints-export-selector/datapoints-export-selector.model.d.ts.map +1 -1
- package/device-grid/device-grid.component.d.ts.map +1 -1
- package/device-grid/device-grid.service.d.ts +2 -0
- package/device-grid/device-grid.service.d.ts.map +1 -1
- package/esm2022/core/aggregation/aggregation.model.mjs +46 -0
- package/esm2022/core/aggregation/aggregation.service.mjs +76 -0
- package/esm2022/core/aggregation/index.mjs +3 -0
- package/esm2022/core/common/index.mjs +1 -3
- package/esm2022/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.mjs +2 -2
- package/esm2022/core/dashboard/wiget-time-context/widget-time-context-icon-bar/widget-time-context-icon-bar.component.mjs +2 -2
- package/esm2022/core/dashboard/wiget-time-context/widget-time-context.component.mjs +4 -4
- package/esm2022/core/index.mjs +2 -1
- package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.mjs +165 -163
- package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component.mjs +82 -48
- package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.service.mjs +5 -95
- package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-data-scope/datapoints-exports-selector-data-scope.component.mjs +3 -3
- package/esm2022/datapoints-export-selector/datapoints-export-selector.component.mjs +3 -3
- package/esm2022/datapoints-export-selector/datapoints-export-selector.model.mjs +1 -9
- package/esm2022/device-grid/device-grid.component.mjs +3 -3
- package/esm2022/device-grid/device-grid.service.mjs +16 -1
- package/esm2022/interval-picker/interval-picker.model.mjs +5 -1
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.mjs +25 -41
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-reload/datapoints-reload.component.mjs +3 -3
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.mjs +55 -49
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.service.mjs +25 -73
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-widget.model.mjs +20 -20
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table.service.mjs +19 -19
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +247 -307
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-grid.mjs +17 -2
- package/fesm2022/c8y-ngx-components-device-grid.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-interval-picker.mjs +5 -1
- package/fesm2022/c8y-ngx-components-interval-picker.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +1075 -1253
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +118 -76
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/interval-picker/interval-picker.model.d.ts +6 -0
- package/interval-picker/interval-picker.model.d.ts.map +1 -1
- package/locales/de.po +40 -27
- package/locales/es.po +40 -27
- package/locales/fr.po +40 -27
- package/locales/ja_JP.po +40 -26
- package/locales/ko.po +38 -24
- package/locales/locales.pot +23 -25
- package/locales/nl.po +40 -27
- package/locales/pl.po +40 -26
- package/locales/pt_BR.po +40 -27
- package/locales/zh_CN.po +38 -24
- package/locales/zh_TW.po +38 -24
- package/package.json +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.d.ts +3 -5
- package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.d.ts.map +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.d.ts +7 -2
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.d.ts.map +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.service.d.ts +7 -27
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.service.d.ts.map +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table-widget.model.d.ts +4 -3
- package/widgets/implementations/datapoints-table/datapoints-table-widget.model.d.ts.map +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table.service.d.ts +5 -5
- package/widgets/implementations/datapoints-table/datapoints-table.service.d.ts.map +1 -1
- package/core/common/aggregation/aggregation.model.d.ts.map +0 -1
- package/core/common/aggregation/aggregation.service.d.ts +0 -17
- package/core/common/aggregation/aggregation.service.d.ts.map +0 -1
- package/esm2022/core/common/aggregation/aggregation.model.mjs +0 -46
- package/esm2022/core/common/aggregation/aggregation.service.mjs +0 -34
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.service.mjs +0 -124
- package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.service.d.ts +0 -56
- package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.service.d.ts.map +0 -1
- /package/core/{common/aggregation → aggregation}/aggregation.model.d.ts +0 -0
|
@@ -8,7 +8,7 @@ import { castArray, flatten, uniq, sortBy, groupBy, camelCase, isEqual, isUndefi
|
|
|
8
8
|
import { merge, of, defer, combineLatest, race, isObservable, from, Subject, BehaviorSubject, NEVER, Observable, firstValueFrom, map as map$1, distinctUntilChanged as distinctUntilChanged$1, fromEvent, pipe, throwError, concat, EMPTY, timer, fromEventPattern, startWith as startWith$1, switchMap as switchMap$1, takeUntil as takeUntil$1, empty, forkJoin, ReplaySubject, interval, shareReplay as shareReplay$1, mergeMap as mergeMap$1 } from 'rxjs';
|
|
9
9
|
import { map, distinctUntilChanged, filter, startWith, switchMap, take, shareReplay, scan, debounceTime, share, takeUntil, tap, catchError, first as first$1, retryWhen, delay, concatMap, debounce, sample, withLatestFrom, mergeMap, every as every$1, toArray, merge as merge$1, expand, skip, mapTo, finalize, reduce as reduce$1, combineLatestWith } from 'rxjs/operators';
|
|
10
10
|
import * as i1 from '@c8y/client';
|
|
11
|
-
import { ApplicationAvailability, OperationStatus, TenantLoginOptionType, UserManagementSource, GrantType, ApplicationType,
|
|
11
|
+
import { ApplicationAvailability, OperationStatus, TenantLoginOptionType, UserManagementSource, GrantType, ApplicationType, BearerAuthFromSessionStorage, FetchClient, Client, PasswordStrength, QueriesUtil, InventoryService, UserService, ApplicationService, TenantService, AlarmService, aggregationType, Service } from '@c8y/client';
|
|
12
12
|
import { __decorate, __metadata } from 'tslib';
|
|
13
13
|
import * as i1$3 from '@angular/router';
|
|
14
14
|
import { NavigationEnd, RouterModule as RouterModule$1, ActivationEnd, NavigationStart, PRIMARY_OUTLET, ActivatedRoute, ActivationStart, ChildActivationEnd, ROUTES, Router, NavigationCancel, NavigationError } from '@angular/router';
|
|
@@ -33,8 +33,6 @@ import { compare, coerce } from 'semver';
|
|
|
33
33
|
import saveAs$1, { saveAs } from 'file-saver';
|
|
34
34
|
import * as i1$2 from '@angular/platform-browser';
|
|
35
35
|
import { BlobReader, ZipReader, BlobWriter, ZipWriter } from '@zip.js/zip.js';
|
|
36
|
-
import * as i20 from '@c8y/ngx-components/interval-picker';
|
|
37
|
-
import { TimeSpanInMs, INTERVALS, INTERVAL_TITLES, IntervalPickerComponent } from '@c8y/ngx-components/interval-picker';
|
|
38
36
|
import * as i1$7 from 'ngx-bootstrap/collapse';
|
|
39
37
|
import { CollapseModule } from 'ngx-bootstrap/collapse';
|
|
40
38
|
import * as i1$4 from 'ngx-bootstrap/modal';
|
|
@@ -63,6 +61,8 @@ import { TextFieldModule } from '@angular/cdk/text-field';
|
|
|
63
61
|
import { FormlyJsonschema } from '@ngx-formly/core/json-schema';
|
|
64
62
|
import * as i5$2 from '@angular/cdk/drag-drop';
|
|
65
63
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
64
|
+
import * as i20 from '@c8y/ngx-components/interval-picker';
|
|
65
|
+
import { TimeSpanInMs, INTERVAL_VALUES, INTERVALS, INTERVAL_TITLES, IntervalPickerComponent } from '@c8y/ngx-components/interval-picker';
|
|
66
66
|
import * as i9 from '@angular/cdk/table';
|
|
67
67
|
import { CdkTable, CdkHeaderCell, CdkTableModule } from '@angular/cdk/table';
|
|
68
68
|
import * as i19 from 'ngx-bootstrap/pagination';
|
|
@@ -9091,79 +9091,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
9091
9091
|
args: [{ providedIn: 'root' }]
|
|
9092
9092
|
}] });
|
|
9093
9093
|
|
|
9094
|
-
const AGGREGATIONS = [
|
|
9095
|
-
{ id: null, title: gettext$1('None') },
|
|
9096
|
-
{ id: aggregationType.MINUTELY, title: gettext$1('Minutely') },
|
|
9097
|
-
{ id: aggregationType.HOURLY, title: gettext$1('Hourly') },
|
|
9098
|
-
{ id: aggregationType.DAILY, title: gettext$1('Daily') }
|
|
9099
|
-
];
|
|
9100
|
-
const AGGREGATION_LIMITS = {
|
|
9101
|
-
MINUTELY_LIMIT: TimeSpanInMs.MINUTE * 10,
|
|
9102
|
-
HOURLY_LIMIT: TimeSpanInMs.DAY * 1,
|
|
9103
|
-
DAILY_LIMIT: TimeSpanInMs.DAY * 4
|
|
9104
|
-
};
|
|
9105
|
-
const AGGREGATION_ICONS = {
|
|
9106
|
-
undefined: 'line-chart',
|
|
9107
|
-
MINUTELY: 'hourglass',
|
|
9108
|
-
HOURLY: 'clock-o',
|
|
9109
|
-
DAILY: 'calendar-o'
|
|
9110
|
-
};
|
|
9111
|
-
const AGGREGATION_TEXTS = {
|
|
9112
|
-
disabled: gettext$1('No aggregation with realtime enabled'),
|
|
9113
|
-
undefined: gettext$1('No aggregation'),
|
|
9114
|
-
MINUTELY: gettext$1('Minutely aggregation'),
|
|
9115
|
-
HOURLY: gettext$1('Hourly aggregation'),
|
|
9116
|
-
DAILY: gettext$1('Daily aggregation')
|
|
9117
|
-
};
|
|
9118
|
-
const AGGREGATION_VALUES = {
|
|
9119
|
-
none: 'NONE',
|
|
9120
|
-
minutely: aggregationType.MINUTELY,
|
|
9121
|
-
hourly: aggregationType.HOURLY,
|
|
9122
|
-
daily: aggregationType.DAILY
|
|
9123
|
-
};
|
|
9124
|
-
const AGGREGATION_VALUES_ARR = [
|
|
9125
|
-
AGGREGATION_VALUES.none,
|
|
9126
|
-
AGGREGATION_VALUES.minutely,
|
|
9127
|
-
AGGREGATION_VALUES.hourly,
|
|
9128
|
-
AGGREGATION_VALUES.daily
|
|
9129
|
-
];
|
|
9130
|
-
const AGGREGATION_LABELS = {
|
|
9131
|
-
NONE: AGGREGATIONS[0].title,
|
|
9132
|
-
[aggregationType.MINUTELY]: AGGREGATIONS[1].title,
|
|
9133
|
-
[aggregationType.HOURLY]: AGGREGATIONS[2].title,
|
|
9134
|
-
[aggregationType.DAILY]: AGGREGATIONS[3].title
|
|
9135
|
-
};
|
|
9136
|
-
|
|
9137
|
-
class AggregationService {
|
|
9138
|
-
/**
|
|
9139
|
-
* Determines which aggregation options should be disabled based on the time range between two dates.
|
|
9140
|
-
* It calculates the time difference and checks against predefined time spans to decide if daily,
|
|
9141
|
-
* hourly, or minutely aggregations should be disabled.
|
|
9142
|
-
*
|
|
9143
|
-
* @param dateFrom - The start date of the time range, as a `Date` object or an ISO date string.
|
|
9144
|
-
* @param dateTo - The end date of the time range, as a `Date` object or an ISO date string.
|
|
9145
|
-
* @returns An `AggregationOptionStatus` object indicating the disabled state of each aggregation option.
|
|
9146
|
-
*/
|
|
9147
|
-
getDisabledAggregationOptions(dateFrom, dateTo) {
|
|
9148
|
-
const fromDate = typeof dateFrom === 'string' ? new Date(dateFrom) : dateFrom;
|
|
9149
|
-
const toDate = typeof dateTo === 'string' ? new Date(dateTo) : dateTo;
|
|
9150
|
-
const timeRangeInMs = toDate.valueOf() - fromDate.valueOf();
|
|
9151
|
-
const disabledAggregationOptions = {};
|
|
9152
|
-
disabledAggregationOptions[AGGREGATION_VALUES.daily] = timeRangeInMs <= TimeSpanInMs.DAY;
|
|
9153
|
-
disabledAggregationOptions[AGGREGATION_VALUES.hourly] = timeRangeInMs <= TimeSpanInMs.HOUR;
|
|
9154
|
-
disabledAggregationOptions[AGGREGATION_VALUES.minutely] = timeRangeInMs <= TimeSpanInMs.MINUTE;
|
|
9155
|
-
return disabledAggregationOptions;
|
|
9156
|
-
}
|
|
9157
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AggregationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
9158
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AggregationService, providedIn: 'root' }); }
|
|
9159
|
-
}
|
|
9160
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AggregationService, decorators: [{
|
|
9161
|
-
type: Injectable,
|
|
9162
|
-
args: [{
|
|
9163
|
-
providedIn: 'root'
|
|
9164
|
-
}]
|
|
9165
|
-
}] });
|
|
9166
|
-
|
|
9167
9094
|
/**
|
|
9168
9095
|
* A service which allows to display alerts.
|
|
9169
9096
|
*/
|
|
@@ -28206,6 +28133,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
28206
28133
|
args: [{ selector: 'c8y-widget-auto-refresh-context-icon-bar', template: "<span class=\"m-l-auto d-flex\">\n <button\n class=\"btn btn-clean btn-no-focus p-l-4 p-r-0\"\n [attr.aria-label]=\"globalAutoRefreshTooltip | translate\"\n [tooltip]=\"globalAutoRefreshTooltip | translate\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"c8y-widget-auto-refresh-context-icon-bar--global-refresh-context-indicator\"\n >\n <span class=\"tag tag--info chip\">\n <i c8yIcon=\"refresh\"></i>\n {{ 'Auto refresh' | translate }}\n </span>\n </button>\n</span>\n" }]
|
|
28207
28134
|
}] });
|
|
28208
28135
|
|
|
28136
|
+
const AGGREGATIONS = [
|
|
28137
|
+
{ id: null, title: gettext$1('None') },
|
|
28138
|
+
{ id: aggregationType.MINUTELY, title: gettext$1('Minutely') },
|
|
28139
|
+
{ id: aggregationType.HOURLY, title: gettext$1('Hourly') },
|
|
28140
|
+
{ id: aggregationType.DAILY, title: gettext$1('Daily') }
|
|
28141
|
+
];
|
|
28142
|
+
const AGGREGATION_LIMITS = {
|
|
28143
|
+
MINUTELY_LIMIT: TimeSpanInMs.MINUTE * 10,
|
|
28144
|
+
HOURLY_LIMIT: TimeSpanInMs.DAY * 1,
|
|
28145
|
+
DAILY_LIMIT: TimeSpanInMs.DAY * 4
|
|
28146
|
+
};
|
|
28147
|
+
const AGGREGATION_ICONS = {
|
|
28148
|
+
undefined: 'line-chart',
|
|
28149
|
+
MINUTELY: 'hourglass',
|
|
28150
|
+
HOURLY: 'clock-o',
|
|
28151
|
+
DAILY: 'calendar-o'
|
|
28152
|
+
};
|
|
28153
|
+
const AGGREGATION_TEXTS = {
|
|
28154
|
+
disabled: gettext$1('No aggregation with realtime enabled'),
|
|
28155
|
+
undefined: gettext$1('No aggregation'),
|
|
28156
|
+
MINUTELY: gettext$1('Minutely aggregation'),
|
|
28157
|
+
HOURLY: gettext$1('Hourly aggregation'),
|
|
28158
|
+
DAILY: gettext$1('Daily aggregation')
|
|
28159
|
+
};
|
|
28160
|
+
const AGGREGATION_VALUES = {
|
|
28161
|
+
none: 'NONE',
|
|
28162
|
+
minutely: aggregationType.MINUTELY,
|
|
28163
|
+
hourly: aggregationType.HOURLY,
|
|
28164
|
+
daily: aggregationType.DAILY
|
|
28165
|
+
};
|
|
28166
|
+
const AGGREGATION_VALUES_ARR = [
|
|
28167
|
+
AGGREGATION_VALUES.none,
|
|
28168
|
+
AGGREGATION_VALUES.minutely,
|
|
28169
|
+
AGGREGATION_VALUES.hourly,
|
|
28170
|
+
AGGREGATION_VALUES.daily
|
|
28171
|
+
];
|
|
28172
|
+
const AGGREGATION_LABELS = {
|
|
28173
|
+
NONE: AGGREGATIONS[0].title,
|
|
28174
|
+
[aggregationType.MINUTELY]: AGGREGATIONS[1].title,
|
|
28175
|
+
[aggregationType.HOURLY]: AGGREGATIONS[2].title,
|
|
28176
|
+
[aggregationType.DAILY]: AGGREGATIONS[3].title
|
|
28177
|
+
};
|
|
28178
|
+
|
|
28209
28179
|
class WidgetTimeContextIconBar {
|
|
28210
28180
|
constructor() {
|
|
28211
28181
|
this.AGGREGATION_ICONS = AGGREGATION_ICONS;
|
|
@@ -28511,6 +28481,78 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
28511
28481
|
args: ['attr.style']
|
|
28512
28482
|
}] } });
|
|
28513
28483
|
|
|
28484
|
+
class AggregationService {
|
|
28485
|
+
constructor() {
|
|
28486
|
+
this.AGGREGATION_MAP = {
|
|
28487
|
+
[INTERVAL_VALUES.minutes]: AGGREGATION_VALUES.none,
|
|
28488
|
+
[INTERVAL_VALUES.hours]: AGGREGATION_VALUES.minutely,
|
|
28489
|
+
[INTERVAL_VALUES.days]: AGGREGATION_VALUES.hourly
|
|
28490
|
+
};
|
|
28491
|
+
}
|
|
28492
|
+
/**
|
|
28493
|
+
* Determines which aggregation options should be disabled based on the time range between two dates.
|
|
28494
|
+
* It calculates the time difference and checks against predefined time spans to decide if daily,
|
|
28495
|
+
* hourly, or minutely aggregations should be disabled.
|
|
28496
|
+
*
|
|
28497
|
+
* @param dateFrom - The start date of the time range, as a `Date` object or an ISO date string.
|
|
28498
|
+
* @param dateTo - The end date of the time range, as a `Date` object or an ISO date string.
|
|
28499
|
+
* @returns An `AggregationOptionStatus` object indicating the disabled state of each aggregation option.
|
|
28500
|
+
*/
|
|
28501
|
+
getDisabledAggregationOptions(dateFrom, dateTo) {
|
|
28502
|
+
const fromDate = typeof dateFrom === 'string' ? new Date(dateFrom) : dateFrom;
|
|
28503
|
+
const toDate = typeof dateTo === 'string' ? new Date(dateTo) : dateTo;
|
|
28504
|
+
const timeRangeInMs = toDate.valueOf() - fromDate.valueOf();
|
|
28505
|
+
const disabledAggregationOptions = {};
|
|
28506
|
+
disabledAggregationOptions[AGGREGATION_VALUES.daily] = timeRangeInMs <= TimeSpanInMs.DAY;
|
|
28507
|
+
disabledAggregationOptions[AGGREGATION_VALUES.hourly] = timeRangeInMs <= TimeSpanInMs.HOUR;
|
|
28508
|
+
disabledAggregationOptions[AGGREGATION_VALUES.minutely] = timeRangeInMs <= TimeSpanInMs.MINUTE;
|
|
28509
|
+
return disabledAggregationOptions;
|
|
28510
|
+
}
|
|
28511
|
+
/**
|
|
28512
|
+
* Determines the new aggregation value based on the current value and disabled options.
|
|
28513
|
+
*
|
|
28514
|
+
* Goal is to switch to the next available aggregation option if the current one is disabled.
|
|
28515
|
+
* - If the current option is disabled, sets the control to the first available (non-disabled) option based on the following order:
|
|
28516
|
+
* - If the current value is `DAILY`, it switches to `HOURLY` if it's not disabled, otherwise to `MINUTELY` if `HOURLY` is also disabled.
|
|
28517
|
+
* - If the current value is `HOURLY`, it switches to `MINUTELY` if it's not disabled.
|
|
28518
|
+
* - If all options are disabled, it sets the value to `NONE`.
|
|
28519
|
+
*
|
|
28520
|
+
* @param currentValue - The current aggregation option.
|
|
28521
|
+
* @param disabledOptions - An object containing disabled options.
|
|
28522
|
+
* @returns The new aggregation option.
|
|
28523
|
+
*/
|
|
28524
|
+
determineFirstNewAvailableAggregationValue(currentValue, disabledOptions) {
|
|
28525
|
+
const { daily, hourly, minutely, none } = AGGREGATION_VALUES;
|
|
28526
|
+
if (!disabledOptions[currentValue]) {
|
|
28527
|
+
return currentValue; // Return the current value if it's not disabled
|
|
28528
|
+
}
|
|
28529
|
+
if (currentValue === daily) {
|
|
28530
|
+
return !disabledOptions[hourly] ? hourly : !disabledOptions[minutely] ? minutely : none;
|
|
28531
|
+
}
|
|
28532
|
+
if (currentValue === hourly) {
|
|
28533
|
+
return !disabledOptions[minutely] ? minutely : none;
|
|
28534
|
+
}
|
|
28535
|
+
return none; // Fallback to 'none' if all else fails
|
|
28536
|
+
}
|
|
28537
|
+
/**
|
|
28538
|
+
* Determines the aggregation value based on the provided interval.
|
|
28539
|
+
*
|
|
28540
|
+
* @param interval - The time range interval.
|
|
28541
|
+
* @returns The corresponding aggregation value.
|
|
28542
|
+
*/
|
|
28543
|
+
determineAggregationValue(interval) {
|
|
28544
|
+
return this.AGGREGATION_MAP[interval] || AGGREGATION_VALUES.daily;
|
|
28545
|
+
}
|
|
28546
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AggregationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
28547
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AggregationService, providedIn: 'root' }); }
|
|
28548
|
+
}
|
|
28549
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AggregationService, decorators: [{
|
|
28550
|
+
type: Injectable,
|
|
28551
|
+
args: [{
|
|
28552
|
+
providedIn: 'root'
|
|
28553
|
+
}]
|
|
28554
|
+
}] });
|
|
28555
|
+
|
|
28514
28556
|
/**
|
|
28515
28557
|
* A service which can be used, to emit data on a dashboard level.
|
|
28516
28558
|
* Each Widget Dashboard gets an own instance of this service provided
|