@provoly/dashboard 0.25.0 → 0.25.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.
@@ -3,7 +3,7 @@ import { OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
3
3
  import * as i1$1 from '@angular/common';
4
4
  import { CommonModule, AsyncPipe, DOCUMENT } from '@angular/common';
5
5
  import * as i1$2 from '@angular/common/http';
6
- import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http';
6
+ import { HttpHeaders, HttpUrlEncodingCodec, HttpParams, HttpClientModule } from '@angular/common/http';
7
7
  import * as i0 from '@angular/core';
8
8
  import { InjectionToken, Injectable, Directive, Optional, Inject, Input, Component, Pipe, ChangeDetectionStrategy, HostBinding, SecurityContext, NgModule, EventEmitter, Output, TemplateRef, ViewChild, Injector, ContentChildren, forwardRef, HostListener, ViewContainerRef, ViewChildren, ViewEncapsulation, createNgModule } from '@angular/core';
9
9
  import * as i3 from '@angular/router';
@@ -478,6 +478,7 @@ const enTranslations$1 = {
478
478
  restricted: 'Restricted',
479
479
  type: 'Visibility',
480
480
  users: 'Authorized users',
481
+ noGroups: 'No group available',
481
482
  conflict: {
482
483
  title: 'Warning',
483
484
  main: 'The following data sources are not accessible to the selected user groups:',
@@ -877,6 +878,7 @@ const frTranslations$1 = {
877
878
  restricted: 'Restreint',
878
879
  type: 'Visibilité',
879
880
  users: 'Utilisateurs autorisés',
881
+ noGroups: 'Aucun groupe disponible',
880
882
  conflict: {
881
883
  title: 'Warning',
882
884
  main: 'Attention, les sources de données suivantes ne seront pas visible de toutes les personnes accédant à la présentation : ',
@@ -4125,6 +4127,32 @@ const SearchActions = {
4125
4127
  setPossibleFilterValues: createAction('[Dashboard] (bus) set possible filter values', props())
4126
4128
  };
4127
4129
 
4130
+ const operators = [
4131
+ 'EQUALS',
4132
+ 'CONTAINS',
4133
+ 'I_CONTAINS',
4134
+ 'GREATER_THAN',
4135
+ 'START_WITH',
4136
+ 'END_WITH',
4137
+ 'LOWER_THAN',
4138
+ 'INSIDE',
4139
+ 'OUTSIDE'
4140
+ ];
4141
+ class FilterParamEncoder extends HttpUrlEncodingCodec {
4142
+ constructor() {
4143
+ super();
4144
+ }
4145
+ encodeValue(v) {
4146
+ const hasOperator = operators.includes(v.split(',')?.[1]);
4147
+ if (hasOperator) {
4148
+ const fragments = v.split(',');
4149
+ fragments[2] = encodeURIComponent(fragments.splice(2).join('\\,'));
4150
+ return fragments.slice(0, 3).join(',');
4151
+ }
4152
+ return encodeURIComponent(v);
4153
+ }
4154
+ }
4155
+
4128
4156
  class SearchService {
4129
4157
  constructor(httpClient, store) {
4130
4158
  this.httpClient = httpClient;
@@ -4151,7 +4179,7 @@ class SearchService {
4151
4179
  return '|' + this.getItemsFilter(id, this.getOrder(quickOrder[id])).toString() + '|';
4152
4180
  }
4153
4181
  getItemsFilter(id, cumulative, includeLimit = true) {
4154
- let params = cumulative ?? new HttpParams();
4182
+ let params = cumulative ?? new HttpParams({ encoder: new FilterParamEncoder() });
4155
4183
  if (this.filters[id]) {
4156
4184
  this.filters[id]
4157
4185
  .filter((filter) => filter.value !== null && filter.value !== undefined)
@@ -4166,7 +4194,7 @@ class SearchService {
4166
4194
  return params;
4167
4195
  }
4168
4196
  getOrder(quickOrder, cumulative) {
4169
- let params = cumulative ?? new HttpParams();
4197
+ let params = cumulative ?? new HttpParams({ encoder: new FilterParamEncoder() });
4170
4198
  if (quickOrder) {
4171
4199
  params = params.append('order', `${quickOrder.attribute},${quickOrder.asc ?? ''}`);
4172
4200
  }
@@ -5380,7 +5408,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
5380
5408
 
5381
5409
  const feature$2 = createFeatureSelector(searchFeatureKey);
5382
5410
  const searchLoading = createSelector(feature$2, (state) => state.searchLoading);
5383
- const possibleFilterValues = (filterId) => createSelector(feature$2, (state) => (filterId ? state.possibleFilterValues[filterId] : []));
5411
+ const possibleFilterValues = (filterId) => createSelector(feature$2, (state) => filterId && state.possibleFilterValues[filterId] ? state.possibleFilterValues[filterId] : []);
5384
5412
  const SearchSelectors = {
5385
5413
  feature: feature$2,
5386
5414
  searchLoading,
@@ -7515,7 +7543,7 @@ class PryGroupShareComponent extends SubscriptionnerDirective {
7515
7543
  useExisting: forwardRef(() => PryGroupShareComponent),
7516
7544
  multi: true
7517
7545
  }
7518
- ], usesInheritance: true, ngImport: i0, template: "@if(templateData$ | async; as data) {\n <div class=\"m-form-radio-group\">\n <div *ngFor=\"let type of visibilityTypes\" class=\"m-form-radio-group__item\">\n <input\n type=\"radio\"\n name=\"visibility\"\n [id]=\"type.label\"\n [value]=\"type.value\"\n [ngModel]=\"radioValue\"\n (ngModelChange)=\"changeGroupsBasedOnRadioValue($event)\"\n [disabled]=\"data.disableRadios[type.value]\"\n />\n <label [for]=\"type.label\" class=\"a-label\" [class.a-label--disabled]=\"data.disableRadios[type.value]\">\n {{ '@pry.share.' + type.label | i18n }}\n </label>\n </div>\n </div>\n @if (radioValue === PryVisibilityType.RESTRICTED) {\n <pry-chips-selector\n bindLabel=\"name\"\n bindValue=\"name\"\n translationStringBase=\"@pry.components.chipsSelector.share.\"\n itemTranslationStringBase=\"@pry.components.chipsSelector.share.groups.\"\n [showActionButtons]=\"false\"\n [items]=\"data.groups\"\n (itemsChanged)=\"changeGroups($event)\"\n [usedItems]=\"data.assignedGroups\"\n [showSearchbar]=\"data.groups.length > 6\"\n ></pry-chips-selector>\n }\n}\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ChipsSelectorComponent, selector: "pry-chips-selector", inputs: ["bindValue", "bindLabel", "translationStringBase", "itemTranslationStringBase", "showActionButtons", "showSearchbar", "items", "usedItems"], outputs: ["cancel", "validated", "previousTab", "nextTab", "itemsChanged"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7546
+ ], usesInheritance: true, ngImport: i0, template: "@if (templateData$ | async; as data) {\n <div class=\"m-form-radio-group\">\n <div *ngFor=\"let type of visibilityTypes\" class=\"m-form-radio-group__item\">\n <input\n type=\"radio\"\n name=\"visibility\"\n [id]=\"type.label\"\n [value]=\"type.value\"\n [ngModel]=\"radioValue\"\n (ngModelChange)=\"changeGroupsBasedOnRadioValue($event)\"\n [disabled]=\"data.disableRadios[type.value]\"\n />\n <label [for]=\"type.label\" class=\"a-label\" [class.a-label--disabled]=\"data.disableRadios[type.value]\">\n {{ '@pry.share.' + type.label | i18n }}\n </label>\n </div>\n </div>\n @if (radioValue === PryVisibilityType.RESTRICTED) {\n @if (data.groups.length > 0) {\n <pry-chips-selector\n bindLabel=\"name\"\n bindValue=\"name\"\n translationStringBase=\"@pry.components.chipsSelector.share.\"\n itemTranslationStringBase=\"@pry.components.chipsSelector.share.groups.\"\n [showActionButtons]=\"false\"\n [items]=\"data.groups\"\n (itemsChanged)=\"changeGroups($event)\"\n [usedItems]=\"data.assignedGroups\"\n [showSearchbar]=\"data.groups.length > 6\"\n ></pry-chips-selector>\n } @else {\n <p class=\"m-text--center\">\n {{ '@pry.share.noGroups' | i18n }}\n </p>\n }\n }\n}\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ChipsSelectorComponent, selector: "pry-chips-selector", inputs: ["bindValue", "bindLabel", "translationStringBase", "itemTranslationStringBase", "showActionButtons", "showSearchbar", "items", "usedItems"], outputs: ["cancel", "validated", "previousTab", "nextTab", "itemsChanged"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7519
7547
  }
7520
7548
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PryGroupShareComponent, decorators: [{
7521
7549
  type: Component,
@@ -7525,7 +7553,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
7525
7553
  useExisting: forwardRef(() => PryGroupShareComponent),
7526
7554
  multi: true
7527
7555
  }
7528
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if(templateData$ | async; as data) {\n <div class=\"m-form-radio-group\">\n <div *ngFor=\"let type of visibilityTypes\" class=\"m-form-radio-group__item\">\n <input\n type=\"radio\"\n name=\"visibility\"\n [id]=\"type.label\"\n [value]=\"type.value\"\n [ngModel]=\"radioValue\"\n (ngModelChange)=\"changeGroupsBasedOnRadioValue($event)\"\n [disabled]=\"data.disableRadios[type.value]\"\n />\n <label [for]=\"type.label\" class=\"a-label\" [class.a-label--disabled]=\"data.disableRadios[type.value]\">\n {{ '@pry.share.' + type.label | i18n }}\n </label>\n </div>\n </div>\n @if (radioValue === PryVisibilityType.RESTRICTED) {\n <pry-chips-selector\n bindLabel=\"name\"\n bindValue=\"name\"\n translationStringBase=\"@pry.components.chipsSelector.share.\"\n itemTranslationStringBase=\"@pry.components.chipsSelector.share.groups.\"\n [showActionButtons]=\"false\"\n [items]=\"data.groups\"\n (itemsChanged)=\"changeGroups($event)\"\n [usedItems]=\"data.assignedGroups\"\n [showSearchbar]=\"data.groups.length > 6\"\n ></pry-chips-selector>\n }\n}\n" }]
7556
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (templateData$ | async; as data) {\n <div class=\"m-form-radio-group\">\n <div *ngFor=\"let type of visibilityTypes\" class=\"m-form-radio-group__item\">\n <input\n type=\"radio\"\n name=\"visibility\"\n [id]=\"type.label\"\n [value]=\"type.value\"\n [ngModel]=\"radioValue\"\n (ngModelChange)=\"changeGroupsBasedOnRadioValue($event)\"\n [disabled]=\"data.disableRadios[type.value]\"\n />\n <label [for]=\"type.label\" class=\"a-label\" [class.a-label--disabled]=\"data.disableRadios[type.value]\">\n {{ '@pry.share.' + type.label | i18n }}\n </label>\n </div>\n </div>\n @if (radioValue === PryVisibilityType.RESTRICTED) {\n @if (data.groups.length > 0) {\n <pry-chips-selector\n bindLabel=\"name\"\n bindValue=\"name\"\n translationStringBase=\"@pry.components.chipsSelector.share.\"\n itemTranslationStringBase=\"@pry.components.chipsSelector.share.groups.\"\n [showActionButtons]=\"false\"\n [items]=\"data.groups\"\n (itemsChanged)=\"changeGroups($event)\"\n [usedItems]=\"data.assignedGroups\"\n [showSearchbar]=\"data.groups.length > 6\"\n ></pry-chips-selector>\n } @else {\n <p class=\"m-text--center\">\n {{ '@pry.share.noGroups' | i18n }}\n </p>\n }\n }\n}\n" }]
7529
7557
  }], ctorParameters: () => [{ type: i1.Store }, { type: i0.ChangeDetectorRef }], propDecorators: { disableRadios: [{
7530
7558
  type: Input
7531
7559
  }], allowedGroups: [{