@provoly/dashboard 0.11.0 → 0.11.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.
@@ -3085,10 +3085,10 @@ const rank = createSelector(manifests, (manifests) => manifests?.tenants.indexOf
3085
3085
  const currentManifestId = createSelector(manifests, (manifests) => manifests.currentId);
3086
3086
  const globalManifest = createSelector(manifests,
3087
3087
  // @ts-ignore
3088
- (manifests) => ({ windows: [], ...manifests?.manifest }) ?? { windows: [] });
3088
+ (manifests) => ({ windows: [], ...manifests?.manifest } ?? { windows: [] }));
3089
3089
  const staticManifest = createSelector(manifests,
3090
3090
  // @ts-ignore
3091
- (manifests) => ({ windows: [], ...manifests?.staticManifest }) ?? { windows: [] });
3091
+ (manifests) => ({ windows: [], ...manifests?.staticManifest } ?? { windows: [] }));
3092
3092
  const refreshRates = createSelector(globalManifest, (manifests) => manifests.refreshRates ?? {});
3093
3093
  const windowManifest = createSelector(globalManifest, rank, (manifest, rank) => manifest.windows[rank] ?? { widgets: [] });
3094
3094
  const gridLayout = createSelector(windowManifest, (manifest) => (manifest.grid ?? {}).layout ?? DashboardGridLayout.MANUAL);
@@ -3151,7 +3151,7 @@ const datasourceFilters = createSelector(feature$5, (state) => state?.manifests.
3151
3151
  ? state?.manifests.manifest.filters.reduce((obj, filter) => (filter.attributes.forEach((attribute) => (obj[attribute.datasource] || (obj[attribute.datasource] = [])).push({
3152
3152
  attribute: attribute.id,
3153
3153
  operator: filter.operator ?? '',
3154
- value: filter.value ?? ''
3154
+ value: filter.value
3155
3155
  })),
3156
3156
  obj), {})
3157
3157
  : {});
@@ -3774,7 +3774,9 @@ class SearchService {
3774
3774
  let filterFormed = '';
3775
3775
  if (this.filters[id]) {
3776
3776
  filterFormed = [];
3777
- this.filters[id].forEach((filter) => {
3777
+ this.filters[id]
3778
+ .filter((filter) => filter.value !== null && filter.value !== undefined)
3779
+ .forEach((filter) => {
3778
3780
  filterFormed.push('filter=' + filter.attribute + ',' + filter.operator + ',' + filter.value);
3779
3781
  });
3780
3782
  filterFormed = '?' + filterFormed.join('&');
@@ -8448,15 +8450,15 @@ class DataWidgetComponent extends BaseWidgetComponent {
8448
8450
  constructor(store, el) {
8449
8451
  super(store, el);
8450
8452
  this.staticResultSet$ = new BehaviorSubject(null);
8451
- this.datasourceIds$ = this.manifest$.pipe(map$1((manifest) => (Array.isArray(manifest.datasource) ? manifest.datasource : [manifest.datasource]).filter((id) => !!id)));
8453
+ this.datasourceIds$ = this.manifest$.pipe(map((manifest) => (Array.isArray(manifest.datasource) ? manifest.datasource : [manifest.datasource]).filter((id) => !!id)));
8452
8454
  this.usedDatasources$ = combineLatest([
8453
8455
  this.datasourceIds$,
8454
8456
  this.store.select(DataSourceSelectors.getDataSources)
8455
- ]).pipe(map$1(([ids, datasources]) => ids
8457
+ ]).pipe(map(([ids, datasources]) => ids
8456
8458
  .map((id) => datasources.find((ds) => ds.id === id) ?? id)
8457
8459
  .map((nq) => (typeof nq !== 'string' ? nq : UNKNOWN_DATASOURCE(nq)))));
8458
8460
  this.resultSet$ = this.initResultSet$();
8459
- this.allItems$ = this.resultSet$.pipe(filter$1((resultSet) => !!resultSet), map$1((resultSet) => Object.keys(resultSet?.items)
8461
+ this.allItems$ = this.resultSet$.pipe(filter((resultSet) => !!resultSet), map((resultSet) => Object.keys(resultSet?.items)
8460
8462
  .map((classId) => resultSet.items[classId])
8461
8463
  .reduce((prev, curr) => [...prev, ...curr], [])));
8462
8464
  }
@@ -8465,7 +8467,7 @@ class DataWidgetComponent extends BaseWidgetComponent {
8465
8467
  this.store.select(DashboardSelectors.resultSets),
8466
8468
  this.datasourceIds$,
8467
8469
  this.staticResultSet$
8468
- ]).pipe(map$1(([resultSets, resultSetNamesArray, staticResultSet]) => {
8470
+ ]).pipe(map(([resultSets, resultSetNamesArray, staticResultSet]) => {
8469
8471
  if (!!staticResultSet) {
8470
8472
  return staticResultSet;
8471
8473
  }
@@ -8477,7 +8479,7 @@ class DataWidgetComponent extends BaseWidgetComponent {
8477
8479
  relations: [],
8478
8480
  merged: resultSetArray.length
8479
8481
  });
8480
- }), distinctUntilChanged((p, v) => equal(p, v)));
8482
+ }), distinctUntilChanged$1((p, v) => equal(p, v)));
8481
8483
  }
8482
8484
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: DataWidgetComponent, deps: [{ token: i1.Store }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
8483
8485
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.6", type: DataWidgetComponent, selector: "pry-data-widget", inputs: { staticResultSet: "staticResultSet" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
@@ -10293,22 +10295,28 @@ const internalReducer = createReducer(dashboardInitialState, on(DashboardActions
10293
10295
  filters: state.manifests.manifest.filters?.filter((filter) => filter.id !== action.id)
10294
10296
  }
10295
10297
  }
10296
- })), on(DashboardActions.updateFilterValue, (state, action) => ({
10297
- ...state,
10298
- manifests: {
10299
- ...state.manifests,
10300
- manifest: {
10301
- ...state.manifests.manifest,
10302
- filters: state.manifests.manifest.filters
10303
- ? [
10304
- ...state.manifests.manifest.filters.map((filter, i) => i === state.manifests.manifest.filters?.findIndex((filter) => filter.id === action.id)
10305
- ? { ...filter, value: action.value }
10306
- : filter)
10307
- ]
10308
- : []
10298
+ })), on(DashboardActions.updateFilterValue, (state, action) => {
10299
+ const filters = JSON.parse(JSON.stringify(state.manifests.manifest.filters ?? []));
10300
+ const filterToUpdate = filters.find((filter) => filter.id === action.id);
10301
+ if (filterToUpdate) {
10302
+ if (!action.value) {
10303
+ delete filterToUpdate.value;
10304
+ }
10305
+ else {
10306
+ filterToUpdate.value = action.value;
10309
10307
  }
10310
10308
  }
10311
- })), on(DashboardActions.getWmsFeatures, (state, action) => ({
10309
+ return {
10310
+ ...state,
10311
+ manifests: {
10312
+ ...state.manifests,
10313
+ manifest: {
10314
+ ...state.manifests.manifest,
10315
+ filters
10316
+ }
10317
+ }
10318
+ };
10319
+ }), on(DashboardActions.getWmsFeatures, (state, action) => ({
10312
10320
  ...state,
10313
10321
  wmsFeatures: []
10314
10322
  })), on(DashboardActions.addWmsFeatures, (state, action) => ({