@provoly/dashboard 1.3.2 → 1.3.3

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.
@@ -50,6 +50,9 @@ class PryDefaultAccessService extends PryBaseAccess {
50
50
  canModifyDataset(dataset) {
51
51
  return of(dataset.owner ?? false);
52
52
  }
53
+ canModifyWidget(widget) {
54
+ return of(widget.owner ?? false);
55
+ }
53
56
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PryDefaultAccessService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
54
57
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PryDefaultAccessService }); }
55
58
  }
@@ -10751,9 +10754,10 @@ class DatasourceSelectorComponent extends SubscriptionnerDirective {
10751
10754
  this.manifest$.next(manifest);
10752
10755
  this.selectedIds$.next(DatasourceUtils.getDatasourceArray(manifest?.datasource));
10753
10756
  }
10754
- constructor(store) {
10757
+ constructor(store, cdr) {
10755
10758
  super();
10756
10759
  this.store = store;
10760
+ this.cdr = cdr;
10757
10761
  this.manifest$ = new BehaviorSubject(null);
10758
10762
  this.selectedIds$ = new BehaviorSubject([]);
10759
10763
  this.showButtons = true;
@@ -10763,11 +10767,14 @@ class DatasourceSelectorComponent extends SubscriptionnerDirective {
10763
10767
  this.cancel = new EventEmitter();
10764
10768
  this.validated = new EventEmitter();
10765
10769
  this.itemsChanged = new EventEmitter();
10766
- this.datasources$ = combineLatest([
10770
+ this.selectedDatasources$ = combineLatest([
10767
10771
  this.store.select(DataSourceSelectors.getDataSourcesSorted),
10768
10772
  this.selectedIds$
10769
- ]).pipe(map(([datasources, selectedIds]) => DatasourceUtils.getAllDatasourcesWithUnknowns(datasources, selectedIds)));
10770
- this.selectedDatasources$ = combineLatest([this.datasources$, this.selectedIds$]).pipe(map(([datasources, selected]) => datasources.filter((ds) => selected.includes(ds.id))));
10773
+ ]).pipe(map(([datasources, selectedIds]) => DatasourceUtils.getAllDatasourcesWithUnknowns(datasources, selectedIds).filter((ds) => selectedIds.includes(ds.id))));
10774
+ this.subscriptions.add(this.selectedIds$.subscribe((selectedIds) => {
10775
+ this.itemsChanged.emit(selectedIds);
10776
+ this.cdr.detectChanges();
10777
+ }));
10771
10778
  }
10772
10779
  isGeo(item) {
10773
10780
  return DatasourceUtils.isGeo(item);
@@ -10776,18 +10783,19 @@ class DatasourceSelectorComponent extends SubscriptionnerDirective {
10776
10783
  this.selectedIds$.next(this.selectedIds$.value.includes(id)
10777
10784
  ? this.selectedIds$.value.filter((i) => i !== id)
10778
10785
  : [...this.selectedIds$.value, id]);
10786
+ this.cdr.detectChanges();
10779
10787
  }
10780
10788
  updateDatasourceList(ids) {
10781
10789
  this.selectedIds$.next(ids);
10782
- this.itemsChanged.emit(ids);
10790
+ this.cdr.detectChanges();
10783
10791
  }
10784
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: DatasourceSelectorComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
10792
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: DatasourceSelectorComponent, deps: [{ token: i1.Store }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
10785
10793
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: DatasourceSelectorComponent, selector: "pry-datasource-selector", inputs: { showButtons: "showButtons", showTitle: "showTitle", manifest: "manifest" }, outputs: { previousTab: "previousTab", nextTab: "nextTab", cancel: "cancel", validated: "validated", itemsChanged: "itemsChanged" }, usesInheritance: true, ngImport: i0, template: "<div class=\"o-datasource-selector u-display-flex -column\">\n @if (showTitle) {\n <h2 class=\"u-self-center\">{{ '@pry.components.datasourceSelector.select' | i18n }}</h2>\n }\n <div>\n <h3>\n {{ '@pry.components.datasourceSelector.selection' | i18n }} ({{ ((selectedDatasources$ | async) ?? []).length }})\n </h3>\n <div class=\"o-datasource-selector__chips u-display-flex -wrap -gap-10\">\n @if ((selectedDatasources$ | async)?.length === 0) {\n <span class=\"a-label -italic\">{{ '@pry.components.datasourceSelector.noItemSelected' | i18n }}</span>\n } @else {\n @for (datasource of selectedDatasources$ | async; track datasource.id) {\n <button\n class=\"a-chip a-chip--ghost -lg a-tooltip\"\n [attr.data-tooltip]=\"'@pry.components.datasourceSelector.unselectItem' | i18n\"\n type=\"button\"\n (click)=\"toggleSelection(datasource.id)\"\n >\n <pry-icon iconSvg=\"close\" [width]=\"15\" [height]=\"15\"></pry-icon>\n {{ datasource.name }}\n <pry-icon *ngIf=\"isGeo(datasource)\" iconSvg=\"globe\" [width]=\"18\" [height]=\"18\"></pry-icon>\n </button>\n }\n }\n </div>\n </div>\n <pry-datasource-list\n mode=\"selector\"\n [selectedDatasources]=\"(selectedIds$ | async) ?? []\"\n (datasourceSelected)=\"updateDatasourceList($event)\"\n ></pry-datasource-list>\n @if (showButtons) {\n <div class=\"m-btn-group o-datasource-selector__footer\">\n <button type=\"button\" (click)=\"cancel.emit()\" class=\"a-btn a-btn--secondary\">\n {{ '@pry.toolbox.manifest.close' | i18n }}\n </button>\n <button\n type=\"button\"\n (click)=\"validated.emit()\"\n #validate\n (keydown.tab)=\"nextTab.emit()\"\n class=\"a-btn a-btn--primary\"\n >\n {{ '@pry.toolbox.manifest.validated' | i18n }}\n </button>\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: PryDatasourceListComponent, selector: "pry-datasource-list", inputs: ["mode", "selectedDatasources"], outputs: ["consultedDataset", "datasourceSelected"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
10786
10794
  }
10787
10795
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: DatasourceSelectorComponent, decorators: [{
10788
10796
  type: Component,
10789
10797
  args: [{ selector: 'pry-datasource-selector', template: "<div class=\"o-datasource-selector u-display-flex -column\">\n @if (showTitle) {\n <h2 class=\"u-self-center\">{{ '@pry.components.datasourceSelector.select' | i18n }}</h2>\n }\n <div>\n <h3>\n {{ '@pry.components.datasourceSelector.selection' | i18n }} ({{ ((selectedDatasources$ | async) ?? []).length }})\n </h3>\n <div class=\"o-datasource-selector__chips u-display-flex -wrap -gap-10\">\n @if ((selectedDatasources$ | async)?.length === 0) {\n <span class=\"a-label -italic\">{{ '@pry.components.datasourceSelector.noItemSelected' | i18n }}</span>\n } @else {\n @for (datasource of selectedDatasources$ | async; track datasource.id) {\n <button\n class=\"a-chip a-chip--ghost -lg a-tooltip\"\n [attr.data-tooltip]=\"'@pry.components.datasourceSelector.unselectItem' | i18n\"\n type=\"button\"\n (click)=\"toggleSelection(datasource.id)\"\n >\n <pry-icon iconSvg=\"close\" [width]=\"15\" [height]=\"15\"></pry-icon>\n {{ datasource.name }}\n <pry-icon *ngIf=\"isGeo(datasource)\" iconSvg=\"globe\" [width]=\"18\" [height]=\"18\"></pry-icon>\n </button>\n }\n }\n </div>\n </div>\n <pry-datasource-list\n mode=\"selector\"\n [selectedDatasources]=\"(selectedIds$ | async) ?? []\"\n (datasourceSelected)=\"updateDatasourceList($event)\"\n ></pry-datasource-list>\n @if (showButtons) {\n <div class=\"m-btn-group o-datasource-selector__footer\">\n <button type=\"button\" (click)=\"cancel.emit()\" class=\"a-btn a-btn--secondary\">\n {{ '@pry.toolbox.manifest.close' | i18n }}\n </button>\n <button\n type=\"button\"\n (click)=\"validated.emit()\"\n #validate\n (keydown.tab)=\"nextTab.emit()\"\n class=\"a-btn a-btn--primary\"\n >\n {{ '@pry.toolbox.manifest.validated' | i18n }}\n </button>\n </div>\n }\n</div>\n" }]
10790
- }], ctorParameters: () => [{ type: i1.Store }], propDecorators: { showButtons: [{
10798
+ }], ctorParameters: () => [{ type: i1.Store }, { type: i0.ChangeDetectorRef }], propDecorators: { showButtons: [{
10791
10799
  type: Input
10792
10800
  }], showTitle: [{
10793
10801
  type: Input