@bizdoc/core 1.13.1 → 1.13.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.
@@ -5603,6 +5603,14 @@ class CubeService {
5603
5603
  }
5604
5604
  return this._http.get(`/api/cube/exploretype/${cube}`, { params });
5605
5605
  }
5606
+ /**
5607
+ * information on expected explore type
5608
+ * @param cube name
5609
+ * @param index name
5610
+ */
5611
+ resolveIndex(cube, index) {
5612
+ return this._http.get(`/api/cube/exploreindextype/${cube}/${index}`);
5613
+ }
5606
5614
  /**
5607
5615
  * explore items by axis
5608
5616
  * @param cube name
@@ -11967,20 +11975,31 @@ class ExploreItemsComponent {
11967
11975
  }
11968
11976
  _index() {
11969
11977
  this._loading$.next(true);
11970
- this._service.indices(this.cube, this.index, this.axes, { scope: this.scope }).subscribe(r => {
11971
- const columns = this._cube.axes.
11972
- filter(a => this.axes[a.name] === undefined && !a.hidden &&
11973
- r.find(row => row[a.name] !== undefined)).
11974
- map(a => {
11975
- return { name: a.name, label: a.title };
11978
+ this._service.resolveIndex(this.cube, this.index).subscribe(e => {
11979
+ const { columns, fields, template } = e;
11980
+ this._service.indices(this.cube, this.index, this.axes, { scope: this.scope }).subscribe(r => {
11981
+ if (!columns.length) {
11982
+ this.columns = this._cube.axes.
11983
+ filter(a => this.axes[a.name] === undefined && !a.hidden &&
11984
+ r.find(row => row[a.name] !== undefined)).
11985
+ map(a => ({ name: a.name, label: a.title }));
11986
+ const index = this._cube.indices.find(i => i.name === this.index);
11987
+ columns.push({ name: 'value', label: index.title, type: FieldType.Currency });
11988
+ this.displayedColumns = columns.map(c => c.name);
11989
+ this._template = null;
11990
+ this.selectable = false;
11991
+ }
11992
+ else {
11993
+ this.columns = columns;
11994
+ this.displayedColumns = columns.filter(c => !c.hidden && !c.key).map(c => c.name);
11995
+ this._template = template;
11996
+ this.selectable = template !== null || fields !== null;
11997
+ }
11998
+ this._datasource(r);
11999
+ }, () => {
12000
+ this._loading$.next(false);
12001
+ this._sb.error();
11976
12002
  });
11977
- const iindex = this._cube.indices.find(i => i.name === this.index);
11978
- columns.push({ name: 'value', label: iindex.title, type: FieldType.Currency });
11979
- this.columns = columns;
11980
- this.displayedColumns = columns.map(c => c.name);
11981
- this._template = null;
11982
- this.selectable = false;
11983
- this._datasource(r);
11984
12003
  }, () => {
11985
12004
  this._loading$.next(false);
11986
12005
  this._sb.error();