nuxeo-development-framework 5.6.8 → 5.7.0

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.
@@ -15148,7 +15148,7 @@
15148
15148
  return DynamicColumnComponent;
15149
15149
  }());
15150
15150
  DynamicColumnComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: DynamicColumnComponent, deps: [{ token: ExtensionService }, { token: ColumnRendererRegistryService }, { token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
15151
- DynamicColumnComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: DynamicColumnComponent, selector: "cts-dynamic-column", inputs: { id: "id", context: "context", column: "column" }, host: { classAttribute: "cts-dynamic-column" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, read: i0.ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: " <ng-container #content></ng-container> ", isInline: true, styles: ["\n\t\t\t.cts-dynamic-column {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\t\t"], encapsulation: i0__namespace.ViewEncapsulation.None });
15151
+ DynamicColumnComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: DynamicColumnComponent, selector: "cts-dynamic-column", inputs: { id: "id", context: "context", column: "column" }, host: { classAttribute: "cts-dynamic-column" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, read: i0.ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: " <ng-container #content></ng-container> ", isInline: true, styles: ["\n\t\t\t.cts-dynamic-column {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: var(--dynamic-column-align, center);\n\t\t\t\tjustify-content: var(--dynamic-column-justity, flex-start);\n\t\t\t\twidth: var(--dynamic-column-width, 100%);\n\t\t\t\tpadding :var(--dynamic-column-padding, unset);\n\t\t\t}\n\t\t"], encapsulation: i0__namespace.ViewEncapsulation.None });
15152
15152
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: DynamicColumnComponent, decorators: [{
15153
15153
  type: i0.Component,
15154
15154
  args: [{
@@ -15157,7 +15157,7 @@
15157
15157
  encapsulation: i0.ViewEncapsulation.None,
15158
15158
  host: { class: 'cts-dynamic-column' },
15159
15159
  styles: [
15160
- "\n\t\t\t.cts-dynamic-column {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\t\t"
15160
+ "\n\t\t\t.cts-dynamic-column {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: var(--dynamic-column-align, center);\n\t\t\t\tjustify-content: var(--dynamic-column-justity, flex-start);\n\t\t\t\twidth: var(--dynamic-column-width, 100%);\n\t\t\t\tpadding :var(--dynamic-column-padding, unset);\n\t\t\t}\n\t\t"
15161
15161
  ]
15162
15162
  }]
15163
15163
  }], ctorParameters: function () { return [{ type: ExtensionService }, { type: ColumnRendererRegistryService }, { type: i0__namespace.ComponentFactoryResolver }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { content: [{
@@ -18587,7 +18587,7 @@
18587
18587
  _this.sourceState$ = _this._sourceState.asObservable().pipe(operators.filter(function (data) { return !!(data === null || data === void 0 ? void 0 : data.fieldConfig) && !!data.aggregation; }));
18588
18588
  _this.renderOptions$ = _this.sourceState$.pipe(operators.map(function (data) { var _a, _b; return (_b = (_a = data.fieldConfig) === null || _a === void 0 ? void 0 : _a.render) === null || _b === void 0 ? void 0 : _b.options; }), operators.filter(Boolean));
18589
18589
  _this._optionsSub = new rxjs.BehaviorSubject([]);
18590
- _this.options$ = _this.sourceState$.pipe(operators.switchMap(function (res) { return _this._aggregationService.prepareAggregationFiled(res); }), operators.filter(function (data) { return !!(data === null || data === void 0 ? void 0 : data.length); }), operators.tap(function (options) {
18590
+ _this.options$ = _this.sourceState$.pipe(operators.switchMap(function (res) { return _this._aggregationService.prepareAggregationFiled(res); }), operators.tap(function (options) {
18591
18591
  _this._optionsSub.next(options);
18592
18592
  }));
18593
18593
  return _this;
@@ -20562,9 +20562,9 @@
20562
20562
  return;
20563
20563
  }
20564
20564
  Object.keys(changes).forEach(function (key) {
20565
- _this._componentRef.instance[key] = changes[key].currentValue;
20565
+ _this._componentRef.instance[key] = ___default["default"].cloneDeep(changes[key].currentValue);
20566
20566
  });
20567
- this._componentRef.changeDetectorRef.markForCheck();
20567
+ this._componentRef.changeDetectorRef.detectChanges();
20568
20568
  };
20569
20569
  BaseField.prototype.ngOnDestroy = function () {
20570
20570
  if (this._componentRef) {
@@ -20680,9 +20680,11 @@
20680
20680
  (_d = (_c = this.handlers)[componentType]) === null || _d === void 0 ? void 0 : _d.call(_c);
20681
20681
  }
20682
20682
  };
20683
+ AggregationFieldComponent.prototype.ngOnChanges = function (changes) {
20684
+ _super.prototype.ngOnChanges.call(this, changes);
20685
+ };
20683
20686
  AggregationFieldComponent.prototype._prepareField = function () {
20684
- var instance = this._componentRef
20685
- .instance;
20687
+ var instance = this._componentRef.instance;
20686
20688
  instance.aggregation = this.aggregation;
20687
20689
  instance.fieldConfig = this.fieldConfig;
20688
20690
  if (this.contentTemplate) {
@@ -20696,14 +20698,14 @@
20696
20698
  {
20697
20699
  provide: i2.NG_VALUE_ACCESSOR,
20698
20700
  useExisting: i0.forwardRef(function () { return AggregationFieldComponent; }),
20699
- multi: true,
20701
+ multi: true
20700
20702
  },
20701
20703
  {
20702
20704
  provide: i2.NG_VALIDATORS,
20703
20705
  useExisting: i0.forwardRef(function () { return AggregationFieldComponent; }),
20704
- multi: true,
20705
- },
20706
- ], usesInheritance: true, ngImport: i0__namespace, template: '<ng-container #dynamicContainer></ng-container>', isInline: true, styles: [""], encapsulation: i0__namespace.ViewEncapsulation.None });
20706
+ multi: true
20707
+ }
20708
+ ], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: '<ng-container #dynamicContainer></ng-container>', isInline: true, styles: [""], encapsulation: i0__namespace.ViewEncapsulation.None });
20707
20709
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AggregationFieldComponent, decorators: [{
20708
20710
  type: i0.Component,
20709
20711
  args: [{
@@ -20715,17 +20717,17 @@
20715
20717
  {
20716
20718
  provide: i2.NG_VALUE_ACCESSOR,
20717
20719
  useExisting: i0.forwardRef(function () { return AggregationFieldComponent; }),
20718
- multi: true,
20720
+ multi: true
20719
20721
  },
20720
20722
  {
20721
20723
  provide: i2.NG_VALIDATORS,
20722
20724
  useExisting: i0.forwardRef(function () { return AggregationFieldComponent; }),
20723
- multi: true,
20724
- },
20725
+ multi: true
20726
+ }
20725
20727
  ],
20726
20728
  host: {
20727
- '[class]': "'aggregation-field' + ' aggregation-field__fieldConfig?.render?.type' ",
20728
- },
20729
+ '[class]': "'aggregation-field' + ' aggregation-field__fieldConfig?.render?.type' "
20730
+ }
20729
20731
  }]
20730
20732
  }], propDecorators: { aggregation: [{
20731
20733
  type: i0.Input
@@ -22537,18 +22539,15 @@
22537
22539
  this.baseAppUrl = baseAppUrl;
22538
22540
  this.configService = configService;
22539
22541
  this.isFeatureEnabled = false;
22542
+ this.isEnabled = false;
22540
22543
  this.editorConfig = (_a = this.configService.myConfiguration) === null || _a === void 0 ? void 0 : _a.configEditor;
22541
22544
  this.isFeatureEnabled = environment.configEditor === 'YES';
22542
22545
  }
22543
- Object.defineProperty(EditorButtonComponent.prototype, "isEnabled", {
22544
- get: function () {
22545
- var _a, _b, _c, _d;
22546
- return ((_a = this.editorConfig) === null || _a === void 0 ? void 0 : _a.enabled) && ((_d = (_c = (_b = this.editorConfig) === null || _b === void 0 ? void 0 : _b.types) === null || _c === void 0 ? void 0 : _c[this.type]) === null || _d === void 0 ? void 0 : _d.enabled);
22547
- },
22548
- enumerable: false,
22549
- configurable: true
22550
- });
22551
- EditorButtonComponent.prototype.ngOnInit = function () { };
22546
+ EditorButtonComponent.prototype.ngOnChanges = function (changes) {
22547
+ var _a, _b, _c, _d;
22548
+ this.typeConfig = (_b = (_a = this.editorConfig) === null || _a === void 0 ? void 0 : _a.types) === null || _b === void 0 ? void 0 : _b[this.type];
22549
+ this.isEnabled = this.isFeatureEnabled && ((_c = this.editorConfig) === null || _c === void 0 ? void 0 : _c.enabled) && ((_d = this.typeConfig) === null || _d === void 0 ? void 0 : _d.enabled);
22550
+ };
22552
22551
  EditorButtonComponent.prototype.navigate = function () {
22553
22552
  var _e;
22554
22553
  var _a;
@@ -22571,12 +22570,12 @@
22571
22570
  return EditorButtonComponent;
22572
22571
  }());
22573
22572
  EditorButtonComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: EditorButtonComponent, deps: [{ token: 'environment' }, { token: i1__namespace$5.Router }, { token: PROJECT_BASE_HREF }, { token: AppConfigService }], target: i0__namespace.ɵɵFactoryTarget.Component });
22574
- EditorButtonComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: EditorButtonComponent, selector: "app-editor-button", inputs: { type: "type", key: "key" }, ngImport: i0__namespace, template: "\n\t\t<ng-container *ngIf=\"isFeatureEnabled && isEnabled\">\n\t\t\t<button\n\t\t\t\tmat-stroked-button\n\t\t\t\t[matTooltip]=\"'JSON_EDITOR.navigateToEditor' | translate\"\n\t\t\t\t(click)=\"navigate()\"\n\t\t\t\t*permission=\"{ name: item?.permission }\"\n\t\t\t>\n\t\t\t\t<mat-icon>edit</mat-icon>\n\t\t\t</button>\n\t\t</ng-container>\n\t", isInline: true, components: [{ type: i1__namespace$c.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i4__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: PermissionsDirective, selector: "[permission]", inputs: ["permission"] }, { type: i7__namespace.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltipPosition", "matTooltipDisabled", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
22573
+ EditorButtonComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: EditorButtonComponent, selector: "app-editor-button", inputs: { type: "type", key: "key" }, usesOnChanges: true, ngImport: i0__namespace, template: "\n\t\t<ng-container *ngIf=\"isEnabled\">\n\t\t\t<button\n\t\t\t\tmat-stroked-button\n\t\t\t\t[matTooltip]=\"'JSON_EDITOR.navigateToEditor' | translate\"\n\t\t\t\t(click)=\"navigate()\"\n\t\t\t\t*permission=\"{ name: typeConfig?.permission }\"\n\t\t\t>\n\t\t\t\t<mat-icon>edit</mat-icon>\n\t\t\t</button>\n\t\t</ng-container>\n\t", isInline: true, components: [{ type: i1__namespace$c.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i4__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: PermissionsDirective, selector: "[permission]", inputs: ["permission"] }, { type: i7__namespace.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltipPosition", "matTooltipDisabled", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
22575
22574
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: EditorButtonComponent, decorators: [{
22576
22575
  type: i0.Component,
22577
22576
  args: [{
22578
22577
  selector: 'app-editor-button',
22579
- template: "\n\t\t<ng-container *ngIf=\"isFeatureEnabled && isEnabled\">\n\t\t\t<button\n\t\t\t\tmat-stroked-button\n\t\t\t\t[matTooltip]=\"'JSON_EDITOR.navigateToEditor' | translate\"\n\t\t\t\t(click)=\"navigate()\"\n\t\t\t\t*permission=\"{ name: item?.permission }\"\n\t\t\t>\n\t\t\t\t<mat-icon>edit</mat-icon>\n\t\t\t</button>\n\t\t</ng-container>\n\t"
22578
+ template: "\n\t\t<ng-container *ngIf=\"isEnabled\">\n\t\t\t<button\n\t\t\t\tmat-stroked-button\n\t\t\t\t[matTooltip]=\"'JSON_EDITOR.navigateToEditor' | translate\"\n\t\t\t\t(click)=\"navigate()\"\n\t\t\t\t*permission=\"{ name: typeConfig?.permission }\"\n\t\t\t>\n\t\t\t\t<mat-icon>edit</mat-icon>\n\t\t\t</button>\n\t\t</ng-container>\n\t"
22580
22579
  }]
22581
22580
  }], ctorParameters: function () {
22582
22581
  return [{ type: undefined, decorators: [{
@@ -47205,7 +47204,8 @@
47205
47204
  _this.isPanelOpened = false;
47206
47205
  _this.isLoadingResult = false;
47207
47206
  _this.isExpanded = false;
47208
- _this.activeQuery = {};
47207
+ // activeQuery: Record<string, any> = {};
47208
+ _this._activeQuerySub = new rxjs.BehaviorSubject(null);
47209
47209
  _this._activeFiltersQuerySub = new rxjs.ReplaySubject();
47210
47210
  _this.activeFiltersQuery$ = _this._activeFiltersQuerySub.asObservable();
47211
47211
  _this._configSubject = new rxjs.BehaviorSubject(null);
@@ -47228,6 +47228,14 @@
47228
47228
  });
47229
47229
  return _this;
47230
47230
  }
47231
+ Object.defineProperty(NdfReportsComponent.prototype, "activeQuery", {
47232
+ get: function () {
47233
+ var _a;
47234
+ return (_a = this._activeQuerySub.getValue()) === null || _a === void 0 ? void 0 : _a.current;
47235
+ },
47236
+ enumerable: false,
47237
+ configurable: true
47238
+ });
47231
47239
  Object.defineProperty(NdfReportsComponent.prototype, "showDetails", {
47232
47240
  get: function () {
47233
47241
  return !!this._reportDetailsSubject.getValue();
@@ -47374,8 +47382,8 @@
47374
47382
  return this._filtersMapper.preparePayload(fields, criteria);
47375
47383
  };
47376
47384
  NdfReportsComponent.prototype._stringifyValues = function (criteria) {
47377
- return Object.entries(criteria).reduce(function (acc, _d) {
47378
- var _e = __read(_d, 2), key = _e[0], value = _e[1];
47385
+ return Object.entries(criteria).reduce(function (acc, _g) {
47386
+ var _h = __read(_g, 2), key = _h[0], value = _h[1];
47379
47387
  acc[key] = Array.isArray(value) ? JSON.stringify(value) : value;
47380
47388
  return acc;
47381
47389
  }, {});
@@ -47389,8 +47397,8 @@
47389
47397
  ]).pipe(operators.tap(function () {
47390
47398
  _this.isLoadingResult = true;
47391
47399
  _this._cdr.detectChanges();
47392
- }), operators.switchMap(function (_d) {
47393
- var _e = __read(_d, 2), criteria = _e[0], config = _e[1];
47400
+ }), operators.switchMap(function (_g) {
47401
+ var _h = __read(_g, 2), criteria = _h[0], config = _h[1];
47394
47402
  var request = config === null || config === void 0 ? void 0 : config.request;
47395
47403
  if (!request) {
47396
47404
  return rxjs.of(null);
@@ -47406,8 +47414,8 @@
47406
47414
  _this._cdr.detectChanges();
47407
47415
  }));
47408
47416
  return rxjs.forkJoin([rxjs.of(config), data$]);
47409
- }), operators.map(function (_d) {
47410
- var _e = __read(_d, 2), config = _e[0], response = _e[1];
47417
+ }), operators.map(function (_g) {
47418
+ var _h = __read(_g, 2), config = _h[0], response = _h[1];
47411
47419
  _this._prepareAggregations(response === null || response === void 0 ? void 0 : response.aggregations);
47412
47420
  return {
47413
47421
  config: config,
@@ -47433,23 +47441,59 @@
47433
47441
  };
47434
47442
  };
47435
47443
  NdfReportsComponent.prototype._updateActiveQuery = function (query) {
47436
- this.activeQuery = query;
47444
+ this._activeQuerySub.next({
47445
+ previous: this.activeQuery,
47446
+ current: query
47447
+ });
47437
47448
  this._activeFiltersQuerySub.next({
47438
47449
  query: query,
47439
47450
  emitEvent: false
47440
47451
  });
47441
47452
  };
47442
47453
  NdfReportsComponent.prototype._prepareAggregations = function (aggregations) {
47443
- var _a;
47454
+ var _a, _b, _c;
47444
47455
  if (this._isConfigChanged && this.aggregations) {
47445
47456
  this.aggregations = null;
47446
47457
  }
47447
- if (this.aggregations && ((_a = this.config.filters) === null || _a === void 0 ? void 0 : _a.reloadStrategy) === 'never') {
47458
+ var reloadStrategy = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.reload) === null || _c === void 0 ? void 0 : _c.strategy;
47459
+ if (this.aggregations && reloadStrategy === 'never') {
47448
47460
  return;
47449
47461
  }
47450
- this.aggregations = aggregations;
47462
+ if (this.aggregations && reloadStrategy === 'onChange') {
47463
+ if (this._shouldReloadOnChange()) {
47464
+ this._updateAggregations(aggregations);
47465
+ }
47466
+ return;
47467
+ }
47468
+ this._updateAggregations(aggregations);
47451
47469
  this._isConfigChanged = false;
47452
47470
  };
47471
+ NdfReportsComponent.prototype._shouldReloadOnChange = function () {
47472
+ var _a, _b, _c, _d, _e, _f;
47473
+ if (((_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.reload) === null || _c === void 0 ? void 0 : _c.strategy) !== 'onChange') {
47474
+ return false;
47475
+ }
47476
+ var triggerFields = (_f = (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.filters) === null || _e === void 0 ? void 0 : _e.reload) === null || _f === void 0 ? void 0 : _f.triggerFields;
47477
+ if (!Array.isArray(triggerFields)) {
47478
+ return false;
47479
+ }
47480
+ var validFields = triggerFields.filter(Boolean);
47481
+ if (!validFields.length) {
47482
+ return false;
47483
+ }
47484
+ var activatedQuery = this._activeQuerySub.getValue();
47485
+ var currentValue = (activatedQuery === null || activatedQuery === void 0 ? void 0 : activatedQuery.current) || {};
47486
+ var previousValue = (activatedQuery === null || activatedQuery === void 0 ? void 0 : activatedQuery.previous) || {};
47487
+ var changedKeys = this._getChangedKeys(previousValue, currentValue);
47488
+ return validFields.some(function (field) { return changedKeys.includes(field); });
47489
+ };
47490
+ NdfReportsComponent.prototype._getChangedKeys = function (previous, current) {
47491
+ var allKeys = ___default["default"].union(___default["default"].keys(previous), ___default["default"].keys(current));
47492
+ return allKeys.filter(function (key) { return !___default["default"].isEqual(previous[key], current[key]); });
47493
+ };
47494
+ NdfReportsComponent.prototype._updateAggregations = function (aggregations) {
47495
+ this.aggregations = ___default["default"].cloneDeep(aggregations);
47496
+ };
47453
47497
  NdfReportsComponent.prototype._checkConfigChange = function (value) {
47454
47498
  var activeQuery = value.activeQuery, config = __rest(value, ["activeQuery"]);
47455
47499
  var _a = this._configSubject.getValue() || {}, aq = _a.activeQuery, currentConfig = __rest(_a, ["activeQuery"]);